TExcelTAD
Home › Parameterized & Fine-Grained Complexity › Parameterized Reductions and W[1]-Hardness

Parameterized Reductions and W[1]-Hardness

Vertex cover parameterized by kk is FPT. Its close relative CLIQUE, "does GG have kk pairwise adjacent vertices?", has resisted every attempt: the best algorithms run in time nO(k)n^{O(k)}, with the exponent improved only by a constant factor through fast matrix multiplication (O(nωk/3)O(n^{\omega k / 3}), Nešetřil and Poljak, 1985). NP-hardness cannot explain the difference, since both problems are NP-complete. Parameterized complexity needs its own notion of reduction and its own hardness classes. This lesson defines them; the next one connects them to the Exponential Time Hypothesis.

Parameterized reductions

A parameterized reduction from a parameterized problem AA to BB maps an instance (x,k)(x, k) of AA to an instance (x′,k′)(x', k') of BB such that

  1. (x,k)∈A  ⟺  (x′,k′)∈B(x, k) \in A \iff (x', k') \in B;
  2. k′≤g(k)k' \le g(k) for some computable gg;
  3. the map runs in time f(k)⋅∣x∣O(1)f(k) \cdot \lvert x \rvert^{O(1)}.

Condition 2 is the new one: the parameter of the target may depend only on the old parameter. Under these conditions, if BB is FPT then so is AA: run the reduction, then the FPT algorithm for BB, which costs h(g(k))⋅(f(k)∣x∣O(1))O(1)h(g(k)) \cdot (f(k) \lvert x \rvert^{O(1)})^{O(1)}.

Not every polynomial reduction is parameterized. The classical reduction from INDEPENDENT SET to VERTEX COVER maps (G,k)(G, k) to (G,n−k)(G, n - k): a set is independent exactly when its complement is a cover. The new parameter n−kn - k depends on nn, so the reduction says nothing parameterized, and indeed vertex cover is FPT while independent set is not believed to be. On the other hand, CLIQUE and INDEPENDENT SET are parameterized-equivalent through the complement graph, with k′=kk' = k.

python · try it yourself
import random
from itertools import combinations

def gnp(n, p, seed):
    rng = random.Random(seed)
    return {frozenset(e) for e in combinations(range(n), 2) if rng.random() < p}

def complement(n, E):
    return {frozenset(e) for e in combinations(range(n), 2)} - E

def has_clique(n, E, k):
    return any(all(frozenset(p) in E for p in combinations(S, 2)) for S in combinations(range(n), k))

def has_independent(n, E, k):
    return any(all(frozenset(p) not in E for p in combinations(S, 2)) for S in combinations(range(n), k))

def has_cover(n, E, k):
    return any(all(e & set(S) for e in E) for S in combinations(range(n), k))

n = 11
print("seed  k  clique(G,k)  indep(co-G,k)  indep(G,k)  cover(G,n-k)")
for seed in range(3):
    E = gnp(n, 0.4, seed)
    for k in [4, 5]:
        print(f"{seed:4} {k:2} {has_clique(n, E, k)!s:12} {has_independent(n, complement(n, E), k)!s:14}"
              f" {has_independent(n, E, k)!s:11} {has_cover(n, E, n - k)}")
seed  k  clique(G,k)  indep(co-G,k)  indep(G,k)  cover(G,n-k)
   0  4 False        False          True        True
   0  5 False        False          True        True
   1  4 False        False          True        True
   1  5 False        False          False       False
   2  4 True         True           True        True
   2  5 False        False          True        True

Both pairs of columns agree on every row. The first pair is a parameterized reduction (kk stays kk); the second pair is a correct reduction, but the parameter of the vertex cover instance is n−kn - k, here 7 or 6, growing with the graph.

The class W[1]

The W hierarchy was defined by Downey and Fellows (1992–1995) via weighted satisfiability of circuits of bounded "weft" (the number of large gates on any input-output path). An equivalent definition that suffices here:

W[1] is the class of parameterized problems that have a parameterized reduction to kk-CLIQUE. A problem is W[1]-hard if kk-CLIQUE reduces to it, and W[1]-complete if both hold.

The working hypothesis FPT ≠\ne W[1] says that kk-CLIQUE is not FPT. Evidence: decades of failed attempts, the fact that W[1] also contains SHORT NONDETERMINISTIC TURING MACHINE ACCEPTANCE (does a given nondeterministic machine accept within kk steps?), which looks as hard as anything parameterized by kk can be, and the fact that FPT == W[1] would refute the Exponential Time Hypothesis (next lesson). A W[1]-hardness proof is therefore strong evidence that no f(k)⋅nO(1)f(k) \cdot n^{O(1)} algorithm exists.

A typical reduction: multicolored clique

