Tutorial Metaheuristics
Tutorial Metaheuristics
Andrea Roli
[email protected]
search methods”.
An introduction to Metaheuristics – p.4
Two-faced Janus
Intensification and Diversification are the driving
forces of metaheuristic search.
Trajectory methods
Population-based methods
A Combinatorial Optimization Problem can
be defined by:
variables ;
variable domains ;
constraints among variables;
Objective function ;
The set of all possible feasible assignments
!
"
"
#
objective function value, i.e., .
%
$
!
Many COPs are -hard no polynomial time
algorithm exists (assuming )
&
Examples: Traveling Salesman problem (TSP), Quadratic
Assignment problem (QAP), Maximum Satisfiability
Problem (MAXSAT), Timetabling and Scheduling
problems.
)
(
that assigns to every a set of
!
'
"
#
"
#
neighbors . is called the
neighborhood of .
)
that assigns to every
(
a set of
!
'
"
#
"
#
neighbors . is called the
neighborhood of .
A locally minimal solution (or local minimum)
with respect to a neighborhood structure is a
"
#
"
#
"
#
solution such that . We
$
+*
+*
+*
!
'
call a strict locally minimal solution if
+*
"
#
"
#
"
#
.
$
+*
+*
!
,
-
assignments. E.g.,
"
320
876
9
4 . "
6
5
5
!
/.
/1
1
&
&
-
4
320
6
For example:
"2
2
2
2
5
2
52
52
2
&
A B A B
solution s
neighborhood of s
solution s
next solution s’
solution s
Initial solution
s*
Local minimum
Solution space
repeat
"
#
BestOf( , )
until no improvement is possible
GHFE
CDA B
C A BF
?@
;
>
I
An introduction to Metaheuristics – p.26
A pictorial view
objective function
Initial solution
Solution space
Solution space
Solution space
Solution space
Solution space
J
while termination conditions not met do
K
"
#
PickAtRandom( )
K
"
"
#
if then
,
K
K
{ replaces }
else
K
#
L
4
end if
Update( )
end while
An introduction to Metaheuristics – p.28
Cooling schedules
The temperature can be varied in different ways:
P
Logarithmic: .
N M
O
TB
F
RSQ
N
VU N
The algorithm is guaranteed to converge to the optimal
solution with probability 1. Too slow for applications.
[
Geometric: , where .
N M
O
N M
O
XY
Z
W
W
Non-monotonic: the temperature is decreased
(intensifications is favored), then increased again (to
increase diversification).
References:
solution s
neighborhood of s
solution s
ALLOWED neighborhood of s
ALLOWED neighborhood of s
d
`_^
ba
c
]
while termination conditions not met do
"
#f
_ ^
ba
c
e
ChooseBestOf( )
_ ^
ba
c
Update( )
]
end while
4 h
g a
a
InitializeTabuLists( )
j
i
i4
i
k
q 0
r
"
#
9
no tabu
o %
l
`ml
k
c
!
no
4
6
aspiration condition is satisfied
"
#
o %
l
m l
k
c
ChooseBestOf( ) e
no
4
UpdateTabuListsAndAspirationConditions()
k
end while
An introduction to Metaheuristics – p.35
Applications
Among the best performing metaheuristics
(when applied with general strategies to
balance intensification and diversification)
Applied to many COPs
TS approaches dominate the Job Shop
Scheduling area
References:
+vu
y{ u
z
sx w
Select a set of neighborhood structures
tsN
|
x
x
s
GenerateInitialSolution()
~
}
w
~
y{ u
|
} ;
}
PickAtRandom( ){Shaking phase}
~
N
} E
E
} ;
LocalSearch( )
~
} E
E
}
if then
} E
E
;
u
w
~
~
}
else
u
3u
w
~
end if
end while An introduction to Metaheuristics – p.38
end while
Applications
Graph based COPs (e.g., -Median problem,
L
the Steiner tree problem, -Cardinality Tree
k
problem)
Some variants also very effective
References:
Solution space
Solution space
Solution space
Solution space
Solution space
"
#
If feature is present in solution , then ,
5
b
&
.
"
#
otherwise
2
&
.
.L
weights the importance of the features.
.L
weights the importance of the features.
"
#
"
#
"
#
. L
&
.
.
g
.L
weights the importance of the features.
"
#
"
#
"
#
. L
&
.
.
g
scales the contribution of the penalties wrt to the original
objective function
LocalSearch( )
4
for all selected features do
b
5
.L
.L
end for
K
References:
Solution space
Solution space
n
io
at
rb
rtu
pe
Solution space
Solution space
LocalSearch( )
J
while termination conditions not met do
K
b
mc
Perturbation( )
4
K
LocalSearch( )
b
mc
ApplyAcceptanceCriterion( )
4
4
end while
References:
They include:
Evolutionary Programming
Evolution Strategies
Genetic Algorithms
Solution space
An introduction to Metaheuristics – p.55
Evolutionary Algorithms
Basic principle: moving a population of solutions
toward good regions of the search space.
objective function
Solution space
An introduction to Metaheuristics – p.55
Evolutionary Algorithms
Basic principle: moving a population of solutions
toward good regions of the search space.
objective function
Solution space
An introduction to Metaheuristics – p.55
The Evolutionary Cycle
Population
Selection
Parents
Population
Selection
Parents
Recombination
Population
Mutation
Offspring
Selection
Parents
Recombination
Population
Mutation
Offspring
Replacement
Recombine( )
KK
K
Mutate( )
KK
Evaluate( )
KK
e
Select( )
end while
bit-strings
integer/real arrays
tree structures or more complex data
structures
the algorithm
The neighborhood function defines,
(
'
for every individual , the set of individuals
!
b"
#
two-parent crossover
multi-parent crossover
population statistics-based recombination
operators
References:
graph .
&
4
#
&
4
are the connections
states are paths in .
solution constructed
solution, an ant can update the pheromone trail (online
step-by-step pheromone update).
Once an ant has built a solution, it can retrace the
same path backward and update the pheromone trails
of the used components according to the quality of the
solution it has built (online delayed pheromone
update).
Pheromone evaporation is always applied the
pheromone trail intensity on the components
decreases over time.
An introduction to Metaheuristics – p.75
Daemon Actions
Can be used to implement centralized actions
which cannot be performed by single ants.
E.g.,
local search procedure applied to the
solutions built by the ants
collection of global information used to
decide whether to deposit additional
pheromone to bias the search process
from an non-local perspective
References: