Algorithm Search⌘K

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 N(p)N(p) for the neighbors of pp and ω(H)\omega(H) for the clique number of a graph HH, with ω\omega of the empty graph equal to 0. For a call EXPAND(Q,R)(Q, R) let R0R_0 be the list RR at its start.

Invariant of a call. At every call EXPAND(Q,R)(Q, R):

(a) QQ is a clique, and every vertex of RR is adjacent to every vertex of QQ; in particular Q∩R=∅Q \cap R = \emptyset.

This holds for the first call, with Q=∅Q = \emptyset. If it holds for a call and p∈Rp \in R, then Q∪{p}Q \cup \{p\} is a clique, and R′=R∩N(p)R' = R \cap N(p) consists of vertices adjacent to all of QQ and to pp; so it holds for the child call of line L10. The same argument shows that the set Q∪{p}Q \cup \{p\} 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 RR at line L11, and a child call gets a list R′R' that does not contain pp, so ∣R′∣<∣R∣|R'| < |R|. By induction on ∣R∣|R| every call stops.

Lemma (the bound). After line L4, let pp be the last vertex of the current list RR. Every clique contained in the current RR has at most col[p]\mathrm{col}[p] 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 RR has color at most col[p]\mathrm{col}[p]. A clique meets an independent set in at most one vertex, so a clique in RR has at most one vertex of each of the colors 1,…,col[p]1, \ldots, \mathrm{col}[p]. □\square

Claim. When EXPAND(Q,R0)(Q, R_0) returns, ∣Qmax⁡∣≥∣Q∣+ω(G[R0])|Q_{\max}| \ge |Q| + \omega(G[R_0]), where Qmax⁡Q_{\max} is its value at that moment. Moreover, Qmax⁡Q_{\max} only grows and is always a clique.

Proof. By induction on ∣R0∣|R_0|. If R0=∅R_0 = \emptyset, this is the top call with Q=∅Q = \emptyset, since line L10 calls EXPAND only with R′≠∅R' \ne \emptyset, and the claim ∣Qmax⁡∣≥0|Q_{\max}| \ge 0 is trivial. So let R0≠∅R_0 \ne \emptyset, and let KK be a maximum clique of G[R0]G[R_0], so K≠∅K \ne \emptyset.

Let p∗p^* be the vertex of KK that the loop reaches first, that is, the vertex of KK that comes last in the sorted list.

  • If the call returns at line L7 at some turn with last vertex pp while all of KK is still in RR, then by the lemma ∣K∣≤col[p]≤∣Qmax⁡∣−∣Q∣|K| \le \mathrm{col}[p] \le |Q_{\max}| - |Q|, which is the claim, since Qmax⁡Q_{\max} only grows afterwards.
  • Otherwise the loop reaches the turn with p=p∗p = p^*, with all of KK still in RR, because line L11 has removed only vertices after p∗p^* in the list, none of them in KK. Passing line L7, it computes R′=R∩N(p∗)⊇K∖{p∗}R' = R \cap N(p^*) \supseteq K \setminus \{p^*\}. If R′=∅R' = \emptyset, then K={p∗}K = \{p^*\} and line L9 makes ∣Qmax⁡∣≥∣Q∣+1=∣Q∣+∣K∣|Q_{\max}| \ge |Q| + 1 = |Q| + |K|. If R′≠∅R' \neq \emptyset, the child call EXPAND(Q∪{p∗},R′)(Q \cup \{p^*\}, R') has ∣R′∣<∣R0∣|R'| < |R_0|, and by induction, after it returns, ∣Qmax⁡∣≥∣Q∣+1+ω(G[R′])≥∣Q∣+1+∣K∣−1|Q_{\max}| \ge |Q| + 1 + \omega(G[R']) \ge |Q| + 1 + |K| - 1.

In all cases ∣Qmax⁡∣≥∣Q∣+∣K∣|Q_{\max}| \ge |Q| + |K| after the call. Every value stored in Qmax⁡Q_{\max} is a clique by invariant (a), and it is replaced only by a larger one. □\square

Conclusion. The top call is EXPAND(∅,V)(\emptyset, V), so at the end ∣Qmax⁡∣≥ω(G)|Q_{\max}| \ge \omega(G). As Qmax⁡Q_{\max} is a clique, ∣Qmax⁡∣=ω(G)|Q_{\max}| = \omega(G), and line L3 returns a maximum clique. If V=∅V = \emptyset, the loop does not run and the empty clique is returned, which is correct. ∎

Back to Tomita's maximum clique algorithm