2d point clustering

后端 未结 5 1703
醉话见心
醉话见心 2021-02-05 08:45

Given: Given a set of N points in the 2D plane (x and y coordinates), and a set of N radii corresponding to each point. We will refer to a point\'s disc as the

5条回答
  •  [愿得一人]
    2021-02-05 09:28

    You have a collection U of pairs (p,R) where p is a point and R its radius.

    The relation ~ on U : (p,R) ~ (q,S) <=> p lies in q's disc or q lies in p's disc <=> |p-q| <= max(R,S)

    is clearly reflexive and symmetric and so it's transitive closure (~, say) is an equivalence relation. The equivalence classes under ~ will be (singletons or) clusters.

    I belive there are standard algorithms to compute the equivalence classes of the transitive closure of a relation like ~ above. For example this is discussed in Numerical Recipes in the chapter on sorting, and they say that their routine is base on Knuth.

    (Sorry not to provide a link but a brief search didn't come up with exactly the right thing).

提交回复
热议问题