1 / 41

An Introduction to Planning Graph

An Introduction to Planning Graph. Chang, Han-Wen. A. Blum and M. Furst, " Fast Planning Through Planning Graph Analysis ", Artificial Intelligence , 90:281--300 (1997) AIMA textbook, Chap. 11, Section 11.4. March 29, 2007. Planning Problem.

leoma
Download Presentation

An Introduction to Planning Graph

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. An Introduction to Planning Graph Chang, Han-Wen A. Blum and M. Furst, "Fast Planning Through Planning Graph Analysis", Artificial Intelligence, 90:281--300 (1997) AIMA textbook, Chap. 11, Section 11.4 March 29, 2007

  2. Planning Problem • Planning is to come up with a sequence of actions that will achieve a goal from the initial state.

  3. Representation • states: conjunction of positive literals • ground and function-free first-order literals • closed-world assumption • actions: • action name and parameter list • precondition • add-effect • delete-effect • no new object created

  4. A A B B R Rocket Example Cargo (A); Cargo (B); Rocket (R); Place (L); Place (P); move (Rocket ?r, Place ?from, Place ?to) Precond: At (?r, ?from) & HasFuel (?r) Add: At (?r, ?to) Delete: At (?r, ?from) & HasFuel (?r) load (Rocket ?r, Place ?p, Cargo ?c) Precond: At (?r, ?p) & At (?c, ?p) Add: In (?c, ?r) Delete: At (?c, ?p) unload (Rocket ?r, Place ?p, Cargo ?c) Precond: At (?r, ?p) & In (?c, ?r) Add: At (?c, ?p) Delete: In (?c, ?r) Place L Init: At (A, L) & At (B, L) & At (R, L) & HasFuel (R) Goal: At (A, P) & At (B, P) Place P

  5. Motivation • Search performance depends on branching factor, and constraints reduce the search space. • Independent actions can be done in any order.

  6. Basic Idea • Construct a graph that encodes constraints on possible plans • Use this “planning graph” to constrain search for a valid plan: • If valid plan exists, it is a subgraph of the planning graph

  7. Planning Graph • Directed and Leveled • Nodes • Proposition nodes • Action nodes • Edges • Precondition edges: from propositions to actions • Add edges: from actions to propositions • Del edges: from actions to propositions • No-op edges: from propositions to propositions

  8. Graph Levels • Alternate Levels • Proposition level: all propositions that could be true at time step t • Action level: all actions that could have their preconditions satisfied at time step t

  9. Extending Planning Graph Load R, L, B Load R, L, A At B, L At B, L At A, L At A, L In B, R In A, R At R, L At R, L Fuel R Fuel R At R, P Move R, L, P

  10. Unload R, L, B Unload R, L, B Unload R, L, A Unload R, L, A Load R, L, B Load R, L, B Load R, L, B Load R, L, A Load R, L, A Load R, L, A At B, L At B, L At B, L At B, L At A, L At A, L At A, L At A, L In B, R In B, R In B, R In A, R In A, R In A, R At R, L At R, L At R, L At R, L Fuel R Fuel R Fuel R Fuel R At R, P At R, P At R, P Unload R, P, B At B, P Unload R, P, A At A, P Move R, L, P Move R, L, P Move R, L, P Propositions Time 3 Propositions Time 2 Actions Time 2 Propositions Time 0 Actions Time 0 Propositions Time 1 Actions Time 1 Precondition edges Rocket Example Add-effect edges Delete-effect edges No-op edges

  11. Mutual Exclusions (mutex) • Inconsistent Effects • Interference • Competing Needs • Inconsistent Support

  12. Inconsistent Effects (mutex) • The action deletes an add-effect of the other. • Load(R, L, A) deletes At(L, A) which is an add-effect of Unload(R, L, A), so the two actions are mutex.

  13. Interference (mutex) • The action deletes a precondition of the other. • Move(R, L, P) deletes At(R, L) which is an precondition of Load(R, L, A), so the two actions are mutex.

  14. Competing Needs (mutex) • If there is a precondition p of action a and a precondition q of action b that are mutex in the previous proposition level, the two actions are mutex. • The precondition At(A, L) of action Load(R, A, L) and the precondition At(A, P) of action Load(R, A, P) are mutex, so the two actions are mutex.

  15. Inconsistent Support (mutex) • If each action a having an add-effect of proposition p is marked as exclusive of each action b having an add-effect of proposition q, the two propositions are mutex. • The proposition At(A, L) and the proposition In(A, R) are mutex at time step t if the are mutex at time step t-1, and any action creates At(A, L) are mutex with any action creates In(A, R).

  16. Spare Tire Example (AIMA)

  17. GraphPlan Algorithm function GRAPHPLAN(problem) returnsolution or failure graph INITIAL-PLANNING-GRAPH(problem) goals GOALS[problem] loop do ifgoals all non-mutex in last level of graph then do solution EXTRACT-SOLUTION(graph, goals, LENGTH(graph)) ifsolution failure then returnsolution else if NO-SOLUTION-POSSIBLE(graph) then return failure graph EXPAND-GRAPH(graph, problem)

  18. Plan Extraction • Valid plan • goals are satisfied • Non-mutex actions • Backward chaining • Achieve goals level by level • Non-mutex actions at level k • Preconditions as the goals for level k-1 • No Non-mutex action found  backtrack

  19. Features • Literals increase monotonically • Actions increase monotonically • Mutexes decrease monotonically • Eventually level off • two consecutive levels are identical

  20. Termination • planning graph eventually leveled-off • If the graph is leveled-off and some literals of the goal do not appear or are marked as mutex in the latest proposition level, the problem is unsolvable.

  21. Advanced Test • Let Sti be the collection of unachievable (sub)goal-sets stored for level i after trial at stage t • If graph leveled off at level n and St-1n = Stn at a stage t > n, then output “No Plan Exists”

  22. Remarks on Planning Graph • Polynomial space / graph creation time • p: |initial state| • n: #object • m: #operator • t: #level • l: max( #add-list ) • k: max( #operator parameter ) • #Max nodes action level: O(mnk) • #Max nodes proposition level: O(p+mlnk)

  23. More Remarks • Sound & complete • Partially-ordered planning • Independent actions in the same level can be executed in any order

  24. Pro and Con • Cases with better performance • pairwise mutex relations capture important constraints • parallel actions reduce the depth of the graph

  25. Thanks

  26. Eat Cake Example (AIMA) similar to drink water example

  27. Spare Tire Example (AIMA)

  28. A A B B R Rocket Example Cargo (A); Cargo (B); Rocket (R); Place (L); Place (P); move (Rocket ?r, Place ?from, Place ?to) Precond: At (?r, ?from) & HasFuel (?r) Add: At (?r, ?to) Delete: At (?r, ?from) & HasFuel (?r) load (Rocket ?r, Place ?p, Cargo ?c) Precond: At (?r, ?p) & At (?c, ?p) Add: In (?c, ?r) Delete: At (?c, ?p) unload (Rocket ?r, Place ?p, Cargo ?c) Precond: At (?r, ?p) & In (?c, ?r) Add: At (?c, ?p) Delete: In (?c, ?r) Place L Init: At (A, L) & At (B, L) & At (R, L) & HasFuel (R) Goal: At (A, P) & At (B, P) Place P

  29. Unload R, L, B Unload R, L, B Unload R, L, A Unload R, L, A Load R, L, B Load R, L, B Load R, L, B Load R, L, A Load R, L, A Load R, L, A At B, L At B, L At B, L At B, L At A, L At A, L At A, L At A, L In B, R In B, R In B, R In A, R In A, R In A, R At R, L At R, L At R, L At R, L Fuel R Fuel R Fuel R Fuel R At R, P At R, P At R, P Unload R, P, B At B, P Unload R, P, A At A, P Move R, L, P Move R, L, P Move R, L, P Propositions Time 3 Propositions Time 2 Actions Time 2 Propositions Time 0 Actions Time 0 Propositions Time 1 Actions Time 1 Precondition edges Rocket Example Add-effect edges Delete-effect edges No-op edges

  30. Extending Planning Graph Load R, L, B Load R, L, A At B, L At B, L At A, L At A, L In B, R In A, R At R, L At R, L Fuel R Fuel R At R, P Move R, L, P

  31. Inconsistent Effects (mutex) • The action deletes an add-effect of the other. • Load(R, L, A) deletes At(L, A) which is an add-effect of Unload(R, L, A), so the two actions are mutex.

  32. Interference (mutex) • The action deletes a precondition of the other. • Move(R, L, P) deletes At(R, L) which is an precondition of Load(R, L, A), so the two actions are mutex.

  33. Competing Needs (mutex) • If there is a precondition p of action a and a precondition q of action b that are mutex in the previous proposition level, the two actions are mutex. • The precondition At(A, L) of action Load(R, A, L) and the precondition At(A, P) of action Load(R, A, P) are mutex, so the two actions are mutex.

  34. Inconsistent Support (mutex) • If each action a having an add-effect of proposition p is marked as exclusive of each action b having an add-effect of proposition q, the two propositions are mutex. • The proposition At(A, L) and the proposition In(A, R) are mutex at time step t if the are mutex at time step t-1, and any action creates At(A, L) are mutex with any action creates In(A, R).

  35. literals: EmptyCup FullCup Thirsty NotThirsty Initial Condition: FullCup & Thirsty Goal: NotThirsty & FullCup Drink Water Example

  36. FillCup Preconds: EmptyCup Add-effs: FullCup Del-effs: EmptyCup EmptyCupAction Preconds: FullCup Add-effs: EmptyCup Del-effs: FullCup Drink Preconds: FullCup & Thirsty Add-effs: EmptyCup & NotThirsty Del-effs: FullCup & Thirsty Drink Water Example -- Actions

  37. Drink Water Planning Graph EmptyCupAction EmptyCupAction FillCup EmptyCup EmptyCup FullCup FullCup FullCup Thirsty Thirsty Thirsty NotThirsty NotThirsty Drink Drink action time 2 proposition time 2 proposition time 3 action time 1 proposition time 1

  38. Inconsistent Effects (mutex) • The action deletes an add-effect of the other. • Drink deletes Full_Cup which is an add-effect of Fill_Cup, so the two actions are mutex.

  39. Interference (mutex) • The action deletes a precondition of the other. • EmptyCupAction deletes FullCup which is an precondition of Drink, so the two actions are mutex.

  40. Competing Needs (mutex) • If there is a precondition p of action a and a precondition q of action b that are mutex in the previous proposition level, the two actions are mutex. • The precondition EmptyCup of action FillCup and the precondition FullCup of action Drink are mutex, so the two actions are mutex.

  41. Inconsistent Support (mutex) • If each action a having an add-effect of proposition p is marked as exclusive of each action b having an add-effect of proposition q, the two propositions are mutex. • The proposition EmptyCup and the proposition FullCup are mutex at time step t if the are mutex at time step t-1, and any action creates EmptyCup are mutex with any action creates FullCup.

More Related