1. Polynomial-Time Reductions ($A \le_p B$)
A reduction is a formal mathematical algorithm for solving problem $A$ using a subroutine that solves problem $B$.
A language $A \subseteq \Sigma^$ is Karp-reducible (or polynomial-time many-one reducible) to language $B \subseteq \Sigma^$, written:
$$A \le_p B$$
if there exists a deterministic polynomial-time computable function $f: \Sigma^* \to \Sigma^$ such that for all $x \in \Sigma^$:
$$x \in A \iff f(x) \in B$$
text
The Key Properties of Reductions
- Tractability Transfer: If $A \le_p B$ and $B \in \mathbf{P}$, then $A \in \mathbf{P}$.
- Hardness Transfer: If $A \le_p B$ and $A$ is hard, then $B$ must be at least as hard as $A$!
2. NP-Hardness and NP-Completeness
- NP-Hard: A language $L$ is NP-Hard if every problem in $\mathbf{NP}$ can be reduced to $L$ in polynomial time: $$\forall A \in \mathbf{NP}, \quad A \le_p L$$
- NP-Complete: A language $L$ is NP-Complete if:
- $L \in \mathbf{NP}$ (its solutions can be verified in polynomial time).
- $L$ is NP-Hard (every problem in NP reduces to it).
The Cook-Levin Theorem (1971)
Stephen Cook and Leonid Levin independently proved that the Boolean Satisfiability Problem (SAT) is NP-Complete:
$$\text{SAT} \in \mathbf{NPC}$$
They proved this from scratch by showing that the execution of any arbitrary Nondeterministic Turing Machine on input $x$ can be encoded directly as a single massive boolean formula $\phi_{M, x}$ in polynomial time. $\phi_{M, x}$ is satisfiable if and only if machine $M$ accepts $x$.
3. Karp's 21 NP-Complete Problems: The Cascade of Reductions
Once SAT was established as the "anchor" of NP-completeness, Richard Karp (1972) showed that dozens of fundamental combinatorial problems are also NP-complete by establishing a chain of polynomial reductions:
text
Proving a New Problem $Y$ is NP-Complete: The 3-Step Recipe
- Prove $Y \in \mathbf{NP}$: Exhibit a polynomial-time verification algorithm $V(x, c)$ that verifies a certificate in $O(|x|^k)$ time.
- Choose a known NP-Complete problem $X$ (e.g. 3-SAT, Vertex Cover, Hamiltonian Path).
- Construct a polynomial reduction $X \le_p Y$: Show how to convert any instance of $X$ into an instance of $Y$ in polynomial time such that $x \in X \iff f(x) \in Y$.
4. Engineering Strategies for NP-Hard Problems in Production
When you prove a problem at work is NP-hard (e.g., optimal vehicle routing, container packing, database query plan scheduling), stop looking for an exact polynomial-time algorithm. Instead, apply standard SRE and engineering strategies:
- Approximation Algorithms: Algorithms with proven bounds. For example, the 2-approximation algorithm for Vertex Cover or Christofides' 1.5-approximation algorithm for Metric TSP.
- Fixed-Parameter Tractability (FPT): Algorithms that scale exponentially only with respect to a small parameter $k$ (e.g. $O(2^k \cdot n)$), which is fast when $k \le 15$.
- SAT / SMT / ILP Solvers: Use modern solvers (Z3, CVC5, Gurobi, OR-Tools). While worst-case exponential, their CDCL (Conflict-Driven Clause Learning) heuristics routinely solve industrial instances with millions of variables in seconds.
- Genetic / Simulated Annealing Metaheuristics: Practical, randomized search algorithms that discover high-quality near-optimal solutions within tight time budgets.