finding search heuristics

17
Finding Search Heuristics Henry Kautz

Upload: alayna

Post on 07-Feb-2016

41 views

Category:

Documents


0 download

DESCRIPTION

Finding Search Heuristics. Henry Kautz. A* Graph Search for Any Admissible Heuristic. if State[node] is not in closed OR g[node] < g[LookUp(State[node], closed )] then. Inconsistent but Admissible. Memory Efficient Versions of A*. Iterative Deepening A* (IDA*) - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Finding Search Heuristics

Finding Search Heuristics

Henry Kautz

Page 2: Finding Search Heuristics

if State[node] is not in closed OR

g[node] < g[LookUp(State[node],closed)]

then

A* Graph Search for Any Admissible Heuristic

Page 3: Finding Search Heuristics

Inconsistent but Admissible

Page 4: Finding Search Heuristics

Memory Efficient Versions of A*

• Iterative Deepening A* (IDA*)– Just like IDS, except that:

• Stopping condition: g(n)+h(n)=f(n) > Cutoff• Increment: Min{ f(n) | n was cutoff last iteration}

– Optimal– Memory linear in cheapest path– Will re-expand nodes frequently

Page 5: Finding Search Heuristics

Memory-Bounded A*

• Throw nodes out of Closed and/or Fringe when memory gets low– Dropping nodes from Closed can make extra work, but

doesn’t hurt optimality

• Dropping nodes from Fringe:– Choose worst node n from Fringe– Set f(Parent(n)) = Max { f(Parent(n)),

Min{ f(n’) | n=Parent(n’) }– If Parent is not in Fringe, put it in Fringe

• Many variations – MA*, SMA*, SMAG*, …

Page 6: Finding Search Heuristics
Page 7: Finding Search Heuristics
Page 8: Finding Search Heuristics
Page 9: Finding Search Heuristics

Properties of Heuristics

• Let h1 and h2 be admissible heuristics

• if for all s, h1(s) h2(s), then– h1 dominates h2– h1 is better than h2

• h3(s) = max(h1(s), h2(s)) is admissible– h3 dominates h1 and h2

Page 10: Finding Search Heuristics

Exercise: Rubik’s Cube

• State: position and orientation of each cubie– Corner cubie: 8 positions, 3 orientations– Edge cubie: 8 positions, 2 orientations– Center cubie: 1 position – fixed

• Move: Turn one face– Center cubits never move!

• Devise an admissible heuristic

Page 11: Finding Search Heuristics

Heuristics

• # cubies out of place / 8– Must divide up 8 so is admissible– Too optimistic / weak

•  Better: 

•  Korf 1997 – Solves Rubik’s cube optimally

⎟⎟

⎜⎜

∑∑

4 / cubiescorner dist Manhattan

4, / cubies edgedist Manhattan max

Page 12: Finding Search Heuristics

Automatically DerivingHeuristics for STRIPS planning

• Goal: quickly compute upper bound on distance from S to a state containing Goals

• Consider: |Goals – S|/m

where m is the maximum number of goals added by any one action

• Admissible?• Accurate?

Yes!

No, ignores preconditions!

Page 13: Finding Search Heuristics

Another Attempt

• Create relaxed planning problem: Solve– Initial = S– Same Goals– Eliminate negative effects from all operators

• Use length of shortest solution to relaxed problem as h– Admissible?– Accurate?– Easy to compute?

Yes!

No, hard as set covering!Pretty good

Page 14: Finding Search Heuristics

Plan Graph Heuristic

• Idea: Quickly estimate the minimum length of solution of relaxed problem

• Method:1. For each literal, create a dummy “persistence” action

with that literal as precondition and effect

2. Compute a Plan Graph:• S0: initial literals• A0: actions whose preconditions are in S0 • S1: add effects of actions in A0• A1: actions whose preconditions are in S1

Page 15: Finding Search Heuristics

Plan Graph Heuristic

• Method (continued):3. Propagate mutual exclusions (mutexes):

• Two non-persistence actions at the same level are mutex

• A persistence action is mutex with an action that whose effect negates it

• Two literals A and B are mutex at level i if all the actions that add A are mutex with those that add B

4. Estimated length = lowest level containing all goals with no mutexes between them

Page 16: Finding Search Heuristics

Example Plan Graph

Page 17: Finding Search Heuristics

Is Planning Solved?

• A* with plan graph heuristic works well for domains with relatively few bad interactions between actions

• For “harder” domains:– Solve non-optimally using non-admissible

heuristics– Solve optimally using other approaches –

such as satisfiability testing• More later in the course!