Brandes' algorithm
In network theory, Brandes' algorithm is an algorithm for calculating the betweenness centrality of vertices in a graph. The algorithm was first published in 2001 by Ulrik Brandes. Betweenness centrality, along with other measures of centrality, is an important measure in many real-world networks, such as social networks and computer networks.
In network theory, Brandes' algorithm is an algorithm for calculating the betweenness centrality of vertices in a graph. The algorithm was first published in 2001 by Ulrik Brandes. Betweenness centrality, along with other measures of centrality, is an important measure in many real-world networks, such as social networks and computer networks. There are several metrics for the centrality of a node, one such metric being the betweenness centrality. For a node v in a connected graph, the betweenness centrality is defined as: C_B(v)= \sum_{s \in V} \sum_{t \in V} \frac{\sigma_{st}(v)}{\sigma_{st}} where \sigma_{st} is the total number of shortest paths from node s to node t , and \sigma_{st}(v) is the number of these paths which pass through v . For an unweighted graph, the length of a path is considered to be the number of edges it contains. By convention, \sigma_{st} = 1 whenever s=t , since the only path is the empty path. Also, \sigma_{st}(v) = 0 if v is either s or t , since shortest paths do not pass through their endpoints. The quantity \delta_{st}(v) = \frac{\sigma_{st}(v)}{\sigma_{st}} is known as the pair dependency of st on v , and represents the proportion of the shortest s – t paths which travel via v . The betweenness centrality is simply the sum of the pair dependencies over all pairs. As well as the pair dependency, it is also useful to define the (single) dependency on v , with respect to a particular vertex s : \delta_s(v) = \sum_{t \in V} \delta_{st}(v) , with which, we can obtain the concise formulation C_B(v) = \sum_{s \in V} \delta_s(v) . The number of shortest paths \sigma_{sv} between s and every vertex v is calculated using breadth-first search. The breadth-first search starts at s , and the shortest distance d(v) of each vertex from s is recorded, dividing the graph into discrete layers. Additionally, each vertex v keeps track of the set of vertices which in the preceding layer which point to it, p(v) . Described in set-builder notation, it can be written as: p(v) = \{u \in V \mid (u, v) \in E \and d(u) + 1 = d(v)\} . This lends itself to a simple iterative formula for \sigma_{sv} : \sigma_{sv} = \sum_{u \in p(v)} \sigma_{su} , which essentially states that, if v is at depth d(v) , then any shortest path at depth d(v)-1 extended by a single edge to v becomes a shortest path to v . Brandes proved the following recursive formula for vertex dependencies: \delta_s(u) = \sum_{v \mid u \in p(v)} \frac{\sigma_{su}}{\sigma_{sv}} \cdot (1 + \delta_s(v)) , where the sum is taken over all vertices v that are one edge further away from s than u . This lemma eliminates the need to explicitly sum all of the pair dependencies. Using this formula, the single dependency of s on a vertex u at depth d(u) is determined by the layer at depth d(u)+1 . Furthermore, the order of summation is irrelevant, which allows for a bottom up approach starting at the deepest layer. It turns out that the dependencies of s on all other vertices u can be computed in O(|E|) time. During the breadth-first search, the order in which vertices are visited is logged in a stack data structure. The backpropagation step then repeatedly pops off vertices, which are naturally sorted by their distance from s , descending. For each popped node v , we iterate over its predecessors u \in p(v) : the contribution of v towards \delta_s(u) is added, that is, \frac{\sigma_{su}}{\sigma_{sv}} \cdot (1 + \delta_s(v)) . Crucially, every layer propagates its dependencies completely, before moving to the layer with lower depth, due to the nature of breadth-first search. Once the propagation reaches back to s , every vertex v now contains \delta_s(v) . These can simply be added to C_B(v) , since C_B(v) = \sum_{s \in V} \delta_s(v) . After |V| iterations of single-source shortest path and backpropagation, each C_B(v) contains the betweenness centrality for v . if dist[v] = null then dist[v] ← dist[u] + 1 Q.enqueue(v) if dist[v] = dist[u] + 1 then σ[v] ← σ[v] + σ[u] prev[v].append(u) // Backpropagation of dependencies while S is not empty do v ← S.pop() for each u in prev[v] do δ[u] ← δ[u] + σ[u] / σ[v] * (1 + δ[v]) if v ≠ s then CB[v] ← CB[v] + δ[v] // Halved for undirected graphs return CB
References
No reference rows published for this article.
Cite this article
MLA
"Brandes' algorithm." encyclopegia.org, 2026, https://encyclopegia.org/wiki/brandes-algorithm. Accessed 24 November 2026.
Chicago
"Brandes' algorithm." encyclopegia.org. Accessed November 24, 2026. https://encyclopegia.org/wiki/brandes-algorithm.
APA
encyclopegia.org. (2026). Brandes' algorithm. Retrieved November 24, 2026, from https://encyclopegia.org/wiki/brandes-algorithm
Accessed November 24, 2026 · CC BY-SA 4.0 · citation page · JSON
Claims
| Predicate | Value | Source |
|---|---|---|
| publication date | 2001 | Wikipedia |