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.
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:
- Block Partitioning: Instead of treating every overlapping window as a separate constraint, the algorithm partitions the entire sequence into larger, manageable blocks.
- 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.
- 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.
- 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.
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
Seqused 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