I have a non fully-connected graph, and I need to transform it to a fully connected one by randomly assigning edges between the components of the graph. Is there a smart way of doing it in networkx?
For example, if I have this graph:
>>> import networkx as nx
>>> G = nx.fast_gnp_random_graph(10000,0.0001,seed=1)
>>> print("Connected?",nx.is_connected(G))
Connected? False
It has 5031 components.
How can I randomly assign the minimum amount of edges that are required to make this graph fully connected?

