Structure and Complexity in Planning with Unary Operators

Unary operator domains -- i.e., domains in which operators have a single effect -- arise naturally in many control problems. In its most general form, the problem of STRIPS planning in unary operator domains is known to be as hard as the general STRIPS planning problem -- both are PSPACE-complete. However, unary operator domains induce a natural structure, called the domain's causal graph. This graph relates between the preconditions and effect of each domain operator. Causal graphs were exploited by Williams and Nayak in order to analyze plan generation for one of the controllers in NASA's Deep-Space One spacecraft. There, they utilized the fact that when this graph is acyclic, a serialization ordering over any subgoal can be obtained quickly. In this paper we conduct a comprehensive study of the relationship between the structure of a domain's causal graph and the complexity of planning in this domain. On the positive side, we show that a non-trivial polynomial time plan generation algorithm exists for domains whose causal graph induces a polytree with a constant bound on its node indegree. On the negative side, we show that even plan existence is hard when the graph is a directed-path singly connected DAG. More generally, we show that the number of paths in the causal graph is closely related to the complexity of planning in the associated domain. Finally we relate our results to the question of complexity of planning with serializable subgoals.


INTRODUCTION
Generating plans in the context of the STRIPS representation language is known to be a difficult (P-SPACE complete) problem [5]. Thus, various authors have explored the existence of more constrained problem classes for which planning is easier. For example, Bylander showed that STRIPS planning in domains where each operator is restricted to have positive preconditions and one postcondition only is tractable. Bäckström and Klein [1] considered other types of local restrictions, but using a more refined model in which two types of preconditions are considered: prevail conditions, which are variable values that are required prior to the execution of the operator and are not affected by the operator, and preconditions, which are affected by the operator. For example, [1] have shown that when operators have a single effect, no two operators have the same effect, and each variable can be affected only in one context (of prevail conditions) then the planning problem can be solved in polynomial time. However, these restrictions are very strict, and it is difficult to find reasonable domains satisfying them.
More recently, Williams and Nayak [3] studied planning problems where all operators affect a single variable, in the context of their work on controlling NASA's Deep-Space One spacecraft. In this context, they defined the notion of a causal graph which relates the causal structure of the domain, i.e., how different variables play a role in our ability to affect other variables. A causal graph is a directed graph whose nodes are the domain propositions. An edgé Ô Õµ appears in the causal graph if some operator that changes the value of Õ has a prevail condition involving Ô. When the causal graph ½ Dept. of Computer Science, Ben-Gurion University of the Negev, P. O. Box 653, Beer-Sheva 84105, Israel, e-mail: dcarmel, brafman @cs.bgu.ac.il is a tree, it is easy to determine a serializability ordering over any set of sub-goals, and consequently, obtain a plan in polynomial time.
An important byproduct of Williams and Nayak's work is its demonstration that unary operator domain are of practical interest. Interestingly, unary operator domains show up naturally in another application -answering dominance queries in CP-networks [4].
Our work continues Williams and Nayak's study of unary operator domains, concentrating on the relationship between the domain's causal graph and the complexity of plan generation and plan existence. In particular we prove the following results: When the undirected graph induced by the causal graph is singly connected, plan existence and plan generation can be performed in Ç´ µ time (where is the number of edges in the causal graph).
When the causal graph is singly connected, plan generation is in NP. When the causal graph has more than three paths between two variables, plan generation is NP-hard. In general, the complexity of plan generation can be bound by a function of the number of paths within the causal graph.
The rest of this paper is devoted to a more formal presentation of these results and their proofs.

COMPLEXITY RESULTS
We now show how, by bounding the structural complexity of the causal graph, we can bound the complexity of plan generation. Recall that we use a propositional language to describe the state of the world, and that our operators are described by a set of prevail conditions -i.e., a set of literals that must hold in a world for the operator to be applicable, a single precondition, and a single post-condition (or effect). The precondition and the post-condition are represented by single literals, one the negation of the other.

Undirected Polytrees
A polytree is a singly connected graph, i.e., a graph in which there is a single path between two nodes. Here, we consider the case of a causal graph in which there is a single path between every pair of nodes in the induced undirected graph. For this class of problems we will present a polynomial time planning algorithm. We will rely on [6]'s formulation of the POP algorithm, and we will assume that the reader is familiar with that algorithm.
Our algorithm proceeds in two stages: First, we perform a forward check step. Following this step, which takes time linear in the size of the input, we can answer the question whether or not a plan exists. If the answer if positive, we run a particular instantiation of the POP algorithm which generates the plan without backtracking in linear time.
The forward checking procedures, described in Figure 1, works as follows: we perform a topological sort of the causal graph and start processing each node (=variable) from top to bottom. At each point, a set of operators is associated with each variable, i.e., the set of operators that can change the value of that variable. Initially, this would be the set of all such operators. Now, for each variable Ú, we check whether its value in the initial state, Ú ¼ , differs from its value in the goal state, Ú £ . If this is the case and there is no operator transforming Ú ¼ to Ú £ we return failure. If Ú ¼ Ú £ then we first check whether there are two operators associated with Ú that have both its values as effects. If this is the case, then, intuitively, this implies that we can change Ú's current value and still regain the value needed in the goal state. Otherwise, we mark Ú locked and we extract all operators in which the negation of Ú's current value appears as a prevail condition -it is clear that we will never be able to apply these operators in a valid plan.
It is apparent that the procedure Forward-Check's running time is linear in the number of operators. 3. If all calls to Recursive-Locking return success, then return success.
Otherwise return failure.

