1 / 21

Local Search Algorithms

Local Search Algorithms. CPS 4801. Outline. Hill-Climbing Search Simulated Annealing Local Beam Search (briefly ). Local search algorithms. In many optimization problems, the path to the goal is irrelevant; the goal state itself is the solution.

aleda
Download Presentation

Local Search Algorithms

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Local Search Algorithms CPS 4801

  2. Outline • Hill-Climbing Search • Simulated Annealing • Local Beam Search (briefly)

  3. Local search algorithms • In many optimization problems, the path to the goal is irrelevant; the goal state itself is the solution. • Find the final configuration satisfying constraints, e.g., n-queens. • In such cases, we can use local search algorithms: • keep a single "current" state, try to improve it • generally move to neighbors • The path are not retained

  4. Local search algorithms • uses very little memory • useful for solving pure optimization problems • can often find reasonable solutions in large state spaces.

  5. Example: n-queens • Put n queens on an n × n board with no two queens on the same row, column, or diagonal

  6. Hill-climbing search (steepest-ascent version) • A simple loop that continuously moves in the direction of increasing value – uphill • Terminates when reaches a “peak” • does not look ahead beyond the immediate neighbors, does not maintain a search tree

  7. 8-queens problem • Each state has 8*7 = 56 successors. complete-state formulation vs. incremental formulation

  8. 8-queens problem • h= number of pairs of queens that are attacking each other, either directly or indirectly (h=0 solution) • h = 17 for the above state

  9. Hill-climbing search • “Greedy local search” • grabs a good neighbor state without thinking ahead about where to go next • makes rapid progress

  10. Hill-climbing search: 8-queens problem • 5 steps from the state in the previous slide • A local minimum with h = 1

  11. Hill-climbing search • Problem: depending on initial state, can get stuck in local maxima.

  12. Hill-climbing search •  Starting from a randomly generated 8-queen state, steepest-ascent hill climbing gets stuck 86% of the time. •  It takes 4 steps on average when it succeeds and 3 when it gets stuck. • The steepest ascent version halts if the best successor has the same value as the current.

  13. Hill-climbing search • allow a sideways move • shoulder • flat local maximum, that is not a shoulder • Solution: a limit on the number of consecutive sideway moves • E.g., 100 consecutive sideways movies in the 8-queens problem • successful rate: raises from14% to 94% • cost: 21 steps on average for each successful instance, 64 for each failure

  14. Variants of hill climbing • Stochastic hill climbing • chooses at random from among the uphillmoves • converge more slowly, but finds better solutions • First-choice hill climbing • generates successors randomly until one is better than the current state • good when with many (thousands) of successors

  15. Variants of hill climbing • Random-restart hill climbing • “If you don’t succeed, try, try again.” • conducts a series of hill-climbing searches from randomly generated initial states, until a goal is found.

  16. Simulated Annealing • A hill-climbing algorithm that never makes “downhill” moves is guaranteed to be incomplete. • Idea: escape local maxima by allowing some “bad” moves

  17. Simulated Annealing • Picks a random move (instead of the best) • If “good move” • accepted; • else • accepted with some probability • The probability decreases exponentially with the “badness” of the move

  18. Simulated Annealing

  19. Simulated Annealing • Simulated annealing was first used extensively to solve VLSI (Very-Large-Scale Integration) layout problems. • It has been applied widely to factory scheduling and other large-scale optimization tasks.

  20. Local Beam Search • Idea: keep k states instead of 1; choose top k of all their successors • Not the same as k searches run in parallel! • Searches that find good states recruit other searches to join them • moves the resources to where the most progress is being made

  21. Local Beam Search • Problem: quite often, all k states end up on same local hill (concentrated in a small region) • Idea: choose k successors randomly(stochastic beam search)

More Related