1

Given the (lat, lon) coordinates of a group of n locations on the surface of the earth, find a (lat, lon) point c, and a value of r > 0 such that we maximize the density, d, of locations per square mile, say, in the surface area described and contained by the circle defined by c and r.

At first I thought maybe you could solve this using linear programming. However, density depends on area depends on r squared. Quadratic term. So, I don't think problem is amenable to linear programming.

Is there a known method for solving this kind of thing? Suppose you simplify the problem to (x, y) coordinates on the Cartesian plane. Does that make it easier?

You've got two variables c and r that you're trying to find so as to maximize the density, which is a function of c and r (and the locations, which is a constant). So maybe a hill-climbing, gradient descent, or simulated annealing approach might work? You can make a pretty good guess for your first value. Just use the centroid of the locations. I think the local maximum you reach from there would be a global maximum.

Paul Reiners
  • 8,576
  • 33
  • 117
  • 202
  • Would this question be more appropriate in a different Stack Exchange site? – Paul Reiners Aug 10 '17 at 14:15
  • 1
    Paul, maybe Mathematics, Computer Science, or Data Science would be your target, if you see no traffic here! Good luck! =) – gsamaras Aug 10 '17 at 15:36
  • 1
    I _think_ this problem is a different beast. Gradient Descent / Centroid as the starting point won't be able to take you there. Just my guess. – displayName Aug 10 '17 at 15:47
  • 1
    In any example I could think of, the answer is the smallest circle enclosing three points. I don't know if it's always the case, but it may be a good approximation / starting point for the search. – Anton Aug 10 '17 at 16:06
  • Very small circle (r->0) enclosing one point :-) For sure the best possible density. I suppose there is a request that circle enclose more than one point. – Ante Aug 10 '17 at 19:48
  • @user3290797 That circle is easy to find with Delaunay triangulation. – Ante Aug 10 '17 at 19:52

1 Answers1

1

Steps:

  • Cluster your points using a density based clustering algorithm1;
  • Calculate the density of each cluster;
  • Recursively (or iteratively) sub-cluster the points in the most dense cluster;
    • The algorithm has to be ignoring the outliers and making them a cluster in their own. This way, all the outliers with high density will be kept and outliers with low density will be weaned out.
  • Keep track of the cluster with highest density observed till now. Return when you finally reach a cluster made of a single point.

This algorithm will work only when you have clusters like the ones shown below as the recursive exploration will be resulting in similarly shaped clusters:

enter image description here


The algorithm will fail with awkwardly shaped clusters like this because as you can see that even though the triangles are most densely placed when you calculate the density in the donut shape, they will report a far lower density wrt the circle centered at [0, 0]:

enter image description here


1. One density based clustering algorithm that will work for you is DBSCAN.

displayName
  • 13,888
  • 8
  • 60
  • 75