Download Full Dynamic Substitutability by SAT Encoding

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Intelligence explosion wikipedia , lookup

Unification (computer science) wikipedia , lookup

Existential risk from artificial general intelligence wikipedia , lookup

History of artificial intelligence wikipedia , lookup

Narrowing of algebraic value sets wikipedia , lookup

Constraint logic programming wikipedia , lookup

Genetic algorithm wikipedia , lookup

Local consistency wikipedia , lookup

Complexity of constraint satisfaction wikipedia , lookup

Transcript
Full Dynamic Substitutability by SAT Encoding
Steven Prestwich
Cork Constraint Computation Centre
Department of Computer Science
University College, Cork, Ireland
email: [email protected]
Abstract. Symmetry in constraint problems can be exploited to greatly
improve search performance. A form of symmetry that has been the subject of considerable research is value interchangeability. Automatically
detecting full interchangeability is thought to be intractable, so research
has focused on either discovery of local interchangeability or programmer
knowledge of full interchangeability. This paper shows that full dynamic
substitutability can be broken in a CSP by reformulating it as a SAT
problem. No analysis is necessary, space requirements are modest, solutions are collected into Cartesian products, and unit propagation enforces
forward checking on the CSP. In experiments on unsatisfiable problems,
better results are obtained than with standard SAT encodings.
1
Introduction
Many important problems in AI can be formulated as constraint satisfaction
problems (CSPs). A CSP is a triple (V, D, C) where V is a set of variables, D
the set of their domains, and C a set of constraints on the variables that specify
the permitted combinations of assignments of domain values to subsets of the
variables, or equivalently the forbidden combinations. CSPs are usually solved
by search algorithms that alternate backtracking with some form of constraint
propagation, for example forward checking or arc consistency.
Constraint problems often exhibit symmetries, and a great deal of research
has recently been devoted to symmetry breaking techniques for reducing search
space size. The most straightforward approach is to add constraints to the problem formulation, so that each equivalence class of solutions to the original problem corresponds to a single solution in the new problem [28]. Alternatively symmetries may be detected and exploited dynamically during search [2, 14, 17, 18].
Symmetries may also be used to guide search to a solution [24]. A form of
symmetry that has received considerable attention is Freuder’s notion of value
interchangeability [15], sometimes called a syntactic symmetry [5]:
Definition. A value a for variable v is fully interchangeable with value b if and
only if every solution in which v = a remains a solution when b is substituted
for a and vice-versa [15].
If two values are interchangeable then one of them can be removed from the
domain, reducing the size of the problem; alternatively they can be replaced by a
single meta-value, or bundled together in a Cartesian product representation of
the search space. Each of these approaches avoids revisiting equivalent solutions.
However, computing fully interchangeable values is believed to be intractable [8,
13, 15, 34] so local forms such as neighbourhood interchangeability are much more
commonly used:
Definition. A value a for variable v is neighbourhood interchangeable with value
b if and only if for every constraint on v, the values compatible with v = a are
exactly those compatible with v = b [15].
Freuder further defined a hierarchy of local k-interchangeabilities such that
neighbourhood interchangeability is equivalent to 2-interchangeability and full
interchangeability to n-interchangeability, where n is the number of variables,
and described an algorithm for computing k-interchangeable values that takes
time exponential in k. Several further types of interchangeability were defined
in [15] and subsequently by other researchers. In particular:
Definition. A value a for variable v is fully substitutable with value b if and
only if every solution in which v = a remains a solution when b is substituted
for a (but not necessarily vice-versa) [15].
Substitutability is weaker than interchangeability. Note that the term weaker
is used in the interchangeability literature to mean achieves more problem reduction; the weakness refers to the preconditions under which interchangeability
can be exploited. Again because substitutable values are expensive to compute,
neighbourhood substitutability (with the obvious definition) is more commonly
used. Another variant is:
Definition. A value a for variable v is dynamically interchangeable for b with
respect to a set A of variable assignments if and only if they are fully interchangeable in the subproblem induced by A [15].
Values may become interchangeable or substitutable during backtrack search
after some variables have been instantiated, so even a problem with no interchangeable values may exhibit dynamic interchangeability under some search
strategy. We may also define an even weaker variant which is not explicitly mentioned in [15], but is a natural generalisation of full substitutability and dynamic
interchangeability:
Definition. A value a for variable v is dynamically substitutable with value b
with respect to a set A of variable assignments if and only if a is fully substitutable for b in the subproblem induced by A.
The contribution of this paper is to show that (full) dynamic substitutability
can be exploited in any CSP without expensive analysis. Surprisingly, this can
be done statically for all search trees via a simple automatic reformulation of the
CSP. The paper is organised as follows. Section 2 defines the reformulation and
analyses its properties. Section 3 evaluates it on colouring benchmarks. Section
4 reviews related work. Section 5 concludes the paper and discusses future work.
2
The maximal encoding
This section describes a new reformulation of the CSP to a problem in propositional satisfiability (SAT). The SAT problem is to determine whether a Boolean
expression has a satisfying set of truth assignments. The problems are usually
expressed in conjunctive normal form: a conjunction of clauses C1 ∧ C2 ∧ . . .
where each clause is a disjunction of literals l1 ∨ l2 ∨ . . . and each literal is either
a Boolean variable v or its negation ¬v. A Boolean variable can be assigned the
value true (T ) or false (F ). SAT problems can be viewed as CSPs with binary
domains, for example a clause a ∨ b ∨ c̄ is a constraint forbidding the assignments
(a = F, b = F, c = T ). We first focus on binary CSPs then discuss non-binary
problems.
2.1
Three known encodings
A binary CSP can be reformulated as a SAT problem (SAT encoded ) in a variety
of ways. The most natural and widely-used encoding is the direct encoding [33].
A SAT variable xvi is defined as true if and only if the CSP variable v is assigned
value i, where i and j denote values in the domain {1, . . . , d} of v. The direct
encoding consists of three sets of clauses. Each CSP variable must take at least
one domain value, expressed by at-least-one (ALO) clauses xv1 ∨ xv2 ∨ . . . ∨ xvd .
No CSP variable can take more than one domain value, expressed by at-most-one
(AMO) clauses x̄vi ∨ x̄vj . Conflicts (v = i, w = j) are enumerated by conflict
(CON) clauses x̄vi ∨ x̄wj .
A well-known variant of the direct encoding contains no AMO clauses and
often improves local search performance. This is also often called the direct
encoding, but to avoid ambiguity we shall refer to it as the multivalued encoding.
In this encoding there is no longer a 1–1 correspondence between SAT and CSP
solutions: from a multivalued SAT solution we extract a CSP solution by taking
any one of the allowed values for each CSP variable.
The support encoding encodes support instead of conflict [16]. It consists of
ALO, AMO and support (SUP) clauses: if i1 . . . ik are the supporting values in
the domain of CSP variable v for value j in the domain of CSP variable w, then
there is a support clause xvi1 ∨ . . . ∨ xvik ∨ x̄wj . The interest of this encoding
is that unit propagation performs arc-consistency in the CSP, whereas on the
direct encoding it performs only forward checking (unit propagation is the main
or only inference rule in many SAT backtrackers). It has been shown to give
better search performance than the direct encoding on some CSPs [16]. It can
also be generalised to non-binary CSPs and to other forms of consistency [7].
2.2
The new encoding
Recall that the direct encoding is the multivalued encoding plus AMO clauses.
Our
W new encoding is the multivalued encoding plus clauses of the form xvi ∨
(w,j)∈Kvi xwj for each variable v and value i, where Kvi is the set of pairs
(w, j) such that there exists a conflict (v = i, w = j). We call these maximality
(MAX) clauses because they force a maximal number of assignments to each
variable: if no assignment to another variable conflicts with an assignment v = a
then v = a is forced to be part of the SAT solution. Whereas AMO clauses
prevent two CSP solutions from being part of the same SAT solution, MAX
clauses collect them together in the same SAT solution. We call the new encoding
consisting of the ALO, CON and MAX clauses the maximal encoding. Maximal
encoding SAT solutions are Cartesian products of partial domains such that any
combination of values is a solution, and no further values can be added to the
product. From such a solution we extract a CSP solution in the same way as
from the multivalued encoding: take any allowed value for each CSP variable.
As an example consider the vertex colouring problem in Figure 1, used in
[15] to illustrate the difference between full and local interchangeability. The
boxes represent vertices a, b, c, d and the lines represent the arcs of the graph,
while the numbers in the boxes are the available colours for the vertices. Each
vertex corresponds to a CSP variable, each arc to a disequality constraint, and
the colours to the variable domains. Colours 1, 2 and 3 for vertex a are fully
interchangeable: in any solution d must be 1 so b and c cannot be 1, and values
2 and 3 are not in the domains of b and c. However, the colours are not neighbourhood interchangeable because a = 1 does not satisfy the constraint a 6= b
for all values of b: it conflicts with b = 1. Thus neighbourhood interchangeability
cannot improve this problem, but our technique should be able to because it exploits full interchangeability (and more). The maximal encoding of the problem
is also shown in Figure 1. This SAT problem has exactly one solution, breaking
all symmetries: the Cartesian product {1, 2, 3}×{4, 5}×{4, 5}×{1} for variables
a, b, c, d. A loosely-constrained CSP with 12 solutions has been reformulated to
a tightly-constrained SAT problem with 1 solution.
Note that a CSP solution may be contained in more than one SAT solution. For example consider another vertex colouring problem with two adjacent
vertices v, w where v has two available colours {1, 2} and w has two available
colours {2, 3}. This problem has three colourings: [v = 1, w = 2], [v = 1, w = 3]
and [v = 2, w = 3]. The maximal encoding of this problem has two SAT solutions {1} × {2, 3} and {1, 2} × {3} for v, w. Each contains two colourings but
[v = 1, w = 3] occurs in both.
2.3
Properties
First we show that the new encoding breaks a very weak form of interchangeability. We use the term “break” from the symmetry literature even though
substitutability is not a symmetry but a dominance relation, and though related solutions are collected together into Cartesian products instead of being
ALO:
CON:
MAX:
a
123
b
145
145 c
xa1 ∨ xa2 ∨ xa3
xb1 ∨ xb4 ∨ xb5
x̄a1 ∨ x̄b1
x̄a1 ∨ x̄c1
x̄b1 ∨ x̄d1
xa1 ∨ xb1 ∨ xc1
xa2
xa3
xb1 ∨ xa1 ∨ xd1
xb4
xb5
xc1 ∨ xa1 ∨ xd1
xc4
xc5
xd1 ∨ xc1 ∨ xb1
1
d
xc1 ∨ xc4 ∨ xc5
x̄c1 ∨ x̄d1
xd1
Fig. 1. A vertex colouring example and its maximal encoding
excluded. The point is that the related solutions are not generated individually.
Theorem. The maximal encoding breaks all dynamic substitutabilities.
Proof. Suppose that, under some partial assignment A, value a is fully substitutable for value b in the domain of variable v. Clearly for any solution S
containing assignments v = a and A, no assignment conflicts with v = a (because S is a solution). By substitutability we can replace v = a by v = b to
get another solution S 0 , so no S assignment conflicts with v = b. Therefore any
maximal encoding representation of S also contains the assignment v = b, so S
and S 0 are collected together in the same maximal encoding solution. This holds
for arbitrary A and thus in any search tree. 2
Thus the maximal encoding also breaks all stronger variants including dynamic interchangeability, full substitutability and full interchangeability. The
next two theorems establish the correctness and completeness of the encoding.
Theorem. Taking any of the allowed values for each CSP variable under the
maximal encoding yields a CSP solution.
Proof. In a maximal encoding solution no clause is violated, including the
CON and ALO clauses. So each CSP variable is assigned a value and none of
the assignments are in conflict. 2
Theorem. Every CSP solution occurs in at least one maximal encoding solution.
Proof. Given a CSP solution we can construct a maximal encoding solution in
which it occurs. We do this in three steps. (i) For each CSP assignment v = i
set xvi to true. (ii) Set to true any false xvi such that there is no constraint
(v = i, w = j) with xwj true; repeat until no such xvi remain. (iii) Set all other
xvi to false. These assignments violate no ALO clause because each v has some
xvi set to true. Assignments (i) violate no CON clause because they derive from
a CSP solution, (ii) violate no CON clause by construction, and (iii) violate no
CON clauses because they are all false assignments and CON clauses
contain
W
only negated literals. Finally, suppose that a MAX clause xvi ∨ (w,j)∈Kvi xwj
is violated. Then xvi and the xwj are false. But xvi satisfies the condition in (ii)
for setting to true, so it cannot be false. This contradiction shows that all MAX
clauses are satisfied, so we have constructed a SAT solution under the maximal
encoding. This contains the assignments representing the CSP solution, so the
CSP solution is contained in the maximal encoding solution. 2
Recall that unit propagation on the direct encoding performs forward checking on the CSP, while on the support encoding it performs arc consistency:
Theorem. Unit propagation on the maximal encoding performs forward checking on the CSP.
Proof. Take any partial assignment A on the CSP variables and any domain
value a for an unassigned variable v. If forward checking on A prunes a from
the domain of v then there must be an assignment w = b in A and a constraint
(v = a, w = b), for some variable w and value b. But this constraint must correspond to a CON clause x̄va ∨ x̄wb . Moreover w = b under A so xwb is true. Then
unit propagation on the CON clause forces xva to be false. 2
The space complexity of the encoding is as follows. Given a CSP with n
variables, d domain values and c constraints. There are n ALO clauses of size d,
nd2 AMO clauses of size 2, cd2 CON clauses of size 2, nd MAX clauses of size
c, and cd SUP clauses of size d. Therefore in terms of the number of literals the
direct and support encodings both have space complexity O(nd2 +cd2 ) while the
maximal encoding has O(nd2 + cdn). For problems in which n d (for example
vertex 3-colouring) the maximal encoding therefore has higher space complexity,
but is otherwise comparable. In our experiments we will present data on encoding
sizes.
2.4
Extension to non-binary problems
Neighbourhood interchangeability has recently been extended to non-binary
CSPs [22]. We now show that the new encoding can also be generalised to handle non-binary constraints (for space reasons we do not provide proofs). An
obvious way is first to transform the CSP to binary form, which is always possible [1, 30]. However, performance is sometimes better on non-binary models,
so we extend the encoding to non-binary CSPs. CON clauses may now have
more than two literals, and the MAX clauses are replaced by expressions of the
V
W
for each variable v and value i, where Cvi
form xvi ∨ c∈Cvi
(w,j)∈Avic xwj
is the set of conflicts c involving v = i, and Avic is the set of pairs (w, j) such
that there exists an assignment w = j in c (with w and v distinct variables). A
generalised SAT solver such as [32] could handle these expressions directly but
standard solvers require conjunctive normal form. Expanding the expression to
conjunctive normal form yields a number of clauses that is exponential
in the
V
constraint arity, so instead we define an auxiliary variable avic ↔ (w,j)∈Avic xwj
for each variable v, value i and conflict
W c ∈ Cvi , and substitute these definitions
in the MAX clauses to obtain xvi ∨ c∈Cvi avic . The encoding consists of CON,
ALO and the new MAX clauses, plus clauses derived from the auxiliary variable
definitions.
3
Experimental results
To evaluate the maximal encoding we compare it with the direct and support
encodings on a set of binary CSPs. We use vertex colouring problems and a
generalisation called bandwidth colouring, in which two adjacent vertices i and j
cannot be assigned colours that are closer in value than a specified distance d ij .
The constraints are conflicting assignments (vi = ci , vj = cj ) where i and j are
adjacent and |ci −cj | < dij . In pure vertex colouring all distances are 1. Problems
are taken from a recent graph colouring symposium,1 which have the advantages
that they are publicly available, were not designed with interchangeability in
mind, and are of several types: the DSJC and R graphs are randomly generated,
the mulsol and zeroin graphs are based on register allocation for variables in
real codes, the miles graphs are geometric and based on distances between US
cities, the GEOM graphs are geometric and based on randomly placed points in
a square, the queen graphs are derived from the N-queens problem, the myciel
graphs are based on the Mycielski transformation and are triangle-free, the school
graph is a school timetabling problem, and the “book graphs” anna–jean are
derived from the relationships between characters in works of literature.
The search algorithm we use is Chaff [25], the first of the latest generation
of fast SAT backtrackers. Chaff is deterministic and does not allow results to be
averaged over multiple runs. However, it has been shown [10] that such solvers
can vary significantly in performance if SAT problems are randomly transformed,
for example by permuting variable names or randomly selecting a variable and
flipping all its occurrences in the problem. These transformations do not affect
the solvability or intrinsic hardness of a problem, and can be used to find average
behaviour of deterministic solvers. They are also used in solver competitions; for
details on them see [10]. We applied them and took median results over 100 runs
of Chaff.
On satisfiable problems, with the number of colours K set sufficiently high
for colourability, results were erratic. Chaff found a first solution for myciel7 a
few times more quickly under the maximal than under the direct and support
1
http://mat.gsia.cmu.edu/COLOR04
encodings, but this was an exception and it usually took longer. However, this
was offset by the fact that the SAT solutions combined several colourings as
a Cartesian product. For space reasons we do not present a table of figures
but mention some results: under the maximal encoding Chaff took an order of
magnitude longer to find 12 11-colourings for queen9 9gb than it took to find 1
11-colouring under the support or direct encodings; it took an order of magnitude
longer to find 200 5-colourings for DSJC125.1gb; slightly longer to find 25,000
5-colourings for R75 1gb; an order of magnitude longer to find 1014 33-colourings
for GEOM60; a few times longer to find 1024 8-colourings for miles250; and three
orders of magnitude longer to find 1067 11-colouring for anna. These results
indicate that the new encoding might be more useful for finding all solutions.
Unfortunately Chaff does not provide all-solution search except in the special
case of unsatisfiable problems, so we set K low enough to make each problem
unsatisfiable. Figures 3 and 4 compare encodings on uncolourable vertex and
bandwidth problems respectively. Note that there is no point in applying the
support encoding to pure vertex colouring because arc consistency is no more
powerful than forward checking on disequality constraints [7], so only the direct
and maximal encodings are compared on the pure problems (in experiments the
support encoding gave worse results than the direct encoding on pure vertex
colouring). Both figures show CPU time (sec), number of backtracks (bt) and
model size (literals). The fastest time, smallest number of backtracks and smallest models for each problem are highlighted in bold. An entry “—” means that
the median time was over 100 seconds.
In terms of backtracks the support encoding is best on the GEOM graphs, the
direct encoding is best on the smaller miles graphs, and the maximal encoding is
best on the DSJC (pure and bandwidth), myciel (pure and bandwidth), queens
(pure and bandwidth), mulsol, zeroin, school, and larger miles graphs, but worst
on the GEOM graphs. In terms of CPU time the direct encoding is best on
the school and smaller miles graphs, and the maximal encoding is best on the
queens (pure and bandwidth), DSJC (bandwidth), mulsol, zeroin, and the large
miles graphs, but worst on the GEOM graphs. So on several problem types the
maximal encoding speeds up proofs of unsatisfiability, and the exploitation of
interchangeability seems to be more important than the level of consistency.
In terms of model sizes the maximal encoding is almost always larger than the
maximal encoding (by a factor of less than 2), but the support encoding is larger
still (often by a larger factor). The maximal encoding clearly does not use an
excessive amount of space on these problems.
Though the first-solution results are disappointing the unsatisfiability results are very encouraging. This agrees in spirit with recent experiments [22]
on random CSPs, which showed that using neighbourhood interchangeability to
combine solutions during search yields greatest improvement at and beyond the
phase transition, where a significant number of problems are unsatisfiable. It
appears that interchangeability reasoning has a more significant effect on nonsolution search states than on CSP solutions. In fact these results are not very
surprising in the light of other work on symmetry breaking. We often transform
a problem by reasoning about symmetric solutions, then find that the transformation improves proofs of unsatisfiability. Moreover, it is well-known that
symmetry breaking sometimes degrades first-solution search, and some methods are designed to avoid exactly this problem [2, 18]. A final comment on the
above experiments. We could obtain better results by adding symmetry breaking
clauses to pre-colour a clique before SAT encoding. However, our aim here is not
to obtain the best results but simply to use the graphs as a source of CSPs.
4
Related work
Since Freuder’s original interchangeability paper [15] there has been considerable research in this area of symmetry breaking. Benson & Freuder [6] apply
neighbourhood interchangeability before search to improve forward checking.
Lal, Choueiry & Freuder [22] apply dynamic neighbourhood interchangeability to non-binary CSPs. Haselböck [19] defines a weakened form of neighbourhood interchangeability with respect to certain constraints. Bowen & Likitvivatanavong [9] enhance neighbourhood interchangeability by splitting domain
values into sub-values. Chmeiss & Saı̈s [11] study a generalisation of neighbourhood substitutability and its exploitation by adding constraints to the model.
Bellicha et al. [4] study other generalisations and their dynamic exploitation
during search. Choueiry & Noubir [13] define neighbourhood partial interchangeability, which is weaker than neighbourhood interchangeability and incomparable with full interchangeability. Choueiry & Davis [12] extend this to a dynamic
version. Weigel, Faltings & Choueiry [34] define context dependent interchangeability, which is weaker than full interchangeability and also intractable to fully
compute, then use approximation algorithms to partially exploit it. Beckwith,
Choueiry & Zou [3] show that dynamic variable ordering remains an important heuristic when combined with neighbourhood interchangeability. They also
design a set of random benchmark problems with a controlled amount of interchangeability, whereas many algorithms are tested on pure random CSPs.
Bistarelli, Faltings & Neagu [8] extend neighbourhood interchangeability and
substitutability to soft constraint problems.
Weaker forms of interchangeability have also been exploited. van Hentenryck
et al. [20] break full interchangeability and two related variants. For example
in wreath-value interchangeability variables take values from a domain D 1 × D2
such that values are interchangeable in D1 , and in D2 for fixed values of D1 ; this
is a form of dynamic interchangeability in which the assigned set of variables
is {v1 } where v1 is the variable with domain D1 . They break these symmetries
in constant time and space using dedicated search algorithms. This approach
has been generalised to arbitrary value symmetries by Roney-Dougal et al. [29].
However, these approaches assume that the user knows the symmetries of the
problem in advance, whereas ours requires no user knowledge and breaks a weak
form of substitutability. In recent work [27] this author describes constraints that
can be added to any binary CSP in order to exploit dynamic interchangeability
and to partially exploit dynamic substitutability, by excluding some solutions.
That approach has the advantage that it can be combined with other techniques
such as arc consistency, whereas the maximal encoding achieves only forward
checking. However, it fully exploits dynamic substitutability, and preserves all
solutions as Cartesian products.
Cartesian products can be effective on under-constrained problems. Hubbe
and Freuder [21] describe backtracking and forward checking algorithms for computing cross product representations (CPRs) that contain dynamic neighbourhood interchangeable values, while Silaghi, Sam-Haroud & Faltings [31] describe
related algorithms that enforce arc consistency. Our SAT solutions can be viewed
as a form of CPR that bundle together values under weaker conditions. More
precisely, they correspond to Lesaint’s maximal consistent decisions (MCDs)
[23], which are Cartesian products of partial variable domains that contain only
solutions, and are maximal in the sense that adding further values causes inconsistency. Weigel, Bliek & Faltings [35] point out that SAT solutions under
the multivalued encoding include MCDs, and our maximality clauses exclude all
other SAT solutions. Lesaint describes a version of the forward checking algorithm (GFC) for finding MCDs, so GFC also exploits dynamic substitutability.
But Lesaint does not analyse the interchangeability properties of MCDs, except
to point out that fully interchangeable values occur in the same set of MCDs. We
believe that a SAT backtracker applied to our encoding will be more efficient
than GFC: the encoding enforces maximality by extra constraints which can
be used for propagation, and improves backtrack performance on unsatisfiable
problems, whereas GFC uses generate-and-test to detect maximality and behaves
identically to standard forward checking on unsatisfiable problems. Note that we
can also apply a SAT local search algorithm to the encoding, giving another way
of computing MCDs that may be more successful on large problems.
To place this work in the context of other interchangeability research, Figure
2 shows a directed graph adapted from [13]. The abbreviations are as follows:
DS denotes full dynamic substitutability; DSS dynamic semi-substitutability,
our previous partial exploitation of DS [27]; FI full interchangeability; KI kinterchangeability; NI neighbourhood interchangeability; PI partial interchangeability (see [13, 15] for a definition); NPI neighbourhood PI [13]; NIc Haselböck’s
weakened NI [19]; CDI context-dependent interchangeability [34]; aCDI approximated CDI [34]; FS full substitutability; and NS neighbourhood substitutability.
An arrow from A to B denotes that B is a weaker form of interchangeability than
A. The graph illustrates the relative weakness of DS compared to most variants.
5
Conclusion
The automatic detection of non-local forms of interchangeability is believed to
require intractable analysis, so researchers have either used stronger local forms
or relied on knowledge provided by the constraint programmer. We showed that
a reformulation approach avoids both requirements. The reformulation is a new
SAT encoding that induces full dynamic substitutability with forward checking
on the CSP, when solved with an off-the-shelf SAT backtracker. Empirical results
DSS
DS
FI
CDI
KI
aCDI
NI
FS
PI
NIc
NPI
NS
Fig. 2. Relating various forms of interchangeability
show that this technique significantly improves proofs of unsolvability. It can also
make first-solution search slower, but this is offset by the fact that each solution
is a compact representation of a (sometimes very large) set of CSP solutions.
Generating a large set of similar solutions has application to interactive problem solving and explanation [13], and robustness under dynamic situations [12,
13, 22, 34]. Local interchangeability has been applied to this task but weaker
forms will obviously generate larger sets. The new encoding is a way of coercing
any SAT solver (including backtracking and local search algorithms) to generate
maximal consistent decisions [23] and (equivalently) pure clusters [26], which
have application to dynamic and distributed CSPs respectively.
A side benefit of this work is the discovery of an interesting new CSP-toSAT encoding, with similar space requirements to those of more well-known
encodings. Increasing the number of such encodings is of interest to SAT research
because it advances the use of SAT techniques on combinatorial problems. A
drawback with our approach is that by SAT encoding a CSP we lose much
of its structure, though some SAT solvers are able to retain structure [32]. In
future work we intend to investigate CSP reformulations combining other forms
of interchangeability and consistency, and evaluate them on other binary and
non-binary CSPs.
Acknowledgments
This work was supported in part by the Boole Centre for Research in Informatics,
University College, Cork, Ireland, and also by Science Foundation Ireland under
Grant 00/PI.1/C075. Thanks to Gene Freuder and other 4C members for helpful
discussions, and to the anonymous referees for useful comments.
References
1. F. Bacchus, P. van Beek. On the Conversion Between Non-Binary and Binary Constraint Satisfaction Problems Using the Hidden Variable Method. Fifteenth National
Conference on Artificial Intelligence, Madison, Wisconsin, USA, 1998, pp. 311–318.
2. R. Backofen, S. Will. Excluding Symmetries in Constraint-Based Search. Fifth International Conference on Principles and Practice of Constraint Programming, Lecture
Notes in Computer Science vol. 1713, Springer-Verlag, 1999, pp. 73–87.
3. A. M. Beckwith, B. Y. Choueiry, H. Zou. How the Level of Interchangeability
Embedded in a Finite Constraint Satisfaction Problem Affects the Performance of
Search. Fourteenth Australian Joint Conference on Artificial Intelligence, Lecture
Notes in Artificial Intelligence vol. 2256, Springer-Verlag, 2001, pp. 50–61,
4. A. Bellicha, M. Habib, M. C. Vilarem, C. Capelle, T. Kokeny. CSP Techniques Using
Partial Orders on Domain Values. ECAI’94 Workshop on Constraint Satisfaction
Issues raised by Practical Applications, T. Schiex and C. Bessière (eds.), Amsterdam,
1994.
5. B. Benhamou. Study of Symmetry in Constraint Satisfaction Problems. Principles
and Practice of Constraint Programming, 1994.
6. B. W. Benson, E. C. Freuder. Interchangeability Preprocessing Can Improve Forward Checking. Tenth European Conference on Artificial Intelligence, Vienna, Austria, 1992, pp. 28–30.
7. C. Bèssiere, E. Hebrard, T. Walsh. Local Consistencies in SAT. Sixth International
Conference on Theory and Applications of Satisfiability Testing, Santa Margherita
Ligure, Italy, 2003, pp. 400–407.
8. S. Bistarelli, B. V. Faltings, N. Neagu. Interchangeability in Soft CSPs. Joint
ERCIM / CoLogNet International Workshop on Constraint Solving and Constraint
Logic Programming, Lecture Notes in Artificial Intelligence vol. 2627, Springer Verlag, 2002, pp. 31–46.
9. J. Bowen, C. Likitvivatanavong. Splitting the Atom: a New Approach to Neighbourhood Interchangeability in Constraint Satisfaction Problems. Poster, Eighteenth
International Joint Conference on Artificial Intelligence, Acapulco, Mexico, 2003.
10. F. Brglez, X. Y. Li, M. F. Stallman. The Role of a Skeptic Agent in Testing and
Benchmarking of SAT Algorithms. Fifth International Symposium on the Theory and
Applications of Satisfiability Testing, University of Cincinnati, 2002, pp. 354–361.
11. A. Chmeiss, L. Saı̈s. About Neighborhood Substitutability in CSPs. Third International Workshop on Symmetry in Constraint Satisfaction Problems, Kinsale, Ireland,
2003, pp. 41–45.
12. B. Y. Choueiry, A. M. Davis. Dynamic Bundling: Less Effort for More Solutions.
Fifth International Symposium on Abstraction, Reformulation and Approximation,
Lecture Notes in Computer Science vol. 2371, Springer-Verlag, 2002, pp. 64–82.
13. B. Y. Choueiry, G. Noubir. On the Computation of Local Interchangeability in Discrete Constraint Satisfaction Problems. Fifteenth National Conference on Artificial
Intelligence, Madison, WI, USA, 1998, pp. 326–333.
14. T. Fahle, S. Schamberger, M. Sellman. Symmetry Breaking. Seventh International
Conference on Principles and Practices of Constraint Programming, Lecture Notes
in Computer Science vol. 2239, Springer-Verlag, 2001, pp. 93–107.
15. E. C. Freuder. Eliminating Interchangeable Values in Constraint Satisfaction Problems. Ninth National Conference on Artificial Intelligence, Anaheim, CA, 1991, pp.
227–233.
16. I. P. Gent. Arc Consistency in SAT. Fifteenth European Conference on Artificial
Intelligence, Lyons, France, 2002, pp. 121–125.
17. I. P. Gent, W. Harvey, T. Kelsey. Groups and Constraints: Symmetry Breaking
During Search. Eighth International Conference on Principles and Practice of Constraint Programming, Lecture Notes in Computer Science vol. 2470, Springer-Verlag,
2002, pp. 415–430.
18. I. P. Gent, B. Smith. Symmetry Breaking During Search in Constraint Programming. Fourteenth European Conference on Artificial Intelligence, 2000, pp. 599–603.
19. A. Haselböck. Exploiting Interchangeabilities in Constraint Satisfaction Problems. Thirteenth International Joint Conference on Artificial Intelligence, Chambéry,
France, 1993, pp. 282–287.
20. P. van Hentenryck, M. Ågren, P. Flener, J. Pearson. Tractable Symmetry Breaking
for CSPs with Interchangeable Values. Eighteenth International Joint Conference on
Artificial Intelligence, Acapulco, Mexico, August 2003, pp. 277–282.
21. P. D. Hubbe, E. C. Freuder. An Efficient Cross Product Representation of the Constraint Satisfaction Problem Search Space. Tenth National Conference on Artificial
Intelligence, San Jose, California, USA, 1992, pp. 421–427.
22. A. Lal, B. Y. Choueiry, E. C. Freuder. Neighborhood Interchangeability and Dynamic Bundling for Non-Binary Finite CSPs. Joint Annual Workshop of ERCIM
/ CoLogNet on Constraint Solving and Constraint Logic Programming, Lausanne,
Switzerland, 2004 (to appear).
23. D. Lesaint. Maximal Sets of Solutions for Constraint Satisfaction Problems.
Eleventh European Conference on Artificial Intelligence, Amsterdam, The Netherlands, 1994, pp. 110–114.
24. P. Meseguer, C. Torras. Exploiting Symmetries Within Constraint Satisfaction
Search. Artificial Intelligence vol. 129 nos. 1–2, 2001, pp. 133–163.
25. M. Moskewicz, C. Madigan, Y. Zhao, L. Zhang, S. Malik. Chaff: Engineering an
Efficient SAT Solver. Thirty Eighth Design Automation Conference, Las Vegas, 2001,
pp. 530–535.
26. A. J. Parkes. Exploiting Solution Clusters for Coarse-Grained Distributed Search.
IJCAI’01 Workshop on Distributed Constraint Reasoning, Seattle, Washington, USA,
2001.
27. S. D. Prestwich. Full Dynamic Interchangeability with Forward Checking and
Arc Consistency. ECAI’04 Workshop on Modeling and Solving Problems With Constraints, Valencia, Spain, 2004.
28. J.-F. Puget. On the Satisfiability of Symmetrical Constrained Satisfaction Problems. J. Komorowski, Z. W. Ras (eds.), Methodologies for Intelligent Systems, International Symposium on Methodologies for Intelligent Systems, Lecture Notes in
Computer Science vol. 689, Springer-Verlag, 1993, pp. 350–361.
29. C. M. Roney-Dougal, I. P. Gent, T. W. Kelsey, S. A. Linton. Tractable Symmetry
Breaking using Restricted Search Trees. Sixteenth European Conference on Artificial
Intelligence, Valencia, Spain, 2004 (to appear).
30. F. Rossi, C. Petrie, V. Dhar. On the Equivalence of Constraint Satisfaction Problems. Nineteenth European Conference on Artificial Intelligence, Stockholm, Sweden,
1990, pp. 550–556.
31. M.-C. Silaghi, D. Sam-Haroud, B. V. Faltings. Ways of Maintaining Arc Consistency in Search Using the Cartesian Representation. New Trends in Constraints,
Joint ERCIM / Compulog Net Workshop, Lecture Notes in Computer Science vol.
1865, Springer-Verlag, 2000, p. 173–187.
32. C. Thiffault, F. Bacchus, T. Walsh. Solving Non-Clausal Formulas with DPLL
Search. Seventh International Conference on Theory and Applications of Satisfiability
Testing, Vancouver, Canada, 2004, pp. 147–156.
33. T. Walsh. SAT v CSP. Sixth International Conference on Principles and Practice
of Constraint Programming, Lecture Notes in Computer Science vol. 1894, SpringerVerlag, 2000, pp. 441–456.
34. R. Weigel, B. V. Faltings, B. Y. Choueiry. Context in Discrete Constraint Satisfaction Problems. Twelfth European Conference on Artificial Intelligence, Budapest,
Hungary, 1996, pp. 205–209.
35. R. Weigel, C. Bliek, B. V. Faltings. On Reformulation of Constraint Satisfaction Problems. Thirteenth European Conference on Artificial Intelligence, Brighton,
United Kingdom, 1998, pp. 254–258.
direct
maximal
graph
K
bt sec literals
bt sec literals
DSJC125.5 7 7368 2.3 60599 2145 0.5 110698
DSJC125.9 7 2695 0.7 103579 2574 1.3 196658
DSJC250.9 8 9442 5.7 462352 7623 5.4 896704
mulsol.i.1
7 5667 1.8 64603 4119 1.9 112245
mulsol.i.2
7 9055 3.6 63602 4413 1.8 111307
mulsol.i.3
7 9598 3.9 63840 5070 2.3 112154
mulsol.i.4
7 8073 3.2 64309 5241 2.3 113008
mulsol.i.5
7 7388 2.8 64736 4880 2.1 113778
zeroin.i.1
7 3648 1.2 67739 3067 1.5 117159
zeroin.i.2
7 5497 2.3 59913 2414 1.0 101724
zeroin.i.3
7 5337 2.2 59654 2415 1.0 101661
anna
8 8196 2.8 16720 18714 13 17984
david
8 5616 1.5 12064 4130 1.0 14384
homer
8 7861 3.1 61952 17709 14 61032
huck
8 5947 1.7
9552 3506 0.6 10816
jean
8 5803 1.4
9184
6285 1.5 9384
miles500
7 2834 0.5 22652
7769 6.2 34552
miles750
8 8484 3.8 42000
9076 3.9 69664
miles1000
8 20676 21 59648 5221 2.3 104960
miles1500
8 33175 44 91360 5875 4.7 168384
queen8 12
8 20785 15.3 28032 9193 3.2 45312
queen9 9
8 12055 5.3 22080 4557 0.9 35088
queen10 10 8 20256 19 29920 6197 1.5 48640
queen11 11 8 14926 8.3 39424 4635 0.9 65296
queen12 12 8 29068 36 50752 6340 1.9 85376
myciel5
4 13152 1.0
2640 6716 1.1 4152
myciel6
4 26212 5.1
7560 14148 4.7 12840
myciel7
4 31565 8.9 21936 18582 10 39288
school
7 4341 1.3 286195 3659 1.4 540050
Fig. 3. Results on unsatisfiable vertex colouring problems
graph
GEOM60
GEOM70
GEOM80
GEOM90
GEOM100
GEOM110
GEOM120
myciel5gb
myciel6gb
myciel7gb
queen8 8gb
queen9 9gb
queen10 10gb
queen11 11gb
queen12 12gb
DSJC125.1gb
DSJC125.5gb
DSJC125.9gb
R75 1gb
R75 5gb
R75 9gb
R100 1gb
R100 5gb
R100 9gb
K
32
35
32
31
31
31
31
4
4
4
7
8
8
8
8
4
8
8
3
6
7
4
6
8
bt
5390
12970
10118
7250
10194
9359
7130
13152
26212
31565
4435
12055
19814
20710
29846
51
7829
9442
18
991
5695
2302
2945
23736
direct
support
maximal
sec literals
bt sec literals
bt sec literals
0.8 163424 2316 0.7 350176 17711 4.5 207808
3.1 250220 7278 5.8 594120 105608 60 333840
6.8 276012 3462 5.4 624916 36054 20 393304
3.3 318232 2810 4.2 729692 35324 15 469064
8.3 389310 2161 4.3 888138 33144 18 592620
5.7 447482 1945 4.0 1029730 32981 15 690364
4.9 526958 2021 5.4 1237314 32654 19 830716
1.0
2640 17576 2.7
8304
6716 1.1 4152
5.2
7560 20679 7.1 25680 14148 4.8 12840
9.1 21936 18342 21 78576 18582 11 39288
0.7 13328
5743 2.2 74480
2483 0.3 21280
5.4 22080 15585 11 140352
4557 0.9 35088
18 29920 25549 25 194560
6197 1.5 48640
19 39424 24769 26 261184
6197 1.5 65296
36 50755 41134 63 341507
6340 1.9 85379
0.0
7888
49 0.0 25552
78 0.0 12776
2.5 70256
— — 506048
3901 1.2 126512
5.9 119376
— — 899008
7623 5.5 224752
0.0
2139
15 0.0
5151
19 0.0 3435
0.1 19587
1121 1.2 104007
2169 0.3 34671
1.7 38860
6224 23 249952
3160 0.9 71417
0.2
5672
2602 0.5 17888
3760 0.4 8944
0.5 33072 1805 3.0 180432
8768 2.9 60144
22 77408
— — 574464
7729 5.3 143616
Fig. 4. Results on unsatisfiable bandwidth colouring problems