GraphPlan

GATE Relevance: Medium-High

🎯 Learning Objectives

  • Describe the planning graph data structure (proposition and action layers)
  • Identify and classify mutex (mutual exclusion) relations
  • Enumerate the four types of mutex: inconsistent effects, interference, competing needs, inconsistent support
  • Trace the GraphPlan algorithm including expansion and solution extraction
  • Understand the level-off property and its implications
  • Use the planning graph as a heuristic for other planners

1. Planning Graph Structure

📚 Planning Graph

A planning graph is a directed, layered graph that alternates between two types of layers:

  • Proposition layer (Pi): set of propositions that could possibly be true at time step i
  • Action layer (Ai): set of actions whose preconditions are satisfiable (without mutex conflicts) in Pi

Layers grow monotonically: Pi ⊆ Pi+1 and Ai ⊆ Ai+1.

Construction starts with P0 = the initial state. Each subsequent layer is built by:

  1. Ai: include all actions whose preconditions all appear in Pi and are not pairwise mutex. Also include no-op (persistence) actions for every proposition in Pi.
  2. Pi+1: includes all propositions in the add lists of actions in Ai.
  3. Compute mutex relations in Ai and Pi+1.

💡 No-Op Actions

For every proposition p in Pi, a special no-op (maintenance) action is added. It has precondition {p}, add list {p}, and empty delete list. This models the persistence of a proposition across time steps.

2. Mutual Exclusion (Mutex) Relations

Mutex relations track pairs of actions or propositions that cannot both be true/executed at the same time step.

2.1 Action-Level Mutex

📚 Inconsistent Effects

Two actions a1 and a2 are mutex if one negates an effect of the other. Formally: some p ∈ Add(a1) ∩ Del(a2), or vice versa.

Example: Move(A, Table, B) adds On(A,B) while Move(C, B, Table) deletes Clear(B) — but more directly, if a1 adds Clear(X) and a2 deletes Clear(X), they have inconsistent effects.

📚 Interference

Action a1 deletes a precondition of a2, or vice versa. Formally: some p ∈ Del(a1) ∩ Precond(a2).

Example: Move(A, Table, B) deletes Clear(B). If another action requires Clear(B) as a precondition, they interfere.

📚 Competing Needs

Actions a1 and a2 have preconditions that are mutex in the preceding proposition layer. Formally: ∃ p ∈ Precond(a1), q ∈ Precond(a2) such that p and q are mutex in Pi.

2.2 Proposition-Level Mutex

📚 Inconsistent Support

Two propositions p and q are mutex in Pi+1 if every pair of actions (ap, aq) that achieves them is mutex in Ai. In other words, there is no way to have both p and q without executing two mutex actions.

Mutex TypeLevelCondition
Inconsistent EffectsActionOne action’s add list ∩ other’s delete list ≠ ∅
InterferenceActionOne action’s delete list ∩ other’s preconditions ≠ ∅
Competing NeedsActionPreconditions of the two actions are mutex in Pi
Inconsistent SupportPropositionAll achiever pairs are mutex in Ai

⚠ GATE Tip

Mutex types are commonly tested. Remember: the first two (inconsistent effects, interference) are static — they depend only on action definitions. Competing needs and inconsistent support are derived — they depend on the mutex relations in the previous layer and may disappear as the graph grows.

3. The GraphPlan Algorithm

GraphPlan Algorithm

function GraphPlan(problem):
    graph ← initial planning graph with P₀ = initial state
    loop:
        // EXPAND: add next action layer and proposition layer
        Aᵢ ← all applicable non-mutex actions for Pᵢ (+ no-ops)
        Pᵢ₊₁ ← union of add lists of all actions in Aᵢ
        compute mutex relations for Aᵢ and Pᵢ₊₁

        // CHECK: are all goal propositions present and non-mutex?
        if goal ⊆ Pᵢ₊₁ and no pair of goal props is mutex:
            solution ← Extract(graph, goal, level i+1)
            if solution ≠ failure:
                return solution

        // TERMINATION: check for level-off
        if Pᵢ₊₁ = Pᵢ and mutexes unchanged:
            return failure  // problem is unsolvable

        i ← i + 1

📚 Solution Extraction

Solution extraction performs a backward search from the last proposition layer. At each level, select a non-mutex set of actions that achieves all needed propositions. The preconditions of these actions become the goals for the previous level. This continues until level 0 (where the initial state must provide all needed propositions).

4. The Level-Off Property

📜 Level-Off Theorem

