def diameter(G, e=None):
 if (e is None):
  e = eccentricity(G)
 return max(e.values())

def diameter ( G , e = None ) : if ( e is None ) : e = eccentricity ( G ) return max ( e . values ( ) )
return the diameter of the graph g .