Graph connected components (for curves)

What will be the best way to create a tree of connected curves?
For example(image case), we feed the set of curves as a plain list and get 3 lists of curves that are grouped by connectivity.


I found this algorithm which can be remade in Grasshopper, but I was wondering if there’s any other way to do this. Preferably without a plug-in.

1 Like

Thank you my lord))

I’m going to throw the obvious out there and assume you’ve already tried multiple curve intersect?

1 Like

Sure I had, but getting out the structured index tree is not that straightforward from this.

There is a way of using the iA and iB output to generate a group of items which intersect, I’ve just not figured it out yet. I know it works because I’m able to do it in my head using only those outputs (without looking at the Rhino screen) so I know it can be done. Just need to figure this out in GH speak now!

Dear @PeterFotiadis. I’m writing a paper about an algorithm where I have used your c# component. Can you hint if there’s any name to refer about your clustering algorithm?

Sure: Flat hard clustering based on ccx events (rather very slow, truth to be said: hence the EntryLevel moniker used).

It couldn’t be bad as well to mention/notice/warn that similar real-life algos use parallel processing (but any // clustering is strictly internal to the practice).