Because the sets of propositions and actions grow monotonically and the sets of mutex relations shrink monotonically, and both are finite, the planning graph must eventually level off: there exists a level k such that Pk = Pk+1 and the mutex sets are identical.

Implications:

  • If the goal propositions never appear (or remain mutex) after level-off, the problem has no solution.
  • Level-off guarantees termination of GraphPlan.
  • The level at which goals first appear non-mutex is a lower bound on plan length — useful as a heuristic.

5. Planning Graph as a Heuristic

Even when not using GraphPlan directly, the planning graph provides powerful heuristics for other planners:

📚 Max-Level Heuristic

hmax-level(s) = the maximum over all goal propositions of the first level at which each appears. This is admissible but not very informative.

📚 Sum-Level Heuristic

hsum-level(s) = the sum of the first levels at which each goal proposition appears. This is not admissible (can overestimate due to positive interactions) but more informative.

📚 Set-Level Heuristic

hset-level(s) = the first level at which all goal propositions appear without any pair being mutex. This is admissible and accounts for interactions between goals.

6. Worked Example: Building a Planning Graph

🔬 Have-Cake-Eat-Cake Problem

Initial State P0: {Have(Cake)}

Goal: {Have(Cake), Eaten(Cake)}

Actions:

  • Eat(Cake): Pre={Have(Cake)}; Add={Eaten(Cake)}; Del={Have(Cake)}
  • Bake(Cake): Pre={¬Have(Cake)}; Add={Have(Cake)}; Del={}

Layer-by-Layer Construction

P0: {Have(Cake), ¬Eaten(Cake)}

A0:

  • Eat(Cake) — Pre: Have(Cake) ✓
  • no-op(Have(Cake)) — persists Have(Cake)
  • no-op(¬Eaten(Cake)) — persists ¬Eaten(Cake)
  • (Bake not applicable: requires ¬Have(Cake), which is not in P0)

Mutex in A0: Eat(Cake) and no-op(Have(Cake)) are mutex by inconsistent effects (Eat deletes Have(Cake), no-op adds it). Also Eat(Cake) and no-op(¬Eaten(Cake)) are mutex by inconsistent effects.

P1: {Have(Cake), ¬Have(Cake), Eaten(Cake), ¬Eaten(Cake)}

Mutex in P1: Have(Cake) and ¬Have(Cake) are mutex (inconsistent support). Eaten(Cake) and ¬Eaten(Cake) are mutex.

Goal check: Have(Cake) and Eaten(Cake) are both in P1. Are they mutex? Have(Cake) achievers: {no-op(Have(Cake))}. Eaten(Cake) achievers: {Eat(Cake)}. These two actions are mutex ⇒ Have(Cake) and Eaten(Cake) are mutex in P1. Cannot extract solution yet.

A1:

  • Eat(Cake) — Pre: Have(Cake) ✓
  • Bake(Cake) — Pre: ¬Have(Cake) ✓ (now available in P1)
  • no-ops for all four propositions

P2: {Have(Cake), ¬Have(Cake), Eaten(Cake), ¬Eaten(Cake)}

Now check: Have(Cake) achievers in A1: {Bake(Cake), no-op(Have(Cake))}. Eaten(Cake) achievers: {Eat(Cake), no-op(Eaten(Cake))}. Bake(Cake) and Eat(Cake) — are they mutex? Bake requires ¬Have(Cake); Eat requires Have(Cake). These preconditions are mutex in P1 ⇒ competing needs. BUT Bake(Cake) and no-op(Eaten(Cake)) are not mutex! ⇒ Have(Cake) and Eaten(Cake) are no longer mutex in P2.

Solution extraction at P2:

  • Need: Have(Cake) and Eaten(Cake) at level 2
  • Choose: Bake(Cake) for Have(Cake), no-op(Eaten(Cake)) for Eaten(Cake) — not mutex ✓
  • At level 1: need ¬Have(Cake) for Bake, and Eaten(Cake) for no-op
  • Choose: Eat(Cake) achieves both ¬Have(Cake) and Eaten(Cake) ✓
  • At level 0: need Have(Cake) for Eat — satisfied by P0 ✓

Plan: Step 1: Eat(Cake) → Step 2: Bake(Cake) — Total 2 steps.

Summary

  • A planning graph alternates proposition and action layers, growing monotonically.
  • Four types of mutex: inconsistent effects, interference, competing needs (action-level); inconsistent support (proposition-level).
  • GraphPlan expands the graph until goals are non-mutex, then extracts a solution via backward search.
  • The level-off property guarantees termination and enables unsolvability detection.
  • The planning graph provides admissible heuristics (max-level, set-level) and an informative non-admissible heuristic (sum-level).