General Purpose Procedures Applied to Scheduling

38
1 General Purpose Procedures Applied to Scheduling Contents Constructive approach 1. Dispatching Rules Local search 1. Simulated Annealing 2. Tabu-Search 3. Genetic Algorithms

description

General Purpose Procedures Applied to Scheduling. Contents Constructive approach 1.Dispatching Rules Local search 1.Simulated Annealing 2.Tabu-Search 3.Genetic Algorithms. Constructive procedures : 1. Dispatching Rules 2. Composite Dispatching Rules 3. Dynamic Programming - PowerPoint PPT Presentation

Transcript of General Purpose Procedures Applied to Scheduling

Page 1: General Purpose Procedures Applied to Scheduling

1

General Purpose ProceduresApplied to Scheduling

Contents

Constructive approach1. Dispatching Rules

Local search1. Simulated Annealing2. Tabu-Search3. Genetic Algorithms

Page 2: General Purpose Procedures Applied to Scheduling

2

Constructive procedures:1. Dispatching Rules2. Composite Dispatching Rules3. Dynamic Programming4. Integer Programming5. Branch and Bound6. Beam Search

Local Search 1. Simulated Annealing2. Tabu-Search3. Genetic Algorithms

Heuristic technique is a method which seeks good (i.e. near-optimalsolutions) at a reasonable cost without being able to guaranteeoptimality.

Page 3: General Purpose Procedures Applied to Scheduling

3

Dispatching Rules

A dispatching rule prioritises all the jobs that are waiting forprocessing on a machine.

Classification• Static: not time-dependent• Dynamic: time dependent

• Local: uses information about the queue where the job is waiting or machine where the job is queued

• Global: uses information about other machines(e.g. processing time of the jobs on the next machine on its route, orthe current queue length

Page 4: General Purpose Procedures Applied to Scheduling

4

Rule Data ObjectivesService in random orderSIRO

ease of implementation

Earliest release date firstERD

rj minimise variation of thewaiting times of jobs at amachine

Earliest due date first EDD dj minimise latenessMinimum slack firstmax(dj-pj-t, 0)

dj, pj minimise due daterelated objectives

Weighted shortestprocessing time firstWSPTwj / pj

wj, pj minimise weighted sum ofcompletion times

Longest processing timefirst LPT

pj load balancing overparallel machines

Shortest setup time firstSST

sjk makespan

Least flexible job first LFJ Mj makespanCritical path CP pj, precedence makespanLargest number ofsucessors LNS

pj, precedence makespan

Shortest queue at the nextmachine SQNO

machine idleness

Page 5: General Purpose Procedures Applied to Scheduling

5

Local SearchStep. 1. Initialisation

k=0Select a starting solution S0SRecord the current best-known solution by setting Sbest = S0

and best_cost = F(Sbest)

Step 2. Choice and UpdateChoose a Solution Sk+1N(Sk)If the choice criteria cannot be satisfied by any member of N(Sk), then the algorithm stopsif F(Sk+1) < best_cost then Sbest = Sk+1 and best_cost = F(Sk+1)

Step 3. TerminationIf termination conditions applythen the algorithm stops

else k = k+1 and go to Step 2.

Page 6: General Purpose Procedures Applied to Scheduling

6

• Global Optimum: better than all other solutions• Local Optimum: better than all solutions in a certain neighbourhood

Page 7: General Purpose Procedures Applied to Scheduling

7

1. Schedule representation2. Neighbourhood design3. Search process4. Acceptance-rejection criterion

1. Schedule representation

Nonpreemptive single machine schedule• permutation of n jobs

Nonpreemptive job shop schedule• m consecutive strings, each representing a permutation of

n operations on a machine

Page 8: General Purpose Procedures Applied to Scheduling

8

2. Neighbourhood design

Single machine: • adjacent pairwise interchange• take an arbitrary job in the schedule and insert it in another positions

Job shop:• interchange a pair of adjacent operations on the critical path

of the schedule• one-step look-back interchange

Page 9: General Purpose Procedures Applied to Scheduling

9

(h, l)(h, k)machine h(i, j)(i, k)machine i

(h, l) (h, k)machine h(i, j)(i, k)machine i

(h, l) (h, k)machine h(i, j) (i, k)machine i

• current schedule

• schedule after interchange of (i, j) and (i, k)

• schedule after interchange of (h, l) and (h, k)

Page 10: General Purpose Procedures Applied to Scheduling

10

3. Search process

• select schedules randomly• select first schedules that appear promisingfor example, swap jobs that affect the objective the most

4. Acceptance-rejection criterion

probabilistic: simulated annealingdeterministic: tabu-search

Page 11: General Purpose Procedures Applied to Scheduling

11

Simulated Annealing

Contents

1. Basic Concepts

2. Algorithm

3. Practical considerations

Page 12: General Purpose Procedures Applied to Scheduling

12

Basic Concepts

tc

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 minimized

c > 0 inferior solution

-c < 0 t tc

tc

e

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

inferior solution (c > 0) still accepted if

Page 13: General Purpose Procedures Applied to Scheduling

13

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

tSFSF kc

e)()(

Page 14: General Purpose Procedures Applied to Scheduling

14

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

Page 15: General Purpose Procedures Applied to Scheduling

15

jobs 1 2 3 4pj 9 9 12 3dj 10 8 5 28wj 14 12 1 12

Exercise.Consider the following scheduling problem 1 | dj | wjTj .

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 16: General Purpose Procedures Applied to Scheduling

16

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.0316340

e

Page 17: General Purpose Procedures Applied to Scheduling

17

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

U3 = 0.91 > = 0.016

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

...

729.0316319

e

Page 18: General Purpose Procedures Applied to Scheduling

18

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]

