Fine-Grained Reductions
The second half of the course moves inside P. Many basic problems have simple polynomial algorithms that nobody has managed to improve by a polynomial factor: for edit distance and 3SUM, for all-pairs shortest paths. Fine-grained complexity organizes these problems by reductions that keep track of exact exponents, so that a small speedup for one problem implies a speedup for others. A few conjectures about a few core problems then explain the apparent barriers of many. The field's systematic development is surveyed by Vassilevska Williams (2015 onward, "On some fine-grained questions in algorithms and complexity").
Why classical reductions are too coarse
A polynomial-time reduction may blow up the instance from size to . That is harmless for NP-hardness, but it destroys exponents: if problem has an algorithm and reduces to with , we only learn that is solvable in , which may say nothing new. Fine-grained reductions are required to be efficient relative to the running times in question.
Definition (Vassilevska Williams; stated in the common form). Let and be time bounds. Problem is -reducible to problem , written , if for every there is a and an algorithm for that, on inputs of size ,
- runs in time , not counting oracle calls, and
- makes calls to an oracle for on instances of sizes with
Consequence. If and can be solved in time for some , then can be solved in time for some . Read in reverse: if needs time, so does with respect to .
Typical instances: (quadratic problems), (cubic, "subcubic equivalence"), and , for reductions from CNF-SAT to quadratic problems, where the reduction itself may take time.
The core conjectures
Fine-grained lower bounds rest on a handful of hypotheses, each about a problem studied for decades:
| Hypothesis | Statement (for every ) |
|---|---|
| SETH | there is a such that -SAT has no algorithm |
| OV conjecture | Orthogonal Vectors with vectors of dimension (some ) has no algorithm |
| 3SUM conjecture | 3SUM on integers has no algorithm |
| APSP conjecture | APSP on -vertex graphs with polynomially bounded integer weights has no algorithm |
All four are conjectures. SETH implies the OV conjecture (proved in Orthogonal Vectors and the Split-and-List Reduction); no reductions are known between SETH, 3SUM and APSP in either direction, which is why they are kept as separate bases of the reduction web.
A first reduction: three lists to one
3SUM comes in two forms: one list (do for three entries at distinct positions?) and three lists (is there , , with ?). They are equivalent under linear-time reductions. From one list to three, take and handle repeated positions with care. From three to one, shift the lists apart so that only one element from each list can sum to zero. If all values satisfy , use
The offsets sum to 0, while every other way of picking three offsets (with repetition) sums to a nonzero multiple of with absolute value at least , which the original values, of total absolute value below , cannot cancel. The reduction runs in linear time and produces one instance of size , so it is an -reduction. The program checks all offset combinations and compares answers on random lists.
import random
from itertools import combinations_with_replacement, product
offsets = {"A": 4, "B": 40, "C": -44}
for combo in combinations_with_replacement("ABC", 3):
total = sum(offsets[x] for x in combo)
print("".join(combo), f"{total:4} M" + (" <- the only zero" if total == 0 else ""))
def three_lists(A, B, C):
Cs = set(C)
return any(-(a + b) in Cs for a, b in product(A, B))
def one_list(S):
n, pos = len(S), {}
for i, x in enumerate(S):
pos.setdefault(x, []).append(i)
for i in range(n):
for j in range(i + 1, n):
for k in pos.get(-(S[i] + S[j]), []):
if k != i and k != j:
return True
return False
rng = random.Random(4)
agree = 0
for trial in range(200):
A, B, C = ([rng.randint(-30, 30) for _ in range(6)] for _ in range(3))
M = 31
S = [a + 4 * M for a in A] + [b + 40 * M for b in B] + [c - 44 * M for c in C]
agree += three_lists(A, B, C) == one_list(S)
print("answers agree on", agree, "of 200 random instances")AAA 12 M
AAB 48 M
AAC -36 M
ABB 84 M
ABC 0 M <- the only zero
ACC -84 M
BBB 120 M
BBC 36 M
BCC -48 M
CCC -132 M
answers agree on 200 of 200 random instances
The size of the reduction matters
A second, deliberately wasteful "reduction" shows why the definition counts instance sizes. 3SUM on three lists reduces to a two-list problem: form the list of all pairwise sums and ask whether some and have . The two-list problem is easy, linear time with hashing. But the instance has size , so the linear algorithm gives for 3SUM, the same as before: a linear-time target problem reached through a quadratic blow-up proves nothing about subquadratic 3SUM.
import random
rng = random.Random(2)
for n in [100, 200, 400, 800]:
A, B, C = ([rng.randint(-10**6, 10**6) for _ in range(n)] for _ in range(3))
P = [a + b for a in A for b in B] # the reduction's output: n^2 numbers
Cneg = {-c for c in C}
found = any(p in Cneg for p in P) # the "linear-time" two-list check
print(f"n = {n:3}: reduced instance has {len(P) + len(C):7} numbers, found = {found}")n = 100: reduced instance has 10100 numbers, found = False
n = 200: reduced instance has 40200 numbers, found = True
n = 400: reduced instance has 160400 numbers, found = True
n = 800: reduced instance has 640800 numbers, found = True
The work is dominated by writing down the reduced instance, which grows by a factor 4 each time doubles. A fine-grained reduction from an problem may produce instances whose total cost under the target's conjectured time stays below ; here it does not.
What fine-grained reductions buy
- Hardness transfer. "Edit distance in refutes SETH" is a fine-grained reduction (CNF-SAT to OV to edit distance), and it explains 40 years of failure to beat the textbook dynamic program (Edit Distance and LCS under SETH).
- Equivalence classes. Reductions in both directions group problems that rise or fall together: APSP, negative triangle, min-plus product, radius and many others are all equivalent under subcubic reductions (APSP, Negative Triangle and Subcubic Equivalence).
- Guidance for algorithm design. A conditional lower bound says where not to look; it often redirects research toward approximation, special cases or log-factor improvements, which the conjectures allow.
Test yourself
Why are ordinary polynomial-time reductions too coarse for problems in P?
- They are not transitive
- They may blow up instance sizes polynomially, which destroys information about exact exponents
- They require nondeterminism
- They only work for decision problems
What does guarantee?
- and have the same running time
- A polynomial speedup for relative to gives a polynomial speedup for relative to
- is NP-hard
- is at most as hard as
Which hypothesis is known to imply the OV conjecture?
- The 3SUM conjecture
- SETH
- The APSP conjecture
- P NP
In the three-lists-to-one reduction for 3SUM, why do the offsets , and work?
- They are prime
- Only one element from each list has offsets summing to 0; every other choice of three offsets sums to at least in absolute value, more than the original values can cancel
- They make all numbers positive
- They sort the list