Graph eccentricity (source code)

= Graph eccentricity
{title2=$e_G(v)=\max_u d_G(v,u)$}

For a vertex $v$ of a finite <connected graph> $G$, its <graph eccentricity> is the greatest <graph distance> to any other vertex:
$$
e_G(v)=\max_{u\in V(G)}d_G(v,u).
$$
The <graph radius> is the minimum eccentricity and the <graph diameter> is the maximum. Eccentricity therefore measures the worst travel distance from a chosen starting point, rather than its average travel distance.

In the four-vertex <path graph> $1-2-3-4$, the eccentricities are $3,2,2,3$. The two middle vertices are best in this worst-case sense; the radius is two and the diameter three. In a <star graph> with at least two leaves, the central vertex has eccentricity one and every leaf has eccentricity two. For a disconnected <graph>, distances across components are usually infinite, so a finite-valued eccentricity requires restricting to a component or stating another convention.