Planning Graphs and Graphplan Section 10.3 Nilufer Onder - - PowerPoint PPT Presentation

planning graphs and graphplan
SMART_READER_LITE
LIVE PREVIEW

Planning Graphs and Graphplan Section 10.3 Nilufer Onder - - PowerPoint PPT Presentation

Planning Graphs and Graphplan Section 10.3 Nilufer Onder Department of Computer Science Michigan Technological University Sec. 10.3 p.1/22 Outline The planning graph Planning graph example The graphplan algorithm Using planning


slide-1
SLIDE 1

Planning Graphs and Graphplan

Section 10.3 —– Nilufer Onder Department of Computer Science Michigan Technological University

  • Sec. 10.3 – p.1/22
slide-2
SLIDE 2

Outline

The planning graph Planning graph example The graphplan algorithm Using planning graphs for heuristics

  • Sec. 10.3 – p.2/22
slide-3
SLIDE 3

A planning graph

A layered graph Two kinds of layers alternate literal (proposition) (shown with circles) action (shown with squares) Every two layers corresponds to a discrete time No variables as in action schemas

  • Sec. 10.3 – p.3/22
slide-4
SLIDE 4

A planning graph

The first layer is a literal layer which shows all the literals that are true in the initial layer Every action has a link from each of its preconditions and a link to each of its effects. Straight lines between to literals at consecutive literal levels denote NoOp

  • Sec. 10.3 – p.4/22
slide-5
SLIDE 5

A planning graph

. . . . . .

  • Sec. 10.3 – p.5/22
slide-6
SLIDE 6

A planning graph

The red lines show mutex relationships Those are the literals and actions that are mutually exclusive, i.e., cannot appear at the same time

  • Sec. 10.3 – p.6/22
slide-7
SLIDE 7

A planning graph

. . . . . .

  • Sec. 10.3 – p.7/22
slide-8
SLIDE 8

Mutex relationships for actions

Inconsistent effects: one action negates the effect of the other

  • Sec. 10.3 – p.8/22
slide-9
SLIDE 9

Mutex relationships for actions

Interference: one of the effects of one action is the negation of a precondition of the other

  • Sec. 10.3 – p.9/22
slide-10
SLIDE 10

Mutex relationships for actions

Competing needs: one of the preconditions of one action is mutually exclusive with a precondition of another

  • Sec. 10.3 – p.10/22
slide-11
SLIDE 11

Mutex relationships for literals

One is the negation of the other Inconsistent support: all ways of achieving two literals is mutually exclusive

  • Sec. 10.3 – p.11/22
slide-12
SLIDE 12

Example

Initial conditions: garbage, cleanhands, quiet Goal: dinner, present, ˜garbage Operators: Cook: pre: cleanhands eff: dinner Wrap: pre: quiet eff: present Carry: pre: eff: ˜garbage, ˜cleanhands Dolly: pre: eff: ˜garbage, ˜quiet

  • Sec. 10.3 – p.12/22
slide-13
SLIDE 13

Example: graph expanded to level S1

garb ~garb cleanh ~cleanh quiet ~quiet dinner present carry dolly cook wrap garb cleanh quiet

S0 A0 S1

  • Sec. 10.3 – p.13/22
slide-14
SLIDE 14

Solution extraction (first attempt)

At level S1, all the goal conditions are present, can look for a solution There are two ways to satisfy dinner, present, ˜garbage: {carry; cook; wrap} {dolly; cook; wrap} carry is mutex with cook dolly is mutex with wrap Solution extraction fails, need to expand the graph

  • Sec. 10.3 – p.14/22
slide-15
SLIDE 15

Example: graph expanded to level S2

garb ~garb cleanh ~cleanh quiet ~quiet dinner present garb ~garb cleanh ~cleanh quiet ~quiet dinner present carry dolly cook wrap carry dolly cook wrap garb cleanh quiet

A0 A1 S2 S1 S0

  • Sec. 10.3 – p.15/22
slide-16
SLIDE 16

Solution extraction (second attempt)

At level S2, all the goal conditions are still present. In fact, they do not go away once they appear. Notice that there are fewer mutex relationships at level S2 There are three ways to satisfy ˜garbage: carry, dolly, noop There are two ways to satisfy present: wrap, noop There are two ways to satisfy dinner: cook, noop So, look for at all 3 × 2 × 2 = 12 combinations

  • Sec. 10.3 – p.16/22
slide-17
SLIDE 17

Solution extraction (second attempt)

Support ˜garbage with carry, dinner with noop, and present with wrap This is a consistent set because none are mutually exclusive The subgoals from level A1 are dinner (precondition

  • f noop), quiet (precondition of wrap)

There are only two subgoals because dolly and carry do not have preconditions Choose cook to support dinner, and noop for quiet. These two actions are not mutex. If there are multiple actions at a level, they can be executed in parallel.

  • Sec. 10.3 – p.17/22
slide-18
SLIDE 18

The GRAPHPLAN algorithm

function GRAPHPLAN (problem) returns a solution, or failure graph ← INITIAL-PLANNING-GRAPH (problem) goals ← CONJUNCTS[problem.GOAL] nogoods ← an empty hash table for tl = 0 to ∞ do if goals all non-mutex in last level of graph then solution ← EXTRACT-SOLUTION ( graph, goals, NUMLEVELS (graph), nogoods) if solution = failure then return solution if graph and nogoods have both leveled off then return failure graph ← EXPAND-GRAPH (graph, problem)

  • Sec. 10.3 – p.18/22
slide-19
SLIDE 19

Properties of planning graphs

A literal that does not appear in the final level of the graph cannot be achieved by any plan. The level cost of a goal literal is the first level it appears, e.g., 0 for cleanhands and 1 for dinner. Level cost is an admissible heuristic but might undercount: it counts the number of levels, whereas there might be several actions at each level

→ use a serial planning graph

  • Sec. 10.3 – p.19/22
slide-20
SLIDE 20

Heuristics derived from planning graphs

The max level heuristic takes the maximum level cost of any of the goals (admissible, not very accurate) The level cost heuristic returns the sum of the level costs of the goals (inadmissible, works well in practice) The set level heuristic finds the level at which all the literals in the conjunctive goal appear in the planning graph without any pair of them being mutually exclusive (dominates max level, works well when the subplans interact a lot)

  • Sec. 10.3 – p.20/22
slide-21
SLIDE 21

Termination of Graphplan

The algorithm is guaranteed to terminate when there is no solution. When both the graph and the no-goods level off, the algorithm terminates The graph will level off at a finite level due to the following properties literals increase monotonically actions increase monotonically mutexes decrease monotonically no-goods decrease monotonically

  • Sec. 10.3 – p.21/22
slide-22
SLIDE 22

Sources for the slides

AIMA textbook (3rd edition) AIMA slides (http://aima.cs.berkeley.edu/) Weld, D.S. (1999). Recent advances in AI planning. AI Magazine, 20(2), 93-122.

  • Sec. 10.3 – p.22/22