The graph diameter of a graph is the length of the "longest shortest path" (i.e.,
the longest graph geodesic ) between any two graph vertices , where is a graph distance .
Here length counts edges . The diameter is therefore
equal to the maximum of all values in the graph
distance matrix . The above random graphs on 10
vertices have diameters 3, 4, 5, and 7, respectively.
A disconnected graph has infinite diameter
(West 2000, p. 71).
The diameter of a graph may be computed in the Wolfram Language using GraphDiameter [g ],
and a fast approximation to the diameter by GraphDiameter [g ,
Method -> "PseudoDiameter" ]. Precomputed diameters for many
named graphs can be obtained using GraphData [graph ,
"Diameter" ].
See also Diameter ,
Graph ,
Graph Distance ,
Graph
Distance Matrix ,
Graph Eccentricity ,
Graph Geodesic ,
Graph
Periphery ,
Graph Triameter ,
Moore
Graph ,
Oriented Diameter ,
Peripheral
Point ,
Transmission-Minimal
Regular Graph
Explore with Wolfram|Alpha
References Harary, F. Graph Theory. Reading, MA: Addison-Wesley, p. 14, 1994. Skiena,
S. Implementing
Discrete Mathematics: Combinatorics and Graph Theory with Mathematica. Reading,
MA: Addison-Wesley, p. 107, 1990. West, D. B. Introduction
to Graph Theory, 2nd ed. Englewood Cliffs, NJ: Prentice-Hall, 2000. Referenced
on Wolfram|Alpha Graph Diameter
Cite this as:
Weisstein, Eric W. "Graph Diameter." From
MathWorld --A Wolfram Resource. https://mathworld.wolfram.com/GraphDiameter.html
Subject classifications