Title: IOE/MFG 543
1IOE/MFG 543
- Chapter 14 General purpose procedures for
scheduling in practice - Section 14.4 Local search (Simulated annealing
and tabu search)
2Introduction
- Constructive vs. improvement type algorithms
- Constructive type
- Construct the schedule by, e.g., adding one job
at the time - Improvement type
- Start with some complete schedule
- Try to obtain a better schedule by manipulating
the current schedule
3General local search algorithm
- G(S) is the value of the objective under schedule
S - Let k1. Start with a schedule S1 and let the
best schedule S0S1 - Choose a schedule Sc from the neighborhood of Sk
N(Sk) - If Sc is accepted let Sk1 Sc, otherwise let
Sk1 Sk. If G(Sk1)ltG(S0) let S0Sk1 - Let kk1. Terminate the search if the stopping
criteria are satisfied. Otherwise return to 2.
4Local search example1SwjTj
Jobs 1 2 3 4
wj 4 5 3 5
pj 12 8 15 9
dj 16 26 25 27
5Local search example (2)Schedule representation
- Let the vector S(j1,,jn) represent the schedule
- jkj if j is the kth job in the sequence
- Use EDD to construct the initial schedule
- S1
- The total weighted tardiness
- Let G(S) be SwjTj under schedule S
- gt G(S1)
6Local search example (3)Neighborhood structure
- Manipulating S1
- Pairwise adjacent interchange
- Try to move a job to a different location in the
sequence - Rules 1 and 2 above define two types of
neighborhoods N1 and N2 - N1(S1)
- N2(S1)
7Local search example (4)Choosing Sc
- Assume we use N1
- Methods for choosing Sc from N1(Sk)
- Randomly
- Move the job forward that has the highest
contribution to the objective - Follow rule 2
- Interchange jobs and
- Sc ( , , , )
- G(Sc)
8Local search example (5)Acceptance criteria
- Is G(Sc) lt G(Sk)?
- Should we consider accepting Sc if G(Sc) G(Sk)
? - In this example we only accept if we get an
improvement in the objective
9Local search example (6)Stopping criteria
- Max number of iterations
- No or little improvement
- We would terminate the search since we did not
improve the current schedule - Local optimal solution
- No solution S in N(Sk) satisfies G(S)ltG(Sk)
10Local search example (7)Continuing
- S2S1(1,3,2,4)
- Swap 3 and 2 gt G(1,2,3,4) 115
- S3(1,2,3,4)
- Swap 4 and 3 gt G(1,2,4,3) 67
- S4(1,2,4,3)
- Swap 4 and 2 gt G(1,4,2,3) 72
- S5S4
- Swap 2 and 1 gt G(2,1,4,3) 83
- STOP and return (1,2,4,3) as the solution
11Local search example (8) Total enumeration
j1 j2 j3 j4 SwjTj
1 2 4 3 67
1 4 2 3 72
2 1 4 3 83
4 1 2 3 92
2 4 1 3 109
4 2 1 3 109
1 2 3 4 115
1 4 3 2 123
2 1 3 4 131
4 2 3 1 131
2 4 3 1 133
1 3 2 4 136
j1 j2 j3 j4 SwjTj
2 3 4 1 137
3 2 4 1 137
1 3 4 2 141
3 4 2 1 142
4 3 2 1 142
4 1 3 2 143
2 3 1 4 161
3 2 1 4 161
3 4 1 2 170
4 3 1 2 170
3 1 2 4 174
3 1 4 2 179
12Local searchDesign criteria
- The representation of the schedule
- The design of the neighborhood
- The search process within the neighborhood
- The acceptance-rejection criteria
- Stopping criteria
13Simulated Annealing (SA)
- Annealing Heating of a material (metal) to a
high temperature and then cooling it at a certain
rate to achieve a desired crystalline structure - SA Avoids getting stuck at a local minimum by
accepting a worse schedule Sc with probability
P(Sk,Sc) exp(- G(Sc)-G(Sk) )
P(Sk,Sc) exp(- bk )
14SA Temperature parameter
- bk 0 is the temperature (also called cooling
parameter) - Initially the temperature is high making moves to
a worse schedule more likely - 50 chance of accepting a slightly worse
schedule seems to work well - As the temperature decreases the probability of
accepting a worse schedule decreases - Often, bkTak for some .9ltalt1 and Tgt0
15SA algorithm
- Set k1 and select b1.Select S1 and set S0S1.
- Select Sc (randomly) from N(Sk).
- If G(S0)ltG(Sc)ltG(Sk) set Sk1Sc and go to 3
- If G(Sc)ltG(S0) set S0Sk1Sc and go to 3
- If G(Sc)gtG(Sk), generate a uniform random number
Uk from a Uniform(0,1) distribution (e.g., rand()
in Excel) - If UkP(Sk,Sc), set Sk1Sc otherwise set
Sk1Sk. - Select bk1 bk.Set kk1.Stop if stopping
criteria are satisfied otherwise go to 2.
16SA example1SwjTj
Jobs 1 2 3 4
wj 4 5 3 5
pj 12 8 15 9
dj 16 26 25 27
17SA exampleIteration 1
- Step 1 S0S1(1,3,2,4). G(S1)136. Let T10 and
a.9 gt b19 - Step 2. Select randomly which jobs to swap,
suppose a Uniform(0,1) random number is V1 .24
gt swap first two jobs - Sc(3,1,2,4), G(Sc)174, P(Sk,Sc)1.5
- U1.91 gt Reject Sc
- Step 3 Let k2
18SA exampleIteration 2
- Step 2. Select randomly which jobs to swap,
suppose a Uniform(0,1) random number is V2 .46
gt swap 2nd and 3rd jobs - Sc(1,2,3,4), G(Sc)115
- gt S3S0Sc
- Step 3 Let k3
19SA exampleIteration 3
- Step 2. V3 .88 gt swap jobs in 3rd and 4th
position - Sc(1,2,4,3), G(Sc)67
- gt S4S0Sc
- Step 3 Let k4
20SA exampleIterations 4 and 5
- Step 2 V4 .49 gt swap jobs in 2nd and 3rd
position - Sc(1,4,2,3), G(Sc)72, b410(.9)46.6
- P(Sk,Sc)47, U4.90 gt S5S4
- Step 3 Let k5
- Step 2 V5 .11 gt swap 1st and 2nd jobs
- Sc(2,1,4,3), G(Sc)83, b510(.9)55.9
- P(Sk,Sc)7, U5.61 gt S6S5
- Step 3 Let k6
- Are you bored yet?
21Tabu (taboo?) search
- Tabu search tries to model human memory processes
- A tabu-list is maintained throughout the search
- Moves according to the items on the list are
forbidden
22Tabu search algorithm
- Set k1. Select S1 and set S0S1.
- Select Sc from N(Sk).
- If the move Sk?Sc is on the tabu list set Sk1Sk
and go to 3 - If Sk?Sc is not on the tabu list set Sk1Sc.Add
the reverse move to the top of the tabu list and
delete the entry on the bottom.If G(Sc)ltG(S0),
set S0Sc. - Set kk1.Stop if stopping criteria are
satisfied otherwise go to 2.
23Tabu search example1SwjTj
Jobs 1 2 3 4
wj 4 5 3 5
pj 12 8 15 9
dj 16 26 25 27
- Determine Sc by the best schedule in the
neighborhood that is not tabu - Use tabu-list length 2
- The tabu list is denoted by L
24Tabu search exampleIteration 1
- Step 1 S0S1(1,3,2,4). G(S1)136. Set L.
- Step 2. N(S1) (3,1,2,4), (1,2,3,4), (1,3,4,2)
with respective cost 174, 115, 141 gt
ScS0S2(1,2,3,4). Set L(3,2), i.e.,
swapping 3 and 2 is not allowed - Step 3 Let k2
25Tabu search exampleIteration 2
- Step 2.
- N(S2) (2,1,3,4), (1,3,2,4), (1,2,4,3)
- with respective costs 131, - , 67
- gt ScS3(1,2,4,3)
- Set S0Sc
- Set L(3,4),(3,2)
- Step 3 Let k3
26Tabu search exampleIteration 3
- Step 2
- N(S3) (2,1,4,3), (1,4,2,3), (1,2,3,4)
- with respective costs 83, 72, -
- gt ScS4(1,4,2,3)
- Set L(2,4),(3,4)
- Step 3 Let k4
27Tabu search exampleIteration 4
- Step 2
- N(S4) (4,1,2,3), (1,2,4,3), (1,4,3,2)
- with respective costs 92, -, 123
- gt ScS5(4,1,2,3)
- Set L(1,4),(2,4)
- Step 3 Let k5
28Tabu search exampleIteration 5
- Step 2
- N(S5) (1,4,2,3), (4,2,1,3), (4,1,3,2)
- with respective costs -, 109, 143
- gt ScS6(4,2,1,3)
- Set L(2,1),(4,1)
- Step 3 Let k6