Académique Documents
Professionnel Documents
Culture Documents
GraphPlan is an algorithm based on planning graph Planning graphs are also used as a source of heuristics (an estimate of how many steps it takes to reach the goal) Planning graph is an approximation of a complete tree of all possible actions and their results
Contd
Planning graph is organised into levels Level S0: initial state, consisting of nodes representing each fluent that holds in S0 Level A0: each ground action that might be applicable in S0 Then alternate Si and Ai Si contains fluents which could hold at time i, (may be both P and P); literals may show up too early but never too late Ai contains actions which could have their preconditions satisfied at i
Initial state: Have(Cake) Goal: Have(Cake) Eaten(Cake) Eat(Cake): Precond: Have(Cake) Effect: Have(Cake) Eaten(Cake) Bake(Cake): Precond: Have(Cake) Effect: Have(Cake)
Example
Example
Example contd..
Graphplan-algorithm
GraphPlan repeatedly adds a level to a planning graph with Expand-Graph. Once all the goals show up as non-mutex in the graph, calls Extract-Solution on the graph to search for a plan. If that fails, extracts another level.
Graphplan-algorithm
function GraphPlan(problem) returns solution or failure graph Initial-Planning-Graph(problem) goals Conjuncts(problem.Goal) loop do if goals all non-mutex in last level of graph then do solution ExtractSolution(graph,goals,umLevels(graph) if solution = failure then return solution else if No-solution-possible(graph) then return failure graph Expand-Graph(graph,problem)
Extracting solution
Backward search problem: The initial state is the last level of the planning graph, Sn, along with the set of goals Available actions in Si: any set of conflict-free actions in Ai1 whose effects cover the goals in the state. Conflict-free means: no two actions are mutex and no two of their preconditions are mutex.
Contd..
The result of applying it is a subset of Si1 which has as its set of goals the preconditions of the selected set of actions. The goal is to reach a state at level S0 such that all the goals are satisfied. The cost of each action is 1.
Termination of GraphPlan
The graph will level off (assuming a finite set of literals and actions): Literals in planning graphs increase monotonically (because of persistence) Actions increase monotonically (because preconditions dont go away) Mutexes decrease monotonically (if two actions are mutex at level t, they were mutex at all previous levels)
Contd
When the graph levels off, if it is missing one of the goal conjuncts or two of the goals are mutex, solution is impossible and GraphPlan returns failure. If the graph levels off but Extract-Solution fails to find a solution, we may need to expand the graph finitely many times (but this will terminate - uses additional tricks).