Professional Documents
Culture Documents
Intelligence
Local Search
(updated 4/30/2006)
Henry Kautz
Local Search in Continuous
Spaces
S initial state vector
f ( S ) quantity to optimized
step size
until Goal_Test(S ) do
f
S S (S )
S
• Terminology:
– “neighbors” instead of “children”
– heuristic h(s) is the “objective function”, no need to be
admissible
• No guarantee of finding a solution
– sometimes: probabilistic guarantee
• Best goal-finding, not path-finding
• Many variations
Local Search versus Systematic
Search
• Systematic Search
– BFS, DFS, IDS, Best-First, A*
– Keeps some history of visited nodes
– Always complete for finite search spaces,
some versions complete for infinite spaces
– Good for building up solutions incrementally
• State = partial solution
• Action = extend partial solution
Local Search versus Systematic
Search
• Local Search
– Gradient descent, Greedy local search,
Simulated Annealing, Genetic Algorithms
– Does not keep history of visited nodes
– Not complete. May be able to argue will
terminate with “high probability”
– Good for “fixing up” candidate solutions
• State = complete candidate solution that may not
satisfy all constraints
• Action = make a small change in the candidate
solution
N-Queens Problem
N-Queens Systematic Search
state = choose_start_state();
add state to Fringe;
while ! GoalTest(state) do
choose state from Fringe according to h(state);
Fringe = Fringe U { Children(state) }
end
return state;
Plateau
objective function
Local Minimum
Variations of Greedy Search
• Where to start?
– RANDOM STATE
– PRETTY GOOD STATE
• What to do when a local minimum is reached?
– STOP
– KEEP GOING
• Which neighbor to move to?
– BEST neighbor
– Any BETTER neighbor (Hill Climbing)
• How to make local search more robust?
Restarts
for run = 1 to max_runs do
state = choose_start_state();
flip = 0;
while ! GoalTest(state) && flip++ < max_flips do
state := arg min { h(s) | s in Neighbors(state) }
end
if GoalTest(state) return state;
end
return FAIL
Uphill Moves: Random Noise
state = choose_start_state();
while ! GoalTest(state) do
with probability noise do
state = random member Neighbors(state)
else
state := arg min { h(s) | s in Neighbors(state) }
end
end
return state;
Uphill Moves: Simulated Annealing
(Constant Temperature)
state = start;
while ! GoalTest(state) do
next = random member Neighbors(state);
deltaE = h(next) – h(state);
if deltaE 0 then Book reverses,
state := next; because is looking for
else max h state
with probability e-deltaE/temperature do
state := next;
end
endif
end
return state;
Uphill Moves: Simulated Annealing
(Geometric Cooling Schedule)
temperature := start_temperature;
state = choose_start_state();
while ! GoalTest(state) do
next = random member Neighbors(state);
deltaE = h(next) – h(state);
if deltaE 0 then
state := next;
else
with probability e-deltaE/temperature do
state := next;
end
temperature := cooling_rate * temperature;
end
return state;
Simulated Annealing