Betweenness

Overview

StructuralGT.betweenness

Details

class StructuralGT.betweenness.NodeBetweenness(*args, **kwargs)

Bases: _Compute

Module for conventional vertex betweenness.

property node_betweenness

Node betweenness centrality.

\[BC(v) =\frac{1}{2N(N-1)} \sum_{s\in \mathscr{N},t \in \mathscr{N}} \frac{\sigma_{st}(e)}{\sigma_{st}}\]

where \(\mathscr{N}\) is the set of nodes, \(\sigma_{st}\) is the number of shortest \((s, t)\) -paths, and \(\sigma{st}(v)\) is the number of those paths passing through node \(v\) [Bra08].

property average_node_betweenness

Average node betweenness centrality.

\[\bar{BC} = \frac{1}{N} \sum_{v\in \mathscr{N}} BC(v)\]
class StructuralGT.betweenness.NodeBoundaryBetweenness(*args, **kwargs)

Bases: _Compute

A module for calculating different extension of the classical edge betweenness centrality measure. In particular, calculates betweennesses which include geometric features of the network via weights and boundary conditions.

property vertex_boundary_betweenness

Node betweenness centrality over a subset of nodes. Sometimes called betweenness subset.

\[g_B(v) =\sum_{s\in \mathscr{S},t \in \mathscr{T}} \frac{\sigma_{st}(v)}{\sigma_{st}}\]

where \(\mathscr{S}\) is the set of sources, \(\mathscr{T}\) is the set of targets, \(\sigma_{st}\) is the number of shortest \((s, t)\) -paths, and \(\sigma_{st}(v)\) is the number of those paths passing through edge \(v\) [Bra08].

class StructuralGT.betweenness.BoundaryBetweenness(*args, **kwargs)

Bases: _Compute

A module for calculating different extension of the classical edge betweenness centrality measure. In particular, calculates betweennesses which include geometric features of the network via weights and boundary conditions, as explained in [RMKD+25].

property boundary_betweenness

Edge betweenness centrality over a subset of nodes. Sometimes called betweenness subset.

\[EBC_B(e) = \frac{1}{2T(S-1)} \sum_{s\in \mathscr{S},t \in \mathscr{T}} \frac{\sigma_{st}(e)}{\sigma_{st}}\]

where \(\mathscr{S}\) is the set of sources, \(\mathscr{T}\) is the set of targets, \(\sigma_{st}\) is the number of shortest \((s, t)\) -paths, and \(\sigma_{st}(e)\) is the number of those paths passing through edge \(e\) [Bra08].

class StructuralGT.betweenness.RandomBoundaryBetweenness(*args, **kwargs)

Bases: _Compute

Calculates the random walk betweenness, as defined by Newman [New05].

property linear_betweenness

A random walk betweenness that requires number of sources and targets to be equal for random walker balance (i.e. charge conservation).

property nonlinear_betweenness

A random walk betweenness that does not requires number of sources and targets to be equal because a ghost sink node is added.