3 edited tags
2 edited tags
1

How Does One Find the "Loneliest Person on the Planet"?

I'm looking for the algorithm that efficiently locates the "Loneliest Person on the Planet", where "loneliest" is defined as:

Maximum minimum distance to another person -- that is, the person for whom the closest other person is farthest away.

Assume a (admittedly miraculous) input of the list of the exact latitude/longitude of every person on Earth at a particular time.

Also take as provided a function d(p1, p2) that returns the distance on the surface of the earth between p1 and p2-- I know this is not trivial, but it's "just spherical geometry" and not the important (to me) part of the question.

What's the most efficient way to find the loneliest person?

Certainly one solution is to calculate d(...) for every pair of people on the globe, then sort every person's list of distances in ascending order, take the first item from every list and sort those in descending order and take the largest. But that involves n*(n-1) invocations of d(...), n sorts of n-1 items and one last sort of n items. Last I checked, n in this case is somewhere north of six billion, right? So we can do better?