Definition
Best-of-Two Approximation Algorithm for Maximum Satisfiability
Given a MaxSAT instance with clauses , the best-of-two algorithm constructs two truth assignments:
- : set each variable independently to with probability ;
- : set each variable independently to with probability , where is an optimal solution of the LP relaxation below.
Return the assignment satisfying more clauses. Writing for the number of clauses satisfied by ,
The algorithm runs in polynomial time; the guarantee is in expectation, not for every random outcome.
Choose one method uniformly
Instead of running both methods, toss one fair coin to choose between and . This mixture has the same expected guarantee. Returning the better of both can only improve the expected value.
From Clauses to a Linear Programme
Let be the variables. Remove repeated literals within each clause. A clause containing both and is always satisfied (e.g., ): set it aside and add its contribution back at the end. Empty clauses are never satisfied and can be discarded. Thus every remaining clause is nonempty and contains each variable at most once. This is what makes its literal outcomes independent under independent variable choices.
For clause , write
Encode truth values and counted clauses
Introduce a binary variable for the truth value of and a binary variable indicating whether we count clause as satisfied. The integer linear programme is
Each summand is a truth indicator, not merely a positive contribution:
- For a positive literal , the term is exactly when is true.
- For a negative literal , the term is exactly when is false, so that is true.
Thus all terms are non-negative, but they can all be zero. The two sums together count the true literals in . For , inspect the actual entries:
Variable values Literal truth indicators Constraint Allowed Only or Still only or The interesting restriction is the first row: we cannot claim a point for a false clause. Without this constraint, maximising would simply set every , even for clauses made false by the chosen assignment.
In the other rows, the clause is true and the constraint permits its point. It does not force by itself; the objective does that. For fixed binary values , maximising over gives
The binary bound on caps the reward at one, even if several literals are true. The inequality and the objective together therefore encode the clause’s OR: zero points if all literals are false, one point otherwise.
The same is shared by every occurrence of . For example, the two clauses and impose and , so . We cannot count both contradictory clauses as satisfied. Hence maximising really maximises the number of clauses satisfied by one consistent assignment, and the integer optimum is exactly .
Relax the binary choices
Replace by and solve the resulting linear programme. Let be an optimal fractional solution and let
Every integer solution remains feasible in the relaxation, so
The fractional value is an upper bound, not necessarily the value of any truth assignment. Rounding turns into the probability of setting ; the variables are used for the analysis, not sampled.
Algorithm
BestOfTwoMaxSAT(F):
simplify clauses as described above
solve the LP relaxation to obtain (ŷ, ẑ)
for each variable xᵢ:
σrand(xᵢ) ← 1 with probability 1/2, otherwise 0
σLP(xᵢ) ← 1 with probability ŷᵢ, otherwise 0
use independent choices
count the clauses satisfied by each assignment
return whichever assignment satisfies more clausesEvery returned assignment is feasible: MaxSAT permits clauses to remain false. The issue is how many clauses are satisfied, not whether the assignment satisfies all of .
Why the Two Methods Complement Each Other
Both coefficients come from asking the same question: what is the probability that every literal in one clause is false? Subtract that probability from to obtain the probability that the clause is satisfied. Fix a clause with literals on distinct variables.
Uniform sampling gives
Every literal is false with probability , whether it is positive or negative. Since the variable choices are independent,
Thus is an exact probability. For three literals, only one of the eight equally likely literal truth patterns makes all three false, so .
LP rounding gives
Now the literal truth probabilities need not equal . The LP constraint gives only
First consider . The LP claims a full point for this clause, but it need not make any individual literal certainly true. It may spread the required total evenly: .This is the worst distribution for satisfying the clause under the constraint : using total and distributing it evenly maximises the product of failure probabilities . The arithmetic–geometric mean argument below proves this. Consequently,
For three literals with truth probabilities , the LP constraint allows , yet the clause fails with probability . Its satisfaction probability is , not .
For a fractional claim , the same argument gives the bound . Its concavity, proved below, yields
Thus is a guaranteed fraction of the LP contribution , not the clause’s exact satisfaction probability in every LP solution. The probabilities explain the worst-case bound; the algorithm still uses the actual probabilities supplied by the LP.
To compare the methods, use the same reference quantity . Uniform sampling gives because ; LP rounding gives at least . Averaging the two methods therefore guarantees at least for this clause.
| Clause length | Uniform coefficient | LP coefficient | Average coefficient |
|---|---|---|---|
Long clauses give uniform sampling many chances to make a literal true. Short clauses give LP rounding a stronger guarantee relative to . The decreasing quantity is a bound coefficient, not a claim that every longer clause has a lower actual satisfaction probability.
Approximation Guarantee
Three-quarter guarantee
For every MaxSAT instance , the uniform mixture and the best-of-two algorithm both satisfy
Proof
Bound the probability that LP rounding misses one clause
Fix a clause of length . Let be its literal truth probabilities: a positive literal has probability , and a negative literal has probability .
LP feasibility gives . The clause is false precisely when all its literals are false. Independence and the arithmetic–geometric mean inequality give
Thus the satisfaction probability is at least , where .
The function is concave on : it is linear for , and for ,
A concave function lies above the chord joining its endpoints. Since and ,
Average the two bounds for the same clause
Uniform sampling misses all literals with probability , so its satisfaction probability is . Choosing one method with probability therefore gives
The second inequality uses . To bound the average coefficient, distinguish the clause lengths:
- : .
- : .
- : and , so .
Here gives the bound on , and gives . Consequently every clause contributes at least in expectation.
Sum the clause contributions
Linearity of expectation does not require different clauses to be independent. For the mixture assignment ,
For best-of-two, write and . For every pair of sampled assignments,
Taking expectations gives the same lower bound for the returned assignment. Finally, if preprocessing set aside tautological clauses, these add to every assignment and to the optimum; preserves the guarantee for the original formula.
Running Time and Derandomisation
Let be the number of literal occurrences. The LP has variables, clause constraints, and bound constraints. Its encoding has polynomial size, so an optimal rational solution can be found in polynomial time. After solving the LP, sampling uses Bernoulli choices, and evaluating both assignments takes time.
Exact sampling from rational probabilities can be implemented in expected polynomial time using unbiased random bits. The usual randomised algorithm description treats each Bernoulli choice as a sampling operation.
The guarantee can also be made deterministic by conditional expectation. For each of the two methods, fix variables one at a time, choosing the value that does not decrease the conditional expected number of satisfied clauses. Such a value exists because the current expectation is a weighted average of the two conditional expectations. Each expectation is computable by summing clause satisfaction probabilities from the remaining independent variables.
The maintained invariant is that the conditional expectation never decreases. Once all variables are fixed, that expectation equals the actual clause count. Derandomise both methods and return the better assignment: its value is at least the average of their original expectations, hence at least .
Example
Fractional satisfaction is not certain satisfaction
Consider the four clauses
The LP solution and is feasible: each clause has total literal truth probability . Thus .
Nevertheless, every integral assignment makes exactly one clause false, so . Both sampling methods are uniform here. Each clause is satisfied with probability , and every sampled assignment satisfies three clauses.
The fractional value does not mean that rounding will certainly satisfy . Here the expected total is exactly , which is already optimal for the original instance.