JuliaGraphs / Graphs.jl

An optimized graphs package for the Julia programming language
http://juliagraphs.org/Graphs.jl/
Other
463 stars 92 forks source link

Random generation should be a utility function #167

Open mschauer opened 2 years ago

mschauer commented 2 years ago

https://github.com/JuliaGraphs/Graphs.jl/blob/2d424640acdb8715218cd763f69ffb322ba5c109/src/SimpleGraphs/generators/randgraphs.jl#L9-L12

My first instinct is that this does not belong in a constructor but in a dedicated rand... function.

Feel free to close, just giving the feedback. Came up in https://github.com/JuliaGraphs/MultilayerGraphs.jl/issues/22

simonschoelly commented 2 years ago

Having to many different constructors might indeed might indeed make things more confusing. So we could think about removing this constructor when releasing the next major version.

On the other hand, this constructor might be good for quick prototyping, as maybe not everyone knows that they should call erdos_renyi instead.

gdalle commented 1 year ago

I am in favor of keeping deterministic constructors

Nagefire commented 1 year ago

Having to many different constructors might indeed might indeed make things more confusing. So we could think about removing this constructor when releasing the next major version.

On the other hand, this constructor might be good for quick prototyping, as maybe not everyone knows that they should call erdos_renyi instead.

Add a sentence to the Graph/SimpleGraph docstring, as in "To construct a random graph, use erdos_renyi"