A ≤p B

The reduction collection

Every reduction the course carried out — 28 in all, 26 Karp reductions and 2 inapproximability barriers — with the construction, both directions of the correctness proof, and the time and space cost of the reduction itself. The arrow points from the problem already known to be hard to the problem whose hardness we want to establish.

28reductions
27with a visualization
2gap arguments
0off-corpus

Every reduction names where it was read from — a lesson heading, an exercise, or the sittings that asked it. A reduction with no course source is marked off-corpus explicitly.

The direction is the whole claim. A ≤p B says B is the harder one — the single most common mistake in this material.

Guided construction

The course reduction network

Step 1 of 6
Canonical NP-complete reduction networkSAT flows to 3SAT, then branches into compatibility graphs, route problems, cut and coloring problems, and arithmetic encodings. Every edge names its concrete transformation.Tseitin + clause splittingSAT3SAT
Logic / compatibility
Visible branch: Logic source1 labeled transformations

28 of 28 reductions

computation tableau, 2×3 windowsVisual

A ∈ NP ≤p SAT

Every language A∈NPA\in\mathrm{NP} satisfies A≤pSATA\le_p\mathrm{SAT}. This is the Cook–Levin theorem: SAT\mathrm{SAT} is NP-hard, and since SAT∈NP\mathrm{SAT}\in\mathrm{NP} as well, it is NP-complete.
L9LessonExerciseExam
the identity map

3SAT ≤p SAT

3SAT≤pSAT\mathrm{3SAT}\le_p\mathrm{SAT}, and therefore 3SAT∈NP\mathrm{3SAT}\in\mathrm{NP}.
L8Lesson
clause splitting with a fresh variableVisual

SAT ≤p 3SAT

SAT≤p3SAT\mathrm{SAT}\le_p\mathrm{3SAT}, hence 3SAT\mathrm{3SAT} is NP-complete.
L8LessonExerciseExam
padding short clausesVisual

3SAT ≤p 3SAT=

Let 3SAT=\mathrm{3SAT}^{=} be the variant in which every clause holds exactly three literals. Then 3SAT≤p3SAT=\mathrm{3SAT}\le_p\mathrm{3SAT}^{=}, so 3SAT=\mathrm{3SAT}^{=} is NP-complete too.
L8Lesson
a shared fourth literalVisual

3SAT ≤p 4NAE

3SAT≤p4NAE\mathrm{3SAT}\le_p\mathrm{4NAE}, so 4NAE\mathrm{4NAE} is NP-hard. A formula is NAE-satisfiable if some assignment gives every clause both a true literal and a false one.
L10LessonExam
NAE clause splitting with a fresh variableVisual

4NAE ≤p 3NAE

4NAE≤p3NAE\mathrm{4NAE}\le_p\mathrm{3NAE}, so 3NAE\mathrm{3NAE} is NP-hard.
L10LessonExam
graph complementVisual

IS ≤p CLIQUE

IS≤pCLIQUE\mathrm{IS}\le_p\mathrm{CLIQUE}: a polynomial algorithm for CLIQUE\mathrm{CLIQUE} would also solve IS\mathrm{IS}.
L7LessonExercise
graph complement, the other wayVisual

CLIQUE ≤p IS

CLIQUE≤pIS\mathrm{CLIQUE}\le_p\mathrm{IS} — the very same reduction, passing to the complement, works in the reverse direction too.
L7LessonExam
same graph, complement the setVisual

IS ≤p VC

IS≤pVC\mathrm{IS}\le_p\mathrm{VC}, hence VC\mathrm{VC} is NP-complete.
L10LessonExerciseExam
a vertex per satisfying assignment, an edge per conflictVisual

3SAT ≤p IS

3SAT≤pIS\mathrm{3SAT}\le_p\mathrm{IS}, hence IS\mathrm{IS} is NP-complete.
ExerciseExam
variable edges, clause triangles, threshold n+2mVisual

3NAE ≤p MAXCUT

3NAE≤pMAXCUT\mathrm{3NAE}\le_p\mathrm{MAXCUT} (over multigraphs), so MAXCUT\mathrm{MAXCUT} is NP-hard.
L10LessonExerciseExam
a vertex N that burns a colour, a triangle per clauseVisual

3NAE ≤p 3COL

3NAE≤p3COL\mathrm{3NAE}\le_p\mathrm{3COL}, hence 3COL\mathrm{3COL} is NP-complete.
L10Lesson
one new vertex joined to everythingVisual

3COL ≤p 4COL

3COL≤p4COL\mathrm{3COL}\le_p\mathrm{4COL}, hence 4COL\mathrm{4COL} is NP-complete. The same idea gives 3COL≤pkCOL\mathrm{3COL}\le_p k\mathrm{COL} for every constant k≥3k\ge3.
L11 · L10Lesson
a vertex per edge, same kVisual

VC ≤p DS

