Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lecture 9: Tabu Search © J. Christopher Beck 2005.

Similar presentations


Presentation on theme: "Lecture 9: Tabu Search © J. Christopher Beck 2005."— Presentation transcript:

1 Lecture 9: Tabu Search © J. Christopher Beck 2005

2 Outline Crystal Maze Tabu & 1-machine JSP Tabu & JSP Local Search
Tabu Search Tabu & 1-machine JSP Example C.5.4 Tabu & JSP N1 neighborhood © J. Christopher Beck 2005

3 Crystal Maze You have 5 minutes!
Place the numbers 1 through 8 in the nodes such that: Each number appears exactly once No connected nodes have consecutive numbers ? © J. Christopher Beck 2005

4 Local Search Idea Randomly assign values (even if the constraints are “broken”) Initial state will probably be infeasible Make “moves” to try to move toward a solution © J. Christopher Beck 2005

5 Random Initial Solution
2 ? 5 ? ? 1 3 ? 6 ? 8 ? 4 ? 7 ? © J. Christopher Beck 2005

6 Random Initial Solution
2 ? 5 ? 1 ? 3 ? ? 6 8 ? ? 4 ? 7 “Broken” constraint Cost = # of broken constraints © J. Christopher Beck 2005

7 What Should We Do Now? Move: Which two numbers? Swap two numbers
Randomly pick a pair The pair that will lead to the biggest decrease in cost Cost: number of broken constraints © J. Christopher Beck 2005

8 What Should We Do Now? Move: Which two numbers? Swap two numbers
Randomly pick a pair The pair that will lead to the biggest decrease in cost Cost: number of broken constraints © J. Christopher Beck 2005

9 Random Initial Solution
2 ? 5 ? ? 1 3 ? 6 ? 8 ? 4 ? 7 ? © J. Christopher Beck 2005

10 Cost Difference Table 1 2 3 4 5 6 7 8 © J. Christopher Beck 2005

11 Random Initial Solution
2 ? 5 ? ? 1 3 ? 6 ? 8 ? 4 ? 7 ? © J. Christopher Beck 2005

12 Swap 1 & 2 1 ? 5 ? ? 2 3 ? 6 ? 8 ? 4 ? 7 ? © J. Christopher Beck 2005

13 Cost Difference Table 1 2 3 4 5 6 7 8 © J. Christopher Beck 2005

14 Random Initial Solution
2 ? 5 ? ? 1 3 ? 6 ? 8 ? 4 ? 7 ? © J. Christopher Beck 2005

15 Swap 1 & 3 2 ? 5 ? ? 3 1 ? 6 ? 8 ? 4 ? 7 ? © J. Christopher Beck 2005

16 Cost Difference Table 1 2 3 4 5 6 7 8 © J. Christopher Beck 2005

17 Random Initial Solution
2 ? 5 ? ? 1 3 ? 6 ? 8 ? 4 ? 7 ? © J. Christopher Beck 2005

18 Swap 1 & 4 2 ? 5 ? ? 4 3 ? 6 ? 8 ? 1 ? 7 ? © J. Christopher Beck 2005

19 Cost Difference Table 1 2 3 4 5 6 7 8 -1 © J. Christopher Beck 2005

20 Cost Difference Table 1 2 3 4 5 6 7 8 -1 -2 -3
-1 -2 -3 © J. Christopher Beck 2005

21 Cost Difference Table 1 2 3 4 5 6 7 8 -1 -2 -3
-1 -2 -3 © J. Christopher Beck 2005

22 Current State 2 ? 5 ? ? 1 3 ? 6 ? 8 ? 4 ? 7 ? © J. Christopher Beck 2005

23 Swap 1 & 7: Cost 3 2 ? 5 ? ? 7 3 ? 6 ? 8 ? 4 ? 1 ? © J. Christopher Beck 2005

24 New Cost Difference Table
1 2 3 4 5 6 7 8 -1 © J. Christopher Beck 2005

25 Current State 2 ? 5 ? ? 7 3 ? 6 ? 8 ? 4 ? 1 ? © J. Christopher Beck 2005

26 Swap 3 & 8: Cost 2 2 ? 5 ? ? 7 8 ? 6 ? 3 ? 4 ? 1 ? © J. Christopher Beck 2005

