Professional Documents
Culture Documents
Simulated Annealing: Petru Eles
Simulated Annealing: Petru Eles
Simulated Annealing: Petru Eles
Petru Eles
Greedy Heuristics
Theoretical Foundation
Hardware/Software Partitioning
Heuristic Algorithms for Combinatorial Optimization Problems 2
Simulated Annealing Petru Eles, 2010
Neighborhood Search
Move Neighbour
Solution
Problems:
Moves
When to stop?
Solution
Greedy heuristics always move from the current solution to the best
neighboring solution.
Local optimum
Local optimum
A solid material is heated past its melting point and then cooled back
into a solid state (annealing).
A solid material is heated past its melting point and then cooled back
into a solid state (annealing).
His simulation follows the energy of the particles with changing temperature
According to thermodynamics:
at temperature T, the probability of an increase in energy of E is:
E kT
p ( E ) = e k is the Boltzmann constant
Generic decisions
Can be taken without a deep insight into the particular problem.
stopping criterion
starting solution
An extreme approach:
Neighborhood structure
Cost function
Should be calculated quickly - possibly incrementally.
Make sure that the local minimum close to the final solution is reached:
run a small, quick greedy optimization.
Travelling Salesman
Hardware/Software Partitioning
A salesman has to travel to a number of cities and then return to the initial city;
each city has to be visited once. The objective is to find the tour with minimum
distance.
Find the shortest Hamiltonian circuit in a complete graph where the nodes
represent cities. The weights on the edges represent the distance between
cities. The cost of the tour is the total distance covered in traversing all cities.
If the problem consists of n cities ci, i = 1, .., n, any tour can be represented
as a permutation of numbers 1 to n.
d(ci,cj) = d(cj,ci) is the distance between ci and cj.
Given a permutation of the n cities, vi and vi+1 are adjacent cities in the
permutation. The permutation has to be found that minimizes:
n1
d (vi,vi + 1) + d (vn,v1)
i=1
If k > 2, there are several ways of reconnecting after the k links have been
removed.
For k = 2, there is only one way of reconnecting the tour after two links have
been removed.
With k = 2:
0
1 2
Permutation:
[0 2 4 6 7 5 3 1] 3 4
5 6
7
0
1 2
5 6
7
0
1 2
Permutation:
[0 2 4 3 5 7 6 1] 3 4
5 6
7
All 2-neighbors of a certain solution are defined by the pair i, j so that i < j.
Hardware P8
P7
P3
P14
P5 P11
P2
P9
P13
P6 P10
P1 P4
P12
Software
W 2 iN = M CL K iCL + M U K iU + M P K iP M SO K iSO
K iCL is equal to the RCL (relative computation load) of process i, and thus is a
measure of the computation load of that process;
Nr_o p i
K iU = ------------------------------
Nr_kind_o p i
- ; K iU is a measure of the uniformity of operations in process i;
Nr_o p
K iP = ------------------i
L_path i
; K iP is a measure of potential parallelism inside process i;
w op j
op j SP i
K iSO = -----------------------------
Nr_o p i
; K iSO captures suitability for software implementation;
Restrictions:
H_costi Max
H
iH
S_costi Max
S
iH
W iN Lim1 i Hw
W iN Lim1 i Sw
Simple moves:
A node is randomly selected for being moved to the other partition.
Improved move:
Together with the randomly selected node also some of its direct
neighbors are moved; a direct neighbor is moved together with the se-
lected node if its movement improves the cost function and does not
violate any constraint.
Cooling schedules
number of TI TL a
nodes SM IM SM IM SM IM
20 400 400 90 75 0.96 0.95
40 500 450 200 150 0.98 0.97
100 500 450 500 200 0.98 0.97
400 1400 1200 7500 2750 0.998 0.995
10000
1000
Execution time (s)
(logarithmic)
100
10
SM
1
IM
0.1
10 20 40 100 400 1000
75000
60000
55000
50000
45000
40000
35000
0 1000 2000 3000 4000 5000 6000 7000
Number of iterations
75000
70000
optimum at iteration 1006
65000
Cost function value
60000
55000
50000
45000
40000
35000
0 200 400 600 800 1000 1200 1400
Number of iterations