Sub topic 17
Further Directions: Approximation-Preserving and Fine-Grained Reductions
This chapter assumes you already know polynomial-time (Karp) reductions, NP-completeness, and the Independent Set and Vertex Cover reductions from earlier chapters. It also assumes you can read Big-O bounds such as O(n²) and O(2ⁿ). The goal here is a map rather than a full course. You will see two ways that researchers make reductions carry more information than a plain yes or no answer.
A Karp reduction tells you one thing: whether problem B can be solved in polynomial time at all. It says nothing about how well you can approximate an optimization problem. It also says nothing about whether the best exponent is n² or n^1.5. Both questions matter in practice, and both need reductions with stronger guarantees.
Why Karp Reductions Lose Approximation Information
From the earlier chapter, S is an independent set exactly when V − S is a vertex cover. So the two decision problems reduce to each other with almost no work. As optimization problems, they behave very differently:
- Minimum Vertex Cover has a simple 2-approximation. Take a maximal matching and put both endpoints of every matched edge into the cover.
- Maximum Independent Set cannot be approximated within n^(1−ε) for any ε > 0 unless P = NP (Håstad; Zuckerman).
Complementation preserves the size of an optimal solution, but it does not preserve the ratio. A cover that is twice the optimum can have a complement that is nearly empty. The code below shows this on a graph made of disjoint edges.
def matching_vertex_cover(vertices, edges):
"""2-approximation: take both endpoints of a maximal matching."""
cover = set()
for u, v in edges:
if u not in cover and v not in cover:
cover.update((u, v))
return cover
def is_vertex_cover(edges, c):
return all(u in c or v in c for u, v in edges)
def is_independent_set(edges, s):
return all(not (u in s and v in s) for u, v in edges)
n = 20
vertices = list(range(n))
edges = [(2 * i, 2 * i + 1) for i in range(n // 2)] # a perfect matching
cover = matching_vertex_cover(vertices, edges)
indep = set(vertices) - cover
opt_cover = n // 2 # one endpoint per edge
opt_indep = n // 2 # the other endpoint per edge
assert is_vertex_cover(edges, cover)
assert is_independent_set(edges, indep)
print("cover size:", len(cover), "ratio:", len(cover) / opt_cover) # 20, 2.0
print("independent set size:", len(indep), "of optimum", opt_indep) # 0 of 10The cover is within the promised factor of 2. Its complement is an independent set of size 0 when the optimum is 10, so the ratio is unbounded. The reduction is correct as a decision reduction and useless as an approximation reduction.
Approximation-Preserving Reductions
An approximation-preserving reduction from optimization problem A to optimization problem B has two maps:
- f turns an instance x of A into an instance f(x) of B.
- g turns any feasible solution y of f(x) back into a feasible solution g(y) of x.
The requirement is that if y is close to optimal for f(x), then g(y) is close to optimal for x. Different definitions fix "close" in different ways.
L-reductions
Papadimitriou and Yannakakis defined the L-reduction with two constants α, β > 0:
- OPTB(f(x)) ≤ α · OPTA(x). The optimum does not blow up.
- |costA(g(y)) − OPTA(x)| ≤ β · |costB(y) − OPTB(f(x))|. The absolute error shrinks or grows by at most a constant factor.
If B has a polynomial-time approximation scheme (PTAS), so does A. A PTAS is an algorithm that achieves ratio 1 + ε for every fixed ε > 0. The complement map between Vertex Cover and Independent Set fails condition 1 on general graphs. That failure is exactly what the code above exhibits.
APX-hardness and PTAS reductions
APX is the class of optimization problems with some constant-factor approximation. A problem is APX-hard if every APX problem reduces to it under a PTAS reduction, a slightly more general relative of the L-reduction. An APX-hard problem has no PTAS unless P = NP. Max-3SAT, Minimum Vertex Cover, and metric TSP are all APX-hard.
Gap-preserving reductions
Most strong inapproximability results start from a gap problem rather than an ordinary decision problem. The PCP theorem gives a polynomial-time reduction from SAT to Max-3SAT with this property:
- Satisfiable formulas map to formulas where every clause can be satisfied.
- Unsatisfiable formulas map to formulas where at most a (1 − δ) fraction of clauses can be satisfied, for a fixed δ > 0.
Any algorithm with ratio better than 1 − δ could tell the two cases apart and therefore decide SAT. A gap-preserving reduction then carries the gap to the target problem. Håstad sharpened this to show that Max-3SAT cannot be approximated better than 7/8 + ε. That bound is tight, because a random assignment satisfies 7/8 of the clauses in expectation. Gap reductions also give the 1.36 lower bound for Vertex Cover (Dinur and Safra). Under the Unique Games Conjecture, the bound rises to 2 − ε.
Fine-Grained Reductions
P contains problems solvable in O(n), O(n²), and O(n¹⁰⁰) time. Polynomial-time reductions cannot tell these apart, because the reduction itself may take more time than the problems being compared. Fine-grained complexity asks a sharper question: if we believe problem A needs time a(n), what does that imply about B?
A fine-grained reduction from (A, a(n)) to (B, b(n)) promises the following. For every ε > 0 there is a δ > 0 such that a b(n)^(1−ε) algorithm for B gives an a(n)^(1−δ) algorithm for A. The reduction's own running time must fit inside that improved budget.
The core hypotheses
| Hypothesis | Statement | Typical consequences |
|---|---|---|
| SETH (Strong Exponential Time Hypothesis) | For every ε > 0 there is a k such that k-SAT on n variables needs 2^((1−ε)n) time | Orthogonal Vectors, Edit Distance, LCS need about n² time |
| 3SUM | Deciding whether three of n integers sum to 0 needs n^(2−o(1)) time | Many computational geometry problems need about n² time |
| APSP | All-Pairs Shortest Paths with integer weights needs n^(3−o(1)) time | Negative Triangle, Radius, and Replacement Paths need about n³ time |
None of these is proved. Each one acts like a local "NP-hard" base problem. Reductions from it explain why decades of effort have not beaten certain running times.
Worked reduction: SAT to Orthogonal Vectors
Orthogonal Vectors (OV) takes two sets A and B, each holding N vectors in {0,1}^d. It asks whether some a in A and b in B satisfy a[i]·b[i] = 0 for every coordinate i. Brute force takes O(N² d) time.
Williams' split-and-list reduction works like this. Split the n variables into two halves. For every assignment to the left half, build one vector with one coordinate per clause. A coordinate is 0 if the partial assignment already satisfies that clause, and 1 otherwise. Do the same for the right half. A pair of vectors is orthogonal exactly when every clause is satisfied by at least one half, which means the combined assignment satisfies the formula.
from itertools import product
def half_vectors(variables, clauses):
vecs = []
for bits in product([False, True], repeat=len(variables)):
assign = dict(zip(variables, bits))
vec = tuple(
0 if any(abs(l) in assign and assign[abs(l)] == (l > 0) for l in clause)
else 1
for clause in clauses
)
vecs.append(vec)
return vecs
def sat_to_ov(n, clauses):
half = n // 2
left = list(range(1, half + 1))
right = list(range(half + 1, n + 1))
return half_vectors(left, clauses), half_vectors(right, clauses)
def has_orthogonal_pair(A, B):
return any(all(x * y == 0 for x, y in zip(a, b)) for a in A for b in B)
def brute_force_sat(n, clauses):
for bits in product([False, True], repeat=n):
if all(any(bits[abs(l) - 1] == (l > 0) for l in c) for c in clauses):
return True
return False
tests = [
(3, [(1, -2), (2, 3), (-1, -3)]), # satisfiable
(2, [(1,), (-1,)]), # unsatisfiable
(4, [(1, 2), (-1, 3), (-3, 4), (-2, -4), (-4, 2)]),
]
for n, clauses in tests:
A, B = sat_to_ov(n, clauses)
assert has_orthogonal_pair(A, B) == brute_force_sat(n, clauses)
print("reduction agrees with brute force on all tests")Now count. Each set has N = 2^(n/2) vectors of dimension d = m, the number of clauses. Suppose OV could be solved in O(N^(2−ε) · poly(d)) time. SAT would then take 2^((1−ε/2)n) · poly(m) time, which contradicts SETH. The reduction runs in O(N · m · n) time, well inside that budget. That fit is what makes it a fine-grained reduction rather than just a polynomial one. Backurs and Indyk then reduced OV to Edit Distance. So a truly subquadratic Edit Distance algorithm would also refute SETH.
Choosing the Right Kind of Reduction
| Question you want to answer | Reduction to use | What must be preserved |
|---|---|---|
| Is B in P at all? | Karp (polynomial-time many-one) | Yes/no answers |
| Can B be approximated within a factor r? | L-, PTAS-, or gap-preserving | Solution quality, via the back-map g |
| Can B beat time n^c? | Fine-grained | Exponent, with reduction time below the target bound |
Exercise
The complement map sends a vertex cover C to the independent set V − C. Show it fails condition 1 of an L-reduction from Independent Set to Vertex Cover by finding a family of graphs where OPTVC / OPTIS grows without bound.
Show answer
Use the star graph with one center and n − 1 leaves. The minimum vertex cover is {center}, so OPTVC = 1. The maximum independent set is the n − 1 leaves. Now reverse the roles. On the complete graph Kn, OPTIS = 1 and OPTVC = n − 1, so OPTVC / OPTIS = n − 1, which is unbounded. No constant α can satisfy OPTVC(f(x)) ≤ α · OPTIS(x).
Exercise
In the SAT-to-OV reduction, suppose you split the variables unevenly, with n/3 on the left and 2n/3 on the right. If OV can be solved in O(|A| · |B|^(1−ε)) time, does SAT get a 2^((1−δ)n) algorithm?
Show answer
Yes. |A| = 2^(n/3) and |B| = 2^(2n/3), so the time is 2^(n/3) · 2^((2n/3)(1−ε)) = 2^(n − 2εn/3), times poly(m). Take δ = 2ε/3. Listing B alone costs 2^(2n/3) time, which is still below 2^((1−δ)n) whenever δ < 1/3. So unbalanced OV hardness also follows from SETH.