JuliaGraphs / MultilayerGraphs.jl

A Julia package for the creation, manipulation and analysis of the structure, dynamics and functions of multilayer graphs.
https://juliagraphs.org/MultilayerGraphs.jl/dev
MIT License
118 stars 3 forks source link

Random MultilayerGraph generation should be a utility function #22

Closed mschauer closed 2 years ago

mschauer commented 2 years ago

Goes a bit against the grain to make this task something the constructor does.

https://github.com/InPhyT/MultilayerGraphs.jl/blob/bcfcebfb74ddc2ef77664cb0eb9045307106136e/src/multilayerdigraph.jl#L21

InterdisciplinaryPhysicsTeam commented 2 years ago

Hi @mschauer,

Thanks for this issue!

Generally speaking, we think that delegating the instantiation of random graphs to a constructor may lead to better consistency in the ecosystem. After all, if we just substituted the arguments min_edges and max_edges with ne (the number of required random edges) we would have something very close (the closest possible?) to what Graphs.jl already does for its concrete types SimpleGraph and SimpleDiGraphs. They infact support random graph generation via SimpleGraph(nv,ne) and SimpleDiGraph(nv,ne).

Here we better explain what we mean (see bullet point 2. : it is meant mainly for "non-wrapper" packages, but we tried to stick to that as much as we could).

By the way just noticed that the docstring should be updated, it has graph_type::Type{<: AbstractGraph} instead of graph_types::Vector{DataType}. We have just fixed it.

CC: @pitmonticone , @ClaudMor

mschauer commented 2 years ago

True, you are just following the example. Moved the issue...