I have two questions.
In undirected graph, I want to find the largest connected component. And I read the API documents of networkX, finding this function
nx.connected_component_subgraphs()
. But I don't know how to use it, since its return value is a generator and I cant derive a subgraph of largest connected component.It is same as one. But the graph is directed. And I want to find the largest weakly connected component of directed graph. Therefore, I use
nx.weakly_connected_component_subgraphs()
, this function. There has a same problem in question 1.
How can I use the built-in function in networkX to find the largest connected component in undirected graph and the largest weakly connected component in directed graph?
I use NetworkX 1.9.1.