Skip to content

@graphty/algorithms / index / betweennessCentrality

Function: betweennessCentrality() ​

betweennessCentrality(s, options?): BetweennessResult

Defined in: indexed/betweenness.ts:262

Node betweenness centrality by Brandes' algorithm: breadth-first, so weights are ignored, as in the legacy betweennessCentrality, whose scores this equals on every graph it can hold. A sampled run (sources or k) is the UNSCALED sum over the sources run, as the WebGPU accelerator reports it.

Parameters ​

s ​

GraphSnapshot

The snapshot

options? ​

BetweennessOptions = {}

Normalisation, endpoints and sampling

Returns ​

BetweennessResult

One score per node index; iterations is the number of sources run

Throws ​

RangeError for a bad sources or k