Diameter of a Graph

Diameter of a Graph can be calculated like this: