Graphs.jl icon indicating copy to clipboard operation
Graphs.jl copied to clipboard

Random generation should be a utility function

Open mschauer opened this issue 3 years ago • 3 comments

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

mschauer avatar Aug 24 '22 15:08 mschauer

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.

simonschoelly avatar Sep 24 '22 10:09 simonschoelly

I am in favor of keeping deterministic constructors

gdalle avatar Nov 20 '22 20:11 gdalle

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"

Nagefire avatar Mar 06 '23 18:03 Nagefire