Abstract
Constraint Satisfaction Problems (CSPs) often involve variables that must take distinct values, a requirement typically modeled using "all-different" constraints. While these are frequently decomposed into a network of binary "not-equal" constraints for simplicity, this paper argues that such decomposition sacrifices vital semantic information. By maintaining the global structure and applying Generalized Arc-Consistency (GAC), search efficiency can be improved by orders of magnitude. We provide a theoretical comparison of consistency measures and demonstrate through extensive benchmarking on quasigroup problems that Maintaining GAC (MGAC) significantly outperforms standard binary Arc-Consistency (MAC), often reducing search trees from millions of nodes to near-zero backtracking.
Introduction
In the realm of combinatorial optimization, the "all-different" constraint is ubiquitous, appearing in scheduling, frequency assignment, and layout design. A common implementation strategy in CSP solvers is to decompose a global all-different constraint on $n$ variables into $n(n-1)/2$ binary disequality constraints. However, this "clique" of binary constraints fails to capture the global dependencies between variables. For instance, if three variables each have a domain of only two possible values, a global view immediately identifies an inconsistency, whereas binary constraints may not. This paper investigates the benefits of treating all-different constraints as high-level global entities.
Theoretical Consistency Hierarchy
The effectiveness of a CSP solver depends on its ability to prune the search space through consistency techniques. The authors analyze several consistency measures, ranging from basic Arc-Consistency (AC) to more advanced forms like Neighborhood Inverse Consistency (NIC).
As illustrated in Figure 1, Generalized Arc-Consistency (GAC) for non-binary constraints is strictly stronger than Path Inverse Consistency (PIC) and standard AC. A key theoretical contribution of this work is proving that for quasigroup-structured problems, GAC on all-different constraints is equivalent to NIC. While NIC is generally computationally prohibitive, GAC can be enforced efficiently using Regin’s graph-matching algorithm, providing high-level pruning at a manageable cost.
Methods and Algorithms
The study compares two primary search algorithms:
- Maintaining Arc-Consistency (MAC): The traditional approach which enforces AC on the binary decomposition of constraints.
- Maintaining Generalized Arc-Consistency (MGAC): An approach that keeps all-different constraints intact and enforces GAC at every node in the search tree using specialized algorithms.
The authors hypothesize that MGAC "dominates" MAC, meaning it will never explore more nodes than MAC for the same problem instance and variable ordering. This dominance is particularly pronounced in "triangle-preserving" constraints, where the local structure of the problem is maintained within the global constraint.
Experimental Results
The algorithms were tested on Quasigroup Completion and Quasigroup Existence problems. Quasigroups (or Latin Squares) serve as an ideal benchmark due to their inherent structure and known difficulty. In Quasigroup Completion tasks, MGAC demonstrated extraordinary pruning power. For problems up to order 25, MGAC typically solved instances with fewer than 5 branches, effectively eliminating the need for the complex random restart strategies required by binary solvers. On order-20 instances, this translated to a reduction in runtime from hours (for MAC) to mere seconds (for MGAC).
The performance gap was even more stark in Quasigroup Existence problems, which involve finding quasigroups that satisfy specific algebraic identities (labeled QG3 through QG7).
As shown in Figure 6, as the order of the quasigroup increases, the number of nodes explored by MAC grows exponentially, often exceeding the one-million-node limit. In contrast, MGAC maintains a much smaller search tree. For example, in the QG5 benchmark at order 13, MGAC explored only 27,265 nodes compared to over 1,000,000 for MAC.
Discussion and Conclusion
The results clearly indicate that the "global view" provided by GAC is essential for solving structured CSPs efficiently. By preserving the semantic integrity of all-different constraints, solvers can detect contradictions much earlier in the search process. However, there is a trade-off: enforcing GAC is more computationally expensive per node than enforcing simple binary AC. In "easy" problem regions where little pruning is required, the overhead of Regin's algorithm may lead to longer total runtimes despite a smaller node count. Future work should explore the application of these principles to other global constraints beyond "all-different."
Summary updated