Finding diameter of graph

graph theory

let us consider following graph

enter image description here

definition of diameter of graphs in book is defined as follow : The diameter of G, written diam(G), is the maximum distance between any two points in G.

now in our case in order to find diam(G) , let take any two point A and H, maximum distance between A and H are 5 because if we use path
A B C D E H , but book says that diam(G)=3 why?

Best Answer

So when they say the 'maximum distance' between two points, they mean you choose $(x,y)$, find $d(x,y)$ which is the minimum length of the path between them, and then define the diameter $d_G=\sup_{x,y\in V(G)}d(x,y)$. That will give you $3$ here and not $5$. You see, the distance itself is already defined as the minimum path length, so you cannot change that. What you can do is find the maximum of this minimum over all pairs of points.