← 🧮 P, NP & NP-Completeness
Subtopic 2 of 3

5.2Reductions and classic NP-complete problems

The idea

A polynomial reduction turns instances of one problem into instances of another. To show a problem is hard, reduce a known hard problem to it.

Think of it like this: Translating a puzzle into another puzzle: if you could solve the second one quickly, you could solve the first.

Why it exists

The direction of reductions is the favourite trap.

How it works

  1. A ≤ₚ B: an algorithm for B gives one for A.
  2. To prove B NP-hard: pick a known NP-hard A and show A ≤ₚ B.
  3. If B ∈ P and A ≤ₚ B, then A ∈ P.
  4. Chain: SAT → 3-SAT → Clique → Independent set → Vertex cover.

Worked example: Clique ≤ₚ Independent set

Complement the graph: a clique in G is an independent set in the complement, so an independent-set solver solves clique.

Now play with it

  • →Read the reduction table row by row.
  • →Say each rule aloud with A and B swapped to see how it would become false.
ReductionDirection to remember
SAT ≤ₚ 3-SATconvert long clauses with extra variables
3-SAT ≤ₚ Cliqueone vertex per literal, join compatible literals from different clauses
Clique ≤ₚ Independent setcomplement the graph
Independent set ↔ Vertex covercomplement sets: S independent ⇔ V − S is a cover
Hamiltonian cycle ≤ₚ TSPweight 1 for edges, 2 for non-edges
To prove B is NP-hardreduce a known NP-hard problem A to B (A ≤ₚ B)
If A ≤ₚ B and B ∈ Pthen A ∈ P
If A ≤ₚ B and A is NP-hardthen B is NP-hard

Cook-Levin theorem: SAT is NP-complete, the first problem proved so. All others follow by reductions.

Check yourself

To prove problem X is NP-hard, you should reduce

Remember: Reduce the known hard problem TO the new one.
Exam notes (the dense version)

A polynomial-time reduction A ≤ₚ B converts instances of A into instances of B. To prove B is NP-hard, reduce a known NP-hard problem to B (the direction matters). The first NP-complete problem is SAT (Cook-Levin). Chain: SAT → 3-SAT → Clique / Independent Set / Vertex Cover → Hamiltonian Cycle → TSP (decision), Subset Sum, 3-Colouring.