TExcelTAD
Home › Parameterized & Fine-Grained Complexity › Fine-Grained Reductions

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: O(n2)O(n^2) for edit distance and 3SUM, O(n3)O(n^3) 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 nn to n5n^5. That is harmless for NP-hardness, but it destroys exponents: if problem BB has an O(N2)O(N^2) algorithm and AA reduces to BB with N=n2N = n^2, we only learn that AA is solvable in O(n4)O(n^4), 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 a(n)a(n) and b(n)b(n) be time bounds. Problem AA is (a,b)(a, b)-reducible to problem BB, written A≤a,bBA \le_{a, b} B, if for every ε>0\varepsilon > 0 there is a δ>0\delta > 0 and an algorithm for AA that, on inputs of size nn,

  • runs in time O(a(n)1−δ)O(a(n)^{1 - \delta}), not counting oracle calls, and
  • makes calls to an oracle for BB on instances of sizes n1,…,nqn_1, \ldots, n_q with
∑i=1qb(ni)1−ε≤a(n)1−δ.\sum_{i=1}^{q} b(n_i)^{1 - \varepsilon} \le a(n)^{1 - \delta}.

Consequence. If A≤a,bBA \le_{a, b} B and BB can be solved in time O(b(n)1−ε)O(b(n)^{1 - \varepsilon}) for some ε>0\varepsilon > 0, then AA can be solved in time O(a(n)1−δ)O(a(n)^{1 - \delta}) for some δ>0\delta > 0. Read in reverse: if AA needs a(n)1−o(1)a(n)^{1 - o(1)} time, so does BB with respect to bb.

Typical instances: a=b=n2a = b = n^2 (quadratic problems), a=b=n3a = b = n^3 (cubic, "subcubic equivalence"), and a(n)=2na(n) = 2^n, b(n)=n2b(n) = n^2 for reductions from CNF-SAT to quadratic problems, where the reduction itself may take 2n/22^{n/2} 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 ε>0\varepsilon > 0)
SETH there is a kk such that kk-SAT has no O(2(1−ε)n)O(2^{(1-\varepsilon)n}) algorithm
OV conjecture Orthogonal Vectors with nn vectors of dimension d=clog⁡nd = c \log n (some cc) has no O(n2−ε)O(n^{2-\varepsilon}) algorithm
3SUM conjecture 3SUM on nn integers has no O(n2−ε)O(n^{2-\varepsilon}) algorithm
APSP conjecture APSP on nn-vertex graphs with polynomially bounded integer weights has no O(n3−ε)O(n^{3-\varepsilon}) 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 SS (do a+b+c=0a + b + c = 0 for three entries at distinct positions?) and three lists A,B,CA, B, C (is there a∈Aa \in A, b∈Bb \in B, c∈Cc \in C with a+b+c=0a + b + c = 0?). They are equivalent under linear-time reductions. From one list to three, take A=B=C=SA = B = C = S 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 ∣x∣<M\lvert x \rvert < M, use

A′={a+4M:a∈A},B′={b+40M:b∈B},C′={c−44M:c∈C},S=A′∪B′∪C′.A' = \{ a + 4M : a \in A \}, \quad B' = \{ b + 40M : b \in B \}, \quad C' = \{ c - 44M : c \in C \}, \quad S = A' \cup B' \cup C'.

The offsets 4M,40M,−44M4M, 40M, -44M sum to 0, while every other way of picking three offsets (with repetition) sums to a nonzero multiple of 4M4M with absolute value at least 12M12M, which the original values, of total absolute value below 3M3M, cannot cancel. The reduction runs in linear time and produces one instance of size 3n3n, so it is an (n2,n2)(n^2, n^2)-reduction. The program checks all offset combinations and compares answers on random lists.

python · try it yourself
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 P=A+BP = A + B of all n2n^2 pairwise sums and ask whether some p∈Pp \in P and c∈Cc \in C have p+c=0p + c = 0. The two-list problem is easy, linear time with hashing. But the instance has size N=n2N = n^2, so the linear algorithm gives O(n2)O(n^2) for 3SUM, the same as before: a linear-time target problem reached through a quadratic blow-up proves nothing about subquadratic 3SUM.

python · try it yourself
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 nn doubles. A fine-grained reduction from an n2n^2 problem may produce instances whose total cost under the target's conjectured time stays below n2−δn^{2-\delta}; here it does not.

What fine-grained reductions buy

  • Hardness transfer. "Edit distance in O(n2−ε)O(n^{2-\varepsilon}) 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?

  1. They are not transitive
  2. They may blow up instance sizes polynomially, which destroys information about exact exponents
  3. They require nondeterminism
  4. They only work for decision problems

What does A≤a,bBA \le_{a,b} B guarantee?

  1. AA and BB have the same running time
  2. A polynomial speedup for BB relative to b(n)b(n) gives a polynomial speedup for AA relative to a(n)a(n)
  3. AA is NP-hard
  4. BB is at most as hard as AA

Which hypothesis is known to imply the OV conjecture?

  1. The 3SUM conjecture
  2. SETH
  3. The APSP conjecture
  4. P ≠\ne NP

In the three-lists-to-one reduction for 3SUM, why do the offsets 4M4M, 40M40M and −44M-44M work?

  1. They are prime
  2. Only one element from each list has offsets summing to 0; every other choice of three offsets sums to at least 12M12M in absolute value, more than the original values can cancel
  3. They make all numbers positive
  4. They sort the list