Reputation: 117
I want to generate a random graph using the edge distribution from the original graph. Is there a way in networkx module to do that?
Upvotes: 0
Views: 271
Reputation: 23907
I'm assuming you mean same degree distribution.
The command nx.configuration_model(degree_list)
will do it.
So in your case, given an existing graph G
:
H = nx.configuration_model([G.degree(node) for node in G])
Upvotes: 1