SAT Encoding for Set of At-Most-K Cardinality Constraints with Ladder Shape

Hieu Truong Xuan, Tuyen Kieu Van, Khanh To VanarXiv 2026

TL;DR

This paper introduces SCL, a novel SAT encoding for "Ladder AMK" constraints—sequences of overlapping "at-most-$k$" constraints common in scheduling and optimization. By decomposing these sequences into blocks and reusing auxiliary variables, the authors achieve a linear $O(nk)$ encoding size, significantly outperforming existing SAT encodings and even specialized CP and MIP solvers on complex problems like Nurse Rostering and Anti-bandwidth.

What Problem Does This Paper Address?

Many real-world combinatorial problems involve sequence constraints. Imagine a nurse who can work at most 4 night shifts in any 14-day window, or a car production line where only 2 out of every 5 consecutive cars can have a sunroof. In SAT (Boolean Satisfiability) terms, these are sequences of overlapping At-Most-K (AMK) cardinality constraints.

When these windows overlap—sharing all but one variable at each end—they form a "ladder" structure.

Fig. 1: Ladder AMK constraint of 10 variables and width 4.

The challenge is that encoding each window individually in a SAT solver leads to a massive explosion in the number of variables and clauses, making the problem computationally intractable for large datasets. While solutions existed for $k=1$ (At-Most-One), this paper is the first to provide an efficient encoding for the more general $k > 1$ case.

Methods

The authors propose the Sequential Counter encoding for Ladder constraints (SCL). The core innovation lies in how the sequence is decomposed:

  1. Block Partitioning: Instead of treating every overlapping window as a separate constraint, the algorithm partitions the entire sequence into larger, manageable blocks.
  2. Sequential Counter (SC) Encoding: Each block is encoded using a modified Sequential Counter technique. This method uses "register bits" to represent cumulative sums of variables within the block.
  3. Connecting Clauses: The authors developed a mathematical framework (Proposition 1) to link these blocks together. By using specific disjunctive clauses, they ensure that the "at-most-$k$" property holds across the boundaries where blocks meet.
  4. Variable Reuse: A key "aha" moment in their method is the realization that register bits from one block can be reused to represent sub-expressions in adjacent blocks, drastically reducing the total number of auxiliary variables needed.
Fig. 5: Decomposition of an Ladder AMK constraint with n = 10 and w = 4.

Datasets

The SCL encoding was evaluated against three main benchmarks:

  • Synthetic Single Ladder Constraints: A dataset of single Ladder AMK constraints with $n=1000$ variables and varying window widths ($w$) and $k$ values to test raw encoding efficiency.
  • Anti-bandwidth Problem (ABP): 24 matrices from the Harwell-Boeing Sparse Matrix Collection, ranging from small (30 vertices) to large (715 vertices).
  • Nurse Rostering Problem (NRP): A variant involving scheduling a single nurse over horizons of 40 to 100 days, subject to 11 complex scheduling requirements.

Key Insights and Ideas

  • Linear Complexity: Most existing encodings for these constraints have a space complexity of $O(n^2)$ or worse. SCL achieves $O(nk)$ complexity, which is essentially linear relative to the number of variables $n$ for a fixed $k$.
  • SAT vs. The World: The paper demonstrates that a well-designed SAT encoding can outperform mature, multi-threaded solvers like Gurobi (MIP) and Google OR-Tools' CP-SAT on specific constraint structures, even when the SAT solver operates in single-threaded mode.
  • Decomposition is Key: The transition from encoding individual constraints to encoding "blocks" of constraints is what allows for massive variable reuse, which is the primary driver of the speedup.

Key Results

  • Nurse Rostering: SCL solved all instances approximately twice as fast as the next best SAT-based encoding (Sequential Counter). On a 100-day instance, SCL took 42ms compared to 106ms for the standard Seq encoding.
  • Anti-bandwidth Problem: The parallel version of the encoding (SCLpar) found optimal or better solutions than CPLEX on several large instances (e.g., M-bcsstk06, N-bcsstk07).
  • Memory Efficiency: In the Nurse Rostering tests, SCL maintained the lowest memory footprint, using only 13.4 MB for a 100-day period, while other encodings like Seq used three times as much.
  • Clause Reduction: For $k=1$, SCL uses roughly half the number of variables and clauses compared to the previously state-of-the-art Duplex encoding.

Limitations and Future Work

The authors acknowledge that while the block-based Sequential Counter is highly effective, it is just one way to encode the blocks. Future research could explore using other cardinality encodings (like BDDs or Sorting Networks) as the base for the blocks to see if further optimizations are possible. Additionally, the authors suggest investigating how these "ladder" structures interact with other types of global constraints in even more complex scheduling scenarios.

Summary updated

Abstract

This paper presents a novel SAT encoding designed to represent a sequence of At-Most-K cardinality constraints arranged in a ladder-like structure, referred to as the Ladder AMK constraint. These AMK constraints feature a ladder-like arrangement, with shared common variables in the center and two variables differing at the beginning and the end. The proposed encoding first decomposes the sequence of AMK constraints into separated blocks, then encodes each block as a whole rather than encoding each AMK constraint individually. This approach improves the efficiency of constraint solving in SAT solvers by significantly reducing the size of the encoding, precisely the number of variables, and the generated clauses required. To achieve this, the encoding employs Sequential Counter to encode each block and constructs clauses that link adjacent blocks, ensuring equivalence with the input constraints. Compared to the previously proposed encoding that uses BDD for Ladder AMO constraint, our encoding requires fewer variables and clauses. Our study is the first study that develops SAT encoding for Ladder AMK constraints with k>1. Experimental results on single Ladder AMO and Ladder AMK constraints indicate that our encoding significantly enhances both the size of the encoding and the efficiency of solving time compared to existing encodings. Furthermore, by evaluating on the two real-world combinatorial problems, namely Anti-bandwidth Problem and Nurse Rostering Problem, we found that the proposed encoding surpasses alternative encodings, as well as more advanced Constraint Programming and Mixed Integer Programming solvers. In summary, the SAT encoding technique presented in this paper provides a more efficient method for encoding sequence constraint, specifically Ladder AMK constraint, which could enhance the effectiveness of SAT solving for various problems involving this type of constraint.

Empirical ResultsBrowse all benchmarks →

BenchmarkMethodMetricScoreProtocol / Evidence
Nurse Rostering ProblemSCLsolving time42 msSingle-nurse variant; 100-day horizon; average over 10 runs; 600-second time limit and …
Source quote
L3940: 42
Nurse Rostering ProblemSCLsolving time16 msSingle-nurse variant; 40-day horizon; average over 10 runs; 600-second time limit and 5…
Source quote
L3934: 16
BibTeX
@misc{xuan2026sat,
  author = {Hieu Truong Xuan and Tuyen Kieu Van and Khanh To Van},
  title = {{SAT Encoding for Set of At-Most-K Cardinality Constraints with Ladder Shape}},
  year = {2026},
  eprint = {2611.04637},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.04637},
}
Figure