VC≤pDS\mathrm{VC}\le_p\mathrm{DS}, so DS\mathrm{DS} (dominating set) is NP-complete.
L19LessonExam
clause cliques, literal–negation edges, threshold mVisual

SAT ≤p MaxIS

SAT≤pMaxIS\mathrm{SAT}\le_p\mathrm{MaxIS}, so MaxIS\mathrm{MaxIS} is NP-hard. Here MaxIS\mathrm{MaxIS} is the language of pairs ⟨G,k⟩\langle G,k\rangle for which the maximum independent set has size exactly kk.
L22LessonExam
plant k−1 vertices joined to every old oneVisual

co-IS ≤p MaxIS

IS‾≤pMaxIS\overline{\mathrm{IS}}\le_p\mathrm{MaxIS}, so MaxIS\mathrm{MaxIS} is coNP-hard.
L22Lesson
inflate each edge to size 3Visual

VC ≤p 3H-VC

VC≤p3H-VC\mathrm{VC}\le_p\mathrm{3H\text{-}VC}, so vertex cover on 3-uniform hypergraphs is NP-hard. A 3-uniform hypergraph is a pair H=(V,E)H=(V,E) in which every hyperedge is a 33-element subset of VV.
L25LessonExercise
subdivide each edge into a path of length 3Visual

Max-Cut-Multi ≤p Max-Cut

Max-Cut-Multi≤pMax-Cut\mathrm{Max\text{-}Cut\text{-}Multi}\le_p\mathrm{Max\text{-}Cut} — the hardness of max cut does not come from parallel edges; it survives on simple graphs.
Exam
a leaf on every vertexVisual

VC ≤p MODEST

Call a graph modest if its maximum degree is at most 11. The problem "can at most kk vertices be removed so the remainder is modest" is NP-complete, via VC≤pMODEST\mathrm{VC}\le_p\mathrm{MODEST}.
Exam
one digit column per edge, no carryingVisual

VC ≤p SUBSET-SUM

VC≤pSUBSET-SUM\mathrm{VC}\le_p\mathrm{SUBSET\text{-}SUM}, hence SUBSET-SUM\mathrm{SUBSET\text{-}SUM} is NP-complete.
L11LessonExercise
variable columns and clause columns, with slack digitsVisual

3SAT ≤p SUBSET-SUM

3SAT≤pSUBSET-SUM\mathrm{3SAT}\le_p\mathrm{SUBSET\text{-}SUM} — the classical form of the reduction, encoding the choice of assignment and the satisfaction of clauses in carry-free digit columns.
Exam
a single padding element, |2S−T|Visual

SUBSET-SUM ≤p PARTITION

SUBSET-SUM≤pPARTITION\mathrm{SUBSET\text{-}SUM}\le_p\mathrm{PARTITION}, so PARTITION\mathrm{PARTITION} is NP-hard.
L12LessonExerciseExam
normalize by half the total, capacity 1, two binsVisual

PARTITION ≤p BIN-PACKING

PARTITION≤pBIN-PACKING\mathrm{PARTITION}\le_p\mathrm{BIN\text{-}PACKING}, so BIN-PACKING\mathrm{BIN\text{-}PACKING} is NP-hard — and stays hard even when the number of bins is the constant k=2k=2.
L12LessonExerciseExam
a triple v_in, v_mid, v_out per vertexVisual

DHC ≤p UHC

DHC≤pUHCDHC\le_p UHC — a Hamiltonian cycle in a directed graph reduces to one in an undirected graph, by encoding the orientation inside the graph's structure.
Exam
a cycle of four reductions instead of twelveVisual

DHP/DHC/UHC/UHP ≤p each other

Between any two of the four problems DHPDHP, DHCDHC, UHPUHP, UHCUHC there is a polynomial-time reduction; they are polynomially equivalent, and hence all NP-hard.
L12 · L12LessonExam
complete the graph, weights 1 and 2, budget |V|Visual

UHC ≤p TSP

UHC≤pTSPUHC\le_p TSP, so TSPTSP is NP-hard (and with membership in NP, NP-complete).
L12LessonExerciseExam
a huge weight α|V|+1 on missing edgesGapVisual

UHC ≤p TSP-OPT

For every α≥1\alpha\ge1: if the optimization version of general TSPTSP admits an α\alpha-approximation, then P=NP\mathrm{P}=\mathrm{NP}. In fact this is an equivalence: some approximation exists   ⟺  P=NP\iff \mathrm{P}=\mathrm{NP}.
L13LessonExercise
the gap between OPT = 2 and OPT = 3GapVisual

PARTITION ≤p BIN-PACKING-OPT

If a polynomial algorithm for bin packing achieves an absolute approximation ratio below 32\tfrac32 — in particular ratio 1.491.49 — then P=NP\mathrm{P}=\mathrm{NP}.
L25 · L12LessonExercise