Presentation is loading. Please wait.

Presentation is loading. Please wait.

Escaping Local Optima. Where are we? Optimization methods Complete solutions Partial solutions Exhaustive search Hill climbing Exhaustive search Hill.

Similar presentations


Presentation on theme: "Escaping Local Optima. Where are we? Optimization methods Complete solutions Partial solutions Exhaustive search Hill climbing Exhaustive search Hill."— Presentation transcript:

1 Escaping Local Optima

2 Where are we? Optimization methods Complete solutions Partial solutions Exhaustive search Hill climbing Exhaustive search Hill climbing Exhaustive search Branch and bound Greedy Best first A* Divide and Conquer Dynamic programming Exhaustive search Branch and bound Greedy Best first A* Divide and Conquer Dynamic programming

3 Where are we going? Optimization methods Complete solutions Partial solutions Exhaustive search Branch and bound Greedy Best first A* Divide and Conquer Dynamic programming Exhaustive search Branch and bound Greedy Best first A* Divide and Conquer Dynamic programming Improved methods based on complete solutions Exhaustive search Hill climbing Exhaustive search Hill climbing

4 Escaping local optima Many strategies including Simulated annealing Tabu search and many others… some examples -->

5 (0) Basic Hill climbing determine initial solution s while s is not a local optimum choose s’ in N(s) such that f(s’)>f(s) s = s’ return s

6 (1) Randomized Hill climbing determine initial solution s; bestS = s while termination condition not satisfied with probability p choose neighbour s’ at random (uniform) else choose s’ with f(s’) > f(s) //climb if possible or s’ with max (f(s’)) over N(s) s = s’; if (f(s) > f(bestS)) bestS = s return bestS

7 (2) Variable Neighbourhood determine initial solution s i = 1 repeat choose neighbour s’ in N i (s) with max(f(s’)) if ((f(s’) > f(s)) s = s’ i = 1// restart in first neighbourhood else i = i+1// go to next neighbourhood until i > iMax return s

8 Stochastic local search  many other important algorithms address the problem of avoiding the trap of local optima (possible source of project topics)  M&F focus on two only simulated annealing tabu search

9 Simulated annealing  metaphor: slow cooling of liquid metals to allow crystal structure to align properly  “temperature” T is slowly lowered to reduce random movement of solution s in solution space

10 Simulated Annealing determine initial solution s; bestS = s T = T 0 while termination condition not satisfied choose s’ in N(s) probabilistically if (s’ is “acceptable”) // function of T s = s’ if (f(s) > f(sBest)) bestS = s update T return bestS

11 Accepting a new solution - acceptance more likely if f(s’) > f(s) - as execution proceeds, probability of acceptance of s’ with f(s’) < f(s) decreases (becomes more like hillclimbing) determine initial solution s; bestS = s T = T 0 while termination condition not satisfied choose s’ in N(s) probabilistically if (s’ is “acceptable”) // function of T s = s’ if (f(s) > f(sBest)) bestS = s update T return bestS determine initial solution s; bestS = s T = T 0 while termination condition not satisfied choose s’ in N(s) probabilistically if (s’ is “acceptable”) // function of T s = s’ if (f(s) > f(sBest)) bestS = s update T return bestS

12 the acceptance function T evolves *sometimes p=1 when f(s’)-f(s)> 0

13 Simulated annealing with SAT algorithm p.123 SA-SAT propositions:P 1,… P n expression:F = D 1 D 2 …D k where clause D i is a disjunction of propositions and negative props e.g.,P x  ~P y  P z  ~P w fitness function:number of true clauses

14 Inner iteration assign random truth setTFFT repeat for i=1 to 4 flip truth of prop iFFFT evaluateFTFT decide to keep (or not)FFTT changed valueFFTF reduce TFFTT

15 Tabu search (taboo) always looks for best solution but some choices (neighbours) are ineligible (tabu) ineligibility is based on recent moves: once a neighbour edge is used, it is tabu for a few iterations search does not stop at local optimum

16 Symmetric TSP example set of 9 cities {A,B,C,D,E,F,G,H,I} neighbour definition based on 2-opt* (27 neighbours) current sequence: B - D - A - I - H - F - E - C - G - B move to 2-opt neighbour B - E - F - H - I - A - D - C - G - B edges B-E and D-C are now tabu i.e., next 2-opt swap cannot involve these edges *example in book uses 2-swap, p 131

17 TSP example, algorithm p 133 how long will an edge be tabu?3 iterations how to track and restore eligibility? data structure to store tabu status of 9*8/2 = 36 edges B - D - A - I - H - F - E - C - G - B recency-based memory ABCDEFGH I00000002 H0000010 G010000 F00000 E0030 D230 C00 B0

18 procedure tabu search begin tries <- 0 repeat generate a tour count <- 0 repeat identify a set T of 2-opt moves select best admissible move from T make appropriate 2-opt update tabu list and other vars if new tour is best-so-far for a given tries update local best tour information count <- count + 1 until count == ITER tries <- tries + 1 if best-so-far for given tries is best-so-far (for all ‘tries’) update global best information until tries == MAX-TRIES end

19 applying 2-opt with tabu  from the table, some edges are tabu: B - D - A - I - H - F - E - C - G - B  2-opt can only consider:  AI and FE  AI and CG  FE and CG ABCDEFGH I00000002 H0000010 G010000 F00000 E0030 D230 C00 B0

20 importance of parameters  once algorithm is designed, it must be “tuned” to the problem selecting fitness function and neighbourhood definition setting values for parameters  this is usually done experimentally

21 procedure tabu search begin tries <- 0 repeat generate a tour count <- 0 repeat identify a set T of 2-opt moves select best admissible move from T make appropriate 2-opt update tabu list and other vars if new tour is best-so-far for a given tries update local best tour information count <- count + 1 until count == ITER tries <- tries + 1 if best-so-far for given tour is best-so-far for all tries update global best information until tries == MAX-TRIES end


Download ppt "Escaping Local Optima. Where are we? Optimization methods Complete solutions Partial solutions Exhaustive search Hill climbing Exhaustive search Hill."

Similar presentations


Ads by Google