Graph Diameter
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. In other words, a graph's diameter is the largest number of vertices
which must be traversed in order to travel from one vertex to another when paths
which backtrack, detour, or loop are excluded from consideration. It 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"].
graph diameter

