according to networkx documentation, connected_component_subgraphs(G) returns a sorted list of all components. Thus the very first one should be the largest component.
As for version 2.4: nx.connected_component_subgraphs(G) is removed.
nx.connected_component_subgraphs(G)
Instead to get the same result use:
connected_subgraphs = [G.subgraph(cc) for cc in nx.connected_components(G)]
And to get the giant component:
Gcc = max(nx.connected_components(G), key=len) giantC = G.subgraph(Gcc)