Skip to content

Extract node betweenness

networkgraphcentrality

Calculate network node betweenness.

Calculates the betweenness centrality for each node in the network. Betweenness centrality is a measure of the number of times a node acts as a bridge along the shortest path between two other nodes.

Usage


The following are the step's expected inputs and outputs and their specific types.

Step signature
extract_node_betweenness(
    targets: list[number],
    *weights: list[number], {
    "param": value
}) -> (betweenness: number)

where the object {"param": value} is optional in most cases and if present may contain any of the parameters described in the corresponding section below.

Example

Example call (in recipe editor)
extract_node_betweenness(ds.targets, ds.weights) -> (ds.betweenness)

Inputs


targets: column:list[number]

A column containing link targets. Source is implied in the index.


*weights: column:list[number]

An optional column containing link weights.

Outputs


betweenness: column:number

A column containing the betweenness metric for each node/row.

Parameters


directed: boolean = False

Whether the links are directed or not.


cutoff: number | null

The maximum path length to consider when calculating the betweenness. If cutoff is zero or negative then there is no such limit.