Lemma 1 Forward-Check returns success if and only if a plan exists.
Clearly, if Forward-Check fails, then no plan exists. To prove the opposite direction we proceed as follows: We define a partial order planning algorithm POP-UPC (partial-order planner for undirected polytree causal graph) and show that it will succeed without backtracking if Forward-Check succeeds. POP-UPC is described in detail in Figure 2. In its description, we assume that a minimal number of operators exists, i.e., if we remove a single operator from the domain, Forward-Check would no longer return success.
Intuitively, POP-UPC works as follows: it maintains a goal agenda sorted based on the causal graph structure: parent variables appear after their descendents. At each point, the next agenda item is selected; ¾ This assumes some appropriate indexing is used. This indexing should be performed once for each planning domain. ¾ and is one of the preconditions of Ò ).

Update goal set: Let
is newly instantiated, then for each of its precondition É, add É to Ò ¼ .

Threat prevention: If
Ò is topologically ordered (based on the causal graph with respect to the precondition part of each pair). if it requires achieving some value for Ú that differs from its initial value, we add an operator to the plan with the desired effect. Otherwise, we need the same value Ú£ for Ú as that which appears in the initial state. If no operator was added which has the opposite of Ú¼ as a prevail condition, we will use the initial state (or in POP terminology, the operator ¼ ) to achieve this value (i.e., we simply do not change this value throughout the plan). If we added an operator which negates Ú¼, we must re-establish it, and we add an operator with that effect. No threats arise in POP-UPC, and the ordering constraints are consistent.

Lemma 2 If Forward-Check was successful then POP-UPC will return a valid plan.
Proof The Lemma will follow from the following claims: 1. For every agenda item, there exists an operator that has it as an effect. 2. There are no threats in the output of POP-UPC.
3. The ordering constraints in Ç are consistent.
(1) The first claim follows from the success of the Forward-Check procedure. It implies that for every variable Ú if Ú's initial value differs from its final value, there is an operator for achieving that value. For any other variable, we can always use the initial state as the source of its value. If Ú's initial and final value are the same and there are no two operators that can change Ú's value in both directions, then because of the locking mechanism, we will not allow any operator that relies on the value of Ú that differs from its initial value.
Hence, the need for an appropriate precondition will not arise. Assume, to the contrary that Ç implies and .
From the argument above, we know that there is a path between Ú and Ú in the undirected graph induced by the causal graph. By our structural assumption, we know that there is a unique path between Ú and Ú . Thus, the situation is as follows: We have a chain of operators , and a chain

Polytrees
In this section we provide an upper bound on the complexity of plan generation when the causal graph is a polytree. In particular, we show that this problem is in NP. However, the question of the exact placement of this problem in the computational complexity hierarchy is left open.
First we make the following observation, upon which we base our proof. The central claim will follow using an induction on the number of variables.
Consider an arbitrary planning problem instance ¥ with a variable set Î, and an operator set £. Denote by Must´Úµ the maximal number of times that a variable Ú must change its value in the course of execution of a valid plan for this problem. For the type of problems we deal with, for all variables in Î Must´Úµ satisfies:

Must´Ùµ
(1) where Sons´Úµ denote the immediate successors of Ú in the corresponding causal graph. That is, a variable must change its value at most once for each requested change of its successors (in order to satisfy necessary prevail conditions), and then at most once in order to accept the value requested by the goal state. Let MinPlanSize´¥µ denote the size of the minimal plan for the problem ¥. Using the Must property of the state variables, the following upper bound for MinPlanSize´¥µ is straightforward: This bound holds for all unary operator domains whose causal graph is acyclic. We will use this bound to prove the following lemma.

Lemma 3 Plan generation for propositional planning problems in
domains whose underlying causal graph is a polytree is in AE È .
Proof In order to prove this claim it is sufficient to show that for any solvable problem instance ¥ Î £ ÁÒ Ø Ó Ð for domains whose causal graph is a polytree, the length of the minimal (optimal) solution will be polynomial in the size of input. Since the verification of the solution takes time linear in its length, the bound follows. We will show that the length of the minimal solution is less than or equal to Ò ¾ , where Ò is the number of variables in Î. Our proof does not rely on the particular initial or goal state, and so we will ignore them, from now on.
Lemma 3 shows that any propositional, "polytree-structured" planning problem, is in AE È . Moreover, the size of the minimal solution is bounded by low polynomial in Î , which does not depend on the size of the whole input, Î · £ . Following subsection will highlight the significance of structural properties in the unary operator planning problems.

