Presentation is loading. Please wait.

Presentation is loading. Please wait.

AI – Week 18 + 19 AI Planning – Plan Generation Algorithms: GraphPlan Lee McCluskey, room 2/09

Similar presentations


Presentation on theme: "AI – Week 18 + 19 AI Planning – Plan Generation Algorithms: GraphPlan Lee McCluskey, room 2/09"— Presentation transcript:

1 AI – Week 18 + 19 AI Planning – Plan Generation Algorithms: GraphPlan Lee McCluskey, room 2/09 Email lee@hud.ac.uklee@hud.ac.uk http://scom.hud.ac.uk/scomtlm/cha2555/ This lecture I have broken the habit of a lifetime and inserted some slides from someone else!! They are from Dana S. Nau’s collection from his and Ghallab and Traverso’s book on AI Planning (see ‘resources’ in the website to find them)

2 Artform Research Group Relaxing ….. One way to reduce branching factor in a problem is by relaxing!! : n First create a relaxed problem -- r emove some restrictions of the original problem n The solutions to the relaxed problem will include all solutions to the original problem n Then do a modified version of the original search. Restrict its search space to include only those actions that occur in solutions to the relaxed problem

3 Artform Research Group The Graphplan algorithm 1. Designed in the mid-1990’s 2. Generally faster than any other known algorithm at that time 3. Produces optimal (parallel) plans 4. Introduced the MOST INFLUENTIAL TECHNIQUE IN PLANNING – The Planning Graph

4 Artform Research Group Parallel Operators n Two operators can be applied „in parallel“ if their outcome does not depend on the order of execution n Drive T1 A B, Drive T2 C D n Operators a and a' interfere if: u del(a) ^ (add(a') U pre(a')) is not empty, or u del(a') ^ (add(a) U pre(a)) is not empty n Allowing sets of non-interfering operators at each step in the plan can make plans shorter => potentially fewer search iterations

5 Artform Research Group The Graphplan algorithm : Outline 1. Incrementally construct a planning graph Assume all applicable ground operators are applied in parallel to the initial state predicates; Produce new state and repeat. Stop when goal predicates are all present in state. 2. Construct mutual exclusion constraints Constrain ground operators that cannot be executed together 3. Do solution extraction Search backwards considering only actions in the planning graph

6 Artform Research Group state-level i effects Maintenance actions: propagate literals to the next level. These represent what happens if no action in the final plan affects the literal. state-level i-1 state-level 0 (the literals true in s 0 ) The Planning Graph Alternating layers of ground literals and actions All actions that might possibly occur at each time step All of the literals asserted by those actions action-level i preconditions

7 Artform Research Group Example F due to Dan Weld (University of Washington) n Suppose you want to prepare dinner as a surprise for your sweetheart (who is asleep) Initial State s 0 = {garbage, cleanHands, quiet} Goal g = {dinner, present,  garbage} ActionPreconditions Effects cook() cleanHandsdinner wrap() quietpresent carry() none  garbage,  cleanHands dolly() none  garbage,  quiet Also have the maintenance actions: one for each literal

8 Artform Research Group Example (continued) state-level 0: {all atoms in s 0 } U {negations of all atoms not in s 0 } action-level 1: {all actions whose prconditions are satisfied in s 0 } state-level 1: {all effects of all of the actions in action-level 1} ActionPreconditionsEffects cook() cleanHandsdinner wrap() quietpresent carry() none  garbage,  cleanHands dolly() none  garbage,  quiet Also have the maintenance actions  dinner  present  dinner  present state-level 0state-level 1action-level 1

9 Artform Research Group Mutual Exclusion n Two actions at the same action-level are mutex if u Inconsistent effects: an effect of one negates an effect of the other u Interference: one deletes a precondition of the other u Competing needs: they have mutually exclusive preconditions n Otherwise they don’t interfere with each other u Both may appear in a solution plan n Two literals at the same state-level are mutex if u Inconsistent support: one is the negation of the other, or all ways of achieving them are pairwise mutex

10 Artform Research Group Example (continued) n Augment the graph to indicate mutexes n carry is mutex with the maintenance action for garbage (inconsistent effects) n dolly is mutex with wrap u interference n ~quiet is mutex with present u inconsistent support n each of cook and wrap is mutex with a maintenance operation ActionPreconditionsEffects cook() cleanHandsdinner wrap() quietpresent carry() none  garbage,  cleanHands dolly() none  garbage,  quiet Also have the maintenance actions  dinner  present  dinner  present state-level 0state-level 1action-level 1

