NP-Completeness and Cook-Levin Theorem

Graduate Depth 67 in the knowledge graph I know this Set as goal
Unlocks 57 downstream topics
np-completeness cook-levin hardness

Core Idea

A language is NP-complete if it is in NP and every language in NP reduces to it in polynomial time. The Cook-Levin theorem proves that boolean satisfiability (SAT) is NP-complete. NP-complete problems are presumed intractable; a polynomial-time algorithm for any NP-complete problem would imply P = NP.

Explainer

From your study of nondeterministic polynomial time (NP), you know that NP is the class of decision problems whose solutions can be *verified* in polynomial time — even if finding a solution might seem hard. NP-completeness identifies a special core within NP: the problems that are, in a formal sense, maximally difficult for the entire class.

A problem is NP-complete if it satisfies two conditions. First, it must be in NP — a witness (a proposed solution) can be checked efficiently. Second, every problem in NP must be polynomial-time reducible to it. This second condition is what makes NP-complete problems remarkable: they are universal difficulty benchmarks. If you could solve one NP-complete problem in polynomial time, the reduction structure would give you polynomial-time algorithms for *every* problem in NP — and we would have P = NP.

The Cook-Levin theorem established the first NP-complete problem: boolean satisfiability (SAT). The proof works by showing that any nondeterministic polynomial-time computation can be encoded as a SAT instance — the variables represent the bits of the machine's computation and the clauses enforce the machine's transition rules. This was a profound result: it showed that SAT captures all of NP inside it. Once SAT was known to be NP-complete, proving other problems NP-complete became easier — you just need to show they are in NP and that SAT (or some already-known NP-complete problem) reduces to them in polynomial time.

It is important to resist two common misreadings. First, NP-complete does not mean "impossible" or "unsolvable" — it means no polynomial-time algorithm is currently known. For small instances, many NP-complete problems are solved routinely by exact or approximation algorithms. Second, and more subtly, the conjecture that P ≠ NP is still *unproven*. We believe it strongly — intuitively, verifying a solution feels easier than finding one — but a mathematical proof has eluded computer scientists for over fifty years. The P vs. NP question remains open.

For practical purposes, proving that your problem is NP-complete is actually useful: it tells you to stop searching for an efficient exact algorithm and instead look to approximation algorithms, heuristics, or special-case structure. It shifts the question from "why can't I solve this efficiently?" to "what is the best we can do given this hardness?"

Practice Questions 3 questions

Prerequisite Chain

Counting to 10Counting to 20Understanding ZeroThe Number ZeroCounting to FiveOne-to-One CorrespondenceCombining Small Groups Within 5Addition Within 10Addition Within 20Two-Digit Addition Without RegroupingTwo-Digit Addition with RegroupingAddition Within 100Repeated Addition as MultiplicationMultiplication Facts Within 100Division as Equal SharingDivision as Grouping (Measurement Division)Division: Grouping (Repeated Subtraction) ModelDivision: Fair Sharing ModelDivision as Equal SharingDivision as GroupingBasic Division FactsDivision Facts Within 100Two-Digit by One-Digit DivisionDivision with RemaindersRemainders and Quotients in DivisionDivision Word ProblemsIntroduction to Long DivisionFactors and MultiplesPrime and Composite NumbersEquivalent FractionsRelating Fractions and DecimalsDecimal Place ValueReading and Writing DecimalsComparing and Ordering DecimalsAdding and Subtracting DecimalsMultiplying DecimalsDividing DecimalsDividing FractionsMixed Number ArithmeticOrder of OperationsInteger Order of OperationsVariable ExpressionsCombining Like TermsOne-Step EquationsTwo-Step EquationsSolving Multi-Step EquationsEquations with Variables on Both SidesLiteral EquationsSlope-Intercept FormPoint-Slope FormWriting Linear EquationsParallel and Perpendicular Line SlopesGraphing Linear EquationsPiecewise FunctionsStep FunctionsComposition of FunctionsInverse FunctionsRadical Functions and GraphsRational ExponentsExponential Functions and GraphsLogarithms IntroductionTime and Space ComplexityTime Complexity Classes: P and EXPTIMENondeterministic Time Complexity and NPThe P vs. NP ProblemComplexity Class P: Polynomial TimeComplexity Class NP: Nondeterministic Polynomial TimeNP-Completeness and Cook-Levin Theorem

Longest path: 68 steps · 357 total prerequisite topics

Prerequisites (1)

Leads To (20)