Sub topic 15
Limits of Approximation: Gap Reductions and the PCP Theorem
This chapter assumes you know polynomial-time reductions and NP-completeness, the definition of the approximation ratio from earlier chapters, and the argument from the chapter on general TSP, where a Hamiltonian-cycle instance was turned into a TSP instance with a huge cost gap. That TSP argument used one specific trick. Here we turn it into a general method and then look at the PCP theorem, which is the result behind most known hardness-of-approximation bounds.
From Decision Hardness to Approximation Hardness
An algorithm design result says "ratio α is achievable." A hardness result says "no polynomial-time algorithm achieves ratio better than β unless P = NP." When α equals β, we know the exact approximability of the problem. Max-3SAT reaches this state at 7/8. For vertex cover there is still a gap between the known upper and lower bounds.
The tool that connects ordinary NP-hardness to approximation is the gap problem.
Gap problems
Take a maximization problem Π and two thresholds c > s. The problem Gap-Π_{c,s} is a promise problem:
- YES instances: OPT ≥ c.
- NO instances: OPT < s.
- Instances in between can never be inputs, so the algorithm may answer anything on them.
For minimization the inequalities flip: YES means OPT ≤ c and NO means OPT > s, with c < s.
The key lemma is short. Suppose Gap-Π_{c,s} is NP-hard and some algorithm A is a ρ-approximation for a maximization problem with ρ < c/s, meaning A(I) ≥ OPT/ρ. On a YES instance, A(I) ≥ c/ρ > s. On a NO instance, A(I) ≤ OPT < s. Comparing A(I) with s decides the gap problem in polynomial time, so P = NP. An NP-hard gap therefore rules out every ratio better than c/s.
Gap-Introducing Reductions
A gap-introducing reduction maps an NP-complete decision problem straight to a gap problem. The TSP chapter did this with edge weights 1 and αn + 1. Bin packing gives a smaller example.
Partition asks whether a multiset of positive integers with sum S splits into two halves that each sum to S/2. Scale each number ai to a size 2ai/S and use bins of capacity 1. A YES instance of Partition then needs exactly 2 bins. A NO instance needs at least 3. An algorithm with ratio below 3/2 would return fewer than 3 bins on every YES instance, which would decide Partition. Bin packing therefore has no (3/2 − ε)-approximation unless P = NP.
The code below runs the reduction on two small instances and computes the optimum by brute force so you can see the gap.
from fractions import Fraction
from itertools import product
def partition_to_bin_packing(nums):
total = sum(nums)
return [Fraction(2 * a, total) for a in nums]
def min_bins(sizes):
if any(s > 1 for s in sizes):
return None
n = len(sizes)
for k in range(1, n + 1):
for assign in product(range(k), repeat=n):
loads = [Fraction(0)] * k
for s, b in zip(sizes, assign):
loads[b] += s
if max(loads) <= 1:
return k
return n
yes_instance = [3, 1, 1, 2, 2, 1] # 3 + 2 = 5 = 10 / 2
no_instance = [2, 2, 2, 4] # all even, half-sum 5 is odd
for nums in (yes_instance, no_instance):
print(nums, "->", min_bins(partition_to_bin_packing(nums)), "bins")The output is 2 bins for the first instance and 3 for the second. No instance can need exactly 2.5 bins, and that discreteness is where the gap comes from.
Gap-Preserving Reductions
Most problems do not have a convenient discrete jump like bin packing does. The usual approach is to start from one problem known to have an NP-hard gap and carry that gap to other problems. A gap-preserving reduction from Gap-Π{c,s} to Gap-Π'{c',s'} maps YES instances to instances with OPT' ≥ c' and NO instances to instances with OPT' < s'. The new gap c'/s' may be smaller than the original, but it must stay bounded away from 1.
Here is a standard example. Turn a 3-CNF formula with m clauses into a graph. Each clause becomes a triangle with one vertex per literal, and every literal vertex is joined to every vertex holding its negation. An independent set picks at most one vertex per triangle and never picks a contradictory pair, so the maximum independent set size equals the maximum number of simultaneously satisfiable clauses. The reduction maps Gap-Max-3SAT{1, 1−ε} to Gap-IndependentSet{m, (1−ε)m} with exactly the same ratio.
The PCP Theorem
Gap-preserving reductions need a starting point: some problem with a constant gap that is NP-hard to decide. The PCP theorem provides one.
The verifier view
A probabilistically checkable proof system has a verifier that receives the input x and random access to a proof string π. The verifier flips r(n) random bits, reads q(n) positions of π, and accepts or rejects. Two conditions must hold:
- Completeness: if x is in the language, some π makes the verifier accept with probability 1.
- Soundness: if x is not in the language, every π is accepted with probability at most 1/2.
The PCP theorem (Arora, Lund, Motwani, Sudan, Szegedy, and Safra, 1992–1998) says NP = PCP(O(log n), O(1)). Every NP statement has a proof that can be checked by reading a constant number of bits chosen with logarithmic randomness.
Why this is a gap statement
The theorem is equivalent to this: there is a constant ε > 0 such that Gap-3SAT_{1, 1−ε} is NP-hard. To see the forward direction, list all 2^{O(log n)} = poly(n) random strings. Each random string fixes q proof positions and an accept predicate on them, so it is a constraint on q Boolean variables. Write each predicate as a 3-CNF with at most a constant number K of clauses, using auxiliary variables. Then:
- On YES inputs, a correct proof satisfies every constraint, so all clauses are satisfied.
- On NO inputs, at least half of the constraints fail for every proof. Each failed constraint has at least one unsatisfied clause, so at least a 1/(2K) fraction of all clauses fail.
So ε = 1/(2K). The proof's bits are the variables, and the verifier's random checks are the clauses. The theorem also holds in the reverse direction: a verifier can pick a random clause and read its three variables.
Tight thresholds
Stronger PCP constructions give sharper constants. Håstad (2001) built a verifier that reads 3 bits and checks one linear equation modulo 2. From it he showed that for every ε > 0, Gap-Max-3SAT_{1, 7/8+ε} is NP-hard. The random assignment from the MAX-SAT chapter already gets 7/8 in expectation, so the trivial algorithm is optimal.
| Problem | Best known ratio | Hardness (assumption) |
|---|---|---|
| Max-3SAT | 7/8 | 7/8 + ε (P ≠ NP, Håstad) |
| Set cover | ln n | (1 − ε) ln n (P ≠ NP, Dinur–Steurer) |
| Vertex cover | 2 | √2 − ε (P ≠ NP); 2 − ε (Unique Games) |
| Max-Cut | 0.878 (Goemans–Williamson) | 0.878 + ε (Unique Games) |
| Clique / independent set | O(n / log² n) | n^{1−ε} (P ≠ NP) |
| Metric TSP | about 1.5 | 123/122 (P ≠ NP) |
| Bin packing | asymptotic PTAS | 3/2 for absolute ratio (P ≠ NP) |
Gap amplification
Independent set shows that a gap can sometimes be enlarged. In the strong graph product G^k, the maximum independent set size is α(G)^k. A gap ratio of c/s therefore becomes (c/s)^k. If any constant-factor approximation existed, you could pick k large enough to contradict a constant hardness gap. More refined versions of this product argument push the hardness up to n^{1−ε}.
Common Mistakes When Reading Hardness Results
- Confusing worst case with typical inputs. "NP-hard to approximate within β" is a statement about the worst case. Heuristics often do far better on real instances.
- Ignoring the assumption. P ≠ NP, the Unique Games Conjecture, and the Exponential Time Hypothesis are different assumptions. The vertex cover row in the table depends on which one you accept.
- Mixing up which problem the bound is about. A bound for the maximization version does not carry over automatically to the complementary minimization version. Vertex cover has a 2-approximation, while independent set, its complement, is hard to approximate within n^{1−ε}. Exact reductions keep optimal solutions intact, but they do not keep approximation ratios.
- Forgetting the direction of the reduction. To transfer hardness, you reduce from the known-hard gap problem to the new problem. Reducing the other way only shows that the new problem is at least as easy as the known one.
Exercise
Suppose you prove that Gap-Π_{c,s} is NP-hard for a minimization problem Π, where YES means OPT ≤ 100 and NO means OPT > 130. What ratio does this rule out, and how would a ρ-approximation with ρ < 1.3 decide the gap problem?
Show answer
It rules out every ratio below 130/100 = 1.3 unless P = NP. On a YES instance a ρ-approximation returns at most ρ·100 < 130. On a NO instance every solution, including the algorithm's, costs more than 130. Answering YES exactly when the output is below 130 decides the gap problem in polynomial time.
Exercise
In the PCP-to-3SAT conversion, each verifier test becomes at most K = 8 clauses and soundness is 1/2. What fraction of clauses can be satisfied on a NO instance, and why does this not contradict Håstad's 7/8 threshold?
Show answer
At least half of the tests fail, and each failed test leaves at least one of its at most 8 clauses unsatisfied, so at least a 1/16 fraction of clauses fail. At most 15/16 of the clauses can be satisfied. Since 15/16 is above 7/8, there is no contradiction. The basic construction gives only a weak gap (1 versus 15/16), and Håstad's specialized verifier is what brings the soundness down to 7/8 + ε.
Exercise
Why does the clause-triangle reduction show that independent set inherits the Max-3SAT gap, while the same graph gives no useful hardness for vertex cover with this gap?
Show answer
The maximum independent set equals the maximum number of satisfiable clauses, so the ratio m / ((1−ε)m) carries over directly. The graph has 3m vertices, so the minimum vertex cover is 3m minus the maximum independent set: 2m on YES instances and more than (2+ε)m on NO instances. That gives a ratio of only 1 + ε/2. Taking complements shrinks multiplicative gaps, so vertex cover needs its own, more careful reductions.