0

I have a huge graph, in which there are "clusters" of sub-graphs, i.e. clusters of graphs that are disconnected from each other. Due to the size of the graph, it's nearly impossible to render well.

What I'd like to do is, split the one big graph into separate graph objects, one for each "cluster" of vertices. I just don't see anything about this in the documentation and can't figure it out. I see there is a Roots property on the graph, which I suspect might be relevant, but don't know where to go from there.

i.e. if I have this graph:

1 -> 2
2 -> 3
10 -> 20
20 -> 30

I'd like to get instances of two separate graph objects:

1 -> 2
2 -> 3

and

10 -> 20
20 -> 30
hyankov
  • 4,049
  • 1
  • 29
  • 46

1 Answers1

0

Assuming the the vertices have location in a plane

  • Find the components
  • Find average location of each component
  • Use the K-Means algorithm to find the clusters of the average component locations.
ravenspoint
  • 19,093
  • 6
  • 57
  • 103