27 Swap 6 & 7: Cost 1 2 ? 5 ? ? 6 8 ? 7 ? 3 ? 4 ? 1 ? © J. Christopher Beck 2005

28 Moves Initial State: Cost 6 Swap 1 & 7: Cost 3 Swap 3 & 8: Cost 2
© J. Christopher Beck 2005

29 Cost Difference Table 1 2 3 4 5 6 7 8 © J. Christopher Beck 2005

30 Now what? There are no improving moves to make!
So far, we have been “hill-climbing” cost moves © J. Christopher Beck 2005

31 Now what? Options: Restart from a new random state
Take the least worse move (increase cost by minimal amount) Try a new style of local search © J. Christopher Beck 2005

32 Now what? Options: Restart from a new random state
Take the least worse move (increase cost by minimal amount) Try a new style of local search © J. Christopher Beck 2005

33 Cost Difference Table 1 2 3 4 5 6 7 8 © J. Christopher Beck 2005

34 Swap 1 & 2: Cost 2 1 ? 5 ? ? 6 8 ? 7 ? 3 ? 4 ? 2 ? © J. Christopher Beck 2005

35 Cost Difference Table 1 2 3 4 5 6 7 8 -1 © J. Christopher Beck 2005

36 Cost Difference Table 1 2 3 4 5 6 7 8 -1 © J. Christopher Beck 2005

37 Moves Initial State: Cost 6 Swap 1 & 7: Cost 3 Swap 3 & 8: Cost 2
© J. Christopher Beck 2005

38 Moves Initial State: Cost 6 Swap 1 & 7: Cost 3 Swap 3 & 8: Cost 2
© J. Christopher Beck 2005

39 Moves Initial State: Cost 6 Swap 1 & 7: Cost 3 Swap 3 & 8: Cost 2
Swap 1 & 2: Cost 1 … and so on © J. Christopher Beck 2005

40 Now what? Options: Restart from a new random state
Take the least worse move (increase cost by minimal amount) Try a new style of local search © J. Christopher Beck 2005

41 Now what? Options: Restart from a new random state
Take the least worse move (increase cost by minimal amount) Try a new style of local search © J. Christopher Beck 2005

42 Tabu Search Idea Local search but:
Keep a small list of the moves we made so that we don’t revisit the same state Keep a list of 4 pairs: the nodes that the numbers were in before we moved them © J. Christopher Beck 2005

43 Assign Labels to Nodes B E ? ? C F ? ? ? ? A H D G ? ?
© J. Christopher Beck 2005

44 Return to a State Before We Started Cycling
Initial State: Cost 6 Swap 1 & 7: Cost 3 Swap 3 & 8: Cost 2 Swap 6 & 7: Cost 1 © J. Christopher Beck 2005

45 Just Swapped 6 & 7: Cost 1 B E 2 ? 5 ? C F 6 ? 8 ? ? 7 3 ? A H D G 4 ?
© J. Christopher Beck 2005

46 Cost Difference Table 1 2 3 4 5 6 7 8 © J. Christopher Beck 2005

47 Just Swapped 6 & 7: Cost 1 B E 2 ? 5 ? C F 6 ? 8 ? ? 7 3 ? A H D G 4 ?
© J. Christopher Beck 2005

48 Swap 1 & 2: Cost 2 B E 1 ? 5 ? C F 6 ? 8 ? 7 ? 3 ? A H D G 4 ? 2 ? Tabu: [(1G,2B)] © J. Christopher Beck 2005

49 Cost Difference Table 1 2 3 4 5 6 7 8 -1 © J. Christopher Beck 2005

50 Cost Difference Table 1 2 3 4 5 6 7 8 X -1 © J. Christopher Beck 2005

51 Cost Difference Table 1 2 3 4 5 6 7 8 X -1 © J. Christopher Beck 2005

52 Swap 3 & 5: Cost 1 B E 1 ? 3 ? C F 6 ? 8 ? 7 ? 5 ? A H D G 4 ? 2 ? Tabu: [(3H,5E),(1G,2B)] © J. Christopher Beck 2005

53 Cost Difference Table 1 2 3 4 5 6 7 8 X © J. Christopher Beck 2005

