11.3

From The Algorithm Design Manual Solution Wiki
Jump to navigation Jump to search

Goal: Reduce any 3-SAT instance F to an equi-satisfiable 4-SAT instance G in polynomial time.

Input: F consists of m clauses Ci = (ℓi1 ∨ ℓi2 ∨ ℓi3).
Construction: For every Ci introduce one fresh variable xi and replace Ci with the two 4-literal clauses
    Di,1 = (ℓi1 ∨ ℓi2 ∨ ℓi3 ∨ xi)
    Di,2 = (ℓi1 ∨ ℓi2 ∨ ℓi3 ∨ ¬xi)
Let G be the conjunction of all 2m clauses {Di,1, Di,2}. Each clause now contains exactly four literals, so G is a 4-SAT formula.

Equi-satisfiability proof
1. If F is satisfiable, extend the satisfying assignment α of its original variables with arbitrary values for every xi. Because at least one of ℓi1,ℓi2,ℓi3 is true under α, both Di,1 and Di,2 are true, so α satisfies G.
2. Conversely, suppose G is satisfiable by some assignment β.
  • If Ci were false under β on the original literals, then ℓi1,ℓi2,ℓi3 are all false.
  • In that case Di,1 simplifies to xi and Di,2 simplifies to ¬xi, so at most one can be true—contradicting that β satisfies both.
  • Therefore every original clause Ci is true under β, and β restricted to F’s variables satisfies F.

Complexity: The reduction introduces at most one new variable and two new clauses per original clause, hence runs in O(|F|) time.

Pseudocode
function Reduce3to4SAT(F):
  G ← ∅
  for each clause (a ∨ b ∨ c) in F do
    x ← newVariable()
    G.add( (a ∨ b ∨ c ∨ x) )
    G.add( (a ∨ b ∨ c ∨ ¬x) )
  return G


Since 3-SAT is NP-hard and we have given a polynomial-time reduction 3-SAT ≤p 4-SAT, it follows that 4-SAT is NP-hard. □


Back to Chapter 11