Extracting Landmarks and Ordering them for Planning Julie Porteous (contact author)
[email protected] Dept. of Computer Science The University of Durham Durham DH1 3LE 0191 374 7707 (tel), 0191 374 2560 (fax)
Laura Sebastia
[email protected] Dept. of Computer Science, Technical University of Valencia, Camino de Vera s/n, 46071 – Valencia, Spain
Abstract We identify important intermediate planning goals, which we refer to as landmarks and present a method for extracting landmarks from an input planning problem. We also present a method for finding orders between landmarks which can be used during planning. These methods have been implemented and integrated with an example planning system. In the paper we present results that support our expectation that these orders can lead to improved planning performance (both in terms of speed and plan quality). Key Words: Planning, Goal orders, Domain analysis
1 Introduction A number of methods have been proposed for identifying orders between goals in a planning problem, the idea being to reduce the inherent complexity of the problem by partitioning it into more manageable chunks. If an order can be identified between a set of goals then this can be used to focus the planner on achieving goals that are placed earlier in the order. For example, [4] described a technique for identifying reasonable orders between goals. The central idea being as follows: a pair of goals A and B can be ordered so that B is achieved before A if it isn’t possible to reach a state in which A and B are both true, from any state in which just A is true, without having to temporarily destroy A. In such a situation it is reasonable to achieve B before A to avoid unnecessary effort. These orders can be identified through analysis of the planning problem, composed of a domain and problem description, in a pre-processing phase prior to planning. Work in this area includes PRECEDE [5] and GAM [4]. PRECEDE and GAM used different approaches but produce similar orders. For example, in the blocks world shown in figure 1 where the initial state is on the left and the goal state is shown on the right (the goal is partially specified since the exact location of blocks A, B , J and C is unspecified) both techniques would identify that goal on(D; A) should be achieved before on(G; D ) and on(E ; B ) before on(H; E ). Although useful in improving planning performance, these methods are limited to finding orders between top-level planning goals, yet in many problems, it would be useful to
J C
F
I
B
E
H
A
D
G
G
H
D
E
I
F
A
B
C
J
Figure 1: Example blocks world problem
have information about orders between intermediate planning goals. As an example, in the blocks problem mentioned earlier, the location of block J is unspecified in the goal state, we could achieve this goal directly by stacking block F on block J in its location in the initial state. But intuitively we can see that before we do this we will need to clear block I since this is required before we can move it to its goal location of being on block C . We can also see that no matter how the problem is solved, block I will have to be cleared at some point, since being clear is a precondition of the move block operator. Since it must feature as an intermediate goal in any solution plan we see it as an important intermediate planning goal, a landmark. Hence a useful order, to avoid wasted effort in this situation, is to order lear(I ) before on(F; J ). We have extended goal ordering techniques to identify such intermediate goals and to find orders between them. In section 2 we define landmarks and outline a method for extracting them from an input planning problem. Then in section 3 we discuss a method for ordering extracted landmarks. Section 4 discusses a planning implementation which uses these orders during search and planning and the results of using this implementation are discussed in section 5. Finally in section 6 we discuss our conclusions and future work.
2 Extracting Landmarks Informally, we define a landmark in a planning problem as a literal that will be true at some point in every solution plan to that problem. As an example, in the blocks world shown in figure 1 the literal lear(I ) is a landmark since it must be true in all possible solution plans (all solution plans require it so that block I can be picked up to stack it on block C ). In contrast, the literal on(J; F ) is not a landmark – there are solution plans which make it true such as the plan in which
block J is unstacked from block I and then stacked on block F whilst establishing the preconditions to move I to its goal position but there are also other solution plans which move block J to other locations and so don’t make on(F; J ) true. Note that we also class as landmarks, all literals in the initial and goal states (I and G ) of the planning problem.
2.1
Landmark extraction
There are two main steps in landmark extraction: the first is to build a relaxed planning graph from which candidate landmarks are extracted; the second step is to verify that all candidates are landmarks. Note that all literals that are returned by the method are indeed landmarks but we do not guarantee that it will return all the landmarks for the problem. Extract candidate landmarks Candidate landmarks are extracted from a relaxed planning graph which we construct using the method discussed in [3]. For a relaxed version of a planning problem (where the delete lists of all operators are ignored, as introduced in HSP [1]), the graph is built by forward chaining from the initial state of the problem to a state where all goals are solved (or a fixpoint is reached which indicates the relaxed planning problem is unsolvable). Levels of the graph are numbered from zero starting at the initial state and the level in which a goal is achieved indicates the minimum number of operators required to solve that individual goal. Once the RPG is constructed we then search backwards through it to extract candidate landmarks. An outline algorithm for landmark extraction is given in figure 2 below. The input to the procedure is the RPG and the set of top-level planning goals for the problem of interest, the output is the set of landmarks. The procedure loops through the levels of the RPG from the highest numbered level (ie the one in which all top level goals have been achieved) through to zero. Within each level each of the goals that are achieved at that level are considered in turn (line 2) and the intersection of the preconditions of all the actions that achieve that goal are assembled (lines 3 and 4). All the literals in this intersection are added to the set of Landmarks (line 6) and they are also added to the set of Goals to be achieved at lower levels (line 7). Those preconditions which aren’t in the set I are unioned and this set is added to SetGoals (line 8). When literals are added to SetGoals they are grouped according to type (two literals l1 = pred1 (a11 ; : : : ; a1m ) and l2 = pred2 (a21 ; : : : ; a2n ) are of the same type if: pred1 = pred2 and the number of arguments are the same (ie m = n); and all the arguments share the same type). For example, in a logistics domain at(plane1,city1-2) and at(plane2,city1-2) are literals of the same type. The procedure then steps through the set SetGoals (line 9), assembling for each set those actions that add any literal in the set (line 10) and then adding to Landmarks and Goals (lines 11-15). Verify Landmarks This second step verifies that all the landmarks are indeed landmarks. In the first step only the operators in the lowest level where a literal is achieved are considered. Then the set I of literals in the intersection of their preconditions are added
procedure extract landmarks(RPG, Goals) Landmarks SetGoals = fg 1. for each level of the RPG (in descending order) 2. for each g in Goals(level) 3. Let A be the set of actions that add g (in earlier levels of RPG) 4. Let I be the intersection of the preconditions of all actions in A 5. for each i in I 6. add i to Landmarks 7. add i to Goals (at earliest level achieved in RPG) 8. Let U be the union of the preconditions of all actions in A and not in I group literals in U by “type” and add to SetGoals 9. for each s in SetGoals(level) 10. Let A be the set of actions that add literals in s (from earlier levels of RPG) 11. Let I be the intersection of the preconditions of all actions in A 12. for each i in I 13. add i to Landmarks 14. add i to Goals (at earliest level achieved in RPG) 15. Let U be the union of the preconditions of actions in A (except those in I) group literals in U by “type” and add to SetGoals
Figure 2: Landmark Extraction as landmarks. But here we check if there are other actions in higher levels that can achieve the same literal. If there are they can cause the intersection I to be different, and any such literals identified in step1 are removed. In order to discard those literals that are not actual landmarks, we use an extended version of the relaxed planning graph, that is, the construction of the graph finishes just when no more actions can be applied. For each landmark l we verify it is a landmark by first building the extended relaxed planning graph, but with literal l switched off, and then testing whether all the goals are reached. If all the goals are reached then l is not required in all solution plans for this problem and can be discarded.
2.2
An example of landmark extraction
As an example, we’ll discuss how this algorithm works with a reduced example of a simple logistics problem. The goal is to have package1 in location bos-po when it is initially in location pgh-po. We start by looking for the operators that add the goal at(package1, bos-po). In this case, there is only one: unload-truck(package1, bos-truck, bos-po). The preconditions of this operator in(package1, bos-truck) and at(bos-truck, bos-po) become the new goals to be achieved and are also added as landmarks. As the algorithm proceeds, the first goal to examine is in(package1, bos-truck) and we find the operator load-truck(package1, bos-truck, bosairport) as an achiever of it. Its preconditions are again added as goals and landmarks (at(package1, bos-airport) and at(bos-truck, bos-airport)). Lets suppose that the next goal to be considered is at(package1, bos-airport). There are two actions achieving this literal: unload-airplane(package1, airplane1, bos-airport) and unload-airplane(package1, airplane2, bos-airport). The intersection and the union of the preconditions of these operators is computed, obtaining I=; and U=ffin(package1, airplane1), in(package1, airplane2)g, fat(airplane1, bos-airport), at(airplane2, bosairport)gg. We can see how the literals in the union have been classified by type and these sets are added as SetGoals. Suppose that now the set to study is fin(package1, airplane1), in(package1, airplane2)g. The operators achieving these literals in the set are: load-airplane(package1, airplane1, pgh-airport) and load-airplane(package1, airplane2, pgh-
airport). Again, the intersection and the union of their preconditions are computed: I=fat(package1, pgh-airport)g and U=fat(airplane1, pgh-airport), at(airplane2, pgh-airport)g. The literal in the intersection is a new landmark. Proceeding this way, that is, keeping the sets of the union of the preconditions, the algorithm is able to find more landmarks. The set of landmarks for this problem is the following: fat(package1, pgh-po), at(pgh-truck, pgh-po), at(bostruck, bos-po), in(package1, pgh-truck), at(pgh-truck, pghairport), at(bos-truck, bos-airport), at(package1, pghairport), at(package1, bos-airport), in(package1, bos-truck), at(package1, bos-po)g
3 Ordering Landmarks We distinguish between two different types of orders between landmarks: intra-landmark orders, where the orders are between landmarks which are all ordered with respect to the same top level planning goal and which can be extracted directly from the RPG; and inter-landmark orders, where the orders are between landmarks that are themselves ordered with respect to other top-level goals. Below we discuss each of these types of orders in turn and illustrate them with examples.
3.1
Intra-landmark orders
An intra-landmark order between a pair of landmarks A and B is written A