NetworkX

Previous topic

networkx.algorithms.distance_measures.diameter

Next topic

networkx.algorithms.distance_measures.periphery

networkx.algorithms.distance_measures.eccentricity

networkx.algorithms.distance_measures.eccentricity(G, v=None, sp=None)

Return the eccentricity of nodes in G.

The eccentricity of a node v is the maximum distance from v to all other nodes in G.

Parameters :

G : NetworkX graph

A graph

v : node, optional

Return value of specified node

sp : dict of dicts, optional

All pairs shortest path lenghts as a dictionary of dictionaries

Returns :

ecc : dictionary

A dictionary of eccentricity values keyed by node.