create a relaxed problem remove some restrictions want the relaxed problem to be solvable in polynomial time Facts: (1) Nodes at state-level 1: initial conditions (2) Nodes at state-level i: literals that might possibly be true at time i. If a literal isn't here, it couldn't be true at time i. (3) Nodes at action-level i: actions that might be possible to execute at time i. if an action isn't here, it isn't possible to execute it at time i. (4) "precondition-level" == "state-level" == "proposition-level" From here on, we'll use Pi for "precondition-level i" and Ai for "action-level i". They are numbered liked this: P1 A1 P2 A2 P3 A3 ... Ak-1 Pk (5) Each Ai has persistence actions ("no-ops" - do nothing). There is one no-op N for each condition C at Pi. The effect of N is C. Thus, C is in Pi+1. Therefore, once a literal appears in the graph, say at Pi, it is also in all Pj, i < j (due to no-ops). (6) An action appears in the graph as soon as it is possible to execute it. Thus it never appears "too late" - it shows up as soon as possible. An action A in Ai can be executed at time i according to the *relaxed problem, where the only restrictions are the pairwise mutex relations*. However, perhaps A can't be executed at time i in the original problem due to other negative interactions in the full problem. We know it is not *impossible* in the full problem to execute A at i. (7) We are assuming the problem has been propositionalized. (8) Each valid plan for the full problem is a subgraph of the planning graph. A valid plan is a subgraph of the full planning graph where: * actions at the same level are not mutex * each action's preconditions are made true by the plan * goals are all satisfied (9) The planning graph is the state space for the relaxed problem. It can be built in polynomial time. (10) These are "parallel" plans, i.e., the actions are only partially ordered (as in partial-order planning). Among all the actions at Ai, any subset of the actions could be executed, as long as mutex relations are not violated. When we search the planning graph at the end for a solution to the full problem, we can choose more than one action from a level as long as mutex's are not violated. (11) Mutex rels: * actions inconsistent effects - effect clobbers effect interference - effect clobbers precondition competing needs - preconditions are mutex (one needs P, one needs ~P) * literals inconsistent support - all possible ways of establishing two literals are mutex (12) Observations: * propositions monotonically increase, since propositions are always carried forward by no-ops [monotonically non-decreasing] * actions monotonically increase [monotonically non-decreasing] * proposition mutex relationships monotonically decrease [monotonically non-increasing] * action mutex relationships monotonically decrease [monotonically non-increasing] * planning graph levels off. * A literal that does not appear in the graph after it has leveled off cannot be achieved by any plan. (13) Complete: Each Ai contains all actions that could possibly be executed at time i. No possibilities are left out. Thus, the planning graph contains all valid plans as subgraphs. (14) Will terminate with failure if there is no plan (15) Once the planning graph is built, we can 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. Thus, you are searching through the planning graph, which is much smaller than the state space for the original plan. Specific graphplan algorithm: Let P1 be the initial conditions For k = 1, 2, 3, ... Add Ak and Pk+1 to the planning graph if the current and previous levels are identical, return fail # Since this line is executed, we already know we # didn't succeed, since the previous level is the same # as this one and we already dealt with it. Either # the goals are not established and not mutex, or # the backward search for a solution did not find a # solution if all goals are established and not mutex in Pk+1: Do a backward search through the planning graph: # recall the numbering: # P1=initConds A1 P2 A2 ... Ak Pk+1; Start state: currentGoals = the problem goals currentLevel = K actions = {} parent = None States with currentLevel = 0 have no successors For other states S: S has a successor for each subset A of non-mutex actions in currentLevel(S) that achieve all of currentGoals(S), namely: currentGoals = preconditions of actions in A currentLevel = K - 1 actions = A parentPointer = S goalP(S): currentLevel(S) = 0 and currentGoals(S) are in P1 If the search finds a solution, then return it # Note: you can do some processing here # to possibly detect if a solution isn't possible. # In this simple algorithm, just continue on to build # the next level of the graph. Note that, because # actions and conditions are monotonically non-decreasing # (and mutex's monotonically non-increasing), # the goals will still be established and not mutex in # subsequent levels. Until the graph levels off, it will # include more possibilities (additional actions and/or # conditions, and/or fewer mutex relations). Thus, there # may be a solution to the full planning problem in the # extended graph. (16) We won't have time to go deeply into the issue of deriving heuristics from the planning graph to use in search-based solutions to the full planning problem. We can observe this: suppose literal L appears for the first time in Pi. i is an estimate of the number of planning steps needed to make L true. We could define h1(j,L) = i-j+1 to be an estimate of the number of steps, starting at state j, needed to establish L. This heuristic is admissible - it never over-estimates the number of steps to establish L, because i is the first level at which L could possibly be true in the full planning problem. We *could* define a heuristic function for, e.g., A*. Suppose a progression linear planning search is evaluating node N with gval = k (assuming a step costs are 1). h(N) = for goal props g1 ... gn max(h1(k,g1),...,h1(k,gn)) (17) The planning graph is much smaller than the corresponding state space for the full plan (i.e., the one with start having the initial conditions). let a be the number of actions and l be the number of literals The state space for the full problem: just on level d in the worst case there are O (l * a ** d) total literals (l literals at each of a ** d nodes). The state space for the relaxed problem, i.e., the planning graph: At Pi there are at most l literals and l**2 mutex rels. At Ai there are at most a + l nodes (the "l" is for the no-op actions), and at most (a + l) ** 2 mutex links. Among all d levels: action nodes: d(a + l) prop nodes: d(l) action mutex rels: d((a+l)**2) prop mutex rels: d(l**2) So, action nodes + prop nodes + all mutex rels O(d(a+l)**2) This is also the complexity of constructing the graph