[Paper Review] A comparison of encodings for cardinality constraints in a SAT solver
This paper evaluates three cardinality constraint encodings—Sinz's sequential-counter, Bailleux-Boufkhad's tree-based, and Abí£o et al.'s sort-based—for use in SAT solvers. Despite significant differences in clause count and structure, the sequential-counter encoding outperforms the others in runtime across combinatorial test cases. Surprisingly, strengthening the encodings to eliminate redundant auxiliary variable solutions had minimal impact on performance, challenging the assumption that larger encodings are inherently slower.
Cardinality constraints are important in many Sat problems; previous studies provide contradictory conclusions about the best encoding to use. Here, three encodings are compared: Sinz's sequential-counter, Bailleux and Boufkhad's tree-based, and Ab\'ıo and coworkers' sort-based approaches. The sequential-counter approach is found to be the fastest of these for a range of related, combinatorial test cases. All encodings permit multiple solutions in the auxiliary variables for a single solution to the main variables; the numbers of multiple solutions can be very large, and might impede a Sat solver. Variants of the encodings are developed, where extra clauses reduce the numbers of multiple solutions. These variants are found to have remarkably little effect on solution time, even when the number of clauses is approximately doubled. The results accentuate the well-known observation that clause count and other measures of encoding size are not reliable indicators of the difficulty of a Sat problem.
Motivation & Objective
- To resolve conflicting prior findings on the best encoding for cardinality constraints in SAT solvers.
- To evaluate three major encoding approaches: sequential-counter, tree-based, and sort-based, under controlled test conditions.
- To investigate whether strengthening encodings—by reducing redundant solutions in auxiliary variables—improves SAT solver performance.
- To challenge the assumption that clause count is a reliable predictor of SAT problem difficulty.
Proposed method
- The study implements and benchmarks three cardinality constraint encodings: Sinz’s sequential-counter, Bailleux and Boufkhad’s tree-based, and Abí£o et al.’s sort-based encoding.
- For each encoding, multiple strengthened variants are created to reduce the number of auxiliary variable solutions per main variable assignment.
- Strengthening techniques include one-way and two-way clauses, and conversion to equality constraints.
- The encodings are tested on combinatorial problems involving grid-based constraints (squares and triangles), with main variables derived from grid points.
- Solver performance is measured via memory accesses (a proxy for runtime) and clause counts, with results visualized across problem sizes.
- Variable ordering is varied (row-major, spiral, random) to assess sensitivity to input structure.
Experimental results
Research questions
- RQ1Which of the three cardinality constraint encodings—sequential-counter, tree-based, or sort-based—delivers the fastest SAT solving performance on combinatorial problems?
- RQ2Does strengthening encodings to eliminate redundant auxiliary variable solutions lead to measurable performance improvements in SAT solving?
- RQ3To what extent do clause count and encoding size correlate with SAT solving difficulty, given that these metrics are commonly used as heuristics?
- RQ4How sensitive are the performance results to the ordering of main variables in the cardinality constraint?
Key findings
- The sequential-counter encoding was the fastest across all test cases involving squares and triangles, outperforming both the tree-based and sort-based encodings.
- Strengthening the sequential-counter encoding by reducing auxiliary variable solutions had negligible impact on runtime, even when clause counts doubled.
- The tree-based encoding showed consistent performance across variants, but was slower than the sequential-counter encoding.
- The sort-based encoding was the slowest of the three, with performance not improved by strengthening techniques.
- No significant performance difference was observed when main variable orderings were changed (row-major, spiral, random), indicating robustness to input structure.
- The results demonstrate that clause count and encoding size are poor predictors of SAT solving difficulty, as strengthened encodings with more clauses performed similarly to their unmodified counterparts.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.