Algorithm Search⌘K

Proofs: Label propagation algorithm

These are the human proofs of Label propagation algorithm, at full length.

Label propagation stops after at most m + 1 rounds with a stable labelling full

This proof shows: correctness, termination.

Let G=(V,E)G = (V, E) be an undirected simple graph with nn vertices and mm edges, and let N(v)N(v) be the set of neighbours of vv. For a labelling ℓ\ell, a vertex vv and a label xx, let cℓ(v,x)=∣{w∈N(v):ℓ(w)=x}∣c_\ell(v, x) = |\{w \in N(v) : \ell(w) = x\}|. A labelling is stable when cℓ(v,ℓ(v))=max⁡xcℓ(v,x)c_\ell(v, \ell(v)) = \max_x c_\ell(v, x) for every vv with N(v)≠∅N(v) \ne \emptyset.

Let Φ(ℓ)=∣{{u,w}∈E:ℓ(u)=ℓ(w)}∣\Phi(\ell) = |\{\{u, w\} \in E : \ell(u) = \ell(w)\}|, the number of agreeing edges. Clearly 0≤Φ(ℓ)≤m0 \le \Phi(\ell) \le m.

Lemma 1 (each change raises the potential). If line L7 changes the label of vv from aa to bb, then Φ\Phi grows by cℓ(v,b)−cℓ(v,a)≥1c_\ell(v, b) - c_\ell(v, a) \ge 1, where ℓ\ell is the labelling just before the change.

Proof. Only the edges at vv can change status. Before the change, the edge {v,w}\{v, w\} agrees exactly when ℓ(w)=a\ell(w) = a, which holds for cℓ(v,a)c_\ell(v, a) edges; after it, exactly when ℓ(w)=b\ell(w) = b, which holds for cℓ(v,b)c_\ell(v, b) edges, since the labels of the neighbours do not change and v∉N(v)v \notin N(v). Line L6 ran just before with the counts of line L5, which are cℓ(v,⋅)c_\ell(v, \cdot), and found cℓ(v,a)<max⁡xcℓ(v,x)c_\ell(v, a) < \max_x c_\ell(v, x); line L7 chose bb with cℓ(v,b)=max⁡xcℓ(v,x)c_\ell(v, b) = \max_x c_\ell(v, x). Both counts are integers, so the difference is at least 1. □\square

Lemma 2 (termination). The loop of lines L2 to L9 runs at most m+1m + 1 times.

Proof. At the start, every label is distinct, so Φ=0\Phi = 0. By Lemma 1 and Φ≤m\Phi \le m, line L7 changes a label at most mm times in the whole run. A round that sets changedchanged to true makes at least one change, so at most mm rounds do so. The first round that makes no change ends the loop at line L9, and it is at most round m+1m + 1. □\square

Lemma 3 (stability at exit). When the loop ends, the labelling is stable.

Proof. The loop ends after a round in which line L8 never ran, so no label changed during that round, and every vertex vv was visited once with the final labelling ℓ\ell. For each vv with a neighbour, the test of line L6 failed, so cℓ(v,ℓ(v))≥max⁡xcℓ(v,x)c_\ell(v, \ell(v)) \ge \max_x c_\ell(v, x), where the maximum is over the labels of the neighbours and is at least 1. Then cℓ(v,ℓ(v))≥1c_\ell(v, \ell(v)) \ge 1, so ℓ(v)\ell(v) is one of those labels, and the reverse inequality holds too. So cℓ(v,ℓ(v))=max⁡xcℓ(v,x)c_\ell(v, \ell(v)) = \max_x c_\ell(v, x). □\square

Lemma 4 (communities stay inside components). At all times, every label xx that some vertex holds is a vertex of the same connected component as that vertex.

Proof. At the start, ℓ(v)=v\ell(v) = v. Line L7 gives vv a label held by a neighbour of vv, which by induction lies in the component of that neighbour, the component of vv. □\square

Theorem. LABEL-PROPAGATION(GG) stops after at most m+1m + 1 rounds, for every random order and every random choice, and returns the classes of a stable labelling; each class lies inside one connected component of GG.

Proof. Lemma 2 gives termination, Lemma 3 stability, and Lemma 4 that two vertices with equal labels lie in the same component as that label, hence in one component. □\square

∎

Back to Label propagation algorithm