Python topological grouping algorithm

in a plan, there are many points and some points will be connected. Please group these points. The grouping rule is:
1) there is no connection between groups
2) there must be connections between points within groups

how to implement such a grouping?

Menu