Many W[1]-hardness proofs start from a variant with extra structure. MULTICOLORED CLIQUE: the vertices are partitioned into kk color classes V1,…,VkV_1, \ldots, V_k; is there a clique with exactly one vertex of each color? It is W[1]-hard by the following reduction from CLIQUE: make kk copies of the vertex set, copy ii forming class ViV_i, and join (u,i)(u, i) to (v,j)(v, j) when i≠ji \ne j, u≠vu \ne v and uv∈Euv \in E. A multicolored kk-clique picks kk distinct, pairwise adjacent original vertices, and every kk-clique gives a multicolored one by assigning its vertices to the classes in any order. The new parameter is kk and the size is O(k2m)O(k^2 m): a parameterized reduction.

The color classes make later gadgets simpler: a gadget can "select one vertex from ViV_i" and "check one edge between ViV_i and VjV_j" separately. The program builds the reduction and checks it.

python · try it yourself
import random
from itertools import combinations, product

def gnp(n, p, seed):
    rng = random.Random(seed)
    return {frozenset(e) for e in combinations(range(n), 2) if rng.random() < p}

def has_clique(n, E, k):
    return any(all(frozenset(p) in E for p in combinations(S, 2)) for S in combinations(range(n), k))

def to_multicolored(n, E, k):
    """vertices (v, i): copy i of v; edges only between different colors."""
    F = set()
    for (u, i), (v, j) in combinations(list(product(range(n), range(k))), 2):
        if i != j and u != v and frozenset((u, v)) in E:
            F.add(frozenset(((u, i), (v, j))))
    return F

def has_multicolored_clique(n, F, k):
    for choice in product(range(n), repeat=k):          # one vertex per color class
        verts = [(choice[i], i) for i in range(k)]
        if all(frozenset(p) in F for p in combinations(verts, 2)):
            return True
    return False

n = 9
print("seed  k  clique  multicolored  |V'|  |E'|")
for seed in range(4):
    E = gnp(n, 0.45, seed)
    for k in [3, 4]:
        F = to_multicolored(n, E, k)
        print(f"{seed:4} {k:2} {has_clique(n, E, k)!s:7} {has_multicolored_clique(n, F, k)!s:13} {n * k:5} {len(F):5}")
seed  k  clique  multicolored  |V'|  |E'|
   0  3 True    True             27    66
   0  4 False   False            36   132
   1  3 True    True             27   132
   1  4 True    True             36   264
   2  3 True    True             27   102
   2  4 False   False            36   204
   3  3 True    True             27    72
   3  4 False   False            36   144

The W hierarchy

Allowing larger weft gives a hierarchy (stated):

FPT⊆W[1]⊆W[2]⊆⋯⊆W[P]⊆XP.\text{FPT} \subseteq \text{W[1]} \subseteq \text{W[2]} \subseteq \cdots \subseteq \text{W[P]} \subseteq \text{XP}.
Problem (parameter kk = solution size) Complexity
CLIQUE, INDEPENDENT SET, MULTICOLORED CLIQUE W[1]-complete
SHORT NONDETERMINISTIC TM ACCEPTANCE W[1]-complete
DOMINATING SET, SET COVER, HITTING SET (unbounded set size) W[2]-complete
WEIGHTED CIRCUIT SATISFIABILITY W[P]-complete

All inclusions are believed to be strict, and FPT ≠\ne XP is known unconditionally (by a diagonalization, Downey and Fellows). In practice, W[1]-hardness is the result one proves; membership in a particular level matters less than knowing that FPT is out of reach.

Further W[1]-hard problems include kk-clique in regular graphs, independent set in unit disk graphs, partitioned subgraph isomorphism, and many problems with structural parameters, such as list coloring parameterized by treewidth. For problems parameterized by treewidth this shows that Courcelle's theorem has limits: list coloring is not MSO-expressible with a bounded formula, because the list sizes are unbounded.

Test yourself

Which condition distinguishes a parameterized reduction from a polynomial-time many-one reduction?

  1. It must run in linear time
  2. The new parameter k′k' must be bounded by a function of the old parameter kk alone
  3. It must preserve the instance size
  4. It must be randomized

Why is the map (G,k)↦(G,n−k)(G, k) \mapsto (G, n - k) from INDEPENDENT SET to VERTEX COVER not a parameterized reduction?

  1. Because it is incorrect
  2. Because the new parameter n−kn - k depends on the input size nn
  3. Because it takes exponential time
  4. Because vertex cover is W[1]-hard

What does a W[1]-hardness proof for a problem suggest?

  1. The problem is NP-hard
  2. The problem has no f(k)⋅nO(1)f(k) \cdot n^{O(1)} algorithm unless FPT == W[1]
  3. The problem is undecidable
  4. The problem has a polynomial kernel

In which class is DOMINATING SET parameterized by solution size complete?

  1. FPT
  2. W[1]
  3. W[2]
  4. XP but no W class