Edge Betweenness Centrality
SQL function: cugraph_edge_betweenness_centrality
Official cuGraph reference: C API
Measure how often each edge lies on shortest paths between vertex pairs, exactly or from an explicit sample of source vertices.
Quickstart
The call below supplies edges from registered relation target_edges with canonical src and dst columns and may include weight. Substitute your own registered relations.
SELECT * FROM cugraph_edge_betweenness_centrality(edges => (SELECT src, dst FROM target_edges));
Inputs
Every relation is a named parenthesized SELECT subquery. The required edges role uses canonical src and dst columns; every role, its canonical columns, and their accepted Arrow types are listed under Relation arguments. Metadata validation resolves registered tables named in its JSON request.
Endpoint columns accept numeric Int32, Int64 vertex IDs or logical string Utf8, LargeUtf8, Utf8View vertex IDs; string vertex-identity outputs are canonicalized to Utf8 (native mapping Int64) while scores, distances, counts, coordinates, and opaque labels stay numeric. The shared vertex-ID contract is summarized in Vertex ID support; the concrete call-specific schema comes from gpu_validate_call.
Logical string side-input limitations:
- edge ID columns and edge-ID predicate side inputs are not supported for logical string graphs
Arguments and options
Relation arguments
| Argument | Required | Columns | Description |
|---|---|---|---|
edges | yes |
| edge relation with canonical src and dst columns, plus optional weight and edge_id columns |
Every edge_id column must have the integer type of src and dst; string-keyed graphs accept no edge IDs.
Named value arguments
| Option | Type | Default | Constraints | Description |
|---|---|---|---|---|
exact_vertex_threshold | integer | 100000 | min 0; max 18446744073709552000 | vertex count threshold for exact betweenness |
k | integer|null | null | min 1; max 18446744073709552000 | optional sample count, at least 1 |
normalized | boolean | true | whether centrality scores are normalized | |
seeds | array|null | null | optional non-empty homogeneous seed vertex array |
Graph construction options
Graph construction follows the shared defaults (directed=true, renumbering, python_cugraph policy) documented in Graph Construction Options.
Output
| Column | Type | Nullable | Description |
|---|---|---|---|
source | Int64|Utf8 | no | Algorithm result column. |
destination | Int64|Utf8 | no | Algorithm result column. |
score | Float64 | no | Algorithm result column. |
These are generic descriptor schemas; run gpu_validate_call to get the concrete, table-specific output schema.
Examples
This example runs on the citation network demo dataset.
The citations that bridge subfields
Where vertex betweenness
scores papers, edge betweenness scores individual citations. The output is
one row per edge (source, destination, score), so joining papers twice
labels both ends of each load-bearing link. The graph is the same ~38k-vertex
2010s AI subgraph used by the Louvain and betweenness examples:
CREATE OR REPLACE VIEW ai_nodes AS
SELECT paper_id FROM papers
WHERE year >= 2010 AND primary_fos IN (
'Deep learning', 'Artificial neural network', 'Convolutional neural network',
'Recurrent neural network', 'Natural language processing',
'Reinforcement learning', 'Image segmentation', 'Feature extraction',
'Object detection', 'Speech recognition');
CREATE OR REPLACE VIEW ai_edges AS
SELECT e.src, e.dst
FROM citation_edges e
JOIN ai_nodes a ON a.paper_id = e.src
JOIN ai_nodes b ON b.paper_id = e.dst;
SELECT ps.title AS citing, pd.title AS cited, ROUND(b.score, 5) AS edge_betweenness
FROM cugraph_edge_betweenness_centrality(edges => (SELECT src, dst FROM ai_edges)) b
JOIN papers ps ON ps.paper_id = b.source
JOIN papers pd ON pd.paper_id = b.destination
ORDER BY b.score DESC
LIMIT 5;
| citing | cited | edge_betweenness |
|---|---|---|
| Rich Feature Hierarchies for Accurate Object Detection and Semantic Segmentation | Regionlets for Generic Object Detection | 0.00022 |
| Squeeze-and-Excitation Networks | Regularized Evolution for Image Classifier Architecture Search | 0.00021 |
| Improving object detection with deep convolutional networks via Bayesian optimization and structured prediction | Deep learning in neural networks | 0.00017 |
| SqueezeNet: AlexNet-level accuracy with 50x fewer parameters and <0.5MB model size | Shallow Networks for High-Accuracy Road Object-Detection | 0.00016 |
| A survey on deep learning in medical image analysis | Deep Learning Convolutional Networks for Multiphoton Microscopy Vasculature Segmentation. | 0.00014 |
The pattern is the classic edge-betweenness signature: the top links are not
famous-cites-famous, they are the single citations that connect a hub (R-CNN,
SENet, SqueezeNet, a survey) to an otherwise peripheral cluster: the bridge a
whole niche crosses to reach the rest of the field. Exact edge betweenness
touches every source-edge pair, so this call is much heavier than its vertex
counterpart; in this run it took about 1.5 minutes on this subgraph, versus
under a second for vertex betweenness on the
capture host. The same exact_vertex_threshold / k
/ seeds policy applies on larger graphs.
Limits
No algorithm-specific limitations.
To dry-run validate relation metadata, column types, and options without execution, see gpu_validate_call.