liveBook · Manning

Betweenness centrality

As explained in Graph Neural Networks in Action

A graph metric that quantifies how often a node lies on shortest paths between other nodes.

Betweenness centrality measures how often a node lies on shortest paths between source and destination nodes. Nodes appearing on many shortest paths have high centrality and may be influential; nodes appearing rarely have low centrality. section 8.3.4

Use betweenness centrality as engineered node data through this workflow:

  • Start with an ETL output such as an edge list. section 8.3.4
  • Import the graph into a graph-processing framework and calculate the value for every node. section 8.3.4
  • Store values in a dictionary keyed by node ID, then attach them as node features for downstream machine learning. section 8.3.4
Figure 8.15 Steps to preprocess data in PyG. From raw files, there are essentially two paths to prep data for ingestion by a PyG algorithm. The first path, shown here, directly creates an iterator of data instances, which is used by the dataloader. The second path mimics the first but performs this process within the dataloader class.
figure

Place centrality computation within the broader path from raw files to data instances consumed by PyTorch Geometric. section 8.3.4

How Graph Neural Networks in Action covers it

How deep it goes
Explains shortest-path counting and influence interpretation, but stops short of formulas, algorithms, and implementation code.
Examples
Uses edge lists, node-ID dictionaries, and shortest paths between unique node pairs as concrete artifacts and examples.
What it assumes
Assumes graphs with nodes, edges, and source-to-destination paths while explaining the metric’s interpretation from those elements.
What you can do after
Apply it via graph-processing workflows and store computed values as node features for PyTorch Geometric data.
How it connects
Connects graph processing, feature engineering, node features, ETL, and PyTorch Geometric.

Also explained in

Compare how 3 books explain betweenness centrality →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Graph Neural Networks in Action. The section links point to the parts of the book it draws on.