A topic in the Open Knowledge Graph — a free, open map of 15,290 topics and the order to learn them in.

NP-Completeness and the Cook-Levin Theorem

Graduate Depth 99 in the knowledge graph ☐ I know this ☆ Set as goal
4topics build on this
645prerequisites beneath it
See this on the map →
NP-Hardness: Definition and PropertiesThe Cook-Levin Theorem→→Counting Complexity and the Sharp-P ClassSatisfiability Problem: The Canonical NP-Complete Problem
np-completeness cook-levin sat completeness

Core Idea

The Cook-Levin theorem proves that Boolean satisfiability (SAT) is NP-complete: every NP problem reduces to SAT, and SAT is in NP. This provides the first NP-complete problem; all other NP-complete problems are discovered by reducing from previously known NP-complete problems, creating a network of reductions.

How It's Best Learned

Carefully study the Cook-Levin proof structure: how an NP Turing machine is encoded in a Boolean formula. Work through simplified reductions (e.g., CLIQUE → 3-SAT).

Common Misconceptions

Explainer

You already understand what NP-hardness means and what the Cook-Levin theorem says. Now it is time to see why those two things together produce an extraordinary structural result about computation. A problem is NP-complete if it is both in NP (it can be verified in polynomial time) and NP-hard (every NP problem reduces to it in polynomial time). The Cook-Levin theorem shows that SAT — Boolean satisfiability — is NP-complete. This is not a routine observation; it is the theorem that turned NP-hardness from a definition into a usable tool.

The proof of Cook-Levin works by encoding computation as Boolean formulas. Given any NP problem with verifier V running in polynomial time p(n), Cook-Levin constructs a formula φ such that: the input x is a yes-instance if and only if φ is satisfiable. The formula encodes the entire tableau of V's computation — the state of the machine at each time step — as Boolean variables, with clauses enforcing valid transitions, input consistency, and acceptance. The formula is polynomial in size because V runs in polynomial time. What makes this remarkable is that it works for *every* NP problem simultaneously: each such problem's verifier produces a different formula, but the construction is uniform. SAT is therefore the "receptacle" that absorbs all of NP.

The consequence is a chain reaction. Once SAT is known to be NP-complete, proving any other problem X is NP-complete requires only: (1) showing X is in NP, and (2) giving a polynomial-time reduction from SAT (or from any already-known NP-complete problem) to X. This is far easier than repeating the full Cook-Levin tableau construction. The direction matters: to show X is NP-hard, reduce a known hard problem *to* X, not the other way around. If SAT → X in polynomial time and SAT is hard, then X must be at least as hard. Over fifty years of research has produced hundreds of NP-complete problems this way — graph problems, scheduling problems, packing problems — all linked by this reduction network.

The deepest implication is what NP-completeness says about the entire complexity class. If any single NP-complete problem is in P — if any one of them can be solved in polynomial time — then every problem in NP is also in P, because the reduction chain collapses: solve any NP problem by reducing it to your one easy NP-complete problem. Conversely, if any NP-complete problem is provably not in P, then P ≠ NP. The P vs NP question is therefore equivalent to asking whether any one NP-complete problem is tractable. Cook-Levin turned an open question about the structure of computation into a question you can attack by studying any single combinatorial problem.

Practice Questions 5 questions

Prerequisite Chain

Understanding Zero → The Number Zero → Counting to Five → Counting to 10 → Counting to 20 → Counting a Set of Objects Up to 20 → Cardinality: The Last Number Counted → Matching Numerals to Quantities → Subitizing Small Quantities → Addition Within 10 → Number Bonds to 10 → Addition Within 20 → Doubles and Near Doubles → Doubles Facts Within 10 → Near Doubles Facts Within 20 → Mental Math Strategies for Addition → Mental Math: Adding and Subtracting Tens → Addition Within 100 → Repeated Addition as Multiplication → Multiplication as Equal Groups → Multiplication: Arrays → Basic Multiplication Facts (0s, 1s, 2s, 5s, 10s) → Multiplication Facts Within 100 → Division as Equal Sharing → Division as Grouping (Measurement Division) → Division: Grouping (Repeated Subtraction) Model → Division: Fair Sharing Model → Division as Equal Sharing → Division as Grouping → Basic Division Facts → Division Facts Within 100 → Multiplication and Division Fact Families → Relationship Between Multiplication and Division → Division Facts as Inverse of Multiplication → Remainders and Quotients in Division → Division Word Problems → Multi-Step Word Problems → Solving Multi-Step Word Problems → Multiplication Word Problems → Division Word Problems → Introduction to Long Division → Factors and Multiples → Prime and Composite Numbers → Equivalent Fractions → Relating Fractions and Decimals → Decimal Place Value → Integers and the Number Line → Comparing and Ordering Integers → Absolute Value → Adding Integers → Subtracting Integers → Multiplying Integers → Dividing Integers → Unit Rates → Proportions → Percent Concept → Converting Between Fractions, Decimals, and Percents → Operations with Rational Numbers → Two-Step Equations → Solving Multi-Step Equations → Equations with Variables on Both Sides → Angle Pairs: Complementary, Supplementary, and Vertical → Parallel Lines and Transversals → Corresponding Angles → Alternate Interior Angles → Triangle Angle Sum Theorem → Exterior Angle Theorem → Triangle Inequality Theorem → Similar Triangles: AA Similarity → Similar Triangles: SSS and SAS Similarity → Proportions in Similar Triangles → Right Triangle Trigonometry Introduction → Sine, Cosine, and Tangent Ratios → Trigonometric Ratios Review → Radian Measure → Converting Between Degrees and Radians → The Unit Circle → Graphing Sine and Cosine → Graphing Tangent and Reciprocal Trigonometric Functions → Derivatives of Trigonometric Functions → Antiderivatives → Indefinite Integrals → Basic Integration Rules → Riemann Sums → Definite Integral Definition → Probability Density Functions and Continuous Distributions → Cumulative Distribution Functions → Continuous Random Variables → Probability Density Functions → Expected Value → Weak Law of Large Numbers → Probability Axioms and Rules → Conditional Probability → Probabilistic Computation and BPP → BPP and Randomized Complexity → Randomized Complexity: RP, co-RP, and ZPP → Complexity Classes and the Complexity Hierarchy → The P Versus NP Problem: Central Open Question → NP-Hardness: Definition and Properties → NP-Completeness and the Cook-Levin Theorem

Longest path: 100 steps · 645 total prerequisite topics

Prerequisites (2)

Leads To (2)