Graphplan Joe Souto CSE 497: AI Planning Sources: Ch. 6 “Fast Planning through Planning Graph Analysis”, A. Blum & M. Furst.

Slides:



Advertisements
Similar presentations
Graphplan. Automated Planning: Introduction and Overview 2 The Dock-Worker Robots (DWR) Domain informal description: – harbour with several locations.
Advertisements

Constraint Based Reasoning over Mutex Relations in Graphplan Algorithm Pavel Surynek Charles University, Prague Czech Republic.
Planning Module THREE: Planning, Production Systems,Expert Systems, Uncertainty Dr M M Awais.
CLASSICAL PLANNING What is planning ?  Planning is an AI approach to control  It is deliberation about actions  Key ideas  We have a model of the.
1 Graphplan José Luis Ambite * [* based in part on slides by Jim Blythe and Dan Weld]
Plan Generation & Causal-Link Planning 1 José Luis Ambite.
Graph-based Planning Brian C. Williams Sept. 25 th & 30 th, J/6.834J.
Planning Graphs * Based on slides by Alan Fern, Berthe Choueiry and Sungwook Yoon.
For Monday Finish chapter 12 Homework: –Chapter 13, exercises 8 and 15.
Planning Russell and Norvig: Chapter 11 Slides adapted from: robotics.stanford.edu/~latombe/cs121/2003/ home.htm.
Planning CSE 473 Chapters 10.3 and 11. © D. Weld, D. Fox 2 Planning Given a logical description of the initial situation, a logical description of the.
1 Chapter 4 State-Space Planning. 2 Motivation Nearly all planning procedures are search procedures Different planning procedures have different search.
Ch. 10 – Planning Supplemental slides for CSE 327 Prof. Jeff Heflin.
1 Classical STRIPS Planning Alan Fern * * Based in part on slides by Daniel Weld.
1 Chapter 16 Planning Methods. 2 Chapter 16 Contents (1) l STRIPS l STRIPS Implementation l Partial Order Planning l The Principle of Least Commitment.
Planning Russell and Norvig: Chapter 11. Planning Agent environment agent ? sensors actuators A1A2A3.
Planning: Part 3 Planning Graphs COMP151 April 4, 2007.
Planning II CSE 473. © Daniel S. Weld 2 Logistics Tournament! PS3 – later today Non programming exercises Programming component: (mini project) SPAM detection.
1 Planning Chapters 11 and 12 Thanks: Professor Dan Weld, University of Washington.
Classical Planning via State-space search COMP3431 Malcolm Ryan.
Planning II CSE 573. © Daniel S. Weld 2 Logistics Reading for Wed Ch 18 thru 18.3 Office Hours No Office Hour Today.
PLANNING Partial order regression planning Temporal representation 1 Deductive planning in Logic Temporal representation 2.
An Introduction to Artificial Intelligence CE Chapter 11 – Planning Ramin Halavati In which we see how an agent can take.
Classical Planning Chapter 10.
GraphPlan Alan Fern * * Based in part on slides by Daniel Weld and José Luis Ambite.
For Wednesday Read chapter 12, sections 3-5 Program 2 progress due.
Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:
Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:
1 Plan-Space Planning Dr. Héctor Muñoz-Avila Sources: Ch. 5 Appendix A Slides from Dana Nau’s lecture.
1 07. The planning problem 2  Inputs: 1. A description of the world state 2. The goal state description 3. A set of actions  Output: A sequence of actions.
Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:
CS.462 Artificial Intelligence SOMCHAI THANGSATHITYANGKUL Lecture 07 : Planning.
For Monday Read chapter 12, sections 1-2 Homework: –Chapter 10, exercise 3.
CPS 270: Artificial Intelligence Planning Instructor: Vincent Conitzer.
For Friday No reading Homework: –Chapter 11, exercise 4.
CPS 570: Artificial Intelligence Planning Instructor: Vincent Conitzer.
1 Chapter 16 Planning Methods. 2 Chapter 16 Contents (1) l STRIPS l STRIPS Implementation l Partial Order Planning l The Principle of Least Commitment.
Automated Planning Dr. Héctor Muñoz-Avila. What is Planning? Classical Definition Domain Independent: symbolic descriptions of the problems and the domain.
Introduction to Planning Dr. Shazzad Hosain Department of EECS North South Universtiy
AI Lecture 17 Planning Noémie Elhadad (substituting for Prof. McKeown)
Classical Planning Chapter 10 Mausam / Andrey Kolobov (Based on slides of Dan Weld, Marie desJardins)
Graphplan.
Robust Planning using Constraint Satisfaction Techniques Daniel Buettner and Berthe Y. Choueiry Constraint Systems Laboratory Department of Computer Science.
Graphplan: Fast Planning through Planning Graph Analysis Avrim Blum Merrick Furst Carnegie Mellon University.
Automated Planning and Decision Making Prof. Ronen Brafman Automated Planning and Decision Making Graphplan Based on slides by: Ambite, Blyth and.
Graphplan CSE 574 April 4, 2003 Dan Weld. Schedule BASICS Intro Graphplan SATplan State-space Refinement SPEEDUP EBL & DDB Heuristic Gen TEMPORAL Partial-O.
Planning in FOL Systems sequences of actions to achieve goals.
1 Chapter 6 Planning-Graph Techniques. 2 Motivation A big source of inefficiency in search algorithms is the branching factor  the number of children.
Planning as Satisfiability
Classical Planning via State-space search
Instructor: Vincent Conitzer
Introduction Contents Sungwook Yoon, Postdoctoral Research Associate
Class #17 – Thursday, October 27
AI Planning.
Planning as Satisfiability with Blackbox
Planning José Luis Ambite.
Graph-based Planning Slides based on material from: Prof. Maria Fox
Graphplan/ SATPlan Chapter
Planning CSE 573 A handful of GENERAL SEARCH TECHNIQUES lie at the heart of practically all work in AI We will encounter the SAME PRINCIPLES again and.
Planning Problems On(C, A)‏ On(A, Table)‏ On(B, Table)‏ Clear(C)‏
Class #19 – Monday, November 3
Chapter 6 Planning-Graph Techniques
Supplemental slides for CSE 327 Prof. Jeff Heflin
Graphplan/ SATPlan Chapter
Russell and Norvig: Chapter 11 CS121 – Winter 2003
Graphplan/ SATPlan Chapter
GraphPlan Jim Blythe.
An Introduction to Planning Graph
Graph-based Planning Slides based on material from: Prof. Maria Fox
[* based in part on slides by Jim Blythe and Dan Weld]
Presentation transcript:

Graphplan Joe Souto CSE 497: AI Planning Sources: Ch. 6 “Fast Planning through Planning Graph Analysis”, A. Blum & M. Furst

Classical Planning Every node is a partial plan Initial plan complete plan for goals

Neoclassical Planning Every node in search space is a set of several partial plans So not every action in a node appears in the solution

Planning Graph State-space: plan is sequence of actions Plan-space: plan is partially ordered set of actions  Planning graph: sequence of sets of parallel actions ex: ( {a1, a2}, {a3, a4}, {a5, a6, a7} )

Veloso’s Rocket Problem St. Louis San Francisco Seattle R1 R2 R3 C1 C2 C3 Solution can be generalized in 3 steps

Veloso’s Rocket Problem St. Louis San Francisco Seattle R1 R2 R3 C1 C2 C3 Step 1: Load all rockets

Veloso’s Rocket Problem St. Louis San Francisco Seattle Step 2: Move all rockets

Veloso’s Rocket Problem St. Louis San Francisco Seattle Step 3: Launch all rockets

What does Graphplan do? Explores the problem with a “planning graph” before trying to find a solution plan Uses STRIPS operators, except no negated literals allowed in preconditions or goals Plan-space used ‘least commitment’, but Graphplan uses ‘strong commitments’ Requires reachability analysis: can a state be reached from a given state? Requires disjunctive refinement: method of addressing flaws since multiple conflicting propositions can exist in each state We’ll start with the reachability concept

Reachability metric necessary since you have to know if a solution state can be reached from s 0 Can be computed w/ reachability graphs, but computing them is intractable Can be approximated w/ planning graph, but this is tractable Reachability

Reachability Trees Consider a simple Blocks World Domain C B A Move(x, y, z) Precond: On(y, x), Clear(x), Clear(z), etc. Effects: On(z, x), ~On(y, x), Clear(y), etc. S0:S0:

B CA BCA B C A Move(B,C,table) Move(A,table,B) B CA Move(A,B,table) A BC B CA Move(A,table,B)Move(B,table,A) C AB Move(C,table,A) etc… Reachability Trees S0:S0: Move(B,C,A) etc…

Reachability Trees Note that a reachability tree down to depth d solves all planning problems with s 0 and A, for every goal that is reachable in d or fewer actions This blows up into O(k d ) nodes where k = # valid actions, thus we move on to finding reachability with planning graphs Could be improved by making a graph rather than tree, but still intractable since #nodes = #states

Planning Graphs What if all the states reachable from s 0 were modeled as a single state? B CA BCA Move(B,C,table) B C A Move(A,table,B) Move(B,C,A) B CA

Planning Graph Idea B CA BCA B C A B CA Move(B,C,table) Move(A,table,B) Move(B,C,A)