ttt

1 is typically close to 0

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

Page 19: General Purpose Procedures Applied to Scheduling

19

Tabu Search

Contents

1. Basic Concepts

2. Algorithm

3. Practical considerations

Page 20: General Purpose Procedures Applied to Scheduling

20

Basic Concepts

Tabu-lists contains moves which have been made in the recent past butare forbidden for a certain number of iterations.

Algorithm

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

Step 2.Select ScN(Sk)If the move Sk Sc is prohibited by a move on the tabu-listthen go to Step 2

Page 21: General Purpose Procedures Applied to Scheduling

21

If the move Sk Sc is not prohibited by a move on the tabu-listthen Sk+1 = Sc

Enter reverse move at the top of the tabu-listPush all other entries in the tabu-list one position downDelete the entry at the bottom of the tabu-list

If F(Sc) < F(Sbest) then Sbest = Sc

Go to Step 3.

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

Page 22: General Purpose Procedures Applied to Scheduling

22

Example.jobs 1 2 3 4pj 10 10 13 4dj 4 2 1 12wj 14 12 1 12

1 | dj | wjTj

Neighbourhood: all schedules that can be obtained throughadjacent pairwise interchanges.Tabu-list: pairs of jobs (j, k) that were swapped within the lasttwo moves

S1 = 2, 1, 4, 3F(S1) = wjTj = 12·8 + 14·16 + 12·12 + 1 ·36 = 500 = F(Sbest)F(1, 2, 4, 3) = 480F(2, 4, 1, 3) = 436 = F(Sbest)F(2, 1, 3, 4) = 652Tabu-list: { (1, 4) }

Page 23: General Purpose Procedures Applied to Scheduling

23

S2 = 2, 4, 1, 3, F(S2) = 436F(4, 2, 1, 3) = 460F(2, 1, 4, 3) (= 500) tabu!F(2, 4, 3, 1) = 608Tabu-list: { (2, 4), (1, 4) }

S3 = 4, 2, 1, 3, F(S3) = 460F(2, 4, 1, 3) (= 436) tabu!F(4, 1, 2, 3) = 440F(4, 2, 3, 1) = 632Tabu-list: { (2, 1), (2, 4) }

S4 = 4, 1, 2, 3, F(S4) = 440F(1, 4, 2, 3) = 408 = F(Sbest) F(4, 2, 1, 3) (= 460) tabu!F(4, 1, 3, 2) = 586Tabu-list: { (4, 1), (2, 4) }F(Sbest)= 408

Page 24: General Purpose Procedures Applied to Scheduling

24

Practical considerations

• Tabu tenure: the length of time t for which a move is forbident too small - risk of cyclingt too large - may restrict the search too mucht=7 has often been found sufficient to prevent cycling

nt

• Number of tabu moves: 5 - 9

• If a tabu move is smaller than the aspiration level thenwe accept the move

Page 25: General Purpose Procedures Applied to Scheduling

25

Genetic Algorithms

Contents

1. Basic Concepts

2. Algorithm

3. Practical considerations

Page 26: General Purpose Procedures Applied to Scheduling

26

Basic Concepts

• Individuals (or members of population or chromosomes)

individuals surviving from the previous generation+

childrengeneration

Simulated AnnealingTabu Search

versus Genetic Algorithms

• a single solution is carriedover from one iterationto the next

• population based method

Page 27: General Purpose Procedures Applied to Scheduling

27

Fitness of an individual (a schedule) is measured by the value of the associated objective function

Representation

Example.the order of jobs to be processed can be represented as a permutation:[1, 2, ... ,n]

Initialisation

How to choose initial individuals?• High-quality solutions obtained from another heuristic technique

can help a genetic algorithm to find better solutions more quicklythan it can from a random start.

Page 28: General Purpose Procedures Applied to Scheduling

28

Reproduction

• Crossover: combine the sequence of operations on one machinein one parent schedule with a sequence of operations onanother machine in another parent.

