Suppose I have some edges:
edges = {1 -> 2, 2 -> 3, 3 -> 1, 4 -> 5, 3 -> 6, 7 -> 8, 8 -> 9, 8 -> 10};
And I make a graph:
g = Graph[edges, VertexLabels -> "Name", ImagePadding -> 10]
After seeing the graph, you realize that there are three separate sub-graphs or families in it, and I want to see them separately. This is what I have done:
families = {Subgraph[g, {1, 2, 3, 6}], Subgraph[g, {4, 5}], Subgraph[g, {7, 8, 9, 10}]};
nMax = 3;
Manipulate[families[[n]], {n, 1, nMax, 1}]
I would like to know how to calculate nMax
and families
automatically. My real problem has thousands of edges and it is not viable to do it visually.