Planning Graphs Based on slides by Alan Fern
Planning Graphs * Based on slides by Alan Fern, Berthe Choueiry and Sungwook Yoon
Graph. Plan h Many planning systems use ideas from Graphplan: 5 IPP, STAN, SGP, Blackbox, Medic h Can run much faster than POP-style planners h History 5 Before Graph. Plan came out, most planning researchers were working on POP-style planners 5 Graph. Plan started them thinking about other more efficient algorithms h Recent planning algorithms run much faster than Graph. Plan 5 However, most of them have been influenced by Graph. Plan 2
Big Picture h A big source of inefficiency in search algorithms is the large branching factor h Graph. Plan reduces the branching factor by searching in a special data structure h Phase 1 – Create a Planning Graph 5 built from initial state 5 contains actions and propositions that are possibly reachable from initial state 5 does not include unreachable actions or propositions h Phase 2 - Solution Extraction 5 Backward search for the Search for solution in the planning graph g backward from goal 3
Planning Graph A literal is just a positive or negative propositon h Sequence of levels that correspond to time-steps in the plan: 5 Each level contains a set of literals and a set of actions 5 Literals are those that could possibly be true at the time step 5 Actions are those that their preconditions could be satisfied at the time step. h Idea: construct superset of literals that could be possible achieved after an n-level layered plan 5 Gives a compact (but approximate) representation of states that are reachable by n level plans 4
Planning Graph state-level 0: propositions true in s 0 state-level n: literals that may possibly be true after some n level plan s 0 propositions … sn an action-level n: actions that may possibly be applicable after some n level plan Sn+1 … … … … … actions 5
Planning Graph h maintenance action (persistence actions) 5 represents what happens if no action affects the literal 5 include action with precondition c and effect c, for each literal c propositions … … … … … actions 6
Graph expansion h Initial proposition layer 5 Just the initial conditions h Action layer n 5 If all of an action’s preconditions are in proposition layer n, then add action to layer n h Proposition layer n+1 5 For each action at layer n (including persistence actions) 5 Add all its effects (both positive and negative) at layer n+1 (Also allow propositions at layer n to persist to n+1 h Propagate mutex information (we’ll talk about this in a moment) 7
Example stack(A, B) precondition: holding(A), clear(B) effect: ~holding(A), ~clear(B), on(A, B) handempty s 0 a 0 holding(A) s 1 holding(A) ~holding(A) stack(a, b) handempty ~clear(B) on(A, B) clear(B) 8
Example stack(A, B) precondition: holding(A), clear(B) effect: ~holding(A), ~clear(B), on(A, B) handempty s 0 a 0 holding(A) s 1 holding(A) ~holding(A) stack(A, B) handempty ~clear(B) on(A, B) clear(B) Notice that not all literals in s 1 can be made true simultaneously after 1 level: e. g. holding(A), ~holding(A) and on(A, B), clear(B) 9
Mutual Exclusion (Mutex) h Between pairs of actions 5 no valid plan could contain both at layer n 5 E. g. , stack(a, b), unstack(a, b) h Between pairs of literals 5 no valid plan could produce both at layer n 5 E. g. , clear(a), ~clear(a) on(a, b), clear(b) h Graph. Plan checks pairs only 5 mutex relationships can help rule out possibilities during search in phase 2 of Graphplan 10
Solution Extraction: Backward Search Repeat until goal set is empty If goals are present & non-mutex: 1) Choose set of non-mutex actions to achieve each goal 2) Add preconditions to next goal set 11
Searching for a solution plan h Backward chain on the planning graph h Achieve goals level by level h At level k, pick a subset of non-mutex actions to achieve current goals. Their preconditions become the goals for k-1 level. h Build goal subset by picking each goal and choosing an action to add. Use one already selected if possible (backtrack if can’t pick non-mutex action) h If we reach the initial proposition level and the current goals are in that level (i. e. they are true in the initial state) then we have found a successful layered plan 12
Graph. Plan algorithm h Grow the planning graph (PG) to a level n such that all goals are reachable and not mutex 5 necessary but insufficient condition for the existence of an n level plan that achieves the goals 5 if PG levels off before non-mutex goals are achieved then fail h Search the PG for a valid plan h If none found, add a level to the PG and try again h If the PG levels off and still no valid plan found, then return failure Correctness follows from PG properties 13
Important Ideas h Plan graph construction is polynomial time 5 Though construction can be expensive when there are many “objects” and hence many propositions h The plan graph captures important properties of the planning problem 5 Necessarily unreachable literals and actions 5 Possibly reachable literals and actions 5 Mutually exclusive literals and actions h Significantly prunes search space compared to POP style planners h The plan graph provides a sound termination procedure 5 Knows when no plan exists h Plan graphs can also be used for deriving admissible (and good non-admissible) heuristics 5 See your book (we may come back to this idea later) 14
- Slides: 14