Professional Documents
Culture Documents
ferland@iro.umontreal.ca
December 2008
Introduction
• General problem
min f(x)
xєX
min f(x)
Subject to ∑1≤ j≤ m xij = 1 1≤ i ≤ n
xij = 0 or 1 1≤ i ≤ n, 1≤ j ≤ m
Problem Formulation
• Assignment type problem
min f(x)
Subject to ∑1≤ j≤ m xij = 1 1≤ i ≤ n
xij = 0 or 1 1≤ i ≤ n, 1≤ j ≤ m
• Vertex 2
color number of adj. vert. same color
red 0
blue 0 <=
Graph coloring example
• Vertex 2
color number of adj. vert. same color
red 0
blue 0 <=
Graph coloring example
• Vertex 1
color number of adj. vert. same color
red 0 <=
blue 1
Graph coloring example
• Vertex 1
color number of adj. vert. same color
red 0 <=
blue 1
Graph coloring example
• Vertex 3
color number of adj. vert. same color
red 1 <=
blue 1
Graph coloring example
• Vertex 3
color number of adj. vert. same color
red 1 <=
blue 1
Graph coloring example
• Vertex 4
color number of adj. vert. same color
red 0 <=
blue 1
Graph coloring example
• Vertex 4
color number of adj. vert. same color
red 0 <=
blue 1
Graph coloring example
• Vertex 5
color number of adj. vert. same color
red 1
blue 0 <=
Graph coloring example
• Vertex 5
color number of adj. vert. same color
red 1
blue 0 <=
GRASP
Greedy Randomized Adaptive Search Procedure
• Next variable to be fixed is selected randomly among those inducing the
smallest increase.
• Referring to the general problem,
i) let J’ = { j : xj is not fixed yet}
and δj be the increase induces by the best value that xj can take ( j є J’ )
J’ = {1, 2, 3, 4, 5}
δ* = 0
α = 0.5
{j є J’ : δj ≤ ( 1 / α ) δ* }= {1, 2, 3, 4, 5}
Select randomly vertex 3
color blue
Graph coloring example
J’ = {1, 2, 3, 4, 5}
δ* = 0
α = 0.5
{j є J’ : δj ≤ ( 1 / α ) δ* }= {1, 2, 3, 4, 5}
Select randomly vertex 3
color blue
Graph coloring example
J’ = {1, 2, 4, 5}
δ* = 0
α = 0.5
{j є J’ : δj ≤ ( 1 / α ) δ* }= {1, 2, 4, 5}
Select randomly vertex 4
color red
Graph coloring example
J’ = {1, 2, 4, 5}
δ* = 0
α = 0.5
{j є J’ : δj ≤ ( 1 / α ) δ* }= {1, 2, 4, 5}
Select randomly vertex 4
color red
Graph coloring example
J’ = {1, 2, 5}
δ* = 0
α = 0.5
{j є J’ : δj ≤ ( 1 / α ) δ* }= {1, 5}
Select randomly vertex 5
color blue
Graph coloring example
J’ = {1, 2, 5}
δ* = 0
α = 0.5
{j є J’ : δj ≤ ( 1 / α ) δ* }= {1, 5}
Select randomly vertex 5
color blue
Graph coloring example
J’ = {1, 2}
δ* = 0
α = 0.5
{j є J’ : δj ≤ ( 1 / α ) δ* }= {1}
Select vertex 1
color red
Graph coloring example
J’ = {1, 2}
δ* = 0
α = 0.5
{j є J’ : δj ≤ ( 1 / α ) δ* }= {1}
Select vertex 1
color red
Graph coloring example
J’ = {2}
δ* = 1
α = 0.5
{j є J’ : δj ≤ ( 1 / α ) δ* }= {2}
Select vertex 2
color blue
Graph coloring example
J’ = {2}
δ* = 1
α = 0.5
{j є J’ : δj ≤ ( 1 / α ) δ* }= {2}
Select vertex 2
color blue
Graph coloring example
J’ = Φ
Neighborhood (Local) Search Techniques
(NST)
• A Neighborhood (Local) Search Technique (NST) is an iterative procedure
starting with an initial feasible solution x0 .
• At each iteration:
Neighborhood N(x) :
The neighborhood N(x) varies with the problem, but its elements are
always generated by slightly modifying x.
• Stopping criterion:
f(x') ≥ f(x)
• Initialize
Select an initial solution x0 є X
Let x:= x0
Descent Method (D)
• Initialize
Select an initial solution x0 є X
Let x:= x0 and stop:= false
• Initialize
Select an initial solution x0 є X
Let x:= x0 and stop:= false
• Initialize
Select an initial solution x0 є X
Let x:= x0 and stop:= false
• Problem formulation:
Let x:= x0
Tabu Search (TS)
• Initialize
Select an initial solution x0 є X
• Short term Tabu lists TLk are used to remember attributes or characteristics
of the modification used to generate the new current solution
• A Tabu List often used for the assignment type problem is the following:
• The Tabu lists are cyclic in order for an attribute to remain Tabu for a fixed
number nk of iterations
Tabu Search (TS)
• Initialize • As long as x' is better than x, the behavior of the
Select an initial solution x0 є X procedure is similar to that of the descent
Let TLk = Φ, k = 1, 2, …,p method.
Determine x' є NC(x) such that Update x* the best solution found so far
x' := argmin z є NC(x) { f(z) }
x:= x'
If f(x) < f(x*) then x* := x ,
TL = Φ
Second example
• TL = Φ
• iter = 1
niter = 1
Knapsack Problem
• TL = { (4, 0)}
• iter = 2
niter = 1
Knapsack Problem
• iter = 3
niter = 2
Knapsack Problem
• iter = 4
niter =1
Knapsack Problem
Subject to
2x1 + 2x2 + x3 + x4 ≤ 3
x1 , x2 , x3 , x4 = 0 or 1.
Let x:= x0
Simulated Annealing
• Initialize
Select an initial solution x0 є X
minoriter := 0
While minoriter ≤ minoritermax
minoriter := minoriter + 1
Generate randomly x' є V ⊆ N(x)
If ∆f = f(x' ) – f(x) < 0 then x:= x'
else
Generate random number r є (0, 1] Update x* the best solution found so far
If r < e - ∆f / TP then x:= x'
If f(x) < f(x*) then x* := x
TP := α TP
Simulated Annealing
• Initialize
Select an initial solution x0 є X • No monotonicity of the objective function!!!
Select an initial temperature TP0
Let TP := TP0 • Stopping criterion ???
Let x* := x:= x0 and stop:= false
minoriter := 0
While minoriter ≤ minoritermax
minoriter := minoriter + 1
Generate randomly x' є V ⊆ N(x)
If ∆f = f(x' ) – f(x) < 0 then x:= x'
else
Generate random number r є (0, 1]
If r < e - ∆f / TP then x:= x'
If f(x) < f(x*) then x* := x
TP := α TP
Simulated Annealing
• Initialize
Select an initial solution x0 є X
Select an initial temperature TP0
Let iter := niter := 0 and TP := TP0
Let x* := x:= x0 and stop:= false
2x1 + 2x2 + x3 + x4 ≤ 3
Knapsack Problem
• TP = 20
• iter = 1
minoriter = 1
niter = 1
Knapsack Problem
0 .33 .66 1
• TP = 20 .72
• iter = 1 x' = [1, 0, 0, 1] ; f(x') = 32
minoriter = 1
niter = 1
Knapsack Problem
0 .33 .66 1
• TP = 20 .72
• iter = 1 x' = [1, 0, 0, 1] ; f(x') = 32
minoriter = 1 • Since f(x') > f(x) = 18, then
niter = 1 x' replaces the current sol. x
Knapsack Problem
• TP = 20
• iter = 1
minoriter = 2
niter = 1
Knapsack Problem
0 0.5 1
• TP = 20 0.83
0 0.5 1
• TP = 20 0.83
• TP = αTP = 0.5*20 = 10
• iter = 2
minoriter = 1
niter = 1
Knapsack Problem
0 0.5 1
• TP = 10 0.41
0 0.5 1
• TP = 10 0.41
• TP = 10
• iter = 2
minoriter = 2
niter = 1
Knapsack Problem
• TP = 5 • The solution
• iter = 3 x* = [1, 0, 0, 1]
minoriter = 0 f(x*) = 32
niter = 2
Threshold Accepting
• Deterministic variant of Simulated Annealing:
• Stopping criteria:
- maximum number of major iterations
- maximum number of successive major iterations where f(x)
does not improve
Simulated Annealing vs Threshold Accepting
• Initialize • Initialize
Select an initial solution x0 є X Select an initial solution x0 є X
Select an initial temperature TP0 Select an initial threshold value dr0
Let iter := niter := 0 and TP := TP0 Let iter := niter := 0 and dr:= dr0
Let x* := x:= x0 and stop:= false Let x* := x:= x0 and stop:= false
• γ(x' , x) = f(x')
• γ(x' , x) = f(x')
• Intensification
• Exchange Procedure
Intensification
ii) Once a local minimum x* is reached, apply the descent method using an
enlarged and more complex neighborhood EN(x) to find a new solution x'
such that f(x') < f(x*).
One way is to apply a truncated depth-first enumaration tree search where
x* is the root. The search is truncated to monitor the number of
modifications used (i.e., the depth of the tree or the size of the
neighborhood) and the level of deterioration tolerated before reaching x' .
Material from the following reference
ferland@iro.umontreal.ca