$M$ is a finite set of points in a metric space. I want to calculate the diameter of the set, i.e. the greatest distance between two points. Is there a smarter way to do this than to calculate the distance between all pairs of points?
$ \delta = \max_{x,y\in M} d(x,y) $
I suppose the triangle inequality could let me know that some distance don't have to be calculated, but it seems like a lot of work to do those checks, and the distance function isn't very expensive.
In case someone was wondering, the points are longitude-latitude points and the distance function the Great Circle distance (which is a metric).