Memra

Polynomial-time reductions

◈ 6 cards

Define L₁ ≤ₚ L₂ via a poly-computable f with x ∈ L₁ ⇔ f(x) ∈ L₂; prove the key transfer lemma (L₂ ∈ P ⇒ L₁ ∈ P), see why ≤ₚ is transitive, and pin down NP-hard vs NP-complete.

Relating one problem to another

We rarely analyze a hard problem from scratch. Instead we reduce it to a problem we already understand. A polynomial-time reduction from language to language , written

is a polynomial-time computable function that maps every instance of to an instance of such that

In words: turns yes-instances into yes-instances and no-instances into no-instances, and it does so quickly. The function is called the reduction algorithm. Note both halves of the biconditional matter — a map that only preserved yes-instances would be useless.

The transfer lemma (the whole point)

Reductions are valuable because they transfer tractability backwards:

> Lemma. If and , then .

Proof. Suppose is the polynomial-time reduction and is a polynomial-time decider for . Build a decider for : on input , compute (polynomial time), then run on and return its answer. Correctness is the biconditional: accepts iff accepts iff iff . Running time: runs in time , so (it cannot write more than it has time for); then runs in time . The composition is polynomial.

The contrapositive is how we use it in practice: if (we believe it is hard) and , then either — the hardness of flows forward into .

Direction is everything

This is the single most common student error. To prove a new problem is hard, you reduce a known-hard problem to :

Why this direction? says "if were easy, then would be easy too." Since we believe is not easy, cannot be easy. Reducing the other way () would only tell you is no harder than the already-hard — which proves nothing about being hard.

Worked example — direction in action

Suppose CLIQUE is already known to be hard, and you want to show a new problem INDEPENDENT-SET is hard. An independent set in is a set of vertices with no edge between any two; a clique is a set with all edges present. They are duals under graph complement: is a clique in iff is an independent set in the complement graph . So define . Building is — polynomial. And has a -clique has an independent set of size . That is exactly CLIQUE INDEPENDENT-SET, with the known-hard CLIQUE on the left. Hardness flows into INDEPENDENT-SET.

Transitivity, NP-hard, and NP-complete

Reductions compose: if and then (run one reduction function then the other — still polynomial). This transitivity is what lets us build a chain of NP-complete problems from a single starting point.

Now the two definitions the exam lives on:

  • is NP-hard if every language satisfies . (It is at least as hard as everything in NP — but itself need not be in NP.)
  • is NP-complete if (1) and (2) is NP-hard.

NP-complete problems are the hardest problems in NP. The payoff theorem: if any NP-complete problem is in P, then (because every NP problem reduces to it, so by the transfer lemma all of NP would collapse into P). Equivalently, if , then no NP-complete problem has a polynomial-time algorithm.

apply ffeed inreturnxinstance of L₁f(x)instance of L₂M₂decides L₂yes / noanswer for x
The reduction machinery behind the transfer lemma: f runs in polynomial time and M₂ runs in polynomial time, so the composition M₁ = M₂ ∘ f decides L₁ in polynomial time.
≤ₚ ✓✗ uselessCLIQUEknown hardINDEP-SETthe new problemA ≤ₚ B reads "if B were easy, A would be easy" — so B inherits A’s hardness, never the reverse.
Direction is the whole proof. CLIQUE ≤ₚ INDEPENDENT-SET puts the KNOWN-hard problem on the left, via f(⟨G,k⟩) = ⟨Ḡ,k⟩, so CLIQUE’s hardness flows into INDEPENDENT-SET. The reverse arrow only says INDEPENDENT-SET is no harder than something already hard — no information.
NORMAL ~/memra/learn/comp-372/polynomial-time-reductions utf-8 LF