Repository navigation
🧩 Constraint Solving POTD:Problem of the Day: Maximum Satisfiability (MaxSAT) #72953
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 #73175. |
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
Given a Boolean formula in conjunctive normal form (CNF) — a collection of clauses, each a disjunction of literals — find an assignment to the variables that maximizes the number of satisfied clauses.
Unlike classical SAT (which asks: "Can all clauses be satisfied?"), MaxSAT relaxes the requirement and accepts partial satisfaction. This makes it a true optimization problem: we want to find the best feasible solution, not just any feasible solution.
Concrete Example
Consider this 3-variable MaxSAT instance with 5 clauses:
An assignment like
{x1 = true, x2 = true, x3 = false}satisfies clauses 1, 2, 3, and 5 (4 out of 5). Can we do better? Try to find an assignment that satisfies all 5 clauses, or prove that 4 is the best we can do.Input/Output Specification
nBoolean variables andmclauses. Each clause is a list of literals (variables or their negations).Why It Matters
Real-world applications:
Fault diagnosis & debugging: Hardware test vectors often produce overconstrained systems. MaxSAT helps find an assignment that satisfies as many test constraints as possible.
AI planning & reasoning: When multiple competing preferences or soft constraints exist (e.g., "prefer this sensor, but if unavailable, use that one"), MaxSAT balances trade-offs gracefully.
Bioinformatics: Sequence alignment and phylogenetic tree inference often involve soft constraints; MaxSAT finds solutions respecting as many biological constraints as feasible.
Software engineering: Automated bug fixing and program synthesis benefit from MaxSAT when complete satisfaction is impossible.
Weighted formula variants (Weighted MaxSAT, Partial MaxSAT) extend this to real-world domains like energy grid scheduling, traffic management, and financial portfolio optimization.
Modeling Approaches
Approach 1: Classical MaxSAT (Unweighted, Complete Enumeration)
Paradigm: Brute-force search + SAT checking
Decision variables: Binary variables
x_i ∈ {0, 1}for each Boolean variable.Objective: Maximize the count of satisfied clauses:
Trade-offs:
Approach 2: SAT-Based Upper Bounding (Linear Relaxation + Cutting Planes)
Paradigm: SAT solver + incremental refinement (binary search on "how many clauses can we satisfy?")
Formulation:
kclauses?"kclauses to be true.Trade-offs:
Approach 3: Integer Linear Programming (ILP)
Paradigm: Mixed-integer linear program
Decision variables:
x_i ∈ {0, 1}for each Boolean variabley_j ∈ {0, 1}for each clause (1 if satisfied, 0 otherwise)Objective:
Constraints: For each clause
(l1 ∨ l2 ∨ ... ∨ l_k), ensure:where contribution captures whether each literal is satisfied.
Trade-offs:
Example: ILP Model (Pseudo-code)
Example instance encoding:
Clause
(x1 ∨ ¬x2):This constraint forces
y[clause]to be 0 if neither literal is satisfied.Key Techniques
1. Clause Weighting & Core Extraction
Many solvers use iterative unsatisfiable core extraction:
This trades satisfaction of some clauses for satisfiability of others, guided by conflict analysis.
2. Branch-and-Bound with Lower/Upper Bounds
Solvers maintain:
At each search node, prune if the upper bound ≤ lower bound. This dramatically reduces the search space.
3. Symmetry Breaking & Local Search
For structured instances, identify variable symmetries and add breaking constraints (e.g., "if variable x and y are interchangeable, force x ≤ y in lexicographic order"). Hybrid approaches combine SAT with local-search moves (flipping variable assignments) to escape local minima.
Challenge Corner
Extend and explore:
Weighted MaxSAT: Suppose each clause has a weight
w_j(importance). How would you modify your model and solver strategy to maximizeΣ w_j · y_jinstead of just the count?Partial MaxSAT: In some formulations, certain "hard" clauses must be satisfied, while others are "soft" and contribute to the objective. How does this change your propagation and branching strategy?
Approximation & Heuristics: MaxSAT is NP-hard. What simple randomized or greedy heuristics could give you a reasonable solution in polynomial time? (Hint: random assignment satisfies each clause with probability close to
1 - (1/2)^kfor a clause withkliterals.)Symmetry Exploitation: If your CNF has redundant variables or clauses, how would you detect and exploit these symmetries to reduce the search space?
References
"An Introduction to SAT Solving" — Handbook chapter by Biere, Heule, van Maaren, and Walsh (2009). Covers SAT and MaxSAT broadly.
"MaxSAT Evaluation" — International competition website and proceedings (www.maxsat.org). Showcases state-of-the-art algorithms and benchmarks.
"Handbook of Constraint Programming" — Ch. 32 on SAT and pseudo-Boolean satisfaction (Rossi, van Beek, Walsh, 2006). Excellent unified perspective.
"Maximum Satisfiability: A Tutorial" — Paper by Argelich et al. (various years). Practical overview of algorithms, from basic SAT-based methods to advanced core-guided techniques.
Dive deeper: Try encoding a small MaxSAT instance and solving it with a SAT solver supporting MaxSAT (e.g., Open-WBO, RC2, or MaxHS). Compare the time and solution quality across different instance sizes!
All reactions