© J. Christopher Beck Lecture 17: Tabu Search
© J. Christopher Beck Outline Review: Local Search & Crystal Maze Tabu Search Tabu & 1-machine JSP Example C.5.4 Tabu & JSP N1 neighborhood
© J. Christopher Beck Readings P Ch C.5
© J. Christopher Beck Core Ideas of Local Search Start with some (random?) assignment of variables Look in “neighborhood” formed by making a small change to the assignment Choose best neighbor Repeat
© J. Christopher Beck Crystal Maze 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 Random Initial Solution ? ? ? ? ? ? ??
© J. Christopher Beck Random Initial Solution ? ? ? ? ? ? ?? “Broken” constraint Cost = # of broken constraints
© J. Christopher Beck What Should We Do Now? Move: Swap two numbers Which 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 What Should We Do Now? Move: Swap two numbers Which 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 Random Initial Solution ? ? ? ? ? ? ??
© J. Christopher Beck Cost Difference Table
© J. Christopher Beck Cost Difference Table
© J. Christopher Beck Current State ? ? ? ? ? ? ??
© J. Christopher Beck Swap 1 & 7: Cost 3 ? ? ? ? ? ? ??
© J. Christopher Beck New Cost Difference Table
© J. Christopher Beck Current State ? ? ? ? ? ? ??
© J. Christopher Beck Swap 3 & 8: Cost 2 ? ? ? ? ? ? ??
© J. Christopher Beck Swap 6 & 7: Cost 1 ? ? ? ? ? ? ??
© J. Christopher Beck Moves Initial State: Cost 6 Swap 1 & 7: Cost 3 Swap 3 & 8: Cost 2 Swap 6 & 7: Cost 1
© J. Christopher Beck Cost Difference Table
© J. Christopher Beck Now what? There are no improving moves to make! So far, we have been “hill- climbing” moves cost
© J. Christopher Beck Tabu Search Idea Local search but: Keep a small list of the moves that are “tabu”: you can’t (un)do them List has a limited length and the oldest entries “fall off” when the list is full
© J. Christopher Beck Tabu 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 Tabu Search & 1-Machine Example C.5.4, min w j T j Tabu List Size = 2 Jobs1234 pjpj djdj wjwj J j, p j, d j, w j J1, 10, 4, 14
© J. Christopher Beck TS Step 1: Find Initial Solution Arbitrarily choose (2, 1, 4, 3) J3, 13, 1, 1J1, 10, 4, 14J2, 10, 2, 12 J4, 4, 12, J j, p j, d j, w j
© J. Christopher Beck TS Step 2: Evaluate Neighborhood & Select Move Neighborhood: swap Adjacent pairwise interchange J3, 13, 1, 1J1, 10, 4, 14J2, 10, 2, 12 J4, 4, 12, 12 J3, 13, 1, 1J1, 10, 4, 14J2, 10, 2, 12 J4, 4, 12, 12 wjTj = 480 J4, 4, 12, 12 J3, 13, 1, 1J1, 10, 4, 14J2, 10, 2, 12 wjTj = 436 J3, 13, 1, 1J1, 10, 4, 14J2, 10, 2, 12 J4, 4, 12, 12 wjTj = 652 Choose (1,4)
© J. Christopher Beck TS Step 3: Add Move to Tabu List J4, 4, 12, 12 J3, 13, 1, 1J1, 10, 4, 14J2, 10, 2, 12 wjTj = 436 Tabu: ((1, 4)) Best so far: (2, 4, 1, 3): 436
© J. Christopher Beck TS Step 2: Evaluate Neighborhood & Select Move J4, 4, 12, 12 J3, 13, 1, 1J1, 10, 4, 14J2, 10, 2, 12 J4, 4, 12, 12 wjTj = 460 J3, 13, 1, 1J1, 10, 4, 14J2, 10, 2, 12 wjTj = 500 J3, 13, 1, 1J1, 10, 4, 14J2, 10, 2, 12 J4, 4, 12, 12 wjTj = 608 Choose (4,2) J4, 4, 12, 12 J3, 13, 1, 1J1, 10, 4, 14J2, 10, 2, 12 wjTj = 436 Tabu: ((1, 4))
© J. Christopher Beck TS Step 3: Add Move to Tabu List Tabu: ((2,4) (1, 4)) J3, 13, 1, 1J1, 10, 4, 14J2, 10, 2, 12 J4, 4, 12, 12 wjTj = 460 Best so far: (2, 4, 1, 3): 436
© J. Christopher Beck TS Step 2: Evaluate Neighborhood & Select Move J4, 4, 12, 12 J3, 13, 1, 1J1, 10, 4, 14J2, 10, 2, 12 J4, 4, 12, 12 wjTj = 436 J3, 13, 1, 1J1, 10, 4, 14J2, 10, 2, 12 wjTj = 440 J3, 13, 1, 1J1, 10, 4, 14J2, 10, 2, 12 J4, 4, 12, 12 wjTj = 632 Choose (1,2) Tabu: ((2,4) (1, 4)) J3, 13, 1, 1J1, 10, 4, 14J2, 10, 2, 12 J4, 4, 12, 12 wjTj = 460
© J. Christopher Beck TS Step 3: Add Move to Tabu List Tabu: ((1,2), (2,4)) J3, 13, 1, 1J1, 10, 4, 14J2, 10, 2, 12 J4, 4, 12, 12 wjTj = 440 Best so far: (2, 4, 1, 3): 436
© J. Christopher Beck TS Step 2: Evaluate Neighborhood & Select Move J4, 4, 12, 12 J3, 13, 1, 1J1, 10, 4, 14J2, 10, 2, 12 J4, 4, 12, 12 wjTj = 460 J3, 13, 1, 1J1, 10, 4, 14J2, 10, 2, 12 wjTj = 408 J3, 13, 1, 1J1, 10, 4, 14J2, 10, 2, 12 J4, 4, 12, 12 wjTj = 586 Choose (1,4) Tabu: ((1,2), (2,4)) J3, 13, 1, 1J1, 10, 4, 14J2, 10, 2, 12 J4, 4, 12, 12 wjTj = 440
© J. Christopher Beck TS Step 3: Add Move to Tabu List Tabu: ((1,4), (1,2)) wjTj = 408 Best so far: (1,4,2,3): 408 J4, 4, 12, 12 J3, 13, 1, 1J1, 10, 4, 14J2, 10, 2, 12 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 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 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 TS & JSP J0 J1 J2 J0 J1 J2
© J. Christopher Beck TS & JSP How might you find a first solution? What could your tabu list format be? Can you define a neighborhood?
© J. Christopher Beck The N1 Neighborhood for JSP J0 J1 J2
© J. Christopher Beck The N1 Neighborhood for JSP J0 J1 J2 Pick a critical path Neighborhood: all swaps on the chosen CP
© J. Christopher Beck Tabu Example JSP Run Tabu on JSP from previous lectures JobsProcessing times 0 J0R0[15] J0R1[50] J0R2[60] 1 J1R1[50] J1R0[50] J1R2[15] 2 J2R0[30] J2R1[15] J2R2[20]