Search code examples
javageometryjava-3d

What is the fastest way to calculate nearby points from large data set of points


I have a large set of 3d points, (20,000+), scattered throughout a 3d space. I need to identify which points are within a specific arbitrary range of each point in the set. For example, for each point, what is the group of points that is within a range of 10 units. The permutations for this are pretty big. So, what would be the most computationally efficient way to approach this ? (I need to solve this using java only.)


Solution

  • You can use k-d tree, which is basically a k-dimensional binary tree. Range search in k-d tree is very efficient.