Proofs: Tomita's maximum clique algorithm
These are the human proofs of Tomita's maximum clique algorithm, at full length.
The coloring bound never cuts off a larger clique full
This proof shows: correctness, termination.
Write for the neighbors of and for the clique number of a graph , with of the empty graph equal to 0. For a call EXPAND let be the list at its start.
Invariant of a call. At every call EXPAND:
(a) is a clique, and every vertex of is adjacent to every vertex of ; in particular .
This holds for the first call, with . If it holds for a call and , then is a clique, and consists of vertices adjacent to all of and to ; so it holds for the child call of line L10. The same argument shows that the set stored at line L9 is a clique.
Termination. Each turn of the loop of lines L5 to L11 either returns or removes one vertex from at line L11, and a child call gets a list that does not contain , so . By induction on every call stops.
Lemma (the bound). After line L4, let be the last vertex of the current list . Every clique contained in the current has at most vertices.
Proof. NUMBER-SORT puts a vertex into a class only if the class has no neighbor of it, so every class is an independent set. The list is sorted by class number, and the loop only removes vertices from the end, so every vertex left in has color at most . A clique meets an independent set in at most one vertex, so a clique in has at most one vertex of each of the colors .
Claim. When EXPAND returns, , where is its value at that moment. Moreover, only grows and is always a clique.
Proof. By induction on . If , this is the top call with , since line L10 calls EXPAND only with , and the claim is trivial. So let , and let be a maximum clique of , so .
Let be the vertex of that the loop reaches first, that is, the vertex of that comes last in the sorted list.
- If the call returns at line L7 at some turn with last vertex while all of is still in , then by the lemma , which is the claim, since only grows afterwards.
- Otherwise the loop reaches the turn with , with all of still in , because line L11 has removed only vertices after in the list, none of them in . Passing line L7, it computes . If , then and line L9 makes . If , the child call EXPAND has , and by induction, after it returns, .
In all cases after the call. Every value stored in is a clique by invariant (a), and it is replaced only by a larger one.
Conclusion. The top call is EXPAND, so at the end . As is a clique, , and line L3 returns a maximum clique. If , the loop does not run and the empty clique is returned, which is correct. ∎