Local Search Algorithms and Optimization Problems
Finding a Good State without worrying about the path to get there.
Outline
Local Search and Optimization
Local search algorithms
Local Search and Optimization
8-Queens Problem
8-Queens Problem
Local search algorithms
Advantages to local search
Example: n-queens
Hill-Climbing Search
Hill-Climbing Search
function HILL-CLIMBING( problem) return a state that is a local maximum
input: problem, a problem
local variables: current, a node.
neighbor, a node.
current ← MAKE-NODE(INITIAL-STATE[problem])
loop do
neighbor ← a highest valued successor of current
if VALUE [neighbor] ≤ VALUE[current]
then return STATE[current]
current ← neighbor
Hill Climbing Search for 8-Puzzle Problem
Generate Successors: Find all possible moves (up, down, left, right) by sliding a tile into the empty space.
Hill Climbing Search for 8-Puzzle Problem
1 2 3
4 8 5
6 _ 7
1 2 3
4 5 6
7 8 _
Initial State
Goal State
Hill-Climbing Search: 8-Queens Problem
Hill-Climbing Search: 8-Queens Problem
Drawbacks
Drawbacks
ridge
Hillclimbing �(Greedy Local Search)
Hill-climbing search problems�(this slide assumes maximization rather than minimization)
20
Local maximum
Plateau
Ridge
Random restart hill-climbing�(note: there are many variants of hill climbing)
Hill-climbing search (steepest-ascent version)
8-queens problem
complete-state formulation
vs.
incremental formulation
8-queens problem
Hill-climbing search
Hill climbing search: �8-queens problem
What we learn hill-climbing is
Usually like
What we think hill-climbing
looks like
Hill-climbing search
Problems for hill climbing
Problems for hill climbing
30
Hill climbing search
Some solutions
Some solutions
Some more solutions�(Variants of hill climbing )
Some more solutions�(Variants of hill climbing )
Simulated Annealing
Simulated Annealing
Simulated Annealing
Simulated Annealing
Local Beam Search
Local Beam Search
Local Beam Search
Simulated Annealing Search
function SIMULATED-ANNEALING( problem, schedule) return a solution state
input: problem, a problem
schedule, a mapping from time to temperature
local variables: current, a node.
next, a node.
T, a “temperature” controlling the probability of downward steps
current ← MAKE-NODE(INITIAL-STATE[problem])
for t ← 1 to ∞ do
T ← schedule[t]
if T = 0 then return current
next ← a randomly selected successor of current
∆E ← VALUE[next] - VALUE[current]
if ∆E > 0 then current ← next
else current ← next only with probability e∆E /T
Genetic Algorithms
Genetic Algorithms
Genetic Algorithms