Compute closeness vitality for nodes.
Closeness vitality at a node is the change in the sum of distances between all node pairs when excluding a that node.
Parameters: | G : graph
v : node, optional
weighted_edges : bool, optional
|
---|---|
Returns: | nodes : dictionary
|
See also
Examples
>>> G=nx.cycle_graph(3)
>>> nx.closeness_vitality(G)
{0: 4.0, 1: 4.0, 2: 4.0}