Planning Graphs Planning graph considers an inclusive disjunction of actions from one node to next that contains all the effects of these actions Goal is considered reachable from s 0 only if it appears in some node of the planning graph Graph is of polynomial size and can be built in polynomial time in size of input Since some actions in a disjunction may interfere, we must keep track of incompatible propositions for each set of propositions and incompatible actions for each disjunction of actions

Planning Graphs Planning graph = directed layered graph with alternating levels of propositions (P) and actions (A) P 0 = initial state A n = set of actions whose preconditions are in P n P n = set of propositions that can be true after n actions have been performed ie: P n-1  effects + (A 1 )

Planning Graphs Precondition arcs go from preconditions in P n to associated actions in A n Add edges indicate positive effects of actions Delete edges mark negative effects of actions Also define a no-op operator  p : precond(  p ) = effects + (  p ) = p and effects - (  p ) =  Note that negative effects are not removed, just marked. P n-1  P n : “persistence principle” Precondition arcs Add edges Delete edges  b2

Move(B,C,table) Move(A,table,B) Move(B,C,A) Clear(B) On(B, C) Clear(A) On(A, table) On(C,table) P0P0 BCA B C A B CA B CA Clear(C) On(B, table) On(B, C) On(A, B) On(A,table) Clear(B) On(B, A) Clear(A) On(C,table) A1A1 P1P1

Definitions 1) Two actions(a,b) are independent iff: effects - (a)  [precond(b)  effects + (b)] =  effects - (b)  [precond(a)  effects + (a)] =  B CA B C A BCA Move(A,table,B) Move(B,C,table) Precond: clear(A), clear(B) Effects + : on(B,A) Effects - : clear(B) Precond: clear(B) Effects + : on(table,B), clear(C) Effects - : none

Definitions 2) A set of independent actions, , is applicable to a state iff precond(  )  s 3) A layered plan is a sequence of sets of actions. A valid plan,  =, is solution to problem iff: Each set  i   is independent  n is applicable to s n g   (…  (  (s 0,  1 ),  2 ) …  n )

Note Since planning graph explores results of all possible actions to level n: If a valid plan exists within n steps, that plan is a subgraph of the planning graph Allows you to find plan w/ min number of actions

Mutual Exclusion Can’t have 2 simultaneous actions in one level that are dependent Two actions at a given level in planning graph are mutually exclusive (“mutex”) if no valid plan can contain both, or no plan could make both true, ie: they are dependent or they have incompatible preconditions μA i = mutually exclusive actions in level i μP i = mutually exclusive propositions in level i

Finding Mutex relationships Two rules: 1. Interference: if one action deletes a precondition of another or deletes a positive effect 2. Competing Needs: if actions a and b have preconditions that are marked as mutex in previous proposition level

Mutex Example B CA B C A BCA Move(A,table,B) Move(B,C,table) Precond: clear(A), clear(B) Effects + : on(B,A) Effects - : clear(B) Precond: clear(B) Effects + : on(table,B), clear(C) Effects - : none Mutex by Interference

Mutex Example Mutex by Competing Needs St. Louis R1 R2 A) Load(R1, C2, St Louis) B) Load(R2, C2, Seattle)  Mutex because C2 cannot be in St Louis and Seattle at same time C2 Seattle

Break

Graphplan Algorithm Input: Proposition level P 0 containing initial conditions Output: valid plan or states no valid plan exists Algorithm: while (!done) { Expansion Phase: Expand planning graph to next action and proposition level; Search/Extraction Phase: Search graph for a valid plan; if (valid plan exists) return successful plan; else continue; }  Graphplan is sound and complete

Expanding Planning Graphs Create next Action level by iterating through each possible action for each possible instantiation given the preconditions in the previous proposition level, then insert no-ops and precondition edges Create next Proposition level from the Add- Effects of the actions just generated Associated with each action is a list of actions it is mutex with

Expansion Algorithm

Move(B,C,table) Move(A,table,B) Move(B,C,A) Clear(B) On(B, C) Clear(A) On(A, table) On(C,table) P0P0 BCA B C A B CA B CA Clear(C) On(B, table) On(B, C) On(A, B) On(A,table) Clear(B) On(B, A) Clear(A) On(C,table)  A1A1 P1P1 Mutex list for Move(B,C,table): -Move(A,table,B) -Move(B,C,A)     Mutex list for Move(A,table,B): -Move(B,C,table) -Move(B,C,A) Mutex list for Move(B,C,A): -Move(B,C,table) -Move(A,table,B)

Finding Graphplan Solution Solution found via backward chaining Select one goal at time t, find an action at t – 1 achieving this goal Continue recursively with next goal at time t Preconditions of actions in A t become the new goals Repeat above steps until reaching P 0 Performance improved w/ “forward checking”: after each action is considered, Graphplan checks that no goal becomes cut off by this action

