NetworkX

Previous topic

networkx.algorithms.distance_measures.center

Next topic

networkx.algorithms.distance_measures.eccentricity

networkx.algorithms.distance_measures.diameter

networkx.algorithms.distance_measures.diameter(G, e=None)

Return the diameter of the graph G.

The diameter is the maximum eccentricity.

Parameters :

G : NetworkX graph

A graph

e : eccentricity dictionary, optional

A precomputed dictionary of eccentricities.

Returns :

d : integer

Diameter of graph

See also

eccentricity