Graphplan.

Slides:



Advertisements
Similar presentations
Constraint Satisfaction Problems Russell and Norvig: Chapter
Advertisements

Constraint Based Reasoning over Mutex Relations in Graphplan Algorithm Pavel Surynek Charles University, Prague Czech Republic.
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 Constraint Satisfaction Problems A Quick Overview (based on AIMA book slides)
Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:
Artificial Intelligence Constraint satisfaction problems Fall 2008 professor: Luigi Ceccaroni.
1 Graphplan José Luis Ambite * [* based in part on slides by Jim Blythe and Dan Weld]
Planning with Constraints Graphplan & SATplan Yongmei Shi.
Action Cook Prec: CleanHands Effects: Dinner Action Wrap Prec: Quiet Effects: Present Action Carry Prec: Effects: ~Garbage AND ~CleanHands Action Dolly.
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.
Best-First Search: Agendas
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 16 Planning Methods. 2 Chapter 16 Contents (1) l STRIPS l STRIPS Implementation l Partial Order Planning l The Principle of Least Commitment.
Fast Planning through Planning Graph Analysis By Jan Weber Jörg Mennicke.
AI – Week AI Planning – Plan Generation Algorithms: GraphPlan Lee McCluskey, room 2/09
CPSC 322, Lecture 18Slide 1 Planning: Heuristics and CSP Planning Computer Science cpsc322, Lecture 18 (Textbook Chpt 8) February, 12, 2010.
Planning: Part 3 Planning Graphs COMP151 April 4, 2007.
CPSC 322, Lecture 12Slide 1 CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12 (Textbook Chpt ) January, 29, 2010.
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.
Planning II CSE 573. © Daniel S. Weld 2 Logistics Reading for Wed Ch 18 thru 18.3 Office Hours No Office Hour Today.
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:
Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:
1 Chapter 7 Propositional Satisfiability Techniques.
Midterm Review Prateek Tandon, John Dickerson. Basic Uninformed Search (Summary) b = branching factor d = depth of shallowest goal state m = depth of.
For Monday Read chapter 12, sections 1-2 Homework: –Chapter 10, exercise 3.
Constraint Satisfaction CPSC 386 Artificial Intelligence Ellen Walker Hiram College.
CPS 270: Artificial Intelligence Planning Instructor: Vincent Conitzer.
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.
Introduction to Planning Dr. Shazzad Hosain Department of EECS North South Universtiy
Chapter 5 Constraint Satisfaction Problems
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)
Robust Planning using Constraint Satisfaction Techniques Daniel Buettner and Berthe Y. Choueiry Constraint Systems Laboratory Department of Computer Science.
© Daniel S. Weld 1 Logistics Travel Wed class led by Mausam Week’s reading R&N ch17 Project meetings.
Graphplan: Fast Planning through Planning Graph Analysis Avrim Blum Merrick Furst Carnegie Mellon University.
Planning I: Total Order Planners Sections
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.
1 CSC 384 Lecture Slides (c) , C. Boutilier and P. Poupart CSC384: Lecture 16  Last time Searching a Graphplan for a plan, and relaxed plan heuristics.
Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:
1 Chapter 6 Planning-Graph Techniques. 2 Motivation A big source of inefficiency in search algorithms is the branching factor  the number of children.
CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12
An Introduction to Artificial Intelligence CE 40417
Fast Propositional Algorithms for Planning
CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12
Planning: Heuristics and CSP Planning
Planning: Heuristics and CSP Planning
CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12
Problem Reduction -AND-OR Graph -AO* Search CSE 402 K3R23/K3R20.
Class #17 – Thursday, October 27
Graph-based Planning Slides based on material from: Prof. Maria Fox
Graphplan/ SATPlan Chapter
Planning CSE 473 AIMA, 10.3 and 11.
Class #19 – Monday, November 3
Chapter 6 Planning-Graph Techniques
Graphplan/ SATPlan Chapter
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

GRAPHPLAN Many Planning Systems now use these Ideas: GraphPlan IPP STAN SGP Blackbox Medic Runs orders of magnitude faster than partial order planners (as POP, SNLP, UFPOP, etc.)

GraphPlan: THE BASIC IDEA 1. Construct the (initial) Planning Graph 2. Extract Solution (if possible) with fast Graph-Search-Algorithms 3. Else expand Graph and goto 2.

The Planning Graph Alternating layers of ground literals and actions (ground instances of operators) representing the literals and actions that might occur at each time step 0 < i < N literals that might be true at time t = (i-1)/2 literals that are true at the initial state i-1 i i+1 literals that might be true at time t = (i+1)/2 ... ... ... ... ... ... ... All possible actions that could be included in the plan at time t= (i+1)/2. The final plan may include several of them, as long as they aren’t mutex (mutual exclusive) “Maintenance” action to propagate a literal to the next level. This represents what happens if no action in the final plan affects the literal Until two consecutive levels are identical (graph levels off) preconditions ... effects ... ... operators Maintenance: NoOps

