Domain Reduction: Sound and Incomplete Constraint Satisfaction (with Respect to Unsatis ability) Robert Schrag
Department of Computer Sciences, Applied Research Laboratories University of Texas at Austin
Daniel Miranker
Department of Computer Sciences University of Texas at Austin
[email protected]
[email protected]
Abstract
We develop a constraint satifaction procedure that is sound and incomplete with respect to unsatisi ability; i.e., the procedure returns the values \unsatis able" or \don'tknow." The method exploits a many-to-one mapping of domain values, termed \domain reduction," with concomitant reduction in worst-case time complexity. We believe the method may become an important complement to existing procedures which are sound and incomplete with respect to satis ability. Formal development and our experiments with randomly generated problems suggest that domain reduction is most promising when input domains are large and constraints are sparse in terms of the number of tuples they allow. These results are encouraging, particularly in the context of database applications and anytime reasoning where domain sizes are extremely large. We suggest new experiments to investigate eectiveness on CSPs with domain sizes beyond the scope of our current implementation of an underlying sound and complete CSP algorithm.
Introduction
A constraint satisfaction problem (CSP) algorithm is sound if every solution it returns is indeed a solution; a CSP algorithm is complete if it always will return a solution when one exists. Consider a nite-domain CSP [Mackworth, 1992] with n variables fx1; x2; : : :; xng, all ranging over a common domain (chosen for simplicity) of d values V = fv1; v2; : : :; vd g, and m binary constraints. The constraints are de ned as sets of allowed tuples. A solution to the CSP assigns a value to every variable such that the corresponding tuple is allowed by every constraint. The worst-case time complexity of a sound
Corresponding author.
and complete algorithm for nding one solution to the CSP is O(dn ). Many techniques exist for solving CSPs as eciently as possible, but no sound and complete algorithm improves on this worst-case complexity; this can be done only by sacri cing soundness or completeness. There exists a number of procedures for solving CSPs which are sound and incomplete with respect to satis ability | any solution they return is a valid solution, but they may not nd a solution when it exists. These include local search procedures such as GSAT [Selman et al., 1992] (or direct CSP versions described by Tsang requiring no propositional encoding [1993]), Crawford and Baker's Isamp solution sampling method [1994], and others. Such procedures are attractive, because frequently they can return a solution for a satis able CSP when sound and complete methods are too expensive. The incompleteness of these procedures leaves the satis ability question for many satis able instances | and all unsatis able instances | unanswered. We believe it would be useful to have some members in the complementary family of procedures which are sound and incomplete with respect to unsatis ability | any report they make that a CSP is unsatis able is valid, but they may not be able to report anything, even when a CSP is unsatis able.1 A member procedure from either family could be tried rst; if that result were equivocal then a procedure from the complementary family could be invoked. Ultimately many CSPs with unknown satis ability would remain, but some whose satis ability still was in question after applying sound and incomplete procedures from only one family could be determined. We introduce a new approach which transforms an input CSP using a many-to-one mapping to reduce the size of its variable domains by a constant factor
; the new domain size is d0 = bd= c. For simplicity of presentation, we assume that is an integer which 1 When such a procedure goes ahead and reports satis ability anyway, we call it \complete and unsound." (See, e.g., [Dean and Boddy, 1988b] .)
evenly divides d0 . We show that the reduced CSP is unsatis able only if the original CSP is. We use a sound and complete algorithm on the reduced problem. Thus, our sound and incomplete method for determining unsatis ability, which we call \domain reduction," runs in worst-case time O(d0n), leading to a savings factor of O( n ) compared to sound and complete algorithms. If d and are large, this savings can be signi cant.
More Preliminaries
Our many-to-one mapping is a function f : V ! V 0 . We apply this mapping as follows. For any tuple t = (v1 ; v2), its reduction is f(t) = (f(v1 ); f(v2 )). For any constraint relation R, its reduction f(R) is the union of the reduction of its tuples; and for any CSP instance I, its reduction f(I) is the set of the reductions of its constraints. An \assignment" is a pairing of a variable x and a domain value v: v=x. For any assignment = v=x, its reduction f() = f(v)=x. An \assignment set" is a set of assignments which mentions any given variable no more than once. For any assignment set , its reduction is the set of the reductions of its members: f() = f : = f( 2 )g. For any set of assignment sets , its reduction is the set of the reductions of its members: f() = f : = f( 2 )g. Theorem: If a reduced instance f(I) is unsatis able, then the original instance I also is unsatis able. For any relation R in I, if a tuple t 2 R, then f(t) 2 f(R). Let P be?1the pre-image of a tuple u 2 f(R) (that is, P is f (u) | the set of possible tuples in R which map to u 2 f(R)). It is necessary only that some member of P be in R; that is, f(R) is more general, or more permissive, than R. From this it should be obvious that f(I) is unsatis able only if I is unsatis able. We also oer the following proof. Proof: Consider the lattice G formed by assignment sets for variables in I, using the partial order of assignment set containment. In this lattice, we de ne the \lower shadow" L of an assignment set to be the set of all assignment sets which contain : L() = f : g. We de ne the lower shadow of a set of assignment sets to be the union ofSthe lower shadows of each member set: L() = 2 L(). Populate the lattice with the set K of assignment sets corresponding to tuples disallowed by any constraint in I. Let L(K) be the lower shadow of K in G. For f(I), the lattice is f(G), and the set of disallowed assignment sets is K 0 f(K), with lower shadow L(f(K 0 )). In eect, our mapping prefers allowed tuples (not disallowed ones) whenever0 several possible tuples map to the same value in V . Now, if an assignment ?set 2 L(K 0 ) then for all assign1 ment sets 2 f (), 2 L(f(K)). Call the assignment sets corresponding to the disallowed tuples and those in their lower shadow \dark." A CSP is unsatis able i all of the assignment sets of length n
are dark. Clearly, if all assignment sets of length n in f(G) are dark (and f(I) is unsatis able), then also all assignment sets of length n in G are dark (and I is unsatis able). 2 Under such a mapping, it is very easy for any constraint to reduce to the \universal" relation (i.e., no constraint at all). Thus, our domain reduction method is likely to return a positive indication of unsatis ability only when constraint relations are quite sparse | allow only a few tuples. Combining this with our observation about the relative complexity of solving the reduced problem, our overall method is likely to oer the most leverage when constraints are sparse and domains and the reduction factor are large. It may be eective for query processing in relational data bases, where domain sizes are extremely large and constraints have a mixture of sparsenesses.
Experiments
In order to evaluate the domain reduction method, we used CSPs from a random generator parameterized by n (number of variables), d (size of common domain), m (number of binary constraints), and q (number of tuples allowed per constraint). It is well-known that in such random distributions there is a fairly sharp transition from under-constrained problems which are almost all satis able to overconstrained problems which are almost all unsatis able [Cheeseman et al., 1991, Williams and Hogg, 1992]. We avoided the under-constrained region, and whenever we happened to generate a satis able instance we discarded it and generated another instance in its place, so that all of our experimental problems were unsatis able. We constructed our mappings to have a uniform number of V 0 values per V value, in order to minimize the overall probability of an allowed tuple dominating an unallowed tuple (i.e., the mappings are favorable to the success of our technique). We processed the generated and reduced problems using an implementation of FC/DVO/CBJ (that is, backtracking search with forward checking, dynamic variable ordering, and con ict-directed backjumping) [Prosser, 1993], and we counted constraint checks as an implementation-independent measure of processing time. We did not attempt to gure in time to perform the mappings. We can generate the mappings in time linear in d. Given the sparseness of constraints and domain sizes for which we expect the technique to work, a \sparse representation" including only the allowed tuples is warranted. Then we can apply the mappings in time linear in the number of allowed tuples, q. The results of our experiments are reported in the following graphs. In addition to n, d, q, , and m, we report the following evaluation measures. m50% is the approximate m value at which 50% of the instances generated for the given values of n, d, and q are satis able (see Figure 1). The re-
lationship between m50% and the actual m value which we use in each case gives an indication of how far into the over-constrained region we are generating the (unreduced) instances. Unsat.0 is the fraction of randomly generated the instances which our method was able to prove unsatis able, after domain reduction. Checks is the mean number of constraint checks on the generated instances. Checks0 is the mean number of constraint checks performed on reduced instances. In each case, we generated 100 separate instances per set of parameter values. We chose d and such that d0 2, because otherwise no disjunction | from choices among tuples | remains in the problem. (As it is, sparse-constraint (small q) problems are exceptionally easy compared to other problems with the same n, d, and m values.) Our rst set of results in Figure 2 shows that if the number of tuples allowed is held constant at q = 2 then domain reduction can be highly successful: Unsat0 is still high, and Checks grows much faster than Checks0 . This suggests that we might be able to obtain practically arbitrary speed-ups for such restricted problems, if the success rates for large do not fall o too fast. Note that m = 4m50% here, so that these problems are well into the over-constrained region. The results in Figures 3, 4, and 5 each show the eect of increasing q for xed n and d. Also, in Figure 3, we use m = 4m50%; in Figure 4, m = 2m50%; in Figure 5, m = m50% ; so that in the successive graphs we shift from the over-constrained region into the transition region. Figure 3 makes it clear that domain reduction is not always eective when and q are both large. Figures 4, and 5 show that as we move from the over-constrained region into the transition region, domain reduction's success rate drops o noticeably, but not dramatically. As the method becomes less successful, it also becomes less costly; this is to be expected, since satis able (reduced) CSPs generally are easier than unsatis able (reduced) CSPs. The reduced problems occasionally require a few more constraint checks to solve than the unreduced problems (as in Figure 4 for q = 16), but they also can require many times fewer (as in Figure 2).
Unsat.’ d=4
1.00
d=8 0.90
d=16 d=32
0.80 0.70 0.60 0.50 0.40 0.30 0.20 0.10 0.00
gamma 2
5
1e+01
Checks’/Checks d=4
7
d=8 5
d=16 d=32
3 2 1.5 1e-01 7 5
3 gamma
n = 100, q = 2: n = 100, d = 16:
d 4 8 m50% 12 8 q 2 4 m50% 7 10
16 7 8 19
32 6 16 37
Figure 1: Experimentally determined approximate values of m50% .
2
5
1e+01
Figure 2: Success rates and costs for experiments with n = 100, q = 2, and m = 4m50% .
Unsat.’
Unsat.’ q=2
1.00
q=2
1.00
q=4 0.90
q=8 q=16
0.80
q=4 0.90
q=16
0.80
0.70
0.70
0.60
0.60
0.50
0.50
0.40
0.40
0.30
0.30
0.20
0.20
0.10
0.10
0.00
q=8
0.00 gamma 2
3
5
gamma
7
2
Checks’/Checks
3
5
7
Checks’/Checks q=2
8
q=4
q=2 q=4
1e+00
q=8 6
q=16
q=8 q=16
7
5 5
4
4 3 3
2.5 2
2
1.5
1.5
1e-01
1e-01 8
gamma 2
3
5
7
Figure 3: Success rates and costs for experiments with n = 100, d = 16, and m = 4m50%.
gamma 2
3
5
7
Figure 4: Success rates and costs for experiments with n = 100, d = 16, and m = 2m50% .
Discussion
Unsat.’ q=2
1.00
q=4 0.90
q=8 q=16
0.80 0.70 0.60 0.50 0.40 0.30 0.20 0.10 0.00
gamma 2
3
5
7
Checks’/Checks q=2
5
q=4
4
q=8 q=16
3
2 1.5
1e-01
7
5
gamma 2
3
5
7
Figure 5: Success rates and costs for experiments with n = 100, d = 16, and m = m50% .
One of the questions we had before undertaking the experiments above was whether, or for what range of problems, we would see an actual performance advantage for reduced problems when domain reduction is successful | even given the worst-case complexity advantage. We transform a more constrained, unsatis able problem to a less constrained, unsatis able problem. This means that we are going from a region of lesser diculty in a distribution which is generally harder to a region of greater diculty in a distribution which is generally easier [Mitchell et al., 1992]. Which eect would dominate? The experiments show that there de nitely are regions where the technique is more successful; dramatic, order-ofmagnitude, gains in eciency can occur when the domain size is large and constraints are sparse. Given large domains, the reduced problems are easiest to process when is large and d0 is small. Smaller values of , give greater chances for success. We think this set of circumstances presents an ideal opportunity for the application of an \anytime" algorithm [Dean and Boddy, 1988a, Boddy and Dean, 1994] for real-time situations. E.g., start with a small value for , and in successive applications double it until a deadline for response is reached. In each application, we are spending more time but also getting a higher probability of success; these are nice properties for an anytime algorithm. Of course, many (if not all) procedures which are sound and incomplete with respect to satis ability | as well as procedures which are sound and complete | may be used complementarily in an anytime fashion. It may seem that we might improve our chances for determining unsatis ability by invoking our method many times against the same CSP using independent mappings, until successful. However, in many experiments in which we allowed up to 10 separate mappings per generated instance, we found no cases where any of these mappings beyond the rst one was eective. We suspect that there may be narrow regions in the reduced distributions where such extra mappings are eective and that we just haven't found one. We have presented our method in terms of binary constraints over variables with a common domain, but constraints of arbitrary arity over variables with heterogenous domains also are technically amenable to domain reduction, though its eectiveness with respect to these must be addressed separately. In the experiments, we used arti cial problems to which our method is most ideally suited. Exactly such problems may not arise in practice, but some naturally occurring problems may have very sparse constraints over variables with large domains which can be reduced. If there are enough such constraints, then domain reduction could be worthwhile. One area where we think it might be especially fruitful is in query processing for relational data bases.
Future Work There are two kinds of experiments which we would have liked to carried out but were prevented from doing so by a limitation of our current constraint satisfaction algorithm implementation: the matrix data structure the implementation uses to represent constraints requires O(d2 ) space. We want to experiment with CSPs that have extremely large variable domains and constraints which are sparse in tuples, so it makes sense for us to adopt a \sparse-matrix" representation of constraints which requires only O(q) space. When we do this, it will allow us to experiment with much larger variable domains and answer the following questions. 1. Can domain reduction de nitively establish unsatis ability for some signi cant problems which are beyond the reach of sound and complete algorithms? In our experiments, we always were able to solve all the problems we generated using a sound and complete algorithm. It appears (from Figure 2, e.g.) that domain reduction may be capable of this when domain sizes are very large and constraints remain sparse. If so, then it will stand as a useful member of the family of constraint satisfaction procedures which are sound and incomplete with respect to unsatis ability (in fact, the only member we know of). 2. Can domain reduction be eective in data base query procecssing? In some data base monitoring applications which we are interested in, d = O(103 ), n = O(10), and q is highly variable. Further experimentation will show whether their characteristics make these applications will good candidates for processing using domain reduction. These are real-time applications, so they also would be a good place to try using it in an anytime fashion. We have said nothing yet about the direct analog to our method which is sound and incomplete with respect to satis ability. Suppose that instead of allowing a tuple in the reduced problem if some mapped possible tuple in the original problem were allowed, we allowed the reduced tuple only if every mapped tuple in the original problem were allowed. Then the original problem is satis able if the reduced problem is (proof omitted). We get the same kind of complexity reduction, and the complementary method is likely to be successful when constraints are dense | disallow few tuples | and is large. We are con dent that such a method would work under appropriate circumstances. Our main question is whether it would be competetive with existing procedures which also are sound and incomplete with respect to satis ability.
Related Work
The playing o of two complementary, sound and incomplete reasoning strategies is echoed in several approaches to tractable reasoning, including temporal reasoning projection [Dean and Boddy, 1988b, Schrag et al., 1992] and knowledge compilation for propositional theories [Selman and Kautz, 1991, Kautz and Selman, 1994, Dalal and Etherington, 1992]. The knowledge compilation approaches are closest to our method. Propositional theories are a degenerate case of CSP, and they can be used to encode CSPs. However, these typically incur a signi cant amount of computational overhead (equivalent to solving the input theory many times) which must be amortized over a large number of anticipated queries. As such, they are not appropriate for speeding solution of new, previously unseen theories. In contrast, our approach uses a simple, linear-time transformation which always leads to a smaller CSP, which usually should be easier to solve. On the other hand, our method is not applicable to propositional theories, since their variable domain size, d = 2, is already as small as it can be. Besides these knowledge compilation approaches, we know of no other CSP procedures which are sound and incomplete with respect to unsatis ability. There is an obvious correspondance between our method and the hierarchical knowledge bases of Borgida and Etherington [1989], much like the one pointed out by Dalal and Etherington [1992] with respect to their framework. For a given variable x, consider the (one-level) hierarchy that results from placing elements of the original domain V at0 the leaves and elements from the reduced domain V at the next level up. Then add axioms of the sort vi ! f(vi ) to a propositional encoding of the CSP. This work also is related to other reasoning approaches that use abstractions, such as Mohan's hierarchical approach to constraint satisfaction [Mohan, 1991]. Our experiments may help shed some light on when solving an abstract version of the CSP will be bene cial.
Conclusion
We have presented \domain reduction," a new constraint satisfaction procedure which is sound and incomplete with respect to unsatis ability. We showed that the worst-case time complexity of processing a reduced problem is exponentially less than that for the original problem. This theoretical argument and our experiments with randomly generated problems suggest that domain reduction is most promising when input domains are large and constraints are sparse in terms of the number of tuples they allow. These rst results are encouraging, and we suggest new experiments to investigate its eectiveness on CSPs with domain sizes larger than our current implementation of the underlying sound and complete
CSP algorithm will allow. We are particularly interested in examining its utility in conjunctive query processing for relational data bases, where domain sizes are extremely large, especially in real-time monitoring situations, where an anytime domain reduction algorithm may be appropriate. This is the rst constraint satisfaction procedure we are aware of which is sound and incomplete with respect to unsatis ability. Unlike the sound and incomplete procedures which are used in most knowledge compilation approaches, domain reduction is competitive in eciency on problems with previously unseen characteristics, and no pre-processing or amortization thereof is required. Domain reduction has similarities with hierarchical constraint satisfaction methods, but it does not require that a hierarchy be captured in advance through a knowledge engineering process. We believe that domain reduction may become an important complement to existing procedures which are sound and incomplete with respect to satis ability in solving problems which are beyond the reach of any sound and complete methods, but more experiments are still necessary to bear this out.
Acknowledgement
We thank Roberto Bayardo for his implementation of the FC/DVO/CBJ constraint satisfaction algorithm and for assistance with using it.
References
[Boddy and Dean, 1994] Boddy, Mark and Dean, Thomas 1994. Deliberation scheduling for problem solving in time-constrained environments. Arti cial Intelligence 67(2):245{285. [Borgida and Etherington, 1989] Borgida, Alex and Etherington, David 1989. Hierarchical knowledge bases and ecient disjunctive reasoning. In Principles of Knowledge Representation and Reasoning: Proceedings of the First International Conference (KR'89). 33{43. [Cheeseman et al., 1991] Cheeseman, Peter; Kanef-
[Dean and Boddy, 1988a] Dean, Thomas and Boddy, Mark 1988a. An analysis of time-dependent planning. In Proceedings AAAI-88 Seventh National Conference on Arti cial Intelligence. 49{54. [Dean and Boddy, 1988b] Dean, Thomas and Boddy, Mark 1988b. Reasoning about partially ordered events. Arti cial Intelligence 36(3):375{399. [Kautz and Selman, 1994] Kautz, Henry and Selman, Bart 1994. An empirical evaluation of knowledge compilation by theory approximation. In Proceedings of the Twelfth National Conference on Arti cial Intelligence (AAAI-94). 155{161.
[Mackworth, 1992] Mackworth, Alan 1992. Constraint satisfaction. In Shapiro, Stuart, editor 1992, Encyclopedia of Arti cial Intelligence. Wiley. 285{ 293. [Mitchell et al., 1992] Mitchell, David; Selman, Bart; and Levesque, Hector 1992. Hard and easy distributions of SAT problems. In Proceedings of the Tenth National Conference on Arti cial Intelligence (AAAI-92). 459{465.
[Mohan, 1991] Mohan, Sunil 1991. Constructing hierarchical solvers for functional constraint satisfaction problems. In Working Notes, AAAI Spring Symposium on Constraint-Based Reasoning, Stanford University, Palo Alto, CA. 147{153. [Prosser, 1993] Prosser, Patrick 1993. Hybrid algorithms for the constraint satisfaction problem. Computational Intelligence 9(3):268{299. [Schrag et al., 1992] Schrag, Robert; Boddy, Mark; and Carcio ni, Jim 1992. Managing disjunction for practical temporal reasoning. In Nebel, Bernhard; Rich, Charles; and Swartout, William, editors 1992, Principles of Knowledge Representation and Reasoning: Proceedings of the Third International Conference (KR'92), San Mateo, CA. Mor-
gan Kaufmann. 36{46. [Selman and Kautz, 1991] Selman, Bart and Kautz, Henry 1991. Knowledge compilation using horn approximations. In Proceedings of the Ninth Na-
sky, Bob; and Taylor, William 1991. Where the really hard problems are. In Proceedings of the
tional Conference on Arti cial Intelligence (AAAI91). 904{909. [Selman et al., 1992] Selman, Bart; Levesque, Hec-
[Crawford and Baker, 1994] Crawford, James and Baker, Andrew 1994. Experimental results on the application of satis ability algorithms to scheduling problems. In Proceedings of the Twelfth Na-
of the Tenth National Conference on Arti cial Intelligence (AAAI-92). 440{446. [Tsang, 1993] Tsang, Edward 1993. Foundations of Constraint Satisfaction. Academic Press.
Twlefth International Joint Conference on Arti cial Intelligence (IJCAI-91). 331{337.
tional Conference on Arti cial Intelligence (AAAI94). 1092{1097.
[Dalal and Etherington, 1992] Dalal, Mukesh and Etherington, David 1992. Tractable approximate deduction using limited vocabularies. In Proceedings of the Ninth Canadian Conference on Arti cial Intelligence (AI'92). 206{212.
tor; and Mitchell, David 1992. A new method for solving hard satis ability problems. In Proceedings
[Williams and Hogg, 1992] Williams, Colin and Hogg, Tad 1992. Using deep structure to locate hard problems. In Proceedings of the Tenth National Conference on Arti cial Intelligence (AAAI-92). 472{477.