54 Swap 1 & 3: Cost 1 B E 3 ? 1 ? C F 6 ? 8 ? 7 ? 5 ? A H D G 4 ? 2 ? Tabu: [(1B,3E),(3H,5E),(1G,2B)] © J. Christopher Beck 2005

55 Swap 5 & 7: Cost 1 B E 3 ? 1 ? C F 6 ? 8 ? 5 ? 7 ? A H D G 4 ? 2 ? Tabu: [(5H,7F),(1B,3E),(3H,5E),(1G,2B)] © J. Christopher Beck 2005

56 Swap 1 & 5: Cost 1 B E 3 ? 5 ? C F 6 ? 8 ? 1 ? 7 ? A H D G 4 ? 2 ? Tabu: [(1E,5F),(5H,7F),(1B,3E),(3H,5E),(1G,2B)] © J. Christopher Beck 2005

57 Swap 1 & 5: Cost 1 B E 3 ? 5 ? C F 6 ? 8 ? 1 ? 7 ? A H D G 4 ? 2 ? Tabu: [(1E,5F),(5H,7F),(1B,3E),(3H,5E)] © J. Christopher Beck 2005

58 Swap 2 & 4: Cost 1 B E 3 ? 5 ? C F 6 ? 8 ? 1 ? 7 ? A H D G 2 ? 4 ? Tabu: [(2G,4D),(1E,5F),(5H,7F),(1B,3E)] © J. Christopher Beck 2005

59 Swap 2 & 6: Cost 1 B E 3 ? 5 ? C F 2 ? 8 ? 1 ? 7 ? A H D G 6 ? 4 ? Tabu: [(2D,6A),(2G,4D),(1E,5F),(5H,7F)] © J. Christopher Beck 2005

60 Swap 3 & 5: Cost 0 B E 5 ? 3 ? C F 2 ? 8 ? 1 ? 7 ? A H D G 6 ? 4 ? Tabu: [(3B,5E),(2D,6A),(2G,4D),(1E,5F)] © J. Christopher Beck 2005

61 Tabu Search A type of local search
Start with some (maybe random) initial state Look at the moves in the “neighborhood” and take the best one Remember the last k moves (“tabu list”) so you don’t undo them © J. Christopher Beck 2005

62 Tabu Search & 1-Machine Example C.5.4, min wjTj Tabu List Size = 2
Jobs 1 2 3 4 pj 10 13 dj 12 wj 14 Jj, pj, dj, wj J1, 10, 4, 14 © J. Christopher Beck 2005

63 TS Step 1: Find Initial Solution
Arbitrarily choose (2, 1, 4, 3) J4, 4, 12, 12 J2, 10, 2, 12 J1, 10, 4, 14 J3, 13, 1, 1 © J. Christopher Beck 2005

64 TS Step 2: Evaluate Neighborhood & Select Move
Neighborhood: swap Adjacent pairwise interchange J3, 13, 1, 1 J1, 10, 4, 14 J2, 10, 2, 12 J4, 4, 12, 12 Choose (1,4) J3, 13, 1, 1 J1, 10, 4, 14 J2, 10, 2, 12 J4, 4, 12, 12 wjTj = 480 J4, 4, 12, 12 J3, 13, 1, 1 J1, 10, 4, 14 J2, 10, 2, 12 wjTj = 436 J3, 13, 1, 1 J1, 10, 4, 14 J2, 10, 2, 12 J4, 4, 12, 12 wjTj = 652 © J. Christopher Beck 2005

65 TS Step 3: Add Move to Tabu List
wjTj = 436 J4, 4, 12, 12 Tabu: ((1, 4)) J2, 10, 2, 12 J1, 10, 4, 14 J3, 13, 1, 1 Best so far: (2, 4, 1, 3): 436 © J. Christopher Beck 2005

66 TS Step 2: Evaluate Neighborhood & Select Move
wjTj = 436 J4, 4, 12, 12 Tabu: ((1, 4)) J2, 10, 2, 12 J1, 10, 4, 14 J3, 13, 1, 1 Choose (4,2) J4, 4, 12, 12 J2, 10, 2, 12 J1, 10, 4, 14 J3, 13, 1, 1 wjTj = 460 J4, 4, 12, 12 J2, 10, 2, 12 J1, 10, 4, 14 J3, 13, 1, 1 wjTj = 500 J4, 4, 12, 12 J2, 10, 2, 12 J3, 13, 1, 1 J1, 10, 4, 14 wjTj = 608 © J. Christopher Beck 2005

