dynamicalab.largest_connected_component

dynamicalab.largest_connected_component(G, relabel=False)[source]

Extract the largest connected component of the graph.

Parameters

G : nx.Graph
Networkx graph
relabel : bool
If True, relabel the nodes to be between 0 and the new number of nodes. Else, keep the original relabeling.

Returns

nx.Graph