Efficient algorithm for grouping points in clusters by the distance between every two points

I am looking for an efficient algorithm for the following problem:

Given the many points in 2D space, where each point is determined by its X and Y coordinates. It is required to split this set of points into a set of clusters, so if the distance between two arbitrary points is less than a certain threshold, these points must belong to one cluster:

cluster examples

In other words, such a cluster is a set of points that are fairly close to each other.

A naive algorithm might look like this:

  • Let R be the resulting list of clusters, initially empty
  • Let P be a list of points, initially contains all points
  • P C, . P
  • Pi P 4. Pc C 4AA. (Pi, Pc) < , Pi C P
  • ​​ C 4, 4
  • C R. P , 3

. , ?

P.S. apriori

+4
2

:

  • DBSCAN

.

+4
  • . , threshhold/sqrt (8).

  • P, , , . , , (). sqaures S.

  • S c. c S. .

  • , sqaures, C. 3 S. S , .

+1

Source: https://habr.com/ru/post/1606182/


All Articles