67 TS Step 3: Add Move to Tabu List
J4, 4, 12, 12 wjTj = 460 J2, 10, 2, 12 J1, 10, 4, 14 J3, 13, 1, 1 Tabu: ((2,4) (1, 4)) Best so far: (2, 4, 1, 3): 436 © J. Christopher Beck 2005

68 TS Step 2: Evaluate Neighborhood & Select Move
J4, 4, 12, 12 wjTj = 460 J2, 10, 2, 12 J1, 10, 4, 14 J3, 13, 1, 1 Tabu: ((2,4) (1, 4)) Choose (1,2) J4, 4, 12, 12 J2, 10, 2, 12 J1, 10, 4, 14 J3, 13, 1, 1 wjTj = 436 J4, 4, 12, 12 J1, 10, 4, 14 J2, 10, 2, 12 J3, 13, 1, 1 wjTj = 440 J4, 4, 12, 12 J2, 10, 2, 12 J3, 13, 1, 1 J1, 10, 4, 14 wjTj = 632 © J. Christopher Beck 2005

69 TS Step 3: Add Move to Tabu List
J4, 4, 12, 12 wjTj = 440 J1, 10, 4, 14 J2, 10, 2, 12 J3, 13, 1, 1 Tabu: ((1,2), (2,4)) Best so far: (2, 4, 1, 3): 436 © J. Christopher Beck 2005

70 TS Step 2: Evaluate Neighborhood & Select Move
J4, 4, 12, 12 wjTj = 440 J1, 10, 4, 14 J2, 10, 2, 12 J3, 13, 1, 1 Tabu: ((1,2), (2,4)) Choose (1,4) J4, 4, 12, 12 J1, 10, 4, 14 J2, 10, 2, 12 J3, 13, 1, 1 wjTj = 408 J4, 4, 12, 12 J2, 10, 2, 12 J1, 10, 4, 14 J3, 13, 1, 1 wjTj = 460 J4, 4, 12, 12 J1, 10, 4, 14 J3, 13, 1, 1 J2, 10, 2, 12 wjTj = 586 © J. Christopher Beck 2005

71 TS Step 3: Add Move to Tabu List
J4, 4, 12, 12 wjTj = 408 J1, 10, 4, 14 J2, 10, 2, 12 J3, 13, 1, 1 Tabu: ((1,4), (1,2)) Best so far: (1,4,2,3): 408 And so on until a bound on the number of iterations (actually 408 is optimal, but TS has no way of knowing) © J. Christopher Beck 2005

72 Tabu Search Framework Find initial solution (something quick)
Until N moves are done Evaluate neighborhood Choose best non-tabu neighbor Update tabu list Return best solution found © J. Christopher Beck 2005

73 Tabu Search Framework To completely define a TS algorithm, you must define How the initial solution is found Format and length of tabu list How to generate a neighborhood from a given state © J. Christopher Beck 2005

74 TS & JSP J0 J1 J2 J0 J2 J1 J0 J1 J2 J1 J2 J0 © J. Christopher Beck 2005

75 TS & JSP How might you find a first solution?
What could your tabu list format be? Can you define a neighborhood? © J. Christopher Beck 2005

76 The N1 Neighborhood for JSP
© J. Christopher Beck 2005

77 The N1 Neighborhood for JSP
Pick a critical path Neighborhood: all swaps on the chosen CP © J. Christopher Beck 2005

78 TS on Cut Out JSP Run TS on JSP that we have been used in previous lectures Choose initial solution method Choose TS format & length Choose neighborhood Activities Jobs 1 2 3 4 M1, 9 M2, 8 M3, 4 M4, 4 M1, 5 M2, 6 M4, 3 M3, 6 M3, 10 M1, 4 M2, 9 M4, 2 © J. Christopher Beck 2005


Download ppt "Lecture 9: Tabu Search © J. Christopher Beck 2005."

Similar presentations


Ads by Google