How this calculation works
Shortest-path distance counts edges in this unweighted undirected model. The eccentricity of a vertex is its greatest distance to any vertex, so it describes how far that starting point is from its most distant destination. This page reports the full distance table, radius, diameter and center, together with one diameter path for a connected graph. Disconnected inputs retain infinite unreachable distances and receive no misleading finite whole-graph center.
e(v)=max_u d(v,u), radius=min_v e(v), diameter=max_v e(v); centers minimize eccentricity in the connected graph convention.A worked example
For the four-vertex path 1–2–3–4, the endpoint eccentricities are three and the two internal eccentricities are two. The radius is two, the diameter is three and the center is {2,3}. The path from one to four certifies the diameter length. A single vertex instead has distance zero to itself, so its radius and diameter are zero and it is its own center.
Good to know
Accepts symmetric 0/1 matrices of order 1–30 with zero diagonal. It does not interpret larger numbers as weights or multiplicities. Whole-graph radius and diameter are infinite when vertices are disconnected, and no finite center is reported. The page does not silently replace infinite eccentricities by maxima over reachable vertices. Directed distances, weighted lengths and component-by-component center conventions are separate problems.
Reference: NetworkX — graph distance measures, eccentricity, radius and center (opens in a new tab) ↗
Graph distance follows edges rather than the drawing scale
Moving a vertex in a sketch does not change its unweighted graph distance unless the edge set changes. A long drawn line still contributes one, just like a short one. The adjacency matrix fixes those relations without assuming a Euclidean embedding. A road network with physical lengths would need weighted distances, and a geographic center is not generally the same object as the graph center returned here.
Breadth-first searches from every vertex produce the displayed distance rows. Taking their maxima gives eccentricities before any global minimum or maximum is selected. In the default path, the two middle vertices tie as centers. Returning only one of them would lose part of the answer, while selecting the visually central point between them would create a location that is not a graph vertex. The page therefore lists all minimizing vertices.
The Shortest path calculator for a weighted graph edge list handles one weighted route, while this page compares unweighted distances from every starting vertex.
Unreachable pairs make the whole-graph convention infinite
If two vertices belong to different components, no finite path length joins them. Replacing that distance by zero would make isolated vertices appear artificially central; dropping it from a maximum would instead compute a within-component quantity. This page keeps infinity in the distance table and does not claim a finite global center. The disconnected notice is a model choice stated explicitly, not a numeric overflow or a failed search.
The diameter path is supplied only when a finite whole-graph diameter exists. It shows one pair attaining the maximum shortest distance, not the longest possible nonrepeating path in the graph. Those are different optimization problems: a graph can contain long detours while two vertices remain close through a shortcut. Matrix symmetry and a zero diagonal are validated so that an accidentally directed or loop-containing input is not quietly analyzed under the wrong assumptions.
A few questions, answered
Is the center always one vertex?
No. Several vertices can have the same minimum eccentricity. The default even-length vertex path has two centers, and complete graphs have every vertex as a center.
Does diameter mean the longest simple path?
No. It is the largest of the shortest-path distances between vertex pairs. A longest simple path can be longer and requires a different calculation.