11 Artform Research Group  dinner  present  dinner  present Example (continued) Check to see whether there’s a possible plan Recall that the goal is {  garbage, dinner, present} Note that All are prossible in s 1 None are mutex with each other Thus, there’s a chance that a plan exists Try to find it Solution extraction state-level 0state-level 1action-level 1

12 Artform Research Group Solution Extraction procedure Solution-extraction(g,j) if j=0 then return the solution for each literal l in g nondeterministically choose an action to use in state s j–1 to achieve l if any pair of chosen actions are mutex then backtrack g’ := {the preconditions of the chosen actions} Solution-extraction(g’, j–1) end Solution-extraction The level of the state s j The set of goals we are trying to achieve state- level i-1 action- level i state- level i A real action or a maintenance action

13 Artform Research Group Example (continued) n Two sets of actions for the goals at state- level 1 n Neither works: both sets contain actions that are mutex  dinner  present  dinner  present state-level 0state-level 1action-level 1

14 Artform Research Group Example (continued)  dinner  present  dinner  present  dinner  present state-level 0state-level 1action-level 1state-level 2action-level 2

15 Artform Research Group Example (continued) n Solution extraction n Twelve combinations at level 4 u Three ways to achieve  garb u Two ways to achieve dinner u Two ways to achieve present  dinner  present  dinner  present  dinner  present state-level 0state-level 1action-level 1state-level 2action-level 2

16 Artform Research Group Example (continued) n Several of the combination s look OK at level 2 n Here’s one of them  dinner  present  dinner  present  dinner  present state-level 0state-level 1action-level 1state-level 2action-level 2

17 Artform Research Group Example (continued) n Call Solution- Extraction recursively at level 2 n It succeeds n Solution whose parallel length is 2  dinner  present  dinner  present  dinner  present state-level 0state-level 1action-level 1state-level 2action-level 2

18 Artform Research Group RECAP: The Graphplan algorithm 1. Incrementally construct a planning graph Assume all applicable ground operators are applied in parallel to the initial state predicates; Produce new state and repeat. Stop when goal predicates are all present in state. 2. Construct mutual exclusion constraints Constrain ground operators that cannot be executed together 3. Do solution extraction Search backwards considering only actions in the planning graph

19 Artform Research Group Graphplan’s limiting assumptions / drawbacks: n Need to create ground instances of everything – all actions and all literals - many of the groundings may be irrelevant. The groundings may lead to an enormous/infinite database! n the goal is a set of literals n If the goal literals are found in the graph very early on, then solution extraction at each subsequent level may be very inefficient..

20 Artform Research Group Conclusions n Before Graphplan came out, most planning researchers were working on plan or state space planners n Graphplan caused a sensation because it was so much faster n Many subsequent planning systems have used ideas from it u IPP, STAN, GraphHTN, Blackbox, TGP, LPG n Several of them are much faster than the original Graphplan n (see PLANET website for how to download them)

21 Artform Research Group Rocket Exercise: First Layer.. at-rocket(London) at(c1,London) at(c2,London) ¬at-rocket(Paris), ¬at(c1,Paris) ¬at(c2,Paris) ¬in-rocket(c1) ¬in-rocket(c2) ¬ at-rocket(London), at-rocket(Paris) ¬ at(c1,London), in-rocket(c1) ¬ at(c1,London), in-rocket(c2) at-rocket(London) at(c1,London) at(c2,London) ¬at-rocket(Paris), ¬at(c1,Paris) ¬at(c2,Paris) ¬in-rocket(c1) ¬in-rocket(c2) move(London,Paris) load(c1,London) load(c2,London)

22 Artform Research Group ¬ at-rocket(London), at-rocket(Paris) ¬ at(c1,London), in-rocket(c1) ¬ at(c1,London), in-rocket(c2) at-rocket(London) at(c1,London) at(c2,London) ¬at-rocket(Paris), ¬at(c1,Paris) ¬at(c2,Paris) ¬in-rocket(c1) ¬in-rocket(c2) Unload(c1,Paris) Unload(c2,Paris) move(London,Paris) load(c1,London) load(c2,London) at(c1,Paris) at(c2,Paris) ¬ at-rocket(London), at-rocket(Paris) ¬ at(c1,London), in-rocket(c1) ¬ at(c1,London), in-rocket(c1) at-rocket(London) at(c1,London) at(c2,London) ¬at-rocket(Paris), ¬at(c1,Paris) ¬at(c2,Paris) ¬in-rocket(c1) ¬in-rocket(c2) Second Layer… Goals Present – But no consistent Action sequence Need a Third Layer…


Download ppt "AI – Week 18 + 19 AI Planning – Plan Generation Algorithms: GraphPlan Lee McCluskey, room 2/09"

Similar presentations


Ads by Google