Algorithm Search⌘K

Proofs: Infomap

These are the human proofs of Infomap, at full length.

The two-level Infomap search lowers the map equation at every move, stops, and ends where no module gains by joining a neighbouring module full

This proof shows: correctness, termination.

The proof is for the search of the page: undirected graphs without self-loops, the two-level map equation, and local moves with aggregation. The fine-tuning and coarse-tuning steps, teleportation and the multilevel map equation are not covered.

Let GG be an undirected graph on VV with positive integer weights Auv=AvuA_{uv} = A_{vu}, no self-loops, ku=∑vAuvk_u = \sum_v A_{uv} and W=12∑uku>0W = \frac12 \sum_u k_u > 0. For a partition M\mathcal{M} of VV, let cut(i)\mathrm{cut}(i) be the weight of the edges with exactly one end in the module ii, tot(i)=∑u∈iku\mathrm{tot}(i) = \sum_{u \in i} k_u, and f(a)=alog⁡2af(a) = a \log_2 a with f(0)=0f(0) = 0.

Lemma 1 (the exact form). With pu=ku/2Wp_u = k_u/2W, qi=cut(i)/2Wq_i = \mathrm{cut}(i)/2W, pi=tot(i)/2Wp_i = \mathrm{tot}(i)/2W and q=∑iqiq = \sum_i q_i,

2W L(M)=f(∑icut(i))−2∑if(cut(i))−∑uf(ku)+∑if(cut(i)+tot(i)).2W \, L(\mathcal{M}) = f\Bigl(\sum_i \mathrm{cut}(i)\Bigr) - 2 \sum_i f(\mathrm{cut}(i)) - \sum_u f(k_u) + \sum_i f(\mathrm{cut}(i) + \mathrm{tot}(i)).

Proof. First, qiq_i is the exit rate: the walker is at uu with probability ku/2Wk_u/2W and takes the edge to vv with probability Auv/kuA_{uv}/k_u, so the rate of the steps from u∈iu \in i to v∉iv \notin i is Auv/2WA_{uv}/2W, and summing over these pairs gives cut(i)/2W\mathrm{cut}(i)/2W. Now, for an integer a≥0a \ge 0, plogp(a/2W)=(f(a)−alog⁡22W)/2W\mathrm{plogp}(a/2W) = (f(a) - a \log_2 2W)/2W. Applying this to every term of the expanded map equation, the coefficients of log⁡22W/2W\log_2 2W / 2W are −C-C for plogp(q)\mathrm{plogp}(q), +2C+2C for −2∑iplogp(qi)-2\sum_i \mathrm{plogp}(q_i), +2W+2W for −∑uplogp(pu)-\sum_u \mathrm{plogp}(p_u) and −(C+2W)-(C + 2W) for ∑iplogp(qi+pi)\sum_i \mathrm{plogp}(q_i + p_i), where C=∑icut(i)C = \sum_i \mathrm{cut}(i) and ∑itot(i)=2W\sum_i \mathrm{tot}(i) = 2W. They add up to 0. □\square

So LL depends on M\mathcal{M} only through the pairs (cut(i),tot(i))(\mathrm{cut}(i), \mathrm{tot}(i)), and 22WL2^{2W L} is a ratio of products of integers aaa^a; comparing two values of LL exactly is comparing two such fractions, which is what the code does.

Lemma 2 (aggregation keeps L). Let HH be a graph built by the algorithm, whose vertex xx stands for a set Sx⊆VS_x \subseteq V, with self-loop weight sx=inG(Sx)s_x = \mathrm{in}_G(S_x) and edge weights Bxy=∑u∈Sx,v∈SyAuvB_{xy} = \sum_{u \in S_x, v \in S_y} A_{uv}. Let kx=2sx+∑y≠xBxyk_x = 2 s_x + \sum_{y \ne x} B_{xy}. For a set XX of vertices of HH, let cutH(X)=∑x∈X,y∉XBxy\mathrm{cut}_H(X) = \sum_{x \in X, y \notin X} B_{xy} and totH(X)=∑x∈Xkx\mathrm{tot}_H(X) = \sum_{x \in X} k_x. Then, with SX=⋃x∈XSxS_X = \bigcup_{x \in X} S_x, cutH(X)=cutG(SX)\mathrm{cut}_H(X) = \mathrm{cut}_G(S_X) and totH(X)=totG(SX)\mathrm{tot}_H(X) = \mathrm{tot}_G(S_X).

Proof. By induction over the levels, kx=totG(Sx)k_x = \mathrm{tot}_G(S_x): the edges of GG inside SxS_x are counted twice in 2sx2 s_x, and those leaving SxS_x once in ∑yBxy\sum_y B_{xy}, which is how they are counted in totG(Sx)\mathrm{tot}_G(S_x). Summing over XX gives the second claim. For the first, ∑x∈X,y∉XBxy\sum_{x \in X, y \notin X} B_{xy} is the weight of the edges of GG from SXS_X to the sets of the other vertices of HH, which cover V∖SXV \setminus S_X. □\square

By Lemma 1 and Lemma 2, define LHL_H of a partition of the vertices of HH by the exact form with cutH\mathrm{cut}_H, totH\mathrm{tot}_H and the constant ∑uf(ku)\sum_u f(k_u) of GG; it equals LL of the matching partition of VV. This is the quantity that line L8 compares, with the cut of a vertex xx alone being kx−2sxk_x - 2s_x.

Lemma 3 (each move lowers L). If lines L7 to L9 take vv from oldold to M≠oldM \ne old, then LL of the partition of VV after the step is smaller than before it.

Proof. After line L7, every placement of vv is a partition of the vertices of HH, and line L8 compares their LHL_H. It leaves oldold only for a module with strictly smaller LHL_H, since it keeps oldold on ties. By Lemma 2, LHL_H is LL of the matching partition of VV. □\square

Lemma 4 (termination). The run makes finitely many moves and has at most nn levels.

Proof. By Lemma 3, every move strictly lowers LL of the current partition of VV, and line L13 does not change it (Lemma 2). So no partition of VV appears twice after a move, and there are finitely many partitions of VV. A sweep without a move ends a level. A level that reaches line L12 made a move; its partition of HH has smaller LHL_H than the singletons of HH by Lemma 3, so it is not the partition into singletons, and the next HH has fewer vertices. □\square

Theorem. INFOMAP(GG) stops and returns a partition PP of VV such that L(P)≤LL(P) \le L of every partition reached before, including the singletons of VV, and such that no part of PP, moved as a whole into another part of PP that it has an edge to, lowers LL.

Proof. Termination is Lemma 4, and the first claim follows from Lemma 3 and Lemma 2. The algorithm returns at line L11 after a level in which nothing moved. In its last sweep, line L8 kept every vertex xx of HH in its own singleton module, so no module of a neighbour of xx gave a smaller LHL_H. The vertices of HH are the parts of PP, a neighbour of xx in HH is a part with an edge to SxS_x, and by Lemma 2 the values compared are the values of LL on VV. □\square

∎

Back to Infomap