MeanGraphDistance
MeanGraphDistance[g] gives the mean distance between all pairs of vertices in the graph g.
MeanGraphDistance[{v -> w, …}]uses rules v -> w to specify the graph g.
Examples
g = Graph[{1 <-> 2, 2 <-> 3, 3 <-> 4}];
MeanGraphDistance[g]Please visit the official Wolfram Language Reference for more details.