BITS Pilani
CS F364: Design and Analysis of Algorithms

NP-Completeness: Reductions in Action

Lecture 27 |2026-07-11

NP-Completeness: Reductions in Action

  • NP-Completeness: Reductions in Action

Lecture Outline

1. Recap: P, NP, NP-Hard, NP-Complete

2. Cook-Levin Theorem — the first NP-complete problem

3. Problem Definitions — 3-SAT, CLIQUE, Vertex Cover

4. The NPC Proof Recipe — 3 steps

5. Reduction 1: 3-SAT \le_P CLIQUE

6. Reduction 2: CLIQUE \le_P Vertex Cover

7. Summary — reduction chain and takeaways

Recap: P, NP, NP-Hard, NP-Complete

Class Intuition Formal (one line)
P Problems we can solve efficiently Decidable in polynomial time by a DTM
NP Problems whose solutions we can verify efficiently Decidable in polynomial time by an NTM (equiv: poly-time verifiable certificate)
NP-hard At least as hard as every problem in NP Every L' \in \text{NP} reduces to L in polynomial time
NP-complete The hardest problems in NP L \in \text{NP} and L is NP-hard

Key question: Does P = NP? Answer affects cryptography, optimization, AI, and virtually every field of computing.

Cook-Levin Theorem (1971)

SAT is NP-complete. — Stephen Cook (1971), Leonid Levin (1973)

  • First NP-complete problem ever proved.
  • The proof encodes the computation of any polynomial-time NTM as a boolean formula.
  • Circuit-SAT (CKT-SAT) is also NP-complete — often a more convenient starting point for reductions.

Why this matters: Before Cook-Levin, we had no “anchor” problem. Now we have SAT — if SAT is easy, every NP problem is easy. If SAT is hard, thousands of problems are hard.

Problem: 3-SAT

3-SAT: Given a boolean formula \phi in conjunctive normal form (CNF) where each clause has exactly 3 literals, does there exist a truth assignment that makes \phi true?

(x_1 \lor x_2 \lor \bar{x}_3) \land (\bar{x}_1 \lor x_2 \lor x_3) \land (x_1 \lor \bar{x}_2 \lor \bar{x}_3)

  • Known: 3-SAT is NP-complete (reduce from SAT by splitting long clauses).
  • Certificate: The satisfying assignment (bits for each variable).
  • Verification: Evaluate each clause — all must be true.

Problem: k-CLIQUE

CLIQUE: Given a graph G = (V, E) and an integer k, does G contain a subset S \subseteq V of size k where every pair of vertices in S is connected by an edge?

  • Status: CLIQUE \in NP — certificate is S, verify all \binom{k}{2} edges exist.
  • We will prove CLIQUE is NP-complete by reducing 3-SAT to it.

Problem: Vertex Cover

Vertex Cover: Given a graph G = (V, E) and an integer k', does G contain a subset C \subseteq V of size k' such that every edge in E has at least one endpoint in C?

  • Status: Vertex Cover \in NP — certificate is C, verify all edges are touched.
  • We will prove Vertex Cover is NP-complete by reducing CLIQUE to it.

The NP-Completeness Recipe

To prove a new problem B is NP-complete:

  1. Show B \in \text{NP}.
    • Certificate verified in polynomial time.
  1. Choose known NP-complete problem A.
  1. Show A \le_P B.
    • Build a polynomial-time reduction mapping instances of A to B.

Our chain: SAT (Cook-Levin) \to 3-SAT \to CLIQUE \to Vertex Cover \to \dots

Why This Matters

If we solve any NP-complete problem in polynomial time, we solve all of them.

The reduction chain lets us prove NP-completeness without re-proving Cook-Levin every time. Each new NP-complete problem becomes a stepping stone for the next.

The Reduction: 3-SAT ≤_P CLIQUE

Input: 3-SAT formula \phi = C_1 \land C_2 \land \dots \land C_k, each clause has 3 literals.

Construction:

  • For each clause C_i, create 3 vertices (one per literal).
  • Connect two vertices with an edge if and only if:
    1. They come from different clauses, and
    2. They are not conflicting (not x and \bar{x})

Output: Graph G and integer k (number of clauses).

Reduction Example

Formula: \phi = (x_1 \lor x_2 \lor x_3) \land (\bar{x}_1 \lor \bar{x}_2 \lor x_3) \land (x_1 \lor \bar{x}_2 \lor \bar{x}_3)

Three clauses → three groups of 3 vertices:

Clause 1 Clause 2 Clause 3
x_1 \bar{x}_1 x_1
x_2 \bar{x}_2 \bar{x}_2
x_3 x_3 \bar{x}_3

Edges connect across clauses except conflicting pairs.

Why This Works

\phi is satisfiable \iff G has a clique of size k.

(\Rightarrow) Satisfying assignment: pick the true literal from each clause. These k literals are pairwise consistent (no x and \bar{x} both true), so they form a k-clique.

(\Leftarrow) A k-clique picks one vertex from each clause (can’t pick two from same clause — no edges within a clause). No conflicting literals → set them to true → consistent satisfying assignment. ✓

The Reduction: CLIQUE ≤_P Vertex Cover

Key insight: Graph complement duality.

The complement graph \bar{G} = (V, \bar{E}) where: \bar{E} = \{(u,v): u,v \in V, u \neq v, (u,v) \notin E\}

Idea: A clique in G corresponds to an independent set in \bar{G} (no edges). An independent set’s complement is a vertex cover.

Graph Duality Theorem

S \subseteq V is a clique in G of size k \iff V \setminus S is a vertex cover in \bar{G} of size |V| - k.

Proof:

S is a clique in G \iff all pairs in S are adjacent in G \iff no pair in S is adjacent in \bar{G}

\iff every edge in \bar{G} has an endpoint outside S \iff V \setminus S touches all edges in \bar{G} \iff V \setminus S is a vertex cover of \bar{G}

The Reduction Procedure

Input: CLIQUE instance (G, k).

Reduction: 1. Compute complement graph \bar{G} (polynomial time) 2. Set k' = |V| - k 3. Output Vertex Cover instance (\bar{G}, k')

Correctness: G \text{ has a } k\text{-clique} \iff \bar{G} \text{ has a } k'\text{-vertex cover}

Thus: CLIQUE \le_P Vertex Cover, so Vertex Cover is NP-complete. ✓

The Reduction Chain So Far

SAT (Cook-Levin, 1971)

3-SAT (clause-bounded SAT)

CLIQUE (graph problem)

Vertex Cover (graph problem)

↓ … (thousands more)

Each arrow is a polynomial-time reduction.

Solve any of these in P, and P = NP.

Summary

Reduction Construction Key Idea
3-SAT → CLIQUE Clause → group of 3 vertices. Edges across groups except conflicting literals. Clique of size k = one literal per clause, all consistent
CLIQUE → Vertex Cover Complement graph \bar{G}. k' = \|V\| - k. S is a clique in G \iff V \setminus S is a VC in \bar{G}

Takeaway: The reduction recipe is simple: pick a known NP-complete problem, map instances, prove correctness both ways. Once you know one reduction, you can chain it to prove NP-completeness for countless problems.