The graph diameter of a graph is the length max_(u, v) d(u, v) of the "longest shortest path" (i.e., the longest graph geodesic) between any two graph vertices (u, v), where d(u, v) 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.