Skip to main content

harmonic_centrality_source_ordered

Function harmonic_centrality_source_ordered 

Source
pub fn harmonic_centrality_source_ordered(
    graph: &Graph,
    sources: &[&str],
) -> HarmonicCentralityResult
Expand description

Compute harmonic centrality while replaying sources in an explicit order.

NetworkX accumulates each target’s score in its outer sources set order: one forward BFS per source, then centrality[target] += 1 / distance. Floating-point addition is not associative, so the level-grouped kernels below can differ by one ULP even though they discover identical distances. Python bindings use this entry point with the exact CPython set iteration order to preserve observable NetworkX values.