Open
Description
I think it would be helpful to add constructors:
SimpleGraph(Base.OneTo(4)) == SimpleGraph(4)
SimpleDiGraph(Base.OneTo(4)) == SimpleDiGraph(4)
representing the more general concept of constructing a graph from a set of vertices. It would enable writing generic code like:
rem_all_edges(g::AbstractGraph) = typeof(g)(vertices(g))
which would work with graphs that don't have simple vertices.
This is analogous to constructing Julia arrays from axes:
julia> zeros(Base.OneTo(3), Base.OneTo(3))
3×3 Matrix{Float64}:
0.0 0.0 0.0
0.0 0.0 0.0
0.0 0.0 0.0
(though for whatever reason Matrix{Float64}(undef, (Base.OneTo(3), Base.OneTo(3)))
doesn't work).