Encoding Linear Constraints into SAT

Ignasi Abío, Valentin Mayer-Eichberger, Peter J. Stuckey

Abstract

Translating mathematical inequalities into Boolean logic is a critical step for leveraging the power of SAT solvers in combinatorial optimization. This paper presents a comprehensive study of encodings for linear integer (LI) constraints, introducing novel techniques based on Multi-valued Decision Diagrams (MDDs) and Sorting Networks (SN). These methods aim to produce compact formulas that maintain domain consistency, enabling SAT solvers to efficiently handle complex mathematical constraints.

Introduction

Boolean Satisfiability (SAT) solvers excel at logic-heavy problems but historically struggle with linear integer (LI) constraints, such as $3x + 2y \leq 10$. Traditionally, these constraints are encoded into Conjunctive Normal Form (CNF), but poor encodings can lead to exponential formula growth or weak logical propagation. This research addresses the challenge of creating "math-aware" SAT encodings that are both compact and mathematically rigorous, allowing SAT solvers to compete with or even outperform specialized Mixed Integer Programming (MIP) solvers on logic-dense combinatorial problems.

Methods and Encodings

The authors categorize and extend several encoding strategies, focusing on maintaining domain consistency—the ability of a solver to deduce all possible variable assignments through unit propagation alone.

Taxonomy of SAT encodings for Pseudo-Boolean (PB) and Linear Integer (LI) constraints.

Key contributions include:

  1. MDD-based Encoding: Generalizing Binary Decision Diagrams (BDDs) to Multi-valued Decision Diagrams allows for representing integer variables with multiple edges. Reduced MDDs merge equivalent partial sums, significantly shrinking the resulting SAT formula.
  2. Sorting Network Encodings (SN-Tare and SN-Opt): These adapt sorting networks for general linear math using a "tare" variable to balance equations, ensuring logical consistency while remaining compact.
  3. BDD-Dec: A logarithmic encoding that decomposes variables and coefficients into powers of two, preventing formula explosion for large coefficients.
  4. Lazy Decomposition: A hybrid strategy where complex SAT encodings are only generated "on-demand" if a constraint becomes a bottleneck during the search process.
Comparison of SAT encoding constructions, their clause complexity, and logical consistency properties.

Experimental Evaluation

The methods were tested on over 5,500 benchmarks, including resource-constrained project scheduling (RCPSP), sports league scheduling, and MIPLib instances.

Key Results

  • Performance Gains: The MDD encoding consistently outperformed the previous state-of-the-art "Support" encoding by reducing redundant variables.
  • Robustness: Sorting Network approaches proved particularly effective for scheduling problems, offering a strong balance between size and speed.
  • Hybrid Success: Lazy Decomposition emerged as the overall winner, keeping the solver lightweight while deploying powerful encodings only where necessary.
  • Competitive Edge: On highly combinatorial tasks like RCPSP, these SAT-based methods significantly outperformed specialized Lazy Clause Generation (LCG) and SMT solvers.

Discussion and Insights

The research highlights that "Consistency is King"—encodings that maintain domain consistency allow SAT solvers to perform deductions comparable to dedicated math solvers. Furthermore, simple preprocessing, such as grouping variables with identical coefficients, can drastically improve encoding efficiency. While SAT-based methods are superior for logic-heavy math problems, MIP solvers like Gurobi remain faster for "pure" mathematical optimization.

Conclusion and Future Work

Despite these advancements, challenges remain for variables with extremely large integer domains. Future research may focus on extending consistency proofs to non-monotonic constraints and developing automated "mixed-radix" base selection for Sorting Network encodings to further optimize performance across diverse problem sets.

Summary updated

BibTeX
@inproceedings{abio2014encoding,
  author = {Ignasi Abío and Valentin Mayer-Eichberger and Peter J. Stuckey},
  title = {{Encoding Linear Constraints into SAT}},
  booktitle = {CP},
  year = {2014},
  doi = {10.1007/978-3-319-10428-7\_9},
}
Figure