4.6.25 · D3Theory of Computation

Worked examples — NP-completeness — Cook's theorem (SAT is NP-complete), reduction

2,847 words13 min readBack to topic

Throughout, remember the one symbol we lean on: means "there is a polynomial-time function turning every instance of into an instance of with ." Read it out loud as " is at least as hard as ."


The scenario matrix

Think of "cases" here the way trig has quadrants. In reductions the axes are: what the input formula does (satisfiable / unsatisfiable / degenerate) and what task we are performing (verify membership, build a reduction, pick the direction). Every cell must have a worked example.

Cell Scenario class Degenerate / edge? Covered by
C1 SAT instance that is satisfiable — find & verify certificate no Ex 1
C2 SAT instance that is unsatisfiable — prove NO by exhaustion no Ex 2
C3 Empty / trivial formulas (empty clause, empty formula) yes, zero-input Ex 3
C4 3-SAT Independent Set on a satisfiable formula (build graph) no Ex 4 (figure)
C5 Same reduction on an unsatisfiable formula — why no large IS exists no Ex 5 (figure)
C6 SAT 3-SAT clause splitting, incl. short (1- and 2-literal) clauses edge: tiny clauses Ex 6
C7 Direction trap — the exam classic "reduce which way?" conceptual twist Ex 7
C8 Chaining reductions via transitivity (3-SAT IS Vertex Cover) composite Ex 8 (figure)
C9 Real-world word problem — course scheduling as a SAT check applied Ex 9

The four clause-shapes to watch: a clause with 3 literals (normal), 2 literals, 1 literal, and the empty clause. Ex 3 and Ex 6 together cover all four.


The examples










Recall Quick self-test

Direction of a hardness reduction ::: reduce FROM a known NP-complete problem TO your new problem ( proves hard) Satisfiability of the empty formula ::: always TRUE (empty AND = identity of AND) Satisfiability of a formula containing the empty clause ::: always FALSE (empty OR = identity of OR) In the 3-SAT IS reduction, what does a triangle enforce? ::: pick at most one literal per clause IS of size corresponds to a Vertex Cover of size ::: Helpers needed to split a -literal clause into 3-SAT ::: fresh variables