aryagraph.algorithms.centrality.harmonic_centrality#
- aryagraph.algorithms.centrality.harmonic_centrality(g: Any, weight: str | Callable[[Hashable, Hashable, dict], float] | None = None) NodeMap[source]#
Harmonic centrality
Σ_{u ≠ v} 1 / d(u, v)(unnormalised, like networkx).Directed graphs use incoming distances; unreachable nodes contribute 0 and zero-length paths (zero-weight edges) are skipped.