I don\'t know if NetworkX recently tweaked one of the methods to be a generator instead of returning a list, but I\'m looking for a good (rather, better) way to get the GC o
In networkx 2.4, nx.connected_component_subgraphs() is deprecated, so the following should work:
nx.connected_component_subgraphs()
Gcc = sorted(nx.connected_components(G), key=len, reverse=True) G0 = G.subgraph(Gcc[0])
G0 is the giant component.