## Search Algorithms

Various search algorithms for the double encoding can be defined, depending on the variables that are instantiated and the constraints that are used for propagation. Here we will restrict ourselves to algorithms that only instantiate original variables and perform propagation using the constraints between dual variables. Intuitively this is the most interesting class of algorithms because they combine nice features from the non-binary representation and the HVE (small domain sizes), and from the DE (strong propagation).

We first show that the FC versions for the HVE discussed in Section 3.2 can be adapted to yield algorithms that run on the double encoding. We call these algorithms dFC0-dFC5. Each algorithm dFC () instantiates only original variables and enforces AC on exactly the same set of variables of the double encoding as the corresponding algorithm hFC does in the HVE. For example, dFC5 will enforce AC on the set of dual variables, and original variables connected to them, such that each dual variable is connected to at least one past original variable and at least one future original variable. The difference between algorithm dFC () and hFC is that the former can exploit the constraints between dual variables to enforce a higher level of consistency than the latter. Not surprisingly, this results in stronger algorithms.

Proposition 5.1   In any non-binary CSP, under a fixed variable and value ordering, algorithm dFCi (i) is strictly stronger than the respective algorithm hFCi.

Proof: It is easy to see that if a value is pruned by hFCi in the HVE then it is also pruned by dFCi in the double encoding. This is a straightforward consequence of the fact that 1) the double encoding subsumes the HVE, and 2) algorithms dFCi and hFCi enforce AC on the same set of variables. Algorithm dFCi is strictly stronger than hFCi because, by exploiting the constraints between dual variables, it can prune more values than hFCi. Consider, for instance, a problem with two constraints and , where and . All variables , , have domains . The allowed tuples of the constraints are and . If is given value 0 in the HVE then algorithms hFC2-hFC5 will prune tuples and from the domains of dual variables and respectively. No other pruning will be performed. In the double encoding, the same variable assignment, by any of the algorithms dFC2-dFC5, will cause the domain wipe-out of the two dual variables.

Corollary 5.1   In any non-binary CSP, under a fixed variable and value ordering, algorithm dFCi (i) is strictly stronger than the respective algorithm nFCi (i=).

Proof: Straightforward consequence of Propositions 5.1 and 3.1.

It is easy to see that algorithm hFC0 (i.e. simple binary FC) is equivalent to dFC0. The same holds for algorithms hFC1 and dFC1. As with the various versions of FC, the MAC algorithm can be adapted to run in the the double encoding so that only original variables are instantiated, and propagation is implemented through the constraints between dual variables. It is easy to see that this algorithm is strictly stronger than the corresponding algorithm for the HVE (the proof is similar to the proof of Proposition 5.1). More interestingly, we show that this MAC algorithm for the double encoding can, at most, have a polynomially greater cost than the corresponding MAC algorithm for the HVE, while, on the other hand, it can be exponentially better.

Proposition 5.2   In any non-binary CSP, under a fixed variable and value ordering, the MAC algorithm for the hidden variable encoding that only instantiates original variables can have exponentially greater cost than the corresponding MAC algorithm for the double encoding.

Proof: To prove this, we can use Example 14 from the paper by Bacchus et al. bcvbw02. In this example we have a CSP with variables, , each with domain , and constraints:

:

:

:

:
Assume that the variables are assigned in lexicographic order in the double encoding. If and are assigned values such that then enforcing AC will prune any tuples from such that . This in turn will prune from any tuples such that . Continuing this way, AC propagation will prune from any values such that . When these deletions are propagated to , will become empty. In a similar way, enforcing AC after assignments to and , such that , leaves empty. Therefore, the CSP is insoluble. MAC in the double encoding needs to instantiate two variables to discover this, and visit nodes. On the other hand, as explained by Bacchus et al. bcvbw02, MAC in the HVE needs to visit nodes to conclude that the problem is insoluble. Finally, note that, for each node, the asymptotic costs of MAC in the double encoding (using PW-AC) and MAC in the HVE are polynomially related. Therefore, MAC in the HVE can be exponentially worse than MAC in the double encoding.

A corollary of Proposition 5.2 is that MAC in the double encoding can have have exponentially smaller cost than MGAC in the non-binary representation.

Proposition 5.3   In any non-binary CSP, under a fixed variable and value ordering, the MAC algorithm for the double encoding that only instantiates original variables can have at most polynomially greater cost than the corresponding MAC algorithm for the hidden variable encoding.

Proof: To prove this we need to show two things: 1) The number of node visits made by MAC in the double encoding is at most by a polynomial factor greater than the number of node visits made by MAC in the HVE, 2) At each node, the worst-case cost of MAC in the double encoding is at most by a polynomial factor greater than the worst-case cost of AC in the HVE. The former is true since MAC in the double encoding is strictly stronger than MAC in the HVE. The latter can be established by considering the worst case complexities of the algorithms at each node. MAC in the HVE costs at each node, while MAC in the double encoding can use PW-AC to enforce AC, which costs . Therefore, there is only a polynomial difference.

In a similar way, we can prove that the relationship of Proposition 5.3 holds between each algorithm dFCi (i) and the corresponding algorithm hFCi. A corollary of Proposition 5.3 is that MAC in the double encoding can have at most polynomially greater cost than MGAC in the non-binary representation. It is important to note that Proposition 5.3 holds only if algorithm PW-AC is used to enforce AC in the double encoding. If we use a generic algorithm, like AC-2001, then we can get exponential differences in favor of MAC in the HVE. Finally, regarding the relationship in node visits among the algorithms for the double encoding, we have the following.

Proposition 5.4   Given the double encoding of a CSP with fixed variable and value ordering schemes, the following relations hold:
1. nodes(dFC1) nodes(dFC0)
2. nodes(dFC2) nodes(dFC1)
3. nodes(dFC5) nodes(dFC3) nodes(dFC2)
4. nodes(dFC5) nodes(dFC4) nodes(dFC2)
5. nodes(dMAC) nodes(dFC5)

Proof: The proof is very simple and it is based on comparing the size of the subsets of the problem where each algorithm enforces AC.

Nikolaos Samaras 2005-11-09