harmonic_centrality(G, nbunch=None, distance=None, sources=None)
Harmonic centrality of a node u
is the sum of the reciprocal of the shortest path distances from all other nodes to u
where :None:None:`d(v, u)`
is the shortest-path distance between :None:None:`v`
and u
.
If :None:None:`sources`
is given as an argument, the returned harmonic centrality values are calculated as the sum of the reciprocals of the shortest path distances from the nodes specified in :None:None:`sources`
to u
instead of from all nodes to u
.
Notice that higher values indicate higher centrality.
If the 'distance' keyword is set to an edge attribute key then the shortest-path length will be computed using Dijkstra's algorithm with that edge attribute as the edge weight.
A NetworkX graph
Container of nodes for which harmonic centrality values are calculated.
Container of nodes :None:None:`v`
over which reciprocal distances are computed. Nodes not in G
are silently ignored.
Use the specified edge attribute as the edge distance in shortest path calculations. If :None:None:`None`
, then each edge will have distance equal to 1.
Dictionary of nodes with harmonic centrality as the value.
Compute harmonic centrality for nodes.
Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.
Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)
SVG is more flexible but power hungry; and does not scale well to 50 + nodes.
All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them