Near-Optimal Encodings of Cardinality Constraints
Pith reviewed 2026-05-14 00:30 UTC · model grok-4.3
The pith
A CNF encoding for AtMostOne uses 2n + 2√(2n) + O(n^{1/3}) clauses, refuting the conjectured optimality of Chen's product encoding.
A machine-rendered reading of the paper's core claim, the machinery that carries it, and where it could break.
Core claim
The central discovery is an explicit CNF encoding of AtMostOne(x1,…,xn) that uses only 2n + 2√(2n) + O(∛n) clauses, together with a matching-style lower bound of 2n + √(n+1) − 2 clauses that any encoding must obey. The same technique yields a monotone circuit for the threshold-2 function smaller than Adleman's construction. For AtMost_k the authors introduce grid compression, a hash-table-inspired compression of the auxiliary variables, to obtain encodings of size 2n + o(n) for k = o(n^{1/3}) and 4n + o(n) for k = o(n).
What carries the argument
Grid compression, a technique that compresses the representation of admissible assignments in the encoding by grouping them into a coarser grid structure, thereby reducing the number of clauses needed to forbid forbidden combinations.
If this is right
- Chen's product encoding is no longer optimal for AtMostOne.
- The new monotone circuit for threshold-2 improves the best known size after fifty years.
- Encodings of AtMost_k now scale linearly with n for k up to roughly the cube root of n.
- Any encoding of AtMostOne must contain at least roughly √n auxiliary clauses.
- The first unconditional nontrivial lower bound for this constraint is now known.
Where Pith is reading between the lines
- Similar compression ideas could be applied to Exactly-k or AtLeast-k constraints to obtain comparable savings.
- The reduced clause counts may translate directly into faster SAT solving times for optimization problems that encode cardinality bounds.
- The circuit improvement suggests that other threshold functions may admit smaller monotone circuits than previously known.
- The grid-compression method might generalize to non-cardinality constraints that involve forbidding certain Hamming-weight patterns.
Load-bearing premise
The algebraic constructions and grid-compression steps produce correct, valid CNF formulas for every sufficiently large n without hidden polynomial factors that would erase the asymptotic savings.
What would settle it
An exhaustive enumeration for n around 100 that either shows the minimal clause count exceeds the stated upper bound or exhibits a concrete assignment that satisfies the proposed clauses yet violates the AtMostOne constraint.
Figures
read the original abstract
We present several novel encodings for cardinality constraints, which use fewer clauses than previous encodings and, more importantly, introduce new generally applicable techniques for constructing compact encodings. First, we present a CNF encoding for the $\text{AtMostOne}(x_1,\dots,x_n)$ constraint using $2n + 2 \sqrt{2n} + O(\sqrt[3]{n})$ clauses, thus refuting the conjectured optimality of Chen's product encoding. Our construction also yields a smaller monotone circuit for the threshold-2 function, improving on a 50-year-old construction of Adleman and incidentally solving a long-standing open problem in circuit complexity. On the other hand, we show that any encoding for this constraint requires at least $2n + \sqrt{n+1} - 2$ clauses, which is the first nontrivial unconditional lower bound for this constraint and answers a question of Ku\v{c}era, Savick\'y, and Vorel. We then turn our attention to encodings of $\text{AtMost}_k(x_1,\dots,x_n)$, where we introduce "grid compression", a technique inspired by hash tables, to give encodings using $2n + o(n)$ clauses as long as $k = o(\sqrt[3]{n})$ and $4n + o(n)$ clauses as long as $k = o(n)$. Previously, the smallest known encodings were of size $(k+1)n + o(n)$ for $k \le 5$ and $7n - o(n)$ for $k \ge 6$.
Editorial analysis
A structured set of objections, weighed in public.
Referee Report
Summary. The manuscript presents novel CNF encodings for cardinality constraints. It gives an explicit construction for the AtMostOne(x1,…,xn) constraint using 2n + 2√(2n) + O(n^{1/3}) clauses, refuting the conjectured optimality of Chen's product encoding. It also provides a lower bound of 2n + √(n+1) - 2 clauses. For AtMost_k, it introduces grid compression to achieve 2n + o(n) clauses when k = o(n^{1/3}) and 4n + o(n) when k = o(n). The work additionally improves the monotone circuit size for the threshold-2 function, improving on Adleman's 50-year-old construction.
Significance. If the constructions hold, this is a significant contribution: it supplies the first nontrivial unconditional lower bound for AtMostOne encodings (answering Kučera et al.), refutes a long-standing conjecture on optimal clause counts, and solves an open problem in monotone circuit complexity. The grid compression technique is presented as a general, hash-table-inspired method that yields asymptotically improved encodings for a range of k, with potential impact on both theory and practical SAT encodings.
minor comments (3)
- [Abstract] Abstract: standardize the big-O notation from O(∛n) to O(n^{1/3}) for consistency with standard mathematical writing.
- [Lower bound section] The lower-bound argument (information-theoretic or counting) would benefit from an explicit statement of the counting measure used to obtain the √(n+1) term.
- [Construction section] Include a small concrete example (e.g., n=9 or n=16) illustrating how grid compression produces the auxiliary variables and clauses for AtMostOne.
Simulated Author's Rebuttal
We thank the referee for their positive summary of our manuscript and for recommending minor revision. The report does not list any specific major comments requiring point-by-point response. We appreciate the recognition of the significance of our results, including the new AtMostOne encoding, the matching lower bound, the grid compression technique, and the improvement to monotone circuit complexity for threshold-2. We will make any minor adjustments as needed in the revised version.
Circularity Check
No significant circularity
full rationale
The paper's central results consist of explicit constructive CNF encodings for AtMostOne and AtMost_k constraints, together with an information-theoretic lower bound. The upper-bound construction relies on grid compression and auxiliary variables to achieve the stated clause counts; the lower bound follows from a direct counting argument on the number of clauses needed to forbid certain assignments. Neither step reduces to a fitted parameter, self-definition, or load-bearing self-citation; both are presented as self-contained combinatorial arguments independent of prior fitted values or author-specific uniqueness theorems.
Axiom & Free-Parameter Ledger
axioms (1)
- standard math Standard properties of asymptotic notation, square roots, and clause counting in CNF formulas.
Reference graph
Works this paper leans on
-
[1]
S. Aaronson. P ?=N P . In J. F. Nash, Jr. and M. T. Rassias, editors,Open Problems in Mathemat- ics, pages 1–122. Springer International Publishing, 2016.doi:10.1007/978-3-319-32162-2_1 . 8
-
[2]
M. Ajtai, J. Koml´ os, and E. Szemer´ edi. Sorting in clogn parallel steps.Combinatorica, 3(1):1–19, 1983.doi:10.1007/BF02579338. 3
-
[3]
K. Amano and A. Maruoka. The monotone circuit complexity of quadratic boolean functions. Algorithmica, 46(1):3–14, 2006.doi:10.1007/s00453-006-0073-0. 2, 8
- [4]
-
[5]
O. Bailleux and Y. Boufkhad. Efficient CNF encoding of boolean cardinality constraints. In F. Rossi, editor,Principles and Practice of Constraint Programming - CP, volume 2833 ofLecture Notes in Computer Science, pages 108–122. Springer, 2003.doi:10.1007/978-3-540-45193-8\ _8. 1
-
[6]
Y. Ben-Haim, A. Ivrii, O. Margalit, and A. Matsliah. Perfect hashing and CNF encodings of cardinality constraints. In A. Cimatti and R. Sebastiani, editors,Theory and Applications of Satisfiability Testing - SAT, volume 7317 ofLecture Notes in Computer Science, pages 397–409. Springer, 2012.doi:10.1007/978-3-642-31612-8\_30. 1, 2
-
[7]
A. Biere, T. Faller, K. Fazekas, M. Fleury, N. Froleyks, and F. Pollitt. CaDiCaL, Gimsatul, IsaSAT and Kissat entering the SAT Competition 2024. In M. Heule, M. Iser, M. J¨ arvisalo, and M. Suda, editors,Proc. of SAT Competition 2024 – Solver, Benchmark and Proof Checker Descriptions, volume B-2024-1 ofDepartment of Computer Science Report Series B, pages...
work page 2024
-
[8]
P. M. Bittner, T. Th¨ um, and I. Schaefer. SAT encodings of the at-most-k constraint. In P. C. ¨Olveczky and G. Sala¨ un, editors,Software Engineering and Formal Methods, pages 127–144. Springer International Publishing, 2019. 31
work page 2019
-
[9]
P. A. Bloniarz.The complexity of monotone boolean functions and an algorithm for finding shortest paths on a graph. PhD thesis, Massachusetts Institute of Technology, 1979. 2, 7, 8, 14 16
work page 1979
-
[10]
J. A. Bondy. Induced subsets.J. Combinatorial Theory Ser. B, 12:201–202, 1972. doi: 10.1016/0095-8956(72)90025-1. 24
-
[11]
S. Bublitz. Decomposition of graphs and monotone formula size of homogeneous functions. Acta Inform., 23(6):689–696, 1986.doi:10.1007/BF00264314. 2, 8
-
[12]
J. Chen. A new SAT encoding of the at-most-one constraint. InProc. of the Tenth Int. Workshop of Constraint Modelling and Reformulation, 2010. 1, 2, 7, 14
work page 2010
-
[13]
T. H. Cormen, C. E. Leiserson, R. L. Rivest, and C. Stein.Introduction to algorithms. MIT Press, Cambridge, MA, third edition, 2009. 3
work page 2009
-
[14]
P. E. Dunne.Techniques for the analysis of monotone Boolean networks. PhD thesis, University of Warwick, 1984. 7, 19
work page 1984
-
[15]
N. E´ en and N. S¨ orensson. Translating pseudo-boolean constraints into SAT.J. Satisf. Boolean Model. Comput., 2(1-4):1–26, 2006.doi:10.3233/SAT190014. 3
-
[16]
G. Emdin, A. S. Kulikov, I. Mihajlin, and N. Slezkin. CNF encodings of symmetric functions. Theory Comput. Syst., 68(5):1291–1311, 2024.doi:10.1007/S00224-024-10168-W. 1, 8, 15
-
[17]
P. Erd˝ os, P. Frankl, and Z. F¨ uredi. Families of finite sets in which no set is covered by the union ofrothers.Israel J. Math., 51(1-2):79–89, 1985.doi:10.1007/BF02772959. 14
-
[18]
A. M. Frisch and P. A. Giannaros. SAT encodings of the at-most- k constraint: Some old, some new, some fast, some slow. InProc. of the Tenth Int. Workshop of Constraint Modelling and Reformulation, 2010. 1, 3, 6, 8, 9, 10
work page 2010
-
[19]
I. P. Gent. Arc consistency in SAT. In F. van Harmelen, editor,Proceedings of the 15th European Conference on Artificial Intelligence, ECAI’2002, Lyon, France, July 2002, pages 121–125. IOS Press, 2002. 2
work page 2002
-
[20]
M. I. Grinchuk. On the monotone complexity of threshold functions.Metody Diskret. Anal., 52:41–48, 120, 1992. 7
work page 1992
-
[21]
P. Hall. On representatives of subsets.J. London Math. Soc., 10(1):26–30, 1935. doi: 10.1112/jlms/s1-10.37.26. 26
-
[22]
T. B. Idalino and L. Moura.A Survey of Cover-Free Families: Constructions, Appli- cations, and Generalizations, pages 195–239. Springer Nature Switzerland, 2023. doi: 10.1007/978-3-031-48679-1_11. 14
-
[23]
PySAT: A Python toolkit for prototyping with SAT oracles
A. Ignatiev, A. Morgado, and J. Marques-Silva. PySAT: A Python toolkit for prototyping with SAT oracles. InSAT, pages 428–437, 2018.doi:10.1007/978-3-319-94144-8_26. 15, 32
-
[24]
S. Jukna. Disproving the single level conjecture.SIAM J. Comput., 36(1):83–98, 2006. doi:10.1137/S0097539705447001. 2, 8
-
[25]
M. Karpi´ nski. CNF encodings of cardinality constraints based on comparator networks, 2019. arXiv:1911.00586. 15
-
[26]
W. Kautz and R. Singleton. Nonrandom binary superimposed codes.IEEE Transactions on Information Theory, 10(4):363–377, 1964.doi:10.1109/TIT.1964.1053689. 14 17
-
[27]
R. E. Krichevskii. Complexity of contact circuits realizing a function of logical algebra.Soviet Physics. Doklady, 8:770–772, 1964. 8
work page 1964
-
[28]
P. Kuˇ cera, P. Savick´ y, and V. Vorel. A lower bound on CNF encodings of the at-most-one constraint.Theor. Comput. Sci., 762:51–73, 2019. doi:10.1016/J.TCS.2018.09.003. 1, 2, 4, 8, 14, 15, 20, 21, 22
-
[29]
K. Lenz and I. Wegener. The conjunctive complexity of quadratic boolean functions.Theoret. Comput. Sci., 81(2):257–268, 1991.doi:10.1016/0304-3975(91)90194-7. 2, 8
-
[30]
J. Marques-Silva and I. Lynce. Towards robust CNF encodings of cardinality constraints. In C. Bessiere, editor,Principles and Practice of Constraint Programming - CP, volume 4741 ofLecture Notes in Computer Science, pages 483–497. Springer, 2007. doi:10.1007/ 978-3-540-74970-7\_35. 1
work page 2007
-
[31]
R. Mirwald and C. P. Schnorr. The multiplicative complexity of quadratic boolean forms. Theoret. Comput. Sci., 102(2):307–328, 1992.doi:10.1016/0304-3975(92)90235-8. 2, 8
-
[32]
V. Nguyen, V. Nguyen, K. Kim, and P. Barahona. Empirical study on SAT-encodings of the at-most-one constraint. InSMA 2020: The 9th International Conference on Smart Media and Applications, Jeju, Republic of Korea, September 17 - 19, 2020, pages 470–475. ACM, 2020. doi:10.1145/3426020.3426170. 1, 31
-
[33]
J. E. Reeves.Cardinality Constraints in Boolean Satisfiability Solving. PhD thesis, Carnegie Mellon University, 2025. 1
work page 2025
-
[34]
I. S. Sergeev. On the complexity of monotone circuits for threshold symmetric boolean functions. Diskret. Mat., 32(1):81–109, 2020.doi:10.4213/dm1547. 7, 15, 19
-
[35]
C. Sinz. Towards an optimal CNF encoding of boolean cardinality constraints. In P. van Beek, editor,Principles and Practice of Constraint Programming - CP, volume 3709 ofLecture Notes in Computer Science, pages 827–831. Springer, 2005. doi:10.1007/11564751\_73. 1, 2, 8, 12, 15, 24, 25
-
[36]
E. Sperner. Ein Satz ¨ uber Untermengen einer endlichen Menge.Math. Z., 27(1):544–548, 1928. doi:10.1007/BF01171114. 32
-
[37]
Wegener.The complexity of Boolean functions
I. Wegener.The complexity of Boolean functions. John Wiley & Sons, Inc., 1987. 7, 19
work page 1987
-
[38]
E. Wynn. A comparison of encodings for cardinality constraints in a SAT solver, 2018. URL: https://arxiv.org/abs/1810.12975,arXiv:1810.12975. 31 A Proofs for Section 3.2 A.1 Proof of Lemma 1 Lemma 1.There is a propagation-complete encoding of the AtMostOne′(x1, . . . , xn; z)constraint using2n+O( √n)clauses andO( √n)auxiliary variables. 18 Proof. Rename t...
discussion (0)
Sign in with ORCID, Apple, or X to comment. Anyone can read and Pith papers without signing in.