Measure difficulty in terms of the input size and a separate parameter — typically the solution size, a structural width, or a bound in the statement.

FPT — fixed-parameter tractable

A problem is FPT if it is solvable in

for some function . The exponential blowup is confined to , so the algorithm is practical whenever is small — regardless of how large is.

Contrast: is not FPT (the exponent depends on ); it is the weaker class XP.

ComplexityClass,
FPT
FPT
FPT ✘ (but FPT)
XPastronomically large ✘

The FPT problems

ProblemParameterBest known
Vertex coversolution size
Feedback vertex set
-path (a path of vertices) (colour coding)
Steiner treenumber of terminals
TSPnumber of cities
Anything on bounded treewidthtreewidth
Closest stringnumber of stringsFPT
-hitting set

The W-hierarchy — what is not FPT

ProblemClass
Independent set / clique (parameter = size)W[1]-hard
Dominating setW[2]-hard
Set cover (parameter = number of sets)W[2]-hard
Graph colouring (parameter = colours)not FPT (NP-hard for )

W[1]-hardness is the parameterized analogue of NP-hardness: no FPT algorithm is expected. Note the striking asymmetry — vertex cover is FPT, but its complement independent set is W[1]-hard.

Kernelization — the defining technique

Reduce the instance in polynomial time to an equivalent one whose size depends only on (the kernel), then solve the kernel by brute force.

Vertex cover kernel — Buss’s rules

  1. A vertex of degree must be in the cover (else all its neighbours are, exceeding ): take it, decrement .
  2. Delete isolated vertices.
  3. If more than edges remain, answer no (each of vertices covers edges).

The result is a kernel with edges and vertices. The Nemhauser-Trotter LP gives a stronger -vertex kernel.

// after kernelization, branch: for an uncovered edge (u,v),
// either u or v is in the cover -> O(2^k) branching, or O(1.28^k) with better rules
bool vc(Graph& g, int k) {
    kernelize(g, k);
    if (g.edges.empty()) return true;
    if (k == 0) return false;
    auto [u, v] = g.anyEdge();
    return vc(g.remove(u), k - 1) || vc(g.remove(v), k - 1);
}

A problem is FPT iff it has a kernel. That equivalence is the central theorem of the field.

Bounded treewidth

Treewidth measures how tree-like a graph is: trees have , series-parallel graphs , planar graphs , and complete graphs .

Almost every NP-hard graph problem is solvable in on graphs of treewidth (Courcelle’s theorem, for anything expressible in monadic second-order logic).

This is why so many problems are easy on trees — treewidth 1. In contests, “the graph is a tree” or “the graph is a cactus” is exactly this escape hatch.

StructureTreewidth
Tree, forest1
Cycle, cactus2
Series-parallel2
Outerplanar2
grid
Planar
Complete graph

Colour coding

A randomised FPT technique: to find a path of vertices, colour the vertices randomly with colours and look for a colourful path (all colours distinct) — which is a DP over colour subsets. The true path is colourful with probability , so repetitions suffice.

, derandomisable with -perfect hash families. The same idea finds any small subgraph pattern.

In competitive programming

Parameterized thinking is really “read the constraints”:

ConstraintIntended technique
DP
meet in the middle
terminals, largeSteiner tree DP
special verticessubset DP over those
”The graph is a tree”tree DP (treewidth 1)
“The graph is a cactus”treewidth 2
”At most removals”branching,
A small alphabet or value rangethat is the parameter

Two independent small numbers in the constraints ( large, tiny) is the signature of an FPT problem — and the exponential factor is meant to be in .

See also: NP-Completeness · Tree DP · Branch and Bound