Betweenness Centrality Calculation Example
Use this premium calculator to explore how betweenness centrality is computed in small networks. Select a sample graph, choose a node, and instantly see the raw score, normalized score, shortest-path contributions, and a visual comparison chart for every node in the network.
Calculator
Centrality Chart
Compare the selected node against every other node in the same graph. The highlighted bar marks your chosen node.
How to Understand a Betweenness Centrality Calculation Example
Betweenness centrality is one of the most useful concepts in network analysis because it captures a simple but powerful idea: some nodes act like bridges. They connect groups, channels, or paths that would otherwise be more distant from one another. In graph theory terms, a node has high betweenness centrality when it lies on many shortest paths between other pairs of nodes. That makes it important for routing, coordination, influence, vulnerability analysis, and bottleneck detection.
If you are studying a betweenness centrality calculation example, the main objective is to see how the score is built from pair-by-pair shortest-path contributions. Unlike degree centrality, which only counts immediate neighbors, betweenness centrality looks at the global structure of the graph. A node can have a modest number of direct connections and still be strategically vital if it sits between clusters.
Core definition
For a node v, betweenness centrality is computed by examining all distinct pairs of other nodes s and t. For each pair, determine the total number of shortest paths between them, then determine how many of those shortest paths pass through v. The contribution from that pair is the ratio of those two quantities.
For undirected graphs, a common normalization divides the raw value by (n – 1)(n – 2) / 2, where n is the total number of nodes. This produces a score between 0 and 1 in many teaching examples, making comparison easier across networks of different sizes.
Why shortest paths matter
The shortest path assumption is central to the interpretation. If information, people, goods, or influence tend to travel efficiently through a network, then nodes appearing on shortest routes become natural gatekeepers. In a road network, these are intersections that sit between major regions. In organizational communication, they are employees who connect departments. In epidemiology or social diffusion, they can be intermediaries that accelerate or constrain spread.
- High degree, low betweenness: a node may have many local neighbors but still remain inside one dense cluster.
- Low degree, high betweenness: a node can have only a few links yet control movement between communities.
- Zero betweenness: peripheral nodes or leaves often contribute little because shortest paths rarely need them as intermediates.
A step-by-step example
Suppose you have a simple path graph with five nodes arranged as A-B-C-D-E. To calculate betweenness centrality for node C, consider every unordered pair that excludes C: (A,B), (A,D), (A,E), (B,D), (B,E), and (D,E). Then find whether the shortest path for each pair passes through C.
- Pair A,B: shortest path is A-B. It does not pass through C, so contribution = 0.
- Pair A,D: shortest path is A-B-C-D. It passes through C, so contribution = 1.
- Pair A,E: shortest path is A-B-C-D-E. It passes through C, so contribution = 1.
- Pair B,D: shortest path is B-C-D. It passes through C, so contribution = 1.
- Pair B,E: shortest path is B-C-D-E. It passes through C, so contribution = 1.
- Pair D,E: shortest path is D-E. It does not pass through C, so contribution = 0.
The raw betweenness centrality of C is therefore 4. Because there are 5 nodes, the undirected normalization denominator is (5 – 1)(5 – 2) / 2 = 6. The normalized score is 4 / 6 = 0.667. This is why the center of a path often has the highest betweenness centrality.
When multiple shortest paths exist
A more realistic betweenness centrality calculation example includes ties. If two shortest paths exist between a pair of nodes, the contribution is split proportionally. For example, if there are two shortest paths from A to F and only one of them passes through node C, then the contribution from pair (A,F) to C is 1/2, not 1. This is a crucial distinction because it prevents over-crediting nodes in redundant networks.
That is exactly why analysts like betweenness centrality for transportation, communication, and resilience studies. It responds not only to path length, but also to path alternatives. The more alternative shortest routes a network provides, the less any single node dominates the flow.
Interpreting common graph patterns
Different graph shapes produce very different betweenness profiles:
- Star graph: the hub has extremely high betweenness because every leaf-to-leaf shortest path goes through the center. All leaves typically have zero.
- Path graph: interior nodes score higher than endpoints, and the most central interior node often peaks.
- Bridge graph: connector nodes between clusters score highly even if they are not the most connected nodes inside either cluster.
- Dense clique: many nodes may have very low betweenness because shortest paths are direct and alternatives are abundant.
| Graph type | Typical high-betweenness node | Interpretation | Expected pattern |
|---|---|---|---|
| Path graph | Middle node(s) | Acts as corridor between both ends | Center highest, endpoints near zero |
| Star graph | Hub | All non-hub pairs route through center | One dominant node, leaves zero |
| Two clusters with a bridge | Bridge node | Controls inter-cluster communication | Bridge spikes above dense local nodes |
| Complete graph | Usually none | Shortest paths are direct | All nodes near zero |
Real-world relevance and statistics
Betweenness centrality is not just a classroom metric. It appears in biology, cybersecurity, urban planning, web science, and public health. Researchers use it to identify critical proteins, vulnerable routers, intermodal transit nodes, and influential intermediaries in collaboration networks. In many applied settings, the nodes with the highest degree are not necessarily the nodes with the highest betweenness. This is important because interventions based only on neighbor count can miss strategically essential connectors.
To place centrality in context, it helps to remember how widespread networked systems are. According to the U.S. Census Bureau, the United States had over 331 million people in the 2020 Census, and population systems are constantly studied through transportation, migration, and social interaction networks. In digital contexts, university research labs such as Stanford SNAP and other academic centers analyze graphs with millions of edges, where shortest-path based centrality helps reveal bottlenecks and influence channels. In public health, network methods are routinely used to study contact structure and diffusion pathways, especially when bridge actors can amplify or limit spread.
| Context | Illustrative statistic | Why betweenness centrality matters | Source type |
|---|---|---|---|
| U.S. population systems | 331,449,281 residents counted in the 2020 Census | Large populations generate transportation, commuting, and service-access networks where bridge nodes affect accessibility | .gov |
| Internet and web-scale graphs | Academic graph datasets often contain millions of nodes and edges | High-betweenness routers or pages can become bottlenecks, strategic relays, or failure points | .edu |
| Biomedical network analysis | NIH-hosted literature widely uses network centrality to study disease transmission and molecular interaction systems | Bridge entities can connect otherwise separate modules, making them useful targets for monitoring or intervention | .gov |
How this calculator works
The interactive calculator above uses small unweighted graphs so the logic remains transparent. For each selected preset graph, it:
- Builds the adjacency list for the graph.
- Enumerates every unordered pair of distinct nodes excluding the selected node.
- Finds the shortest path distance for each pair.
- Counts all shortest paths between the pair.
- Counts how many of those shortest paths pass through the selected node.
- Adds the ratio to produce the raw betweenness score.
- Normalizes the score using the standard undirected denominator.
The chart then compares the full node set, which is useful because centrality is meaningful in relative terms. A normalized score of 0.40 might be impressive in one network and ordinary in another, depending on the graph structure.
Common mistakes in manual calculation
- Including pairs where the selected node is one endpoint. Betweenness only counts paths where the node is an intermediate.
- Ignoring multiple shortest paths. Equal-length alternatives split the contribution.
- Mixing directed and undirected formulas. The denominator changes depending on graph type.
- Confusing degree centrality with betweenness centrality. Immediate neighbors are not the same as brokerage power.
- Failing to normalize when comparing networks of different sizes.
When to use betweenness centrality
This measure is especially helpful when your question involves mediation, brokerage, access control, or vulnerability. It is less informative when shortest-path assumptions are unrealistic or when all nodes are densely connected and direct paths dominate. In those cases, other metrics such as closeness, eigenvector centrality, or flow-based measures may complement the analysis.
Still, for many educational and practical use cases, betweenness centrality remains one of the clearest ways to explain why a node matters beyond simple popularity. It answers the question: Which nodes sit in the middle of important routes between others? That makes it ideal for teaching network structure through examples.
Authoritative resources for deeper study
- Stanford University SNAP graph datasets and network analysis resources
- U.S. Census Bureau overview of the 2020 U.S. population count
- PubMed Central at NIH for network-analysis research in health and biology
Final takeaway
A strong betweenness centrality calculation example shows more than a formula. It reveals how graph structure shapes strategic importance. In a path, the middle dominates. In a star, the hub controls everything. In a bridge network, connector nodes become critical even when they are not the most locally connected. Once you understand how shortest-path contributions accumulate pair by pair, the metric becomes intuitive and highly practical.