Simulated Annealing

8
1 Simulated Annealing Contents 1. Basic Concepts 2. Algorithm 3. Practical considerations

description

Simulated Annealing. Contents 1. Basic Concepts 2. Algorithm 3. Practical considerations. t . . . Basic Concepts. Allows moves to inferior solutions in order not to get stuck in a poor local optimum.  c = F ( S new ) - F ( S old ) F has to be minimised. - PowerPoint PPT Presentation

Transcript of Simulated Annealing

Page 1: Simulated Annealing

1

Simulated Annealing

Contents

1. Basic Concepts

2. Algorithm

3. Practical considerations

Page 2: Simulated Annealing

2

Basic Concepts

t

c

eU

U is a random number from (0, 1) intervalt is a cooling parameter:

t is initially high - many moves are acceptedt is decreasing - inferior moves are nearly always rejected

Allows moves to inferior solutions in order not to get stuck ina poor local optimum.

c = F(Snew) - F(Sold) F has to be minimised

c > 0 inferior solution

-c < 0 t t

c t

c

e

• As the temperature decreases, the probability of acceptingworse moves decreases.

inferior solution (c > 0) still accepted if

Page 3: Simulated Annealing

3

Algorithm

Step 1.k=1 Select an initial schedule S1 using some heuristic and set Sbest = S1

Select an initial temperature t0 > 0Select a temperature reduction function (t)

Step 2.Select ScN(Sk)If F(Sbest) < F(Sc)

If F(Sc) < F(Sk) then Sk+1 = Sc

elsegenerate a random uniform number Uk

If Uk < then Sk+1 = Sc

else Sk+1 = Sk

else Sbest = Sc

Sk+1 = Sc

t

SFSF kc

e)()(

Page 4: Simulated Annealing

4

Step 3.tk = (t) k = k+1 ;If stopping condition = true then STOPelse go to Step 2

Page 5: Simulated Annealing

5

jobs 1 2 3 4 pj (processing time) 9 9 12 3 dj (deadline) 10 8 5 28 wj (weight) 14 12 1 12

Exercise.Consider the following scheduling problem for minimizing the totalWeighted tardiness (tardiness is amount a job exceeds deadline) .

Apply the simulated annealing to the problem starting out with the3, 1, 4, 2 as an initial sequence.Neighbourhood: all schedules that can be obtained throughadjacent pairwise interchanges.Select neighbours within the neigbourhood at random. Choose (t) = 0.9 * tt0 = 0.9Use the following numbers as random numbers: 0.17, 0.91, ...

Page 6: Simulated Annealing

6

Sbest = S1 = 3, 1, 4, 2F(S1) = wjTj = 1·7 + 14·11 + 12·0+ 12 ·25 = 461 = F(Sbest)t0 = 0.9

Sc = 1, 3, 4, 2F(Sc) = 316 < F(Sbest) Sbest = 1, 3, 4, 2F(Sbest) = 316S2 = 1, 3, 4, 2t = 0.9 · 0.9 = 0.81

Sc = 1, 3, 2, 4F(Sc) = 340 > F(Sbest)

U1 = 0.17 > = 1.35*10-13

S3= 1, 3, 4, 2t = 0.729

81.0

316340

e

Page 7: Simulated Annealing

7

Sc = 1, 4, 3, 2F(Sc) = 319 > F(Sbest)

U3 = 0.91 > = 0.016

S4= S4 = 1, 3, 4, 2t = 0.6561

...

729.0

316319

e

Page 8: Simulated Annealing

8

Practical considerations

Initial temperature• must be "high"• acceptance rate: 40%-60% seems to give good results

in many situations

Cooling schedule• a number of moves at each temperature• one move at each temperature

t = ·t is typically in the interval [0.9, 0.99]

t

tt

1 is typically close to 0

Stopping condition• given number of iterations• no improvement has been obtained for a given number of iteration