Definition
Independent Set to Clique
There is a polynomial-time many-one reduction from the Independent Set problem to the Clique problem:
Construction
Given an independent set instance with , output the clique instance
where is the complement graph of :
Thus, has the same vertices as . Every edge of becomes a non-edge of , and every non-edge between distinct vertices of becomes an edge of . The threshold remains unchanged.
The highlighted vertices have no edges between them in . Complementation inserts exactly those missing edges, so the same vertex set forms a clique in .
Correctness
The graph has an independent set of size at least if and only if its complement has a clique of size at least .
Correctness
Forward
Suppose that has an independent set with . For every distinct , the pair is not an edge of . It is therefore an edge of . Hence every pair of vertices in is adjacent in , so is a clique of size at least .
Backward
Suppose that has a clique with . For every distinct , the pair is an edge of and therefore not an edge of . Hence no two vertices in are adjacent in , so is an independent set of size at least .
Running time
Let . Constructing requires inspecting each of the unordered pairs of distinct vertices and reversing its adjacency status. The reduction therefore runs in time and produces at most edges, which is polynomial in the input size.
NP-completeness
Independent Set is NP-hard, so this reduction proves that Clique is NP-hard. Together with membership in NP, this proves that Clique is NP-complete.