Definition
Assignment-and-Complement Algorithm (MaxSAT)
For a MaxSAT formula with non-empty clause, choose any truth assignment and let flip every variable. Write for the number of clauses satisfied by . Return
This is a deterministic -constant-factor approximation algorithm: the returned assignment satisfies at least half as many clauses as an optimal assignment.
The assignments are like two sides of a coin, but the choice is not random: keep if it reaches half; otherwise use . A clause can be satisfied on both sides.
Why One Half Is Guaranteed
Approximation guarantee
Proof
Every non-empty clause contains a literal. That literal is true under either or , so the clause is satisfied by at least one of them. Counting over all clauses gives
The algorithm need not identify the better assignment: if already reaches , keep it. Otherwise,
In either case, the output satisfies at least clauses. Since , this is at least half the optimum.
Complexity and Scope
Counting satisfied clauses takes time, where is the total number of literal occurrences. Creating and, if necessary, complementing an assignment takes time for variables. Total time is , with space for the assignment.
Empty clauses are never satisfiable: discard them before counting . This leaves the optimum unchanged. The argument concerns unweighted MaxSAT; for non-negative clause weights, replace clause counts by total satisfied weight throughout.
Example
Flipping reaches the bound
Let . The all-false assignment satisfies only , so .
Its complement satisfies , giving . The optimum is also : the clauses and cannot both be satisfied.