🧩 Constraint Solving POTD:Maximum Satisfiability (MAX-SAT) #24483
Closed
Replies: 1 comment
-
|
This discussion has been marked as outdated by Constraint Solving — Problem of the Day. A newer discussion is available at Discussion #24733. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Problem Statement
The Maximum Satisfiability (MAX-SAT) problem asks: given a set of Boolean clauses, find a truth assignment to the variables that satisfies as many clauses as possible.
This is the optimization counterpart of the classic decision problem SAT (which asks only whether all clauses can be satisfied at once). When not all clauses can be simultaneously satisfied, MAX-SAT quantifies how close we can get.
Concrete Instance
Consider 4 Boolean variables
x₁, x₂, x₃, x₄and 7 clauses:(x₁ ∨ x₂ ∨ ¬x₃)(¬x₁ ∨ x₃)(x₂ ∨ x₄)(¬x₂ ∨ ¬x₄)(x₁ ∨ ¬x₂ ∨ x₄)(¬x₁ ∨ ¬x₃ ∨ ¬x₄)(x₃ ∨ x₄)Input: a CNF formula with
nvariables andmclauses (optionally weighted).Output: a truth assignment
x₁, …, xₙ ∈ {true, false}maximizing the number (or total weight) of satisfied clauses.For the instance above, the assignment
x₁=T, x₂=T, x₃=T, x₄=Fsatisfies 6 out of 7 clauses (clause 4 is falsified). Can you do better?Why It Matters
Modeling Approaches
Approach 1 — MIP (Mixed-Integer Programming)
Introduce a binary variable
yⱼ ∈ {0,1}for each clausejindicating whether it is satisfied, plus the original Boolean variablesxᵢ ∈ {0,1}.Decision variables:
xᵢ ∈ {0, 1}for each variableiyⱼ ∈ {0, 1}for each clausej(1 = clause satisfied)Formulation:
Trade-offs: SLS methods like WalkSAT and GSAT are extremely fast in practice and find near-optimal solutions quickly for random instances. They cannot prove optimality and may get stuck in local optima. Best used as a portfolio component or when approximate solutions suffice.
Example Model (PySAT / RC2 snippet)
RC2 is the state-of-the-art core-guided algorithm that won multiple MAX-SAT Evaluation competitions.
Key Techniques
1. Core-Guided Optimization & Cardinality Encoding
The pivotal insight in modern MAX-SAT is that instead of branching on variables directly, we can identify unsatisfiable cores among soft clauses and encode the relaxation as a cardinality constraint (
at-most-korat-least-k). Efficient cardinality encodings (totalizer, sequential counter) are crucial — they determine how much propagation the underlying SAT solver can perform.2. Preprocessing & Resolution-Based Lower Bounds
Unit propagation and failed literal detection eliminate variables before search. Resolution-based lower bounds (from LP relaxations or the dual of cardinality extensions) let solvers prune large portions of the search tree without ever exploring them. The gap between the LP relaxation bound and the optimal integer solution is often very tight for random 3-SAT instances.
3. Symmetry Breaking & Clause Learning
Even in MAX-SAT, symmetry breaking (e.g., when variables appear symmetrically in multiple clauses) can dramatically prune the search space. Clause learning (from CDCL) is inherited by MAX-SAT solvers to avoid re-exploring equivalent conflict states, making the search non-chronological and far more efficient than simple backtracking.
Challenge Corner
References
Beta Was this translation helpful? Give feedback.
All reactions