Betweenness Centrality Calculation Example

Interactive Graph Theory Tool

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

Each preset demonstrates a different shortest-path structure and centrality pattern.
Betweenness centrality measures how often this node lies on shortest paths between other pairs of nodes.
Nodes 0
Edges 0
Pairs examined 0
Select a graph and node, then click Calculate Betweenness.
Formula used: for each pair of distinct nodes s and t, sum sigma(st, v) / sigma(st), where sigma(st) is the number of shortest paths from s to t and sigma(st, v) is the number of those shortest paths that pass through node v.

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.

CB(v) = sum over all s != v != t of sigma(s,t | v) / sigma(s,t)

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.

  1. Pair A,B: shortest path is A-B. It does not pass through C, so contribution = 0.
  2. Pair A,D: shortest path is A-B-C-D. It passes through C, so contribution = 1.
  3. Pair A,E: shortest path is A-B-C-D-E. It passes through C, so contribution = 1.
  4. Pair B,D: shortest path is B-C-D. It passes through C, so contribution = 1.
  5. Pair B,E: shortest path is B-C-D-E. It passes through C, so contribution = 1.
  6. 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:

  1. Builds the adjacency list for the graph.
  2. Enumerates every unordered pair of distinct nodes excluding the selected node.
  3. Finds the shortest path distance for each pair.
  4. Counts all shortest paths between the pair.
  5. Counts how many of those shortest paths pass through the selected node.
  6. Adds the ratio to produce the raw betweenness score.
  7. 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

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.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top