0

Let's say I have a bunch of points:

enter image description here

What is the best way to get a certain amount of closest neighbors. For example I wan't the 8 closest points for point no 57.

This without using brute force.

O yeah, if possible, it would be great if it's efficient for moving points as well.

clankill3r
  • 145
  • 6
  • Do you have the coordinates of all the points? Seems like a stupid question but I have to ask... – Andrew Wilson Mar 20 '15 at 18:42
  • Also: http://gamedev.stackexchange.com/questions/14373/given-a-list-of-2d-locations-and-sizes-how-can-i-efficiently-find-the-nearest-o – House Mar 20 '15 at 18:44
  • 1
    This question might also help: https://gamedev.stackexchange.com/questions/79842/efficiently-detecting-objects-inside-multiple-radius/79845#79845 – Philipp Mar 20 '15 at 18:44
  • 1
    Basically, look up spatial partitioning and nearest neighbor algorithms. – House Mar 20 '15 at 18:45

0 Answers0