kle*_*ell 1 python graphics 2d cluster-analysis
簇是指一组相互连接的重叠圆。该图像可能会更好地说明我要查找的内容:

在我的数据中,圆由其中心坐标表示。我已经完成了碰撞检测,以生成代表重叠的成对中心点的列表:
pts = [(-2,2), (-2,2), (0,0), (2,1), (6,2), (7,1)]
overlaps = [
(pts[0], pts[1]),
(pts[0], pts[2]),
(pts[1], pts[2]),
(pts[2], pts[3]),
(pts[4], pts[5]),
]
Run Code Online (Sandbox Code Playgroud)
这是预期的结果:
expected_clusters = [
((-2,2), (-2,2), (0,0), (2,1)),
((6,2), (7,1))
]
Run Code Online (Sandbox Code Playgroud)
在实践中,我将使用的数据集约为这个大小,因此我可能永远都不需要扩大规模。但这并不是说我不会支持更理想的解决方案。
我提出了自己的幼稚解决方案,我将其发布为答案。但是我会对看到其他解决方案感兴趣。