Reductions, NP-Completeness & NP-Hardness

How polynomial-time reductions transfer difficulty, how Cook–Levin turns bounded computation into SAT, how to build and audit NP-completeness proofs, and which claims hardness results do not justify.

builds onComplexity Classes: P & NPPropositional & Predicate Logic

A reduction is a compiler between decision problems. It converts every instance of problem AA into an instance of problem BB while preserving the yes/no answer. If the compiler is efficient, an efficient solver for BB would yield one for AA. NP-completeness organizes thousands of apparently different problems around this transferable difficulty—but it supplies conditional evidence, not an unconditional exponential lower bound.

Start with languages and encodings #

A decision problem is represented by a language A⊆Σ∗A\subseteq\Sigma^*: strings in AA are yes-instances. Graphs, formulas, and schedules therefore need explicit encodings. Polynomial time is measured in the encoded length ∣x∣|x|, so a numeric parameter written in binary has length Θ(log⁡n)\Theta(\log n), while unary representation has length Θ(n)\Theta(n). Changing encoding can change whether an algorithm is polynomial; reasonable encodings are polynomially interconvertible, but binary and unary encodings are deliberately not equivalent in that sense.

Recall the class boundary:

  • PP: a deterministic algorithm decides membership in polynomial time.
  • NPNP: yes-instances have polynomial-size certificates verifiable in deterministic polynomial time; equivalently, a nondeterministic Turing machine decides the language in polynomial time.
  • coNPcoNP: complements of languages in NPNP.

NPNP means nondeterministic polynomial time, not "non-polynomial." We know P⊆NP∩coNPP\subseteq NP\cap coNP; whether P=NPP=NP remains open.

Polynomial-time many-one reduction #

For languages AA and BB,

A≤mpBA\le_m^p B

means that a polynomial-time computable function ff exists such that, for every input xx,

x∈A⟺f(x)∈B.x\in A\quad\Longleftrightarrow\quad f(x)\in B.

The biconditional is essential: yes-instances map to yes-instances and no-instances to no-instances. The solver composition is

Therefore, if A≤mpBA\le_m^pB and B∈PB\in P, then A∈PA\in P. Read the arrow as AA is no harder than BB or BB is at least as hard as AA.

Many-one reductions are reflexive and transitive. If A≤mpBA\le_m^pB via ff and B≤mpCB\le_m^pC via gg, then x↦g(f(x))x\mapsto g(f(x)) is polynomial because the length of f(x)f(x) is polynomially bounded and polynomial compositions remain polynomial.

NP-hard versus NP-complete #

Classification Required claims
BB is NP-hard Every A∈NPA\in NP reduces to BB
BB is NP-complete BB is NP-hard and B∈NPB\in NP

NP-hard problems need not be decision problems and need not belong to NPNP; optimization versions are often called NP-hard by reduction from their decision versions. Some undecidable problems are NP-hard as well. NP-complete is the narrower intersection: the hardest decision languages inside NPNP under the specified reduction.

The phrase "under the specified reduction" matters. A polynomial-time Turing reduction may ask an oracle several adaptive questions; a many-one reduction produces one instance and preserves its answer directly. Cook's original terminology used an oracle-style reduction, while the modern default definition of NP-completeness uses polynomial-time many-one reductions. Never merge results across these notions without naming the reduction type.

Cook–Levin: bounded computation becomes a formula #

The Cook–Levin theorem establishes that Boolean satisfiability is NP-complete. Membership is immediate: a truth assignment is a polynomial-size certificate, and evaluating a formula is polynomial.

For hardness, take any A∈NPA\in NP. A nondeterministic machine MM decides AA in time p(n)p(n). A complete accepting run on input xx can be drawn as a tableau:

  • each row is one machine configuration;
  • the first row encodes the initial configuration on xx;
  • adjacent rows must obey one transition of MM;
  • some row is accepting;
  • the tableau has polynomially many cells because the time and visited tape region are polynomially bounded.

Introduce Boolean variables describing the symbol, state, and head position in every cell. Add local clauses asserting:

  1. exactly one compatible symbol/state choice per location;
  2. the correct initial row;
  3. at least one accepting state;
  4. every small window between adjacent rows is a legal transition.

The resulting formula FM,xF_{M,x} has polynomial size, is constructible in polynomial time, and is satisfiable exactly when MM has an accepting computation on xx. The key idea is local checkability: a globally valid computation history is determined by polynomially many constant-size consistency constraints.

Cook's 1971 paper framed the result using tautology and its contemporary reduction terminology; the standard Cook–Levin presentation is the equivalent SAT/CNF many-one formulation.

