Near-Optimal Encodings of Cardinality Constraints
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 AtMostOne(x1,…,xn) constraint using 2n + 2 2n + O([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 + n+1 - 2 clauses, which is the first nontrivial unconditional lower bound for this constraint and answers a question of Kucera, Savick\'y, and Vorel. We then turn our attention to encodings of AtMostk(x1,…,xn), where we introduce "grid compression", a technique inspired by hash tables, to give encodings using 2n + o(n) clauses as long as k = o([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 5 and 7n - o(n) for k 6.
Turn this paper into a full lesson
ArcXiv compiles a staged curriculum from this paper: 8-12 lessons across beginner → advanced, synthesised section guides, visuals, flashcards, a quiz, exercises, and on-demand deep dives per section. Grounded in the abstract, never invented.