NetworkX

Previous topic

networkx.degree_centrality

Next topic

Clique

Quick search

networkx.closeness_centrality

closeness_centrality(G, v=None, weighted_edges=False)

Compute closeness centrality for nodes.

Closeness centrality at a node is 1/average distance to all other nodes. Returns a dictionary of closeness centrality values keyed by node. The closeness centrality is normalized to be between 0 and 1.