Skip to main content

Module harmonic

Module harmonic 

Source
Expand description

Harmonic centrality Σ_{u ≠ v} 1 / d(v, u) (unweighted graph).

Harmonic centrality (Marchiori & Latora 2000) is the sum of the reciprocals of the shortest-path distances from a vertex to every other vertex. Unlike closeness centrality — which sums distances and therefore requires a connected graph — unreachable vertices simply contribute 1/∞ = 0, so harmonic centrality is well-defined on disconnected graphs.

H(v) = Σ_{u ≠ v, d(v,u) < ∞} 1 / d(v, u)

Distances are computed by a BFS from each source (treating the graph as unweighted). The optional normalised variant divides by n − 1 so values lie in [0, 1].

§References

  • Marchiori, M. & Latora, V. (2000). “Harmony in the small-world.” Physica A 285(3–4), 539–546.
  • Boldi, P. & Vigna, S. (2014). “Axioms for centrality.” Internet Math.

Functions§

harmonic_centrality
Compute the (raw) harmonic centrality of every vertex.
harmonic_centrality_normalized
Compute the normalised harmonic centrality (H(v) / (n − 1)).