Closed KirstieJane closed 5 years ago
@KirstieJane Thanks for the opening issue about that!
Indeed, the nx.erdos_renyi_graph()
has the parameter seed. If we set this parameter to some value (e.g. 10), you will create the same Erdos Renyi graph each time we call plot_degree_dist
.
Do you want to have this value hardcoded G_ER = nx.erdos_renyi_graph(nodes, cost, seed=10)
or add this parameter seed to our function plot_degree_dist
?
I think add the parameter to the plot_degree_dist
function, and give it a default value. It would be great to also give the options of passing 'random' for the seed and having the code create a new graph each time.
(But not having random as the default, that would have to be explicitly asked for)
@KirstieJane, add commit to PR #121 to address this problem. Now by default, we set seed to 10 (just a default integer value) and we are able to make our results reproducible.
In case it is needed to create random Erdos Renyi Graph, set seed
to None.
Closing since #121 has been merged, adding this random seed setting functionality
@wingedRuslan notes in his tutorial that "Note: The Grey Curve (the degree distribution of an Erdos Renyi random graph) will not be exactly the same, because every time you call the plotting function a new Erdos Renyi random graph is created."
I think this is a problem and we should have an option to set the seed for that graph.
By default we don't have to, but I think its important for full reproducibility to be able to make the exact figure again.