Warning

This documents an unmaintained version of NetworkX. Please upgrade to a maintained version and see the current NetworkX documentation.

# closeness_vitality¶

closeness_vitality(G, weight=None)[source]

Compute closeness vitality for nodes.

Closeness vitality of a node is the change in the sum of distances between all node pairs when excluding that node.

Parameters: G (graph) – weight (None or string (optional)) – The name of the edge attribute used as weight. If None the edge weights are ignored. nodes – Dictionary with nodes as keys and closeness vitality as the value. dictionary

Examples

>>> G=nx.cycle_graph(3)
>>> nx.closeness_vitality(G)
{0: 4.0, 1: 4.0, 2: 4.0}


closeness_centrality()