Generate connected components as subgraphs.
Parameters: | G : NetworkX graph
|
---|---|
Returns: | comp : generator
copy: bool (default=True) :
|
See also
Notes
For undirected graphs only. Graph, node, and edge attributes are copied to the subgraphs by default.
Examples
>>> G = nx.path_graph(4)
>>> G.add_edge(5,6)
>>> graphs = list(nx.connected_component_subgraphs(G))