1 of 30

State Space Planning

2 of 30

Planning as Search

  • It is natural to model planning as a search problem
    • Definition of state is natural
    • Operators define the state transition
    • Goal test: Whether the current state satisfies the goal or not
  • Different planning procedure has different search spaces
    • State-space planning: Each node represents the state of the world
    • Plan-space-planning: Each node is a partial plan

3 of 30

Outline: State-space Planning

  • Forward Search
  • Backward Search
  • Lifting
  • STRIPS
  • Domain-specific Planning
    • Block-stacking

4 of 30

Forward Search

5 of 30

Forward Search

take c3

move r1

take c2

6 of 30

Forward Search Properties

  •  

7 of 30

Forward Search: Pruning

  • Forward-search’s state-space is much larger
  • Modify algorithm to prune branches of the search space
    • Cut off search below these branches
  • Safe pruning is guaranteed not to prune every solution
    • To maintain the completeness of the algorithm
  • Strongly safe pruning guarantee not pruning at least one optimal solution

8 of 30

Forward Search Pruning Strategy

  •  

9 of 30

Deterministic Implementation

  • Some deterministic implementations of forward search:
    • breadth-first search
    • depth-first search
    • best-first search (e.g., A*)
    • greedy search
  • Breadth-first and best-first search are sound and complete
    • But they usually aren’t practical because they require too much memory
    • Memory requirement is exponential in the length of the solution

10 of 30

Deterministic Implementation

  • In practice, more likely to use depth-first search or greedy search
    • Worst-case memory requirement is linear in the length of the solution
    • In general, sound but not complete
      • But classical planning has only finitely many states
      • Thus, can make depth-first search complete by doing loop-checking

11 of 30

Branching Factor of Forward Search

  • Many applicable actions that don’t progress toward goal
  • Deterministic implementations can waste time trying lots of irrelevant actions

a3

a1

a1

a2

a50

a3

initial state

goal

a2

12 of 30

Backward Search

  •  

13 of 30

 

  •  

14 of 30

Backward Search Algorithm

15 of 30

Backward Search Algorithm

Initial State

Goal

At first iteration choose

16 of 30

Backward Search Algorithm

At second iteration choose

17 of 30

Backward Search Algorithm

Satisfies

18 of 30

Efficiency of Backward Search

  • Backward search can also have a very large branching factor
    • an operator o that is relevant for g may have many ground instances a1, a2, …, an such that each ai’s input state might be unreachable from the initial state
  • As before, deterministic implementations can waste lots of time trying all of them

b1

b1

b2

b50

b3

initial state

goal

19 of 30

Lifted Backward Search

  • Lifting: Can reduce the branching factor of backward search if we partially instantiate the operators

holding(b1)

. . .

ontable(b1)

on(b1,b1)

on(b1,b2)

on(b1,b50)

pickup(b1)

unstack(b1,b1)

unstack(b1,b2)

unstack(b1,b50)

holding(b1)

ontable(b1)

on(b1,y)

pickup(b1)

unstack(b1,y)

20 of 30

Lifted Backward Search

21 of 30

The Search Space is Still Large

  • Suppose actions a, b, and c are independent, action d must precede all of them, and there’s no path from s0 to d’s input state
  • We’ll try all possible orderings of a, b, and c before realizing there is no solution

c

b

a

goal

a

b

b

a

b

a

a

c

b

c

c

b

d

d

d

d

d

d

s0

22 of 30

STRIPS

  • Similar to Backward-search with following difference
    • Only the preconditions of the last operators added to the plan are treated as the subgoals
      • Reduces the branching factor
    • If current state satisfies all of an operator’s preconditions, STRIPS commits to the execution of the operator and will not backtrack

23 of 30

G

Efficient but Incomplete

24 of 30

Sussman Anomaly

Two relevant operators at top level: “put A onto B” and “put B onto C”

25 of 30

Sussman Anomaly (Case: put A onto B)

  • Achieve on(A,B)
    • put C from A onto Table
    • put A onto B
    • sub-plan complete from initial state; commit to it
  • Achieve on(B,C)
    • put A from B onto Table
    • put B onto C
    • sub-plan complete from new state (un-achieves first sub-goal); commit to it
  • Re-achieve on(A,B)
    • put A onto B

Length 5 plan

26 of 30

Sussman Anomaly (Case: put B onto C)

  • Achieve on(B,C)
    • put B onto C
    • sub-plan complete from initial state; commit to it
  • Achieve on(A,B)
    • put B from C onto Table
    • put C from A onto Table
    • put A onto B
  • Re-achieve on(B,C)
    • put A from B onto Table
    • put B on C
  • Re-achieve on(A,B)
    • put A onto B

Length 7 plan

27 of 30

Sussman Anomaly

  • Interleave plans
  • Shortest solution for achieving on(A,B)
    • put C from A onto Table
    • put A onto B
  • Shortest solution for achieving on(B,C)
    • put B onto C
  • Optimal solution – Interleave two solutions
    • put C from A onto Table
    • put B onto C
    • put A onto B

28 of 30

Sussman Anomaly

STRIPS Does not always find the best solution

29 of 30

Sussman Anomaly

30 of 30

Sussman Anomaly

Shortest plan for achieving on(c1,c2)

Shortest plan for achieving on(c2,c3)

Interleaved plan