same graph, complement the set

IS ≤p VC

IS≤pVC\mathrm{IS}\le_p\mathrm{VC}, hence VC\mathrm{VC} is NP-complete.

The construction

On input ⟨G,k⟩\langle G,k\rangle with G=(V,E)G=(V,E):

  1. Return ⟨G, ∣V∣−k⟩\langle G,\ |V|-k\rangle.

That is all. The same graph, with only the number changed.

The construction rests on one observation, the heart of the lesson: for every U⊆VU\subseteq V, U is a vertex cover of G  ⟺  V∖U is independent in G.U \text{ is a vertex cover of } G \iff V\setminus U \text{ is independent in } G . Both say exactly the same thing about every edge: "every edge has an endpoint in UU" is "no edge has both endpoints outside UU".

Visualization

Guided construction

Independent Set → Vertex Cover

Step 1 of 6
Independent Set to Vertex Cover via set complementAn independent set on a path is complemented to a vertex cover while the threshold becomes n minus k.Same graph G1234

Correctness — both directions

IS ∈ ⟹ VC ∈

Suppose ⟨G,k⟩∈IS\langle G,k\rangle\in\mathrm{IS}. Then some U⊆VU\subseteq V is independent in GG with ∣U∣=k|U|=k. By the observation, V∖UV\setminus U is a vertex cover of GG, of size ∣V∖U∣=∣V∣−∣U∣=∣V∣−k.|V\setminus U|=|V|-|U|=|V|-k . So GG has a vertex cover of size ∣V∣−k|V|-k, i.e. ⟨G,∣V∣−k⟩∈VC\langle G,|V|-k\rangle\in\mathrm{VC}.

VC ∈ ⟹ IS ∈

Suppose ⟨G,∣V∣−k⟩∈VC\langle G,|V|-k\rangle\in\mathrm{VC}. Then GG has a vertex cover U⊆VU\subseteq V with ∣U∣=∣V∣−k|U|=|V|-k. By the observation, V∖UV\setminus U is independent in GG, of size ∣V∖U∣=∣V∣−(∣V∣−k)=k.|V\setminus U|=|V|-(|V|-k)=k . So ⟨G,k⟩∈IS\langle G,k\rangle\in\mathrm{IS}.

Cost of the reduction

TimeO(|⟨G,k⟩|²)
SpaceO(|⟨G,k⟩|)
Output size|⟨G,k⟩| + O(1)

The algorithm copies the input and performs one subtraction. On a RAM that is even constant time; on a Turing machine it is a binary subtraction on a number no longer than the input, i.e. O(∣⟨G,k⟩∣2)O(|\langle G,k\rangle|^2) done naively. Polynomial either way, which is all that is required.

What it buys

VC\mathrm{VC} is NP-hard, and being in NP\mathrm{NP} as well (witness UU; the verifier checks ∣U∣≤k|U|\le k and scans the edges) it is NP-complete. From there it becomes the starting point of VC≤pSUBSET-SUM\mathrm{VC}\le_p\mathrm{SUBSET\text{-}SUM}, VC≤pDS\mathrm{VC}\le_p\mathrm{DS}, and VC≤p3H-VC\mathrm{VC}\le_p\mathrm{3H\text{-}VC}.

Pitfalls

  • "Exactly kk" versus "at least / at most kk". The proof uses sizes exactly kk and exactly ∣V∣−k|V|-k, while the definitions say "at least kk" for IS\mathrm{IS} and "at most kk" for VC\mathrm{VC}. This is legitimate: a cover can always be grown (adding vertices never breaks a cover) and an independent set can always be shrunk (a subset of an independent set is independent). Note the directions are opposite between the two problems — and for every new problem the question must be asked afresh.

  • "Why not the identity?" — two reasons. Direction: we want a reduction into VC\mathrm{VC}, not out of it, since the goal is to prove VC\mathrm{VC} hard. And the number: the graph does stay the same, but kk must change, precisely because of the relation between a set's size and its complement's.

The chain

Where this was read from

  • Lesson 10משפט 2: IS≤pVC\mathrm{IS} \le_p \mathrm{VC}, ולכן VC\mathrm{VC} היא NP-שלמה
  • Guided exerciseindependent-set-to-vertex-cover
  • 2026 '2 מועד 2The ≤p\le_p relations between the "exactly", "at least", and "minimum" versions of vertex cover.