Planning Graph Solution

Extraction Algorithm Optimization: Actions that failed to satisfy certain goals at certain levels are saved in “nogood” hash table ( ▼ ), indexed by level, so when you backtrack you can prevented wasting time examining actions that were not helpful earlier

Graphplan Algorithm

Algorithm Example Initial state: B CA D E BC A D E Goal state: On(A, table) On(B, A) On(D, B) Clear(D) On(E, table) On(C, E) Clear(C)

Move(B,C,table) Clear(B) On(B, C) Clear(A) On(A, table) On(C,table) On(E, table) On(D,E) Clear(D) P0P0 B CA Clear(A) On(B, A) Clear(C) Clear(D) On(C,table) On(B, table) On(B, C) On(E,table) On(A, B) On(A,table) Clear(B) On(D,E) Clear(E) On(D,table) A1A1 P1P1 D E Move(B,C,A) Move(D,E,table) A2A2 P2P2 Move(D,table,B) Move(C,table,E) On(E,table) On(B, A) Clear(C) On(C,E) On(C,table) On(B, table) On(B, C) Clear(D) On(A, B) On(A,table) Clear(B) On(D,E) Clear(E) On(D,table) On(D,B)        Move(B,C,D) Move(D,E,A) … … Solution: ({Move(B,C,A),Move(D,E,table)}, {(Move(C,table,E),Move(D,table,B)})

Monotonicity Property Recall persistence principle: Since negative effects are never removed, and for  : precond(  p ) = effects + (  p ) = p  P n-1  P n, propositions monotonically increase  Similarly, A n-1  A n, actions monotonically increase

Unsolvable problems Due to monotonic property of planning graphs, P n-1  P n, and A n-1  A n At some point, all possible propositions will have been explored, thus P n =P n+k for all k>0 Graph has “leveled off” (also called “Fixedpoint” in book) If you reach a proposition level that’s identical to the previous level, and all goal conditions are not present and non-mutex, problem is unsolvable Thus Graphplan is complete

Graphplan Planning System Two files required to specify a domain Facts file – describe objects in the problem, initial state, and goal state Operations file – describe valid operations in that domain

Sample Facts File (blockA OBJECT) (blockB OBJECT) (blockC OBJECT) (blockD OBJECT) (preconds (on-table blockA) (on blockB blockA) (on blockC blockB) (on blockD blockC) (clear blockD) (arm-empty)) (effects (on blockB blockA) (on blockC blockB) (on blockA blockD)) Things (operands) in the domain Initial state Goal State (variable_name variable_type) (…) (preconds (literal_name {variable_name1 variable_name2 …}) (…) ) (effects (literal_name {variable_name1 variable_name2 …}) (…) ) General Syntax

Sample Operations File (operator PICK-UP (params ( OBJECT)) (preconds (clear ) (on-table ) (arm-empty)) (effects (holding ))) (operator STACK (params ( OBJECT) ( OBJECT)) (preconds (clear ) (holding )) (effects (arm-empty) (clear ) (on ))) (operator Operator_name (params ( )) (preconds (literal { …}) (…) ) (effects (literal { …}) (…) ) General Syntax

More Samples: Rocket Facts (London PLACE) (Paris PLACE) (JFK PLACE) (r1 ROCKET) (r2 ROCKET) (alex CARGO) (jason CARGO) (pencil CARGO) (paper CARGO) (preconds (at r1 London) (at r2 London) (at alex London) (at jason London) (at pencil London) (at paper London) (has-fuel r1) (has-fuel r2)) (effects (at alex Paris) (at jason JFK) (at pencil Paris) (at paper JFK))

More Samples: Rocket Ops (operator LOAD (params ( CARGO) ( ROCKET) ( PLACE)) (preconds (at ) (at )) (effects (in ) (del at ))) (operator UNLOAD (params ( CARGO) ( ROCKET) ( PLACE)) (preconds (at ) (in )) (effects (at ) (del in ))) (operator MOVE (params ( ROCKET) ( PLACE) ( PLACE)) (preconds (has-fuel ) (at )) (effects (at ) (del has-fuel ) (del at )))

Important Graphplan has no concept of negation. Use propositions with equivalent meaning Ex:  inhand(B)  not-inhand(B) Cannot use _ in any token. Use – instead. Comments: Begin line with ; See README file for more details

Running Graphplan Access in my home directory on Suns: /home/jhs4/graphplan Contains executable and sample facts/operations files Execute with:./graphplan.sparc Program prompts for names of operations and fact files at runtime Source for Solaris and Linux in./solaris-src and./linux-src respectively

Graphplan System Live Demo

Contact Trouble running Graphplan? me: jhs4(at)lehigh.edu