General DAGs
The polytree structure of the causal graph turns out to be crucial for guaranteeing reasonable solution times. As we now show, there are solvable propositional planning problems with an arbitrary acyclic (DAG) causal graph that have minimal solutions of exponential size. Analysis of this class of problems points to the reason for such inherent intractability. This allows us to characterize an important parameter of the causal graph affecting planning complexity and to extend the class of problems which are in NP. However, we also show that most of these restricted problems are NP-complete.

Lemma 4 Plan generation for STRIPS planning problems with a unary operator domain whose causal graph is acyclic is inherently intractable.
Proof We prove this claim simply by showing the supporting example. However, we will perform more detailed analysis, postponing the example to the end of the proof. Our analysis is based on the fact that the upper bound for MinPlanSize, presented in Equation 2 can be exponential in the size of input. First, we prove this claim, then we show by example that this upper bound can be achieved. The escalation of the complexity, when the number of variables in Î grows, can be shown by bounding newMust´Úµ using a different method than that of Equation 3. For the problems considered in Lemma 4, where Ú Ú denotes the total number of different, not necessary disjoint, paths from Ú to Ú . This means that for a given propositional planning problem with acyclic causal graph, with variables numbered according to a topological sort induced by the causal graph, Thus, the upper bound for MinPlanSize, presented in Equation 2 can be exponential in the size of the problem description. Now we show an example, for which such an exponential upper bound can be achieved. This particular example was used in different context by Bäckström and Nebel in [2]. Consider a propositional planning problem with Î Ò, and Parents´Ú µ Ú½ Ú ½ for ½ Ò. The operator set £ consist of ¾Ò operators Easy to see that the causal graph of this problem forms a DAG, and an instance of this planning problem with the initial state ¼ ¼ and the goal state ¼ ¼ ½ have a unique minimal solution of length ¾ Ò ½ corresponding to a Hamilton path in the state space.

¤
The analysis of the proof of Lemma 4 was performed in order to point out the reason for this potential exponential escalation of the solution's size. An immediate conclusion of Lemma 4 is that there is a significant class domains with an acyclic causal graph for which planning is in AE È .

Lemma 5 Plan generation for (STRIPS unary operator) planning
problems with an underlying causal graph that is AE-path-restricted is in NP.

Proof Based on the observations above
MinPlanSize´¥µ AEÒ ¾ Again, we have found a class of planning problems that is in NP. But is it NP-hard? The following Lemma shows that in most cases, this is indeed the case.

Lemma 6 Plan generation for propositional, 4-path-restricted
planning problems is AE È -complete.
Proof The proof is by polynomial reduction from 3-SAT to the corresponding propositional, 4-path-restricted plan generation problems. 3-SAT is the problem of finding a satisfying assignment to a propositional formula in conjunctive normal form in which each conjunct (clause) has at most three literals. Let ½ Ò be a propositional formula belonging to 3-SAT, and let and ½ Ñ be the variables used in . An equivalent propositional, 4-path-restricted planning problem can be constructed as follows: where ½ ¾ , and ¿ are the variables that participate in the th clause of . Á Ò Ø -consist of false assignments to all variables in Î ( Ú for each Î ¾ Î ). Ó Ð -consist of true assignments to all variables in Î (Ú for each Î ¾ Î ).
Let every operator ¾ £ be presented as a three-tuple pre post prv of pre-, post-, and prevail conditions respectively. Then, the corresponding operator set £ is specified as follows: where « ½ « are all possible truth assignments on the variables ½ ¾ ¿ , that satisfy the th clause of . Easy to see, that the described planning problem have all propositional variables, singleeffect operators and an acyclic causal graph (see figure 3). First, we note that the resulting graph has at most 4 directed paths between any pair of nodes. Clearly, there are no paths between nodes and ; exactly one path between and and any of the 's; at most one path between a particular and a particular ; and exactly 4 paths between or and any of the (one direct link, and three passing through the 3 variables consitituting ). Now we describe the dynamics of the problem. As long as , and , each can change its value from Ü to Ü , and no can change its value. After either the value of is changed to , or the value of is changed to , no can change its value (the assignment on the formula's variables is locked), but some variables from ½ Ò can change their values from to . Finally, after the remaining variable from changes to its positive value, (i.e. the assignment on become ), each , that still has the value Ü can be changed to Ü , but no can change its value (the truth values of the formula's clauses depends only on previously locked values of the formula's variables).
Clearly, Ó Ð is reachable (¥ is solvable) if and only if a satisfying assignment for can be found. Likewise, the maximal number of paths between pairs of vertices in the causal graph is achieved between each locking variable ( and ), and each clause variable ( ½ Ò), and is equal to 4. Thus, plan generation for propositional, 4-path-restricted planning problems is AE È -hard, and from Lemma 5, we know that it is AE È -complete.

SUMMARY
We have shown that the structure of the causal graph for unary operator STRIPS domains is an important factor in determining the computational complexity of plan generation. In particular, we have shown that a polynomial time algorithm exists for graphs in which there is at most one undirected path between nodes, and that in polytrees the maximal plan length is a low order polynomial. More generally, we have shown a relation between the number of path between variables in the causal graph and the computational complexity of the corresponding planning problem.