Skip to main content

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.

Signature

cugraph_edge_betweenness_centrality(table_name [, src_col, dst_col [, weight_col [, options_json]]])

Relation inputs

The first positional argument names a registered edge table or view (the edges role). Parenthesized relation subqueries are not accepted; metadata validation uses the same registered name.

Vertex ID types

The edges relation declares the accepted vertex-ID domains. Numeric calls preserve the existing numeric schema. When logical string support is declared, Utf8, LargeUtf8, and Utf8View endpoint columns share one logical domain; their vertex-identity outputs are canonicalized to Utf8.

DomainAccepted endpoint inputsOutput contract
Numeric edge endpointsInt32, Int64The numeric output schema is used for numeric calls.
Logical string edge endpointsUtf8, LargeUtf8, Utf8ViewVertex identity columns are canonicalized to Utf8; scores, distances, counts, coordinates, and opaque labels remain numeric.

The native mapping type is Int64. Call-specific output schemas come 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

Scalar arguments & JSON options

Positional scalar arguments

src_col and dst_col name the edge endpoint columns; both are optional and default to src and dst.

ArgumentTypeRequiredDefaultNotes
weight_colUtf8|nullnoaccepted as an edge-column binding; native algorithm execution does not consume weights; semantic effect: none for this algorithm

JSON options

OptionTypeDefaultConstraintsDescription
exact_vertex_thresholdUInt64100000Maximum actual graph vertex count allowed for exact betweenness without explicit seeds or k.
kUInt64|nullnullmin 1; mutually exclusive with seedsDeterministic approximate seed count. Execution uses the first k distinct graph vertices in stable order and refuses k larger than the actual vertex count.
normalizedBooleantrue
seedsList<Int64>|List<Utf8>|nullnullmutually exclusive with kExplicit homogeneous integer or string seed vertices for approximate betweenness. Null requests exact all-vertex betweenness unless k is set.

Graph construction options

Graph construction follows the shared defaults (directed=true, renumbering, python_cugraph policy) documented in Graph Construction Options.

Output schema

ColumnTypeNullableDescription
sourceInt64|Utf8noAlgorithm result column.
destinationInt64|Utf8noAlgorithm result column.
scoreFloat64noAlgorithm result column.

These are generic descriptor schemas; validate the 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('ai_edges', 'src', 'dst') 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;
citingcitededge_betweenness
Rich Feature Hierarchies for Accurate Object Detection and Semantic SegmentationRegionlets for Generic Object Detection0.00022
Squeeze-and-Excitation NetworksRegularized Evolution for Image Classifier Architecture Search0.00021
Improving object detection with deep convolutional networks via Bayesian optimization and structured predictionDeep learning in neural networks0.00017
SqueezeNet: AlexNet-level accuracy with 50x fewer parameters and <0.5MB model sizeShallow Networks for High-Accuracy Road Object-Detection0.00016
A survey on deep learning in medical image analysisDeep 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: about 1.5 minutes on this subgraph, versus sub-second for vertex betweenness. The same exact_vertex_threshold / k / seeds policy applies on larger graphs.

Limitations & lifecycle

No algorithm-specific limitations.

Validate before running

Dry-run validation checks registered relation metadata, column presence, static dtypes, and options only; it does not scan edge data, construct a graph, or prove source-vertex existence:

SELECT * FROM gpu_validate_call(
'cugraph_edge_betweenness_centrality',
'{"schema_version":1,"relations":{"edges":{"table":"target_edges"}},"options":{"src_col":"src","dst_col":"dst"}}'
);

See GPU Function Catalog API for the full gpu_validate_call contract.