Example 1. Ordinary crossover operator is not useful!

Cut Point 1 Cut Point 2

P1 = [2 1 3 4 5 6 7]P2 = [4 3 1 2 5 7 6]

O1 = [4 3 1 2 5 6 7]O2 = [2 1 3 4 5 7 6]

Cut Point

P1 = [2 1 3 4 5 6 7]P2 = [4 3 1 2 5 7 6]

O1 = [2 1 3 2 5 7 6]O2 = [4 3 1 4 5 6 7]

Example 2. Partially Mapped Crossover

314255

Page 29: General Purpose Procedures Applied to Scheduling

29

Example 3. Preserves the absolute positions of the jobs taken from P1and the relative positions of those from P2

Cut Point 1

P1 = [2 1 3 4 5 6 7]P2 = [4 3 1 2 5 7 6]

O1 = [2 1 4 3 5 7 6]O2 = [4 3 2 1 5 6 7]

Example 4. Similar to Example 3 but with 2 crossover points.

Cut Point 1 Cut Point 2

P1 = [2 1 3 4 5 6 7]P2 = [4 3 1 2 5 7 6] O1 = [3 4 5 1 2 7 6]

Page 30: General Purpose Procedures Applied to Scheduling

30

• Mutation enables genetic algorithm to explore the search spacenot reachable by the crossover operator.

Adjacent pairwise interchange in the sequence

[1,2, ... ,n] [2,1, ... ,n]

Exchange mutation: the interchange of two randomly chosen elementsof the permutation

Shift mutation: the movement of a randomly chosen element a random number of places to the left or right

Scramble sublist mutation: choose two points on the string in randomand randomly permuting the elements between these two positions.

Page 31: General Purpose Procedures Applied to Scheduling

31

Selection

• Roulette wheel: the size of each slice corresponds to the fitness ofthe appropriate individual.

slice for the 1st individual

slice for the 2nd individual

selected individual

...

Steps for the roulette wheel1. Sum the fitnesses of all the population members, TF2. Generate a random number m, between 0 and TF3. Return the first population member whose fitness added to the

preceding population members is greater than or equal to m

Page 32: General Purpose Procedures Applied to Scheduling

32

• Tournament selection1. Randomly choose a group of T individuals from the population.2. Select the best one.

How to guarantee that the best member of a population will survive?• Elitist model: the best member of the current population is set

to be a member of the next.

Page 33: General Purpose Procedures Applied to Scheduling

33

AlgorithmStep 1.k=1 Select N initial schedules S1,1 ,... , S1,N using some heuristicEvaluate each individual of the population

Step 2.Create new individuals by mating individuals in the current populationusing crossover and mutationDelete members of the existing population to make place forthe new membersEvaluate the new members and insert them into the populationSk+1,1 ,... , Sk+1,N

Step 3.k = k+1If stopping condition = true then return the best individual as the solution and STOPelse go to Step 2

Page 34: General Purpose Procedures Applied to Scheduling

34

Example

jobs 1 2 3 4 5pj 4 3 7 2 2dj 5 6 8 8 17

1 || Tj

• Population size: 3

• Selection: in each generation the single most fit individualreproduces using adjacent pairwise interchange chosen at randomthere are 4 possible children, each is chosen with probability 1/4Duplication of children is permitted.Children can duplicate other members of the population.

• Initial population: random permutation sequences

Page 35: General Purpose Procedures Applied to Scheduling

35

Generation 1Individual 25314 14352 12345Cost 25 17 16

Selected individual: 12345 with offspring 13245, cost 20

Generation 2Individual 13245 14352 12345Cost 20 17 16 Average fitness is improved, diversity is preservedSelected individual: 12345 with offspring 12354, cost 17

Generation 3Individual 12354 14352 12345Cost 17 17 16

Selected individual: 12345 with offspring 12435, cost 11

Page 36: General Purpose Procedures Applied to Scheduling

36

Generation 4Individual 14352 12345 12435Cost 17 16 11

Selected individual: 12435 This is an optimal solution.

Disadvantages of this algorithm:• Since only the most fit member is allowed to reproduce

(or be mutated) the same member will continue to reproduce unlessreplaced by a superior child.

Page 37: General Purpose Procedures Applied to Scheduling

37

Practical considerations

• Population size: small population run the risk of seriouslyunder-covering the solution space, while large populations willrequire computational resources.Empirical results suggest that population sizes around 30are adequate in many cases, but 50-100 are more common.

• Mutation is usually employed with a very low probability.

Page 38: General Purpose Procedures Applied to Scheduling

38

Summary

Meta-heuristic methods are designed to escape local optima.

They work on complete solutions. However, they introduce parameters (such as temperature, rateof reduction of the temperature, memory, ...)How to choose the parameters?

Other metaheuristicsAnt optimizationGRASP