Abstract
Multi-valued Decision Diagrams (MDDs) are a powerful tool for representing complex, ad-hoc constraints in Constraint Satisfaction Problems (CSPs). However, traditional MDD propagation algorithms often lag behind modern bitwise table-based solvers. This paper introduces Binary Constraint Trees (BCTs), a novel representation that transforms MDDs into tree-structured binary constraints. By leveraging a specialized bitwise propagation algorithm on these trees, the authors achieve significant performance gains—up to 12x faster than state-of-the-art table algorithms and 98x faster than leading MDD propagators.
Introduction
In the realm of Constraint Programming, MDDs are favored for their ability to compactly represent "ad-hoc" constraints, such as specific sequences or patterns, which would otherwise require massive tables of allowed values. Despite their compactness, a performance gap exists: recent bitwise table algorithms, like the Compact Table (CT) algorithm, frequently outperform MDD-specific solvers. This discrepancy arises because MDD propagators have not fully utilized the efficiency of bitwise operations. The central question addressed here is whether MDDs can be re-encoded to facilitate faster, bitwise propagation while maintaining their structural advantages.
Methodology
The proposed approach involves a multi-step pipeline to transform MDDs into a more computationally efficient form.
Direct Tree Binary Encoding (DTBE)
The first step is mapping the nodes and edges of an MDD into a set of "hidden" variables and binary constraints, resulting in a Binary Constraint Tree (BCT). A crucial property of this transformation is that because the resulting structure is a tree, enforcing simple Arc Consistency (AC) on the binary constraints is mathematically equivalent to enforcing Generalized Arc Consistency (GAC) on the original complex constraint.
Reduction Rules
While the initial BCT is comparable in size to the MDD, the authors introduce four reduction rules to optimize the structure. These rules eliminate, merge, and reconstruct hidden variables to minimize the number of constraints and variables. A key innovation in this phase is the use of Conditional C-Tables (CC-T) to reconstruct variable domains more efficiently.
BCT GAC Propagator
To solve the resulting BCTs, a specialized propagator was developed using sparse bit sets and bitwise operations (e.g., numberTrailingZeros, bitwise AND/OR). This design allows the solver to process multiple potential values simultaneously, bringing the raw speed of bitwise table algorithms to the structured environment of a tree.
Key Insights
- Trees are Magic for Consistency: In a tree-structured constraint network, a simple pass up and down the tree (Arc Consistency) is sufficient to find consistency, avoiding expensive global search.
- Compactness through Reduction: Surprisingly, the reduced BCT can be exponentially smaller than the original MDD. In some benchmarks, the BCT was over 2,000 times smaller than the initial encoding.
- Bitwise Hybridization: The core innovation lies in combining the space-saving node sharing of MDDs with the high-speed bitwise processing of modern table solvers.
Experimental Results
The TBE (Tree Binary Encoding) approach was evaluated against state-of-the-art solvers on a wide range of benchmarks, including Car Sequencing, Pentominoes, and Nurse Scheduling, as well as over 2,500 table-based instances from the XCSP repository.
- Performance: TBE was the fastest algorithm on 71% of the table instances tested.
- Comparative Speedups: It outperformed the leading MDD propagator (CD) by up to 98x and the state-of-the-art table algorithm (CT) by up to 12x.
- Search Throughput: On challenging problems like Pentominoes, the TBE approach processed 246 nodes per second, a massive improvement over the 4 nodes per second managed by baseline MDD solvers.
Conclusion and Future Work
The transformation of MDDs into BCTs offers a significant leap in propagation performance. While the reduction process is heuristic (as finding the optimal BCT is NP-hard), the current rules provide substantial gains. The initial transformation overhead is minimal, typically averaging under 0.5 seconds. Future research will explore higher levels of consistency beyond GAC and the application of tree encodings to other decision diagram variants.
Summary updated