1 / 67

Graph-based Planning

Graph-based Planning. Brian C. Williams Sept. 25 th & 30 th , 2002 16.412J/6.834J. Outline. Introduction The Graph Plan Planning Problem Graph Construction Solution Extraction Properties Termination with Failure. Graph Plan.

Télécharger la présentation

Graph-based Planning

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Graph-based Planning Brian C. Williams Sept. 25th & 30th, 2002 16.412J/6.834J

  2. Outline • Introduction • The Graph Plan Planning Problem • Graph Construction • Solution Extraction • Properties • Termination with Failure

  3. Graph Plan • Graphplan was developed in 1995 by Avrim Blum and Merrick Furst, at CMU. • Recent implementations by other researchers have extended the capability of Graphplan to reason with temporally extended actions, metrics and non-atomic preconditions and effects.

  4. Proposition Init State Action Time 1 Proposition Time 1 Action Time 2 Approach: Graph Plan • Constructs compact encoding of state space from operators and initial state, which prunes many invalid plans – Plan Graph. • Generates plan by searching for a consistent subgraph that achieves the goals.

  5. Plan graphs focus towards valid plans • Plan graphs exclude many plans that are infeasible. • Plans that do not satisfy the initial or goal state. • Plans with operators that threaten each other. • Plan graphs are constructed in polynomial time and are of polynomial in size. • The plan graph does not eliminate all infeasible plans. • Plan generation still requires focused search.

  6. 1 Prop 1 Action 2 Prop 2 Action 3 Prop Example: Graph and Solution cleanH quiet noGarb cleanH quiet dinner present noGarb cleanH quiet dinner present carry dolly cook wrap carry dolly cook wrap

  7. Outline • Introduction • The Graph Plan Planning Problem • Graph Construction • Solution Extraction • Properties • Termination with failure

  8. GraphPlan Planning Problem • State • A consistent conjunction of propositions (positive literals) • E.g., (and (cleanhands)(quiet) (dinner) (present)(noGarbage)) • Doesn’t commit to the truth of all propositions • Initial State • Problem state at time i = 0 • E.g., (and (cleanHands) (quiet)) • Goal State • A partial state, represented by a conjunction of literals. • E.g., (and (noGarbage) (dinner) (present)) • The planner must put the system in a final state that satisfies the conjunction.

  9. noGarb cleanH carry GraphPlan Planning Problem Actions • E.g., (:operator carry :precondition :effect (:and (noGarbage) (not (cleanHands))) • Preconditions: propositions that must be true to apply operator. • A conjunction of propositions (no negated propositions). • Effects: Propositions that operator changes, given preconditions. • A conjunction of propositions (adds) and their negation (deletes). Add Edge Delete Edge • Parameterized schemas and objects are used to compactly encode actions.

  10. noGarb cleanH carry dinner cook cleanHands GraphPlan Planning Problem Action Execution at time i: If all propositions of :precondition appear in the state at i, Then state at i+1 is created from state at i, by adding to i, all “add” propositions in :effects, removing from i, all “delete” propositions in :effects. (:operator cook :precondition (cleanHands) :effect (dinner)) (:operator carry :precondition :effect (:and (noGarbage) (not (cleanHands)))

  11. P P Noop-P GraphPlan Planning Problem • Noops • Every proposition has a no-op action, which maintains it from time i to i+1. • E.g., (:operator noop-P :precondition (P) :effect (P))

  12. Example: Dinner Date Problem Initial Conditions: (and (cleanHands) (quiet)) Goal: (and (noGarbage) (dinner) (present)) Actions: (:operator carry :precondition :effect (and (noGarbage) (not (cleanHands))) (:operator dolly :precondition :effect (and (noGarbage) (not (quiet))) (:operator cook :precondition (cleanHands) :effect (dinner)) (:operator wrap :precondition (quiet) :effect (present)) + noops

  13. Prop at 1 Action at 1 Prop at 2 Action at 2 Prop at 2 A Plan in GraphPlan <Actions[i] > • Sets of concurrent actions performed at each time [i] • Uses model of concurrency as interleaving. • If actions a and b occur at time i, then it must be valid toperform either a followed by b, OR b followed by a. dinner present cook wrap cleanH quiet noGarb cleanH dinner present carry noop-dinner noop-present

  14. A Complete Consistent Plan Given that the initial state holds at time 0, a plan is a solution iff: • Complete: • The preconditions of every operator at time i, is satisfied by a proposition at time i. • The goal propositions all hold in the final state. • Consistent: • The operators at any time i can be executed in any order, without one of these operators undoing the: • preconditions of another operator at time i. • effects of another operator at time i.

  15. Prop at 1 Action at 1 Prop at 2 Action at 2 Prop at 3 Example of a Complete Consistent Plan dinner present Initial Conditions: (and (cleanHands) (quiet)) Goal: (and (noGarbage) (dinner) (present)) cook wrap cleanH quiet noGarb cleanH dinner present carry (noop dinner) (noop present)

  16. GraphPlan Algorithm • Phase 1 – Plan Graph Expansion • Creates graph encoding pairwise consistency and reachability of actions and propositions from initial state. • Graph includes, as a subset, all plans that are complete and consistent. • Phase 2 - Solution Extraction • Graph treated as a kind of constraint satisfaction problem (CSP). • Selects whether or not to perform each action at each time point, by assigning CSP variables and testing consistency.

  17. Outline • Introduction • The Planning Problem • Graph Construction • Solution Extraction • Properties • Termination with failure

  18. Graph Properties A Plan graph • compactly encodes the space of consistent plans, • while pruning . . . • partial states and actions at each time i that are not reachable from the initial state. • pairs of actions and propositions that are mutually inconsistent at time i. • plans that cannot reach the goals.

  19. Constructing the planning graph…(Reachability) • Initial proposition layer • Contains propositions in initial state.

  20. 1 Prop 1 Action 2 Prop 2 Action 3 Prop Example: Initial State, Layer 0 cleanH quiet

  21. Constructing the planning graph…(Reachability) • Initial proposition layer • Contains propositions in initial state • Action layer i • If all action’s preconditions are consistent in i-1 • Then add action to layer i • Proposition layer i+1 • For each action at layer i • Add all its effects at layer i+1

  22. 1 Prop 1 Action 2 Prop 2 Action 3 Prop Example: Add Actions and Effects cleanH quiet noGarb cleanH quiet dinner present carry dolly cook wrap

  23. Constructing the planning graph…(Reachability) • Initial proposition layer • Write down just the initial conditions • Action layer i • If all action’s preconditions appear consistent in i-1 • Then add action to layer i • Proposition layer i+1 • For each action at layer i • Add all its effects at layer i+1 • Repeat until all goal propositions appear

  24. 1 Prop 1 Action 2 Prop 2 Action 3 Prop Can a solution exist? cleanH quiet noGarb cleanH quiet dinner present Do all goal propositions appear? carry dolly cook wrap

  25. Constructing the planning graph…(Consistency) • Initial proposition layer • Write down just the initial conditions • Action layer i • If action’s preconditions appear consistent in i-1 (non-mutex) • Then add action to layer i • Proposition layer i+1 • For each action at layer i • Add all its effects at layer i+1 • Identify mutual exclusions • Actions in layer i • Propositions in layer i + 1 • Repeat until all goal propositions appear non-mutex

  26. Mutual Exclusion: Actions • Actions A,B are mutuallyexclusive at level iif no valid plan could possibly contain both at i: • They Interfere • A deletes B’s preconditions, or • A deletes B’s effects, or • Vice versa or • OR . . . .

  27. 1 Prop 1 Action 2 Prop 2 Action 3 Prop What causes the exclusion? cleanH quiet noGarb cleanH quiet dinner present carry dolly cook wrap

  28. 1 Prop 1 Action 2 Prop 2 Action 3 Prop What causes the exclusion? cleanH quiet noGarb cleanH quiet dinner present carry dolly cook wrap

  29. 1 Prop 1 Action 2 Prop 2 Action 3 Prop What causes the exclusion? cleanH quiet noGarb cleanH quiet dinner present carry dolly cook wrap

  30. 1 Prop 1 Action 2 Prop 2 Action 3 Prop What causes the exclusion? cleanH quiet noGarb cleanH quiet dinner present carry dolly cook wrap

  31. Mutual Exclusion: Actions • Actions A,B are mutuallyexclusive at level iif no valid plan could possibly contain both at i: • They Interfere • A deletes B’s preconditions, or • A deletes B’s effects, or • Vice versa or • They have competing needs: • A & B have inconsistent preconditions

  32. 1 Prop 1 Action 2 Prop 2 Action 3 Prop Layer 0: complete action mutexs cleanH quiet noGarb cleanH quiet dinner present carry dolly cook wrap

  33. P Q A1 A2 M N Mutual Exclusion: Proposition Layer Propositions P,Q are inconsistent at i • if no valid plan could possibly contain both at i • If at i, all ways to achieve P exclude all ways to achieve Q

  34. 1 Prop 1 Action 2 Prop 2 Action 3 Prop Layer 1: add proposition mutexs cleanH quiet noGarb cleanH quiet dinner present carry dolly cook wrap None!

  35. 1 Prop 1 Action 2 Prop 2 Action 3 Prop Can a solution exist? cleanH quiet noGarb cleanH quiet dinner present Do all goal propositions appear non-mutex? carry dolly cook wrap

  36. Outline • Introduction • The Planning Problem • Graph Construction • Solution Extraction • Properties • Termination with failure

  37. Graphplan • Create plan graph level 1 from initial state • Loop • If goal  propositions of the highest level (nonmutex) • Then search graph for solution • If solution found, then return and terminate • Else extend graph one more level A kind of double search: forward direction checks necessary (but insufficient) conditions for a solution, ... Backward search verifies...

  38. Searching for a Solution Recursively find consistent actions achieving all goals at t, t-1, . . . : • For each goal proposition G at time t • For each action A making G true at t • If A isn’t mutex with previously chosen action at t, • Then select it • Finally, • If no action of G works, • Then backtrack on previous G. • Finally • If action found for each goal at time t, • Then recurse on preconditions of actions selected, t-1, • Else backtrack.

  39. 1 Prop 1 Action 2 Prop 2 Action 3 Prop Searching for a solution Select action achieving Goal noGarb cleanH quiet noGarb cleanH quiet dinner present carry dolly cook wrap

  40. 1 Prop 1 Action 2 Prop 2 Action 3 Prop Searching for a solution Select action achieving Goal dinner, Consistent with carry cleanH quiet noGarb cleanH quiet dinner present carry dolly cook wrap Backtrack on noGarb

  41. 1 Prop 1 Action 2 Prop 2 Action 3 Prop Searching for a solution Backtrack on noGarb cleanH quiet noGarb cleanH quiet dinner present carry dolly cook wrap Select action dolly

  42. 1 Prop 1 Action 2 Prop 2 Action 3 Prop Searching for a solution Select action achieving Goal dinner, Consistent with dolly cleanH quiet noGarb cleanH quiet dinner present carry dolly cook wrap

  43. 1 Prop 1 Action 2 Prop 2 Action 3 Prop Searching for a solution Select action achieving Goal present, Consistent w dolly, cook cleanH quiet noGarb cleanH quiet dinner present carry dolly cook wrap

  44. 1 Prop 1 Action 2 Prop 2 Action 3 Prop Searching for a solution Recurse on preconditions of dolly, cook & wrap cleanH quiet noGarb cleanH quiet dinner present carry dolly cook wrap All satisfied by initial state

  45. Avoiding redundancy • No-ops are always favoured. • guarantees that the plan will not contain redundant actions.

  46. 1 Prop 1 Action 2 Prop 2 Action 3 Prop Suppose the Plan Graph was Extended cleanH quiet noGarb cleanH quiet dinner present noGarb cleanH quiet dinner present carry dolly cook wrap carry dolly cook wrap

  47. 1 Prop 1 Action 2 Prop 2 Action 3 Prop Can a valid plan use carry? cleanH quiet noGarb cleanH quiet dinner present noGarb cleanH quiet dinner present carry dolly cook wrap carry dolly cook wrap

  48. 1 Prop 1 Action 2 Prop 2 Action 3 Prop Using carry at level 2 is valid cleanH quiet noGarb cleanH quiet dinner present noGarb cleanH quiet dinner present carry dolly cook wrap carry dolly cook wrap

  49. 1 Prop 1 Action 2 Prop 2 Action 3 Prop Using carry at level 2 is valid cleanH quiet noGarb cleanH quiet dinner present noGarb cleanH quiet dinner present carry dolly cook wrap carry dolly cook wrap

  50. Outline • Introduction • The Planning Problem • Graph Construction • Solution Extraction • Properties • Termination with failure

More Related