Cost Optimal Planning as Satisﬁability
Abstract
We investigate upper bounds on the length of cost optimal plans that are valid for problems with 0-cost actions.
We employ these upper bounds as horizons for a SAT encoding of planning with costs.
Given an initial feasible plan cost, we experimentally show that this SAT-based approach is able to compute plans with costs better than the initial cost, and in many cases it can match the optimal cost.
Also, in multiple instances, the approach is successful in proving that a certain cost is the optimal plan cost.
Introduction
Compilation to propositional satisﬁability (SAT), or other constraint formalisms, has been a successful approach to solving different variants of planning and model checking (Kautz and Selman 1992; Biere et al. 1999).
The majority of such compilation based techniques work by submitting multiple queries to a constraints solver, e.g. a SAT solver, and each of those queries encode the question ‘Does there exist a witness transition sequence with at most h steps?’, where h is some natural number, usually called the horizon.
This is repeated for multiple increasing values of h .
In order for these methods to be complete, there must be an upper bound on h , usually called the completeness threshold , beyond which no witness could be found if none that is shorter exists.
Also, the tighter the bounds, the more efﬁcient these compilation based procedures are.
Previous work has identiﬁed different state space topological properties to be completeness thresholds for different variants of model checking and planning problems.
E.g. for model checking safety properties, Biere et al.
identiﬁed the diameter , which is the length of the longest shortest path in the state space, as a completeness threshold.
The diameter is also a completeness threshold for satisﬁcing planning.
Biere et al.
also identiﬁed the recurrence diameter , which is the length of the longest simple path in the state space, as a completeness threshold for bounded model checking of liveness properties.
Identifying and computing completeness thresholds was considered an active research area in model checking by Edmund Clarke (Clarke, Emerson, and Sifakis 2009) in his Turing lecture and, indeed, authors have identiﬁed completeness thresholds for many involved kinds of model checking problems (Kroening et al. 2011; Bundala,
Ouaknine, and Worrell 2012).
Optimal planning is a variant of planning where the solution has to be optimal, according to some measure of optimality.
There has been multiple compilations of various types of optimal planning to SAT, satisﬁability modulo theories (SMT), and maximum satisﬁability formalisms (Büttner and Rintanen 2005; Giunchiglia and Maratea 2007;
Robinson et al. 2010; Muise, Beck, and McIlraith 2016; Leofante et al. 2020).
Many of the existing compilations tackle optimality criteria of different variants of the length of the plan.
Nonetheless, a particularly interesting optimality criterion is plan cost, which has been the primary optimality criterion in planning competitions since 2008 (Gerevini et al.
A gap in the literature seems to be a practical completeness threshold for cost optimal planning problems that have actions with 0-cost.
This is one hurdle to the application of SAT-based planning to such problems since, without a reasonable completeness threshold, optimality can only be proved after solving the compilation for a horizon that is the number of states in the state space.
This is impractical for most problems since it can be exponentially bigger than the size of the given problem.
It should be noted that some approaches try to circumvent the need for a tight completeness threshold, such the ones by Robinson et al.
and Leofante et al., which add an over-approximation of the transition relation underlying the planning problem to the encoding.
Optimality of a given solution is then proved when this over-approximation is unsatisﬁable.
Nonetheless, these approaches still need to compute compilations for multiple horizons and they are susceptible to having to solve compilations for an exponential horizon, unless a tighter completeness threshold is available, since the over-approximation is a relaxation of the given problem, i.e. it could be solvable even if the concrete problem is not solvable.
In this work we try to address that gap, and study the suitability of different state space topological properties as completeness thresholds for cost optimal planning with actions with 0-cost.
We identify the sublist diameter as a completeness threshold, which has the advantage of being practically bounded.
We also identify a new topological property, the subset diameter , as a completeness threshold and show that no tighter completeness threshold can be computed for a given problem without exploiting cost information, the ini- tial state, or the goal.
To test the practical utility of the completeness thresholds we found, we devise a SAT compilation for cost optimal planning, and use that in an any-time planning as satisﬁability algorithm, where the horizon is ﬁxed from the beginning to the completeness threshold.
This algorithm starts with an upper bound on the total cost and improves that cost upper bound every iteration.
Experiments show that the algorithm is able to compute plans with costs better than the initial costs, and in many cases it can compute plans whose cost matches the optimal cost.
Furthermore, the algorithm is able to prove the optimality of certain costs for a number of instances, some of which could not be proven optimal by the widely used LM-cut (Pommerening and Helmert 2012) planning heuristic.
Background and Notation
Let v (cid:55)→ b denote a maplet.
A mapping f : V → A from the set V to A is a set of maplets s.t.
if v (cid:55)→ a 1 ∈ f and v (cid:55)→ a 2 ∈ f , we have that a 1 = a 2 , v ∈ V , and a 1 .
We write D ( f ) to denote { v | ( v (cid:55)→ a ) ∈ f } , the domain of f .
We deﬁne f ( v ) to be a if v (cid:55)→ a ∈ f , and otherwise it is undeﬁned.
The composition of two mappings f and g , denoted as f ◦ g , is deﬁned as f ( g ( • )) .
In the rest of this paper, we use | • | to denote the cardinality of a set or the length of a list.
We consider planning problems where actions have costs.
Such problems are speciﬁed in terms of a factored transition system, which is a set of actions, an initial state, a goal, and a cost mapping that assigns costs to actions.
Deﬁnition 1 (States and Actions) .
A state, x , is a mapping from state-characterising propositions to Booleans, i.e. ⊥ or (cid:62) .
For states x 1 and x 2 , the union, x 1 (cid:93) x 2 , is deﬁned as { v (cid:55)→ b | v ∈ D ( x 1 ) ∪ D ( x 2 ) ∧ if v ∈ D ( x 1 ) then b
= x 1 ( v ) else b = x 2 ( v ) } .
Note that the state x 1 takes precedence.
An action is a pair of states, ( p, e ) , where p represents the preconditions and e represents the effects .
For action π
= ( p, e ) , the domain of that action is D ( π ) ≡
D ( p ) ∪ D ( e ) .
Deﬁnition 2 (Execution) .
When an action π (= ( p, e )) is executed at state x , it produces a successor state π ( x ) , formally deﬁned as π ( x ) =
if p (cid:42) x then x else e (cid:93) x .
We lift execution to lists of actions → π , so → π ( x ) denotes the state resulting from successively applying each action from → π in turn, starting at x .
We give examples of states and actions using sets of literals, where we denote the maplet a (cid:55)→ (cid:62) with the literal a and a (cid:55)→ ⊥ with the literal a .
For example, ( { a, b } , { c } ) is an action that if executed in a state where a is true and b is false, it sets c to true.
We also give examples of sequences, which we denote by the square brackets, e.g. [ a, b, c ] .
Deﬁnition 3 (Factored Transition System) .
A set of actions δ constitutes a factored transition system.
D ( δ ) denotes the domain of δ , which is the union of the domains of all the actions in δ .
Let set ( → π ) be the set of elements in → π .
The set of valid action sequences, δ ∗ , is { → π | set ( → π ) ⊆
δ } .
The set of valid states, U ( δ ) , is { x | D ( x ) =
D ( δ ) } .
v 1 vv 1 vv 1 v(a) v 1 vv 1 vv 1 vv 1 v(b) v 1 vv 1 vv 1 vv 1 v(c)
Example 1.
Consider the factored system δ ≡ { π 1 ≡ ( ∅ , { v 1 , v 2 } ) , π 2 ≡ ( ∅ , { v 1 , v 2 } ) , π 3 ≡ ( ∅ , { v 1 , v 2 } ) , π 4 ≡ ( ∅ , { v 1 , v 2 } ) } .
Figure 1a shows the state space of δ 1 , where different states deﬁned on the variables D ( δ 1 ) = { v 1 , v 2 } are shown.
Since every state can be reached via one action from every other state, the state space is a clique.
Deﬁnition 4 (Planning Problem) .
A planning problem Π is a tuple ( δ, C , I, G ) , where δ is a factored transition system,
I is a state s.t.
I ∈
U ( δ ) , G is a state s.t.
G ⊆ D ( δ ) , and C is a mapping from δ to N .
We refer to the different components of Π as Π .δ , Π .
C , Π .
I , and Π .
G , but when it is unambiguous we only use δ , C , I , and G .
A solution to Π is an action sequence → π ∈ δ ∗ s.t.
G ⊆
→ π ( I ) .
We deﬁne the mapping
C ∗ from δ ∗ to N s.t.
C ∗ ([]) ≡ 0 , and C ∗ ([ π 1 , π 2 , . . . ])
≡
C ( π 1 )+ C ∗ ([ π 2 , . . . ]) .
An optimal solution to Π is a solution → π s.t.
C ∗ ( → π ) ≤ C ∗ ( → π (cid:48) ) , for any other solution → π (cid:48) of Π .
For any mapping f from N to N , we denote by f ( Π ) the planning problem ( δ, f ◦ C , I, G )
Example 2.
Let C
= { π i
(cid:55)→ 1 | 1 ≤ i ≤ 4 } be a cost mapping.
A planning problem Π is ( δ 1 , C , { v 1 , v 2 } , { v 1 , v 2 } ) .
A solution for Π is [ π 2 , π 1 ] , where C ∗ ([ π 2 , π 1 ])
= 2 .
An optimal solution for Π is [ π 1 ] , where C ∗ ([ π 1 ])
= 1 .
Deﬁnition 5 (Completeness Threshold) .
A natural number
CT is a completeness threshold for planning problem Π iff for any solution → π of Π there is a solution → π (cid:48)
s.t.
| → π (cid:48) | ≤ CT and C ∗ ( → π (cid:48) )
≤ C ∗ ( → π ) .
An evident use for a completeness threshold is in methods for ﬁnding cost optimal plans based on compilation to constraints, where one would at most need to unfold the transition relation in the compilation as many times as a completeness threshold for the given problem.
There are multiple possible values that could act as completeness thresholds for a planning problem.
The following propositions characterise three such thresholds.
Proposition 1.
For any planning problem Π , 2 |D ( δ ) | − 1 is a completeness threshold for Π .
Proposition 2.
For any planning problem Π , if → π is a solution for the problem and if C ( π ) (cid:54) = 0 for every π ∈ δ , then (cid:98)C ∗ ( → π ) /c
min (cid:99) is a completeness threshold for Π , where c min denotes min π ∈ δ C ( π ) .
The two above completeness thresholds are either too loose to be of any practical use, or do not hold for planning problems in general.
In the next section we study tighter completeness thresholds for planning problems that can be used with more general planning problems.
Different Completeness Thresholds
As stated earlier, topological properties of the state space have been employed as completeness thresholds for planning and model checking.
In this section we study the suitability of different topological properties as completeness thresholds for planning.
The diameter
One such topological property is the diameter, suggested by
Biere et al. (1999), which is the length of the longest shortest path between any two states in the state space of a system.
Deﬁnition 6 (Diameter) .
The diameter, written d ( δ ) , is the length of the longest shortest action sequence, formally
[Equation]
Example 3.
For the transition system δ from Example 1, the diameter is 1 because any state can be reached from any other state with one action.
Note that if there is a valid action sequence between any two valid states of δ , then there is a valid action sequence between them is not longer than d ( δ ) .
Thus it is a completeness threshold for model checking of safety properties and satiscﬁcing planning.
There are many features of the diameter that would make it a practically viable completeness threshold.
First, it is the tightest topological property of state spaces that has been studied in the literature of model checking and planning, as far as we know.
Secondly, although the worstcase complexity of computing the diameter for a factored transition system, and succinct digraphs more generally, is Π P 2 -hard (Hemaspaandra et al. 2010), there are practical methods that can compositionally compute upper bounds on the diameter (Baumgartner, Kuehlmann, and Abraham 2002;
Rintanen and Gretton 2013; Abdulaziz, Gretton, and
Norrish 2015, 2017).
Unfortunately, nonetheless, the diameter is not a completeness threshold for cost optimal planning, as shown in the following example.
Example 4.
Consider the factored system δ ≡ { π 1 ≡ ( { v 1 , v 2 } , { v 1 , v 2 } ) , π≡ ( { v 1 , v 2 } , { v 1 , v 2 } ) , π≡ ( { v 1 , v 2 } , { v 1 , v 2 } ) } .
Consider the cost mapping C ≡ { π 1 (cid:55)→ 1 , π 2 (cid:55)→ 1 , π 3 (cid:55)→ 3 } where the transitions are labelled with the costs of the corresponding actions.
Consider a planning problem Π ≡ ( δ, C , { v 1 , v 2 } , { v 1 , v 2 } ) .
The diameter of that system is 1, but there is a plan of lengthwhose cost is less than any plan whose length is bounded by the diameter.
The recurrence diameter
Another topological property that has been used as a completeness threshold for different model checking problems is the recurrence diameter, which is the length of the longest transition sequence in the state space of a transition system that does not traverse the same state twice.
It was proposed by Biere et al. as a completeness threshold.
Deﬁnition 7 (Recurrence Diameter) .
Let distinct ( x, → π ) denote that all states traversed by executing → π at x are distinct states.
The recurrence diameter is the length of the longest simple path in the state space, formally
[Equation]
Example 5.
For the system δ from Example 1, the recurrence diameter is 3 as there are many paths with 3 actions in the state space that traverse distinct states, e.g. executing the action sequence [ π 1 , π 2 , π 3 ] at the state { v 1 , v 2 } traverses the distinct states [ { v 1 , v 2 } , { v 1 , v 2 } , { v 1 , v 2 } , { v 1 , v 2 } ] , and there are none that are longer than 3 transitions.
The recurrence diameter is a completeness threshold for
SAT-based planning and bounded model-checking of safety properties, as well as bounded model-checking of liveness properties, which was the original reason for its inception (Biere et al. 1999)
Note that in general the recurrence diameter is an upper bound on the diameter, and that it can be exponentially larger than the diameter (Biere et al. 1999).
However, it can still be exponentially smaller than the number of states in the state space, which could make it a practically useful completeness threshold.
Theorem 1.
For any planning problem Π , rd ( δ ) is a completeness threshold for Π .
Proof.
The proof depends on the following proposition.
Proposition 3.
For an action sequence → π ∈ δ ∗ , if distinct ( x, → π ) , then | → π | ≤ rd ( δ ) .
We now show that, given → π ∈ δ ∗ and a state x ∈ U ( δ ) , there is an action sequence → π (cid:48)
s.t.
C ∗ ( → π (cid:48) )
≤ C ∗ ( → π ) , | → π (cid:48) | ≤ rd ( δ ) , and → π ( x ) =
→ π (cid:48) ( x ) .
We do that by complete induction on → π .
The induction hypotheses would then state that there is such an → π (cid:48) that can be derived for each → π 0 , if | → π 0 | < | → π | .
If distinct ( x, → π ) holds, then the proof is ﬁnished by Proposition 3.
Otherwise, there are action sequences → π 1 , → π 2 , and → π 3 , s.t.
→ π 2 is not empty, → π = → π 1 (cid:95) → π 2 (cid:95) → π 3 , and → π 1 ( x ) =
→ π 1 (cid:95) → π 2 ( x ) , where (cid:95) denotes list appending.
Since → π ( x ) = → π 1 (cid:95) → π 3 ( x ) , the proof is ﬁnished by applying the induction hypothesis to → π 1 (cid:95) → π 3 .
A problem with using the recurrence diameter as a completeness threshold is that the complexity of computing it is NP-hard (Pardalos and Migdalas 2004) for explicitly represented digraphs, and that complexity is NEXP-hard (Papadimitriou and Yannakakis 1986) for succinctly represented digraphs, like STRIPS (Fikes and Nilsson 1971).
Practically, the existing methods to compute the recurrence diameter have a doubly exponential worst case running time (Kroening and Strichman 2003; Abdulaziz and Berger 2021), and they are only useful when applied to small abstractions in the context of compositionally computing upper bounds on other topological properties.
Furthermore, there is not a compositional algorithm that can compute upper bounds on the recurrence diameter using abstractions’ recurrence diameters (Abdulaziz 2017)[Chapter 3, Theorem 2].
Accordingly, due to this absence of a practical way to compute it or tightly bound it, the recurrence diameter cannot be practically used as a completeness threshold.
The traversal diameter
Another topological property that was studied in the literature is the traversal diameter which was introduced by Abdulaziz (2019).
The traversal diameter is one less than the largest number of states that could be traversed by any path.
Deﬁnition 8 (Traversal Diameter) .
Let ss ( x, → π ) be the set of states traversed by executing → π at x .
The traversal diameter is
[Equation]
Example 6.
Consider a factored system whose state space is shown in Figure 1b.
For this system, the traversal diamter and the recurence diameter are both 1 .
Consider another factored system whose state space is shown in Figure 1c.
For this system, the traversal diamter is 3 and the recurence diameter is 2 .
Abdulaziz (2019) showed that the traversal diameter is an upper bound on the recurrence diameter.
Since the traversal diameter is an upper bound on the recurrence diameter, it is thus a completeness threshold.
He also showed that it can be exponentially smaller than the number of states in the state space, and that it can be exponentially larger than the recurrence diameter.
Computing the traversal diameter can be done in a worst case running time that is linear in the size of the state space, which is exponentially better than the time needed to compute the recurrence diameter using the fastest existing methods.
Furthermore, the traversal diameter is compositionally bounded via partitioning the set of state variables: an upper bound on the traversal diameter is the product of the traversal diameters of the different projections of the problem’s factored transition system on each of the state variables equivalence classes.
Although the traversal diameter has the advantage of relatively easy computation with a compositional bounding method, the fact that the traversal diameter is bounded by multiplying all projection traversal diameters leads to computing bounds that are too loose to be of practical value.
The sublist diameter
Another topological property that can be used as a completeness threshold is the sublist diameter, deﬁned below.
Deﬁnition 9 (Sublist Diameter) .
A list → π (cid:48) is a sublist of → π , written → π (cid:48)
(cid:22)· → π , iff all the members of → π (cid:48) occur in the same order in → π .
The sublist diameter, (cid:96) ( δ ) , is the length of the longest shortest equivalent sublist to any action sequence → π ∈ δ ∗ starting at any state x ∈ U ( δ ) .
Formally, (cid:96) ( [Equation] =
[Equation]
Example 7.
Consider the factored system δ from Example 1.
For that system the sublist diameter is 1 since, for any → π ∈ δ ∗ , executing the last action in → π will reach the same state reached by executing δ .
The sublist diameter was ﬁrst conceived by Abdulaziz,
Gretton, and Norrish (2015) for theoretical purposes, where it was used to show that the diameter can be upper bounded by projections’ recurerrence diameters, if the projections were induced by an acyclic variable dependency graph.
The way they showed that by showing: (i) the sublist diameter is an upper bound on the diameter, (ii) the sublist diameter is a lower bound on the recurrence diameter, and, most importantly, (iii) that the sublist diameter can be upper bounded by projections’ sublist diameters.
Those three properties would make the sublist diameter a very appealing completeness threshold, since it is relatively tight and since it can be upper bounded practically via the existing compositional methods introduced by Abdulaziz et al..
The following theorem shows that the sublist diameter is indeed a completeness threshold.
Theorem 2.
For any planning problem Π , (cid:96) ( δ ) is a completeness threshold for Π .
Proof.
The proof depends on the following proposition.
Proposition 4.
For any δ , x ∈ U ( δ ) , and → π ∈ δ ∗ , there is a → π (cid:48) s.t.
→ π (cid:48) (cid:22)· → π , | → π (cid:48) | ≤ (cid:96) ( δ ) , and → π ( x ) =
→ π (cid:48) ( x ) .
Given a solution → π for Π , we obtain → π (cid:48) , which is the witness of Proposition 4.
Since → π (cid:48) (cid:22)· → π , we have that C ∗ ( → π (cid:48) ) ≤
C ∗ ( → π ) .
This ﬁnishes our proof.
The subset diameter
As we stated earlier, the sublist diameter has many advantages as completeness threshold.
In particular it is relatively tight and it has effective methods to compute upper bounds on it.
In this section we study how tight can a computed completeness threshold be.
Consider the following topological property.
Deﬁnition 10 (Subset Diameter) .
A list → π (cid:48) is a subset of → π , written → π (cid:48) ⊆
→ π , iff all the members of → π (cid:48) occur in → π .
The subset diameter, S ( δ ) , is the length of the longest shortest equivalent subset to any action sequence → π ∈ δ ∗ starting at any state x ∈ U ( δ ) .
Formally,
[Equation]
Example 8.
Consider the factored system { π
[Equation]
[Equation]
[Equation]
2 } ) , π 3 ≡ ( ∅ , { v 1 } ) } .
The sublist diameter of this system is 3, because there is not a sublist of the action sequence [ π 1 , π 2 , π 3 ] that can reach the state { v 1 , v 2 , v 3 } from { v 1 , v 2 , v 3 } .
On the other hand, the subset diameter of this system is 2, since [ π 2 , π 1 ] is a subset of [ π 1 , π 2 , π 3 ] that can reach { v 1 , v 2 , v 3 } from { v 1 , v 2 , v 3 } .
It should be clear that the following holds.
Proposition 5.
For any δ , d ( δ ) ≤ S ( δ ) ≤ (cid:96) ( δ ) .
Furthermore, using an argument similar to the one used to prove Theorem 4, we have the following.
Theorem 3.
For any planning problem Π , S ( δ ) is a completeness threshold for Π .
More interestingly, we show that the subset diameter is the smallest completeness threshold that can be computed for a planning problem, if the action costs and the initial and goal states are not taken into consideration.
Theorem 4.
For any factored transition system δ , there is a planning problem Π s.t.
Π .δ =
δ and there is a solution → π for Π s.t.
| → π | = S ( δ ) and for any solution → π (cid:48) , if | → π (cid:48)
| < | → π | , then C ∗ ( → π (cid:48) )
> C ∗ ( → π ) .
Proof.
Our proof depends on the following proposition.
Proposition 6.
For any factored transition system δ , there is a state x ∈ U ( δ ) and an action sequence → π ∈ δ ∗ s.t.
| → π | = S ( δ ) and there is not any action sequence → π (cid:48) s.t.
→ π (cid:48) ⊆
→ π and → π ( x ) = → π (cid:48)
( x ) and | → π (cid:48) | < | → π | .
Obtain a state x 0 and an action sequence → π 0 that are the witnesses for Proposition 6.
Let C ≡ { π (cid:55)→
| π ∈ → π 0 } ∪ { π (cid:55)→ 1 | π (cid:54)∈ → π 0 } .
We now construct the required planning problem Π by letting x 0 be its initial state, → π ( x 0 ) be its goal, δ be its factored transition system and C be its cost function.
It should be clear that → π 0 is a plan for Π .
Since x 0 and → π 0 are the witnesses of Proposition 6, we have that any solution → π (cid:48) for Π that is shorter than → π 0 will have at least an action not from → π 0 .
Accordingly, we have that C ∗ ( → π 0 ) <
1 ≤ C ∗ ( → π (cid:48) ) , which ﬁnishes our proof.
In this section we primarily focused on the theoretical limit on the tightness of the completeness thresholds and thus devised the subset diameter and showed that it is the tightest.
We did not consider on whether the subset diameter can be computed or approximated.
Proposition 5 shows that we can use the same methods to bound from Abdulaziz et al.
to compute a bound on the subset diameter.
However, as shown in Example 8, the subset diameter can be strictly smaller than the sublist diameter, so an interesting open question is whether there is an exponential separation between them, i.e. whether there is a class of factored systems whose subset diameters are exponentially smaller than their sublist diameters.
If this were true, an interesting question is whether there are methods to bound or compute the subset diameter that can exploit this tightness.
Note also that Theorem 4 does not rule out the possibility that a completeness threshold signiﬁcantly tighter than the subset diameter could be computed if the initial state, goal, or cost function are taken as input to the function that computes the completeness threshold.
Theorem 4 merely shows the tightness limit on completeness thresholds that can be computed only the factored transition system underlying the planning problem.
A SAT-Encoding for Planning with Costs
To experimentally test the above completeness thresholds, we devise a simple SAT-based encoding of planning with action costs.
The core idea of this encoding is to embed action costs into the transition relation by compiling them to their binary representation, effectively keeping track of the plan cost as a part of the state.
Consider the following compilation of a factored system.
Deﬁnition 11 (Augmented System) .
Let, for a natural number n , D n denote the indexed set of state variable { u 1 , u 2 , . . .
, u (cid:100) log n (cid:101) } .
Let x ni denote the state deﬁned by assigning all the state variables D n , s.t.
their assignments binary encode the natural number i , where the index of each variable from D n represents its endianess.
Note: x ni is well deﬁned for 0 ≤ i ≤ 2 (cid:100) log n (cid:101) − 1 .
For an action π , natural numbers C , c , and i , the augmented action π Ci,c , is deﬁned as ( p (cid:93) x
Ci , e (cid:93) x
Ci + c ) .
For a factored system δ , a natural number C , and a function f mapping elements of δ to natural numbers, the augmented factored system δ Cf is deﬁned as { π C i,f ( π ) | π ∈ δ ∧ 0 ≤ i ≤ C − f ( π ) } .
Intuitively, interpreting the function f as a cost function for actions, the augmented factored system is a cost bounded version of the given system, where paths can have at most cost C .
This is shown in the following example.
Example 9.
Consider the factored system and the cost function from Example 4.
The augmented system δ 2 C would be { ( { v 1 , v 2 , u 1 , u 2 } , { v 1 , v 2 , u 1 , u 2 } ) , ( { v 1 , v 2 , u 1 , u 2 } , { v 1 , v 2 , u 1 , u 2 } ) , ( { v 1 , v 2 , u 1 , u 2 } , { v 1 , v 2 , u 1 , u 2 } ) , ( { v 1 , v 2 , u 1 , u 2 } , { v 1 , v 2 , u 1 , u 2 } ) } .
Note that the factored system in the above example will only have paths that, when mapped to the original system, will have a cost of at most 2.
Indeed, we have the following theorem that shows how searching for an action sequence whose cost is bounded can be done by searching for any action sequence.
Theorem 5.
For a system δ , a mapping C from δ to natural numbers, states x, x (cid:48)
∈ U ( δ ) , and natural numbers l and i , there is an action sequence → π ∈ δ ∗ s.t.
C ∗ ( → π ) ≤ C , | → π | = l , and x (cid:48) ⊆
→ π ( x ) iff there is an action sequence → π C ∈ δ C C ∗ s.t.
| → π C | = l , and x (cid:48) ⊆
→ π C ( x (cid:93) x C
+ i i )
Proof.
( ⇒ )
We prove this by induction on → π .
The base case is trivial.
The step case states that → π = [ π ] (cid:95) → π 0 , and the induction hypothesis states that the theorem statement applies to → π 0 .
Accordingly, we can obtain an action sequence → π C by applying the induction hypothesis, after substituting π ( x ) for x , → π ( x ) for x (cid:48) , | → π 0 | for l , C − C ( π ) for C , and
C ( π ) for i , s.t.
→ π C ∈ δ C C ∗ , | → π C | = | → π 0 | , and → π ( x ) ⊆
→ π C ( π ( x ) (cid:93) x C C ( π ) ) .
Since π ( x ) (cid:93) x C C ( π ) =
π C 0 , C ( π ) ( x (cid:93) x C 0 ) , we have our proof.
( ⇐ ) Before we prove this direction, let x (cid:23) vs denote the projection of a state on a set of variables vs , i.e. { v (cid:55)→ b | v ∈ vs } ∩ x .
Our proof for this direction of the theorem statement is by induction on → π C .
Again, the base case is
[Table]
trivial.
The step case states that → π C =
[ π ] (cid:95)
→ π 0 , and the induction hypothesis states that the theorem statement applies to → π 0 .
Note that there is an action π (cid:
) ∈
δ s.t.
π = π
(cid:48)
C
+ i
i, C ( π ) .
We can obtain an action sequence → π by applying the induction hypothesis, after substituting π (cid:48)
( x ) for x , → π C ( x ) (cid:23) D ( δ ) for x (cid:48) , | → π 0 | for l , C − C ( π (cid:48) ) for C , and C ( π (cid:48) )
for i , s.t.
→ π ∈ δ ∗ , | → π | = | → π 0 | , C ∗ ( → π ) ≤ C − C ( π (cid:48) ) and → π ( x ) ⊆
→ π C ( π ( x ) (cid:93) x C C ( π ) ) .
Since π (cid:48) ( x ) (cid:93) x C C
( π ) =
π ( x (cid:93) x C 0 ) , we have our proof.
The theorem above enables solving a bounded cost planning problem with satisﬁcing planning methods.
Deﬁnition 12 (Augmented Problem) .
For a planning problem Π , a natural number C , the augmented planning problem Π C is deﬁned as ( δ C C , C , I (cid:93) x
C 0 , G ) .
Corollary 1.
For a system Π and a natural number l , there is a solution → π for Π s.t.
C ∗ ( → π ) ≤ C and | → π | = l iff there is a solution → π C for Π C s.t.
| → π C | = l .
Any-Time SAT-Based Optimal Planning
To ﬁnd an optimal plan, we need to iteratively decrement the cost bound until no plan is found.
A challenge to doing that is that the size of the augmented system is a factor of
C larger than the original system, where C is the cost upper bound.
One way to circumvent this size increase employs the following proposition.
Proposition 7.
For a set of natural numbers N , let gcd( N ) denote their greatest common divisor.
For a planning problem Π let gcd( Π ) denote gcd( {C ( π ) | π ∈ δ } ) .
An action sequence → π is a solution for Π with cost C iff → π is a solution for Π / gcd( Π ) with cost (cid:98)
C/ gcd( Π ) (cid:99) .
Using the above proposition to scale down the action cost bound dramatically limits the blow up in the size of the augmented factored systems for many domains.
Another way to limit the size of the augmented factored system is by factoring the actions of the augmented system.
Algorithm 1 is the overall algorithm that we use.
It is an any time algorithm that, given an initial plan, computes plans with improving costs until the optimal cost is reached.
That algorithm assumes that there is a SAT-based procedure solve that computes a satisﬁscing plan, given a planning problem and a horizon.
It also assumes that there is a procedure factor that factors actions in a planning problem, i.e. if there are two actions π 1 and π 2 s.t.
π
= ( { v } ∪ p, e ) and π 2 = ( { v } ∪ p, e ) in δ , both of the actions are removed and replaced by ( p, e ) , where this is greedily done until a ﬁxed point is reached.
Lastly, it also uses a function to compute the completeness threshold with every iteration since the completeness threshold might change depending on the current plan cost if the problem has no 0-cost actions (Proposition 2).
That function is speciﬁed in the following corollary.
Corollary 2.
For a planning problem Π and a solution → π for Π , let CT ( → π, Π ) be (cid:98)C ∗ ( → π ) /c
min (cid:99)
if C ( π ) (cid:54) =
for every π ∈ δ , and (cid:96) ( δ ) otherwise.
A completeness threshold for Π is CT ( → π, Π ) .
→ π (cid:48) :
=
→ π while → π (cid:48) (cid:54) =
none → π :=
→ π (cid:48) Π (cid:48) :
= factor (( Π / gcd( Π ))
(cid:98)C ∗ ( → π ) − 1 / gcd( Π ) (cid:99) )
→ π (cid:48) :
= solve ( Π (cid:48) , CT ( → π, Π )) return → π
Experimental Evaluation
We experimentally test Algorithm 1 to investigate its ability to (i) ﬁnd plans with better costs than the initial plan, (ii) ﬁnd plans with optimal costs, and (iii) show that a plan is an optimal plan.
We implement the function solve by computing the SAT encoding using the SAT-based planner
Madagascar (Rintanen, Heljanko, and Niemelä 2006), where we try the three different possible encodings computed by
Madagascar: the sequential, the ∀ -step, and the ∃ -step encodings.
To solve the formulae resulting from these encodings, we use the SAT solver of Madagascar and the state-ofthe-art SAT solver Kissat (Biere et al. 2020).
Furthermore, we use Kissat’s two conﬁgurations: SAT and UNSAT, and we run the experiments once with adding symmetry breaking clauses using the tool BreakId (Devriendt et al. 2016) and once without them.
The initial plans are computed by the planner Fast Downward (Helmert 2006) with the FF heuristic (Hoffmann and Nebel 2001).
To compute completeness threshold when there are actions with 0-cost, instead of computing the sublist diameter, we use upper bounds computed using previously published methods (Abdulaziz, Gretton, and Norrish 2017; Abdulaziz 2019; Abdulaziz and Berger 2021).
The initial plan computation, completeness threshold computation, and the execution of Algorithm 1 are given 1800s timeout and 4GB memory limit.
As a baseline, we use Fast Downward with the LM-cut heuristic (Pommerening and Helmert 2012) to compute optimal plans, with the same time and memory limits.
We try all methods on standard planning benchmarks from previous instances of the
International Planning Competition.
Table 1 shows the coverage of the different conﬁgurations of SAT encoding and SAT solving.
It shows that none of the conﬁgurations is consistently the best in all domains, whether in terms of proving optimality, or improving the initial cost.
Nonetheless, it seems that conﬁgurations using
Kissat as a SAT solver outperform the conﬁgurations where
Madagascar’s SAT solver in more domains.
Also it seems that the different conﬁgurations are complementary to each other within each of the domains, which is why the total number of solved instances is better than the number of instances solved by any individual conﬁguration in 10 domains out of 16.
Another point to note is that, overall, Algorithm 1 proves optimality for less problems than Fast Downward with the
LM-cut heuristic.
Interestingly, nonetheless, Algorithm 1 is able to prove optimality on instances on which LM-cut fails like in NoMystery, Hiking, Transport, Visitall, Scanalyzer, and Maintenance.
We note that all of these domains have no 0-cost actions.
Furthermore, Algorithm 1 is able to compute plans with costs that match those computed using LM-cut, but without being able to prove that these are the optimal costs.
This is the case in Logistics, Rover, Zeno, Satellite,
Scanalyzer, and TidyBot.
To get a more ﬁne-grained view of the quality of computed plans, the plot in Figure 2 shows the cost of the cheapest plan computed by all of the conﬁgurations and compares it to the cost of the initial plan.
In this plot, we have restricted ourselves to problems where the initial bound was at most 100 to preserve readability of the plots.
The problems shown in that ﬁgure show that the costs are signiﬁcantly improved for many of the domains.
Discussion
In this work we have investigated different completeness thresholds for cost optimal planning.
These completeness thresholds enable more applicability of SAT-based planning techniques to cost optimal planning, in particular to problems that have actions with cost 0.
We devised a simple
SAT-based technique that effectively operates by compiling away action costs into action effects.
Experimental results using our method show reasonable performance.
Although its coverage is less than state-of-the-art A* based optimal planners, using SAT-based techniques for cost optimal planning problems has multiple advantages.
E.g. it is very easy to obtain a certiﬁcate of optimality if the SAT solver proves a certain cost is optimal, which is a problem that recently attracted attention (Eriksson, Röger, and Helmert 2017).
Also, it can be easily adapted to generating different plans with the same cost, namely, by adding constraints to the SATencoding that prohibit a given plan, which is another inter- esting problem (Katz et al. 2018).
There are multiple interesting future directions in which this work can be further pursued.
First the upper bounds could be improved by either incorporating the action costs, initial state, or goal.
Another interesting problem is to ﬁnd whether there is an exponential separation between the subset diameter and sublist diameter and, if there is one, investigating methods to compute or bound the subset diameter.
The encoding can also be improved by employing approximate methods when compiling the costs, e g. the method by Hoffmann et al.
(2007) could be adapted to compilingout costs.
Also, since our experiments show that the different combinations of SAT-encoding and SAT solving are complementary a portfolio approach can be used to optimise the used combination for different instances.