Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove points to maximize shortest nearest neighbor distance

If I have a set of N points in 2D space, defined by vectors X and Y of their locations. What is an efficient algorithm that will

  1. Select a fixed number (M) points to remove so as to maximize the shortest nearest-neighbor distance among the remaining points.
  2. Remove a minimum number of points so that the shortest nearest-neighbor distance among the remaining points is greater than a fixed distance (D).

Sorting by points by their shortest nearest neighbor distance and removing the points with the smallest values does not give the correct answer, as then you remove both points of close pairs, while you may only need to remove one of the points in those pairs.

For my case, I am usually dealing with 1,000-10,000 points, and I may remove 50-90% of points.

like image 537
Noam Ross Avatar asked Nov 12 '13 17:11

Noam Ross


1 Answers

You shouldn't need to store (or compute) the entire distance matrix: a Delaunay triangulation should efficiently (O(n log n) worst case) give you the closest neighbors of your point set. You should also be able to update it efficiently as you delete points.

For most cases of close pairs, you should be able to check to see which of the pair would be farthest from its neighbors if the other is removed. This is not an exact solution; especially if you remove a large proportion of points, removing a locally optimum point may exclude the globally optimum solution. Also, you should be able to deal with clusters of 3 or more locally close points. However, if you are only removing a small proportion of points from a randomly distributed set, both these cases may be relatively rare.

There may or may not be a better way (i.e., an exact and efficient algorithm) to solve your problem, but the above suggestions should lead to an approximate and/or combinatorial approach which works best when the points that need deleting are sparsely distributed.

like image 146
comingstorm Avatar answered Oct 01 '22 04:10

comingstorm