Given set of points in 3D, find group of points closest to each other

577 Views Asked by At

Given a set of any 8 points in 3D space. I want to find a subset of points that are closest to each other.

Application: Assume in a 3D space, I have any 8 colors(represented in RGB). I know how to calculate the distance between any 2 colors. I want to calculate which points would form the closest cluster.

What we know will work [brute-force]:

  • Calculate the distance between all the combinations of colors.
  • For each color find which other color is farthest and falls under the Maximum distance and create a subset from those point.
  • In each of the set find the set in which the colors form the closest cluster.

Any better algorithm would be helpful.

Links: How to calculate the distance between 2 color