networkx.algorithms.distance_measures.diameter

diameter(G, e=None, usebounds=False)[source]

Returns the diameter of the graph G.

The diameter is the maximum eccentricity.

Parameters
GNetworkX graph

A graph

eeccentricity dictionary, optional

A precomputed dictionary of eccentricities.

Returns
dinteger

Diameter of graph

See also

eccentricity