Take the 2-minute tour ×
Cross Validated is a question and answer site for people interested in statistics, machine learning, data analysis, data mining, and data visualization. It's 100% free, no registration required.

I have a load of point data in 3D, and I wish to cluster them like so:

  • Each cluster contains points all of which are at most distance $d$ from another point in the cluster.
  • All points in two distinct clusters are at least distance $d$ from each other.

The distances used are Euclidean distances.

Is this a well known clustering algorithm? If so, what is is called? Thanks.

share|improve this question

1 Answer 1

up vote 4 down vote accepted

Create a graph in which the points are nodes and two points are connected with an edge if and only if they lie within distance $d$ of each other. Stated in these terms, your criteria become

  • Every node in a cluster of two or more nodes is connected to at least one other node in that cluster.

  • No two points in any disjoint clusters can be connected to each other.

In short, you want to compute the connected components of this graph. Linear-time algorithms are well known and simple to execute, as described in the Wikipedia article.

To do this efficiently for a lot of points in 3D, you want to limit the amount of distance calculation you perform. Data structures such as octrees, or even simpler ones (such as exploiting a lexicographic sorting of the points) work well.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.