How Labels Turn a Cell Graph into Clusters
A cell-neighborhood graph represents cells as vertices and their neighborhood relationships as edges. Label propagation turns that structure into a partition by repeatedly assigning each vertex a label that is common among its neighbors. Vertices sharing a final label are placed in the same cluster. The method is simple, but its simplicity has consequences: the labels can depend on the order in which vertices are updated and on how ties are resolved.
The procedure is a graph-clustering algorithm, not a test of whether two cells have the same biological identity. A cluster is a group induced by the chosen graph and algorithm. Its interpretation still depends on the quality of the graph and on subsequent biological assessment.
The standard initialization gives every vertex its own distinct label. An iteration visits vertices and updates their labels according to the labels currently held by their neighbors. In an asynchronous schedule, each update takes effect immediately, so a vertex visited later in the same iteration can use labels updated earlier. In a synchronous schedule, every vertex's new label is computed from the labels at the start of the iteration, and all changes take effect together. These schedules need not produce the same result.
For the basic rules described here, assume the graph is undirected, has no self-loops, and has nonnegative edge weights. An unweighted graph is the special case in which every edge has weight 1. If a cell graph is directed, first choose a suitable symmetrization; otherwise, “neighbor” and the edge contribution need additional direction-specific definitions. Isolated vertices have no neighboring labels to copy and are ordinarily left with their initial labels.
Local Updates and What They Optimize
For a vertex \(v\), let \(N(v)\) be its set of neighbors and let \(w_{vu}\) be the weight of the edge between \(v\) and neighbor \(u\). In an unweighted graph, set \(w_{vu}=1\). For a candidate label \(c\), define its support at \(v\) as the total weight of edges from \(v\) to neighbors currently carrying \(c\):
Here \(\mathbf{1}\{\ell(u)=c\}\) is 1 when \(u\) has label \(c\), and 0 otherwise. An update chooses a label maximizing \(S_v(c)\). For an unweighted graph, this is simply the label held by the largest number of neighbors. If more than one label has maximum support, there is a tie, and the algorithm needs a tie rule.
One common tie rule is to retain the vertex's current label whenever that label is among the maximizers. Another is to choose randomly among the tied labels. A deterministic implementation might instead use a fixed ordering of labels. These rules are not interchangeable: they can lead to distinct final partitions.
The argument assumes the neighbors' labels stay fixed during the update. With asynchronous single-vertex updates, that condition holds at each step. If ties are resolved by retaining the current label, any label change is to a strictly higher-support label, so \(F\) strictly increases at that step. Since a finite graph has finitely many label assignments, such a sequence of strict increases must terminate. But if tied labels can replace the current label, \(F\) can stay constant during a change; cycles are then possible. With synchronous updates, multiple vertices change at once, so the single-vertex argument does not guarantee that \(F\) increases.
Worked Example: An Asynchronous Update on a Four-Cell Path
Consider four hypothetical cells, A, B, C, and D, joined in a path: A—B—C—D. All edges have weight 1. Initialize each cell with its own label, written A, B, C, and D. Visit the cells in the order A, B, C, D, and use the rule “retain the current label if it is tied for the maximum.”
Update A. Its only neighbor, B, has label B. Thus \(S_A(B)=1\), so A changes from label A to B.
Update B. Its neighbors are A and C. A now has label B, while C has label C, giving \(S_B(B)=1\) and \(S_B(C)=1\). B's current label B is tied for maximum, so it remains B.
Update C. Its neighbors are B and D, with labels B and D. The supports are \(S_C(B)=1\) and \(S_C(D)=1\). C's current label C is not tied for maximum. Suppose the tie rule selects B; C changes to B.
Update D. Its only neighbor, C, now has label B. D changes from D to B. The final labels are B, B, B, B: this update sequence produces one cluster. Every update followed the majority rule, but the outcome depends on the choices made when support was tied.
Worked Example: A Tie Changes the Partition
Use the same path, initialization, visit order, and rule that retains the current label when it is tied for maximum. At C, however, suppose the tie between B and D is resolved in favor of D instead of B.
A changes to B. B sees one neighbor labeled B and one labeled C, so it remains B under the current-label tie rule. C sees B and D with equal support and changes to D. Finally, D sees its only neighbor C labeled D, so D remains D. The final labels are B, B, D, D, giving clusters \(\{A,B\}\) and \(\{C,D\}\).
The graph and visit order have not changed; only the tie choice at C has changed. The example shows why reporting a partition without describing implementation choices can hide meaningful algorithmic variability.
Weights, Update Schedules, and Stopping
Weights affect the strength of a neighbor's vote, not the definition of a label. A high-weight edge contributes more support to its neighbor's label than a low-weight edge. This is appropriate when edge weights represent relative neighborhood strength, as in a weighted cell graph, but it does not make the final labels uniquely determined.
Worked Example: A Weighted Vote
Suppose a hypothetical cell \(v\) has four neighbors. Two carry label Red, connected to \(v\) by weights 0.8 and 0.6. Two carry label Blue, connected by weights 0.9 and 0.2. The current label of \(v\) is Blue.
The total support for Red is \(0.8+0.6=1.4\). The total support for Blue is \(0.9+0.2=1.1\). Since \(1.4>1.1\), an update assigns \(v\) the label Red. Its local contribution to \(F\) increases by \(1.4-1.1=0.3\) under this update, with all neighbor labels fixed. Counting neighbors without weights would give two votes to each label and incorrectly describe the weighted rule as a tie.
Asynchronous updates allow a label to travel through the graph within an iteration: cells visited later can use labels that have already moved. Synchronous updates instead use the same previous state for all vertices in an iteration. Neither schedule is automatically equivalent to the other, and an iteration count alone does not ensure that the labels have stabilized.
Worked Example: Synchronous Updates Can Cycle
Take two hypothetical cells, P and Q, joined by one unweighted edge. Initialize P with label P and Q with label Q. Under synchronous updates, P copies Q's label and Q copies P's label, because each has only one neighbor. After one iteration, P has label Q and Q has label P. At the next iteration, they swap again, returning to the original label assignment.
Thus the label assignment alternates indefinitely even though the graph has only one edge. The partition into two singleton clusters happens to remain the same, but the labels themselves do not converge. A stopping rule based only on a maximum number of iterations can return an arbitrary point in this cycle. This example also shows why the monotone single-vertex argument does not establish convergence for synchronous updates.
In practice, a label-propagation implementation needs a stopping rule, such as stopping when a full asynchronous sweep makes no changes, or stopping at a prespecified iteration limit. For stochastic tie-breaking, repeated runs can be useful for assessing how much the partition varies. If an iteration limit is reached while labels are still changing, the output should be treated as an unfinished or schedule-dependent result, not silently described as a stable fixed point.
Diagnostics, Alternatives, and Limitations
Useful diagnostics begin with the graph and then examine the algorithm's behavior. Check that edge weights are nonnegative and that the graph has the intended symmetry. Record the update schedule, initialization, tie rule, and stopping rule. Inspect whether any vertices remain isolated and whether any labels are still changing at termination. Compare partitions across different update orders or tie-breaking seeds; substantial differences indicate that the result is sensitive to implementation choices.
Label propagation is fast and easy to implement because each update only aggregates labels among a vertex's neighbors. Its main alternative in the immediate graph-clustering context is an objective-based community method such as Louvain or Leiden: those methods use a community quality objective and their own iterative procedures, whereas basic label propagation copies a locally most-supported label. The local within-label weight justification above does not turn label propagation into modularity optimization. These methods can therefore return different partitions even on the same graph.
The most important failure modes are:
- Order sensitivity: asynchronous updates use the latest labels, so changing the vertex order can change later votes.
- Tie sensitivity: several labels may have equal support, especially at the start when every vertex has a distinct label.
- Over-merging: labels can spread across a connected graph and produce very large communities; connectedness alone does not establish that one cluster is meaningful.
- Nonconvergence: permitted tie changes or synchronous updating can cause cycles or persistent changes.
- Graph dependence: missing, spurious, or poorly weighted edges alter the votes and therefore the clusters.
- Isolated vertices: without neighbors, a vertex has no label evidence from the graph and ordinarily retains its own label.
These limitations matter in single-cell analysis because a partition is conditional on the constructed graph. Label propagation does not independently validate cell types, select a biologically correct number of clusters, or remove artifacts from the graph. Its speed is useful for exploration, but it should not be mistaken for stability or biological confirmation.
Check Your Understanding
Answer each question, then compare your reasoning with the solutions.
- A vertex has three neighbors labeled X, X, and Y in an unweighted graph. What label does the majority update assign?
- A vertex has two Red neighbors connected with weights 0.3 and 0.4, and two Blue neighbors connected with weights 0.2 and 0.9. Which label has greater weighted support?
- Why does choosing a maximum-support label not guarantee that synchronous updates increase total within-label edge weight?
- What should an isolated vertex do under the basic label-propagation rule, and what does its label indicate?
- In the four-cell path example, what implementation details should be reported to make the partition reproducible?
Solutions. (1) X, because it occurs twice while Y occurs once. (2) Blue has support \(0.2+0.9=1.1\), while Red has \(0.3+0.4=0.7\), so the weighted update assigns Blue. (3) The single-vertex justification holds other labels fixed; synchronous updating changes several vertices together, so changes can affect one another and the total need not increase. (4) It has no neighboring votes, so it ordinarily retains its initial label; that label reflects the initialization, not evidence of similarity to other cells. (5) Report the graph and its weights, initial labels, asynchronous or synchronous schedule, vertex order if asynchronous, tie rule, and stopping rule.