# How to extract connected components from persistence diagram?

From the given point cloud (Fig. 1), I use Scipy-TDA to extract persistence diagram (Fig. 2). What I'm interested in is to extract 3 circles. For example, I'd like to know 3 center points and labels for each point. I'm quite newbie to topological data analysis. Anyone to help me or guide the process?  Edit: To show a challenging case, my data is like the following where 12 ellipses should be clustered. • Have you tried K-means clustering? It might be really easy job for means to divide your dataset into three different regions and give you the centeroid of each Voronoi. K-means is freely available in scikit-learn. Feb 28 '20 at 13:48
• Thanks for the input. Actually, my real data is more complicated. For example, there can be a circle containing all the 3 circles. In this case, I guess K-means can be a problem. Feb 28 '20 at 18:57
• I just proposed K-means based on the picture that you attached here. But, for much more complex situations even if your point cloud is unstructured, still there are some advanced clustering techniques like Hierarchical and DBSCAN methods that might work very well, where K-means fails to find the right clusters. But based on your data and even if you have another circle around these three circles, I believe it's a relatively easy task still for K-means, but you never know until you try it. Feb 28 '20 at 19:14
• Are you sure you'll always have circles? If so, you can leverage that prior. Reply here and I'll think about methods. Feb 29 '20 at 16:32
• It can have ellipses as well, but as a starter, I want to cluster the circles first. Actually, the real data is quite challenging. For example, I have 12 ellipses and have very sparse points. Any idea is welcome! Feb 29 '20 at 16:43

For the cases you are asking about, I would define a parameter $$\varepsilon$$ such that for two nodes $$p, q$$ are connected via an edge $$e$$ if $$d(p,q)<\varepsilon$$ -with $$d(\cdot,\cdot)$$ is some distance function-.