Worked reduction: 3-SAT to CLIQUE #

Let a 3-CNF formula have clauses C1,…,CkC_1,\ldots,C_k. Build a graph:

  1. Create one vertex for each literal occurrence in each clause.
  2. Connect two vertices when they come from different clauses and their literals are not contradictory.
  3. Ask whether the graph contains a clique of size kk.

Why it works:

  • If the formula is satisfiable, choose one true literal from every clause. No two chosen literals contradict, so all chosen vertices are adjacent and form a kk-clique.
  • If a kk-clique exists, it contains at most one vertex per clause because vertices within a clause are not connected. With kk clauses it therefore chooses exactly one mutually compatible literal from each. Assign those literals true and extend consistently to the other variables; every clause is satisfied.

For

(x∨¬y∨z)∧(¬x∨y∨z)∧(x∨y∨¬z),(x\lor\neg y\lor z)\land(\neg x\lor y\lor z)\land(x\lor y\lor\neg z),

the occurrences xx from clause 1, yy from clause 2, and xx from clause 3 form a 3-clique. They are pairwise compatible and give a satisfying partial assignment x=y=truex=y=\text{true}.

The construction has 3k3k vertices and at most O(k2)O(k^2) candidate edges, so it is polynomial. Both the size analysis and the reverse implication belong in the proof; a persuasive picture alone is not a reduction.

The reusable proof template #

To prove a decision problem BB NP-complete:

  1. Specify an encoding and the exact decision question. Optimization and search variants are not interchangeable with the language.
  2. Show B∈NPB\in NP. Give a certificate, bound its length polynomially, and describe a polynomial-time verifier.
  3. Choose known NP-complete AA. Select a source problem whose structure matches BB.
  4. Construct f(x)f(x). State every generated object and prove its encoded size and construction time are polynomial.
  5. Prove both directions. Show x∈A⇒f(x)∈Bx\in A\Rightarrow f(x)\in B and f(x)∈B⇒x∈Af(x)\in B\Rightarrow x\in A.
  6. Conclude NP-hardness, then combine with membership. Do not call BB NP-complete after proving only one half.

For reductions involving a numeric threshold, also ensure the threshold itself has polynomial encoded length. Creating an object whose value is exponential can be fine if represented compactly; explicitly writing exponentially many objects is not.

Weak and strong NP-completeness #

An algorithm running in time polynomial in numeric values such as capacity WW, but not in their bit length log⁡W\log W, is pseudopolynomial. This distinction motivates:

  • weakly NP-complete: hardness may rely on exponentially large numeric values under binary encoding, and a pseudopolynomial algorithm may exist;
  • strongly NP-complete: the problem remains NP-complete even when relevant numbers are polynomially bounded (or unary-encoded under the standard formulation).

This terminology is about how numerical magnitude participates in hardness. It does not mean that a weakly NP-complete problem is known to have a polynomial-time algorithm.

What an NP-completeness result licenses #

If any NP-complete language is in PP, then every language in NPNP is in PP, so P=NPP=NP. Conversely, if P≠NPP\ne NP, no NP-complete language is in PP.

It does not establish:

  • that the problem requires exponential time—no such general lower bound follows;
  • that every instance is difficult—special cases, parameters, and distributions may be tractable;
  • that approximation or heuristics are useless—the reduction concerns exact worst-case decision;
  • that NPNP is the complement of PP—the complement class is coNPcoNP;
  • that a fast verifier can certify no-instances—NPNP only promises certificates for yes-instances;
  • that an observed exponential algorithm is optimal.

Auditing a claimed reduction #

Ask these questions in order:

  1. What are the source and target languages, including encodings?
  2. Which reduction notion is used—many-one, Turing, randomized, parameterized?
  3. Is the direction correct for the desired claim?
  4. Is the transformation total and polynomial in input length?
  5. Does the biconditional hold, including edge cases and malformed inputs?
  6. Is membership in NPNP separately established before saying NP-complete?
  7. Does the conclusion remain conditional on P≠NPP\ne NP, rather than pretending that separation is already known?

This checklist catches most flawed arguments: reversed arrows, one-way constructions, exponential output, optimization/decision drift, and the unjustified leap from "hard in practice" to NP-hard.

Sources

  1. paperCook — The Complexity of Theorem-Proving Procedures
  2. paperKarp — Reducibility Among Combinatorial Problems
  3. articleClay Mathematics Institute — P vs NP

Searches titles, aliases, headings, summaries, and full text.↑↓ move ↵ open esc close