Mutual Exclusion Inconsistent Effects Competing Needs Inconsistent Support Interference Two actions are mutex if Inconsistent effects: an effect of one negates an effect of the other Interference: one effect deletes a precondition of the other Competing needs: they have mutually exclusive preconditions Two literals are mutex if Inconsistent support: one is the negation of the other, or all ways of achieving them are pairwise mutex

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

The Sweetheart Example : Suppose you want to prepare dinner, clean the garbage and give a present as a surprise to your sweetheart, who is asleep. Initial Conditions: (and (garbage) (cleanHands) (quiet)) Goal: (and (dinner) (present) (not (garbage)) Actions: cook :precondition (cleanHands) :effect (dinner) wrap :precondition (quiet) :effect (present) carry :precondition :effect (and (not (garbage)) (not (cleanHands))) dolly :precondition :effect (and (not (garbage)) (not (quiet))) Also there are NoOps = “maintenance actions”

The Graph for this Example (1) Generate the first two levels of the planning graph carry is mutex with NoOp (garbage) (inconsistent effects) 1 2 garb garb carry garb dolly is mutex with wrap (interference) dolly cleanH cleanH quiet is mutex with present (inconsistent support) cleanH cook quiet quiet wrap cook :precondition (cleanHands) quiet carry :precondition :effect (dinner) :effect (and (not (garbage)) (not (cleanHands))) dinner present

Extraction of a Solution for the Example (1): Check to see whether there’s a possible plan: Recall that the goal is: (and (dinner) (present) (not (garbage))) 1 2 garb garb carry garb dolly Note that All literals are present at level 2 None are mutex with each other cleanH cleanH cleanH cook quiet quiet wrap quiet Thus there is a chance that a plan exists dinner present Solution Extraction

Solution Extraction: The Algorithm procedure SOLUTION-EXTRACTION(goal_set, graphlevel) if graphlevel = 0 we have found a solution Level of the graph we are at for each goal in goal_set choose (nondeterministically) an action at level graphlevel–1 that achieves it if any pair of chosen actions are mutex, then backtrack precondition_set:= {the precondition of the chosen actions} SOLUTION-EXTRACTION(precondition_set, graphlevel-2)

Solution Extraction for the Example (2): Two sets of actions for the goals at level 2 Neither works: both sets contain actions that are mutex 1 2 1 2 garb garb garb garb carry carry garb garb dolly dolly cleanH cleanH cleanH cleanH cleanH cleanH cook cook quiet quiet quiet quiet wrap wrap quiet quiet dinner dinner present present

Solution Extraction Example (3) Go back and do more graph extension: generate two more levels 1 2 3 4 garb garb garb carry carry garb garb dolly dolly cleanH cleanH cleanH cleanH cleanH cook cook quiet quiet quiet wrap wrap quiet quiet dinner dinner present present

Example: Solution extraction (4) 1 2 3 4 garb garb garb carry carry garb garb dolly dolly cleanH cleanH cleanH cleanH cleanH cook cook quiet quiet quiet wrap wrap quiet quiet dinner dinner Twelve combinations at level 4 present present Tree ways to archive “garb” Two ways to archive “dinner” Two ways to archive “present”

Example: Solution extraction (5) Several of the combinations look OK at level 2. Here is one of them: 1 2 3 4 garb garb garb carry carry garb garb dolly dolly cleanH cleanH cleanH cleanH cleanH cook cook quiet quiet quiet wrap wrap quiet quiet dinner dinner present present

Example: Solution extraction (6) Call Solution-Extraction recursively at level 2; one combination works, so we have got a plan 1 2 3 4 garb garb garb carry carry garb garb dolly dolly cleanH cleanH cleanH cleanH cleanH cook cook quiet quiet quiet wrap wrap quiet quiet dinner dinner present present

Compare with POP Graphplan will examine fewer actions than POP, because it will only look at actions in the planning graph However (like POP), Graphplan may examine the same actions more than once if it finds multiple plans to achieve them Look at ways to make Graphplan more efficient

Ways to improve GraphPlan Techniques from Constraint satisfaction Problems (CSP) Forward checking Memorization Variable ordering Handling the closed-world assumption Action schemata, type analysis, and simplification Not reachable states (because of domain theory) e.g. impossible: at(car1 Washington, t)  at(car1 Philadelphia, t)

Constraint Satisfaction Problems Set of variables: Each variable has a domain of possible values Set of constraints Find values for the variables that satisfy all the constraints Crypto-arithmetic SEND +MORE MONEY M=1 S=9 S=8 ... O=0 O=1 Dynamic constraint satifaction problems When we select values for some variables, this changes what the remaining variables and constraints are x1=0 x1=1 one set of variables and constraints another set of variables and constraints

Solution extraction as Dynamic Constraint Satisfaction (1) A different CSP variable for each subgoal at each level V4,garb  {carry, dolly, maintain} V4,dinner  {cook, maintain} V4,present  {wrap, maintain} Constraints: the mutex constraints (just like before)

Solution extraction as Dynamic Constraint Satisfaction (2) Once a solution is found at level 4 this defines another CSP at level 2 So far, no real difference to what we had before, but Use of some standard CSP techniques: Forward checking Dynamic Variable Ordering Memorization

CSP-Techniques: Forward Checking Whenever we assign a value to a variable: Also check unassigned variables to see if this shrinks their domains If a domain shrinks to the empty set, then backtrack Example GraphPlan: Suppose we assign V4,garb := dolly Then no longer feasible to have V4,quiet := maintain SEND +MORE MONEY M=1 S=9 S=8 ... O=0 O=1

CSP-Techniques: Dynamic Variable Ordering Heuristics for choosing the order in which to assign variable values Examples If a variable has only one possible value, then assign it immediately Otherwise, assign the variable with the fewest remaining possible values (use forward checking to figure out which variable) Speeds up GraphPlan by about 50% [Kambhampati] SEND +MORE MONEY M=1 S=9 S=8 ... O=0 O=1 Choose Variabel ordering based on analysis of subgoal interactions Speeds up GraphPlan by orders of magnitude on some problems [Koehler]

CSP-Techniques: Memorization If a set of subgoals is inconsistent at level i, record this info for future use For recursive calls to level i with the same subgoals backtrack immediately Can take lots of space, but can also speed things up significantly a “nogood” at level 2

Closed-World assumption Closed-world assumption: Any proposition not explicitly known to be true can be assumed to be false For GraphPlan: If something isn’t explicitly mentioned in the initial state, then assume it’s false

Example Closed-world Assumption Suppose we had another operator: buy-dinner precondtion: have-money effects: dinner, have-money 1 2 garb garb carry garb dolly cleanH cleanH Since “have-money” isn’t mentioned in the initial state, assume it is false cleanH cook quiet quiet wrap Thus, can’t apply this operator quiet dinner present

Action Schemata (i.e., Planning Operators) (1) So far, all our GraphPlan operators have been ground – What about operators that contain variables? (defschema (drive) :parameters (?v ?s ?d) :precondition (and (vehicle ?v) (location ?s) (location ?d) (road-connect ?s ?d) (at ?v ?s)) :effect (and ((at ?v ?s)) (at ?v ?d))) drive(?v ?s ?d) precondition: vehicle (?v) location (?s) location (?d) road-connect (?s ?d) at (?v ?s) effect: at (?v ?s), at (?v ?d)

Action Schemata (i.e., Planning Operators) (2) Put all applicable ground instances into the planning graph Suppose the initial state contains n constants Suppose an operator contains k variables O(nk) instances of the operator at each level of the planning graph: drive (?v, ?s, ?d) n * n * n

Type Analysis: Sorted logics Many operator instances will be irrelevant because they use variable values that can never be satisfied Type analysis Determine which predicates represent types Calculate the set of possible constants for each type Instantiate ground actions only for plausibly typed combinations of constants location(Philadelphia), location(Washington), location(Richmond), at(Philadelphia), vehicle(car1), vehicle(car2), road-connect(Philadelphia, Washington) road-connect(Washington, Richmond) drive(Washington, Philadelphia, Richmond) Simplest form: If an initial condition is absent from the effects of any operators, then it will never change, so conclude that it is a type. E.g., “location” and “vehicle” Not a vehicle

Simplification Don’t need to include static terms in the planning graph Remove them from the preconditions of actions Only create instantiations that satisfy the static preconditions location(Philadelphia), location(Washington), location(Richmond), at(Philadelphia), vehicle(car1), vehicle(car2), road-connect(Philadelphia, Washington) road-connect(Washington, Richmond) at(Phiadelphia) drive(car1, Philadelphia, Washington) precondition: at(car1, Philadelphia) effect: at(car1, Philadelphia), at(car1, Washington) drive(car2, Philadelphia, Washington) precondition: at(car2, Philadelphia) effect: at(car2, Philadelphia), at(car2, Washington) Can do even more complicated things [Fox & Long] drive(car1, Philadelphia, Richmond) precondition: at(car1, Philadelphia) effect: at(car1, Philadelphia), at(car1, Richmond)

Backward Planning:Regression Focussing GraphPlan-Algorithm: (short form) loop -grow the planning graph -forward two levels -do solution extraction repeat Instead, backward loop -grow the planning graph backward two levels -augment it by going forward -from the intersection of its leftmost fringe with the initial state do solution extraction in the normal way repeat