Constructors for 2.0
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
Research direction
Start by reviewing the listed SimpleGraph constructors and the proposed Graph and MultiGraph signatures. Compare how vertex collections, adjacency matrices, edge lists, generators, and multigraphs should be represented in the 2.0 API. Done means reaching agreement on a consistent constructor design; this issue is a discussion thread rather than an implementation task.
Written by the indexing model from the issue text.
Description
Here is a thread for discussing the constructors for Graphs 2.0
Current constructors
Constructors for SimpleGraph
SimpleGraph{T}(): empty graphSimpleGraph{T}(nv::Integer): graph with no edgesSimpleGraph{T}(nv::Integer, ne::Integer): random graph (erdos-renyi)SimpleGraph(::Type{T}): empty graphSimpleGraph(nv::Integer, ne::Integer, edgestream::Channel): add edges from the stream until stream end or we reachneedges.SimpleGraphFromIterator(edgelist)SimpleGraph(adjmx::AbstractMatrix)SimpleGraph{T}(g::AbstractGraph)SimpleGraph(edge_list::Vector{SimpleGraphEdge{T}})
Goals for 2.0
We will have a new concrete graph type Graph{V} which can represent arbitrary vertices.
We would need new constructors to be able to construct such new graphs.
Instead of passing nv, we should provide a list (or even an iterator ?) of the vertices of the graph.
As the type of vertices can be arbitrary, the type signatures of generators can quickly become a mess / incompatible
Also we will need to support multigraphs
My proposal
Graph{V}()andGraph(::Type{V})should be unambiguous- Remove
SimpleGraph{T}(nv::Integer, ne::Integer)(much better to call explicitlyerdos-renyi) - I don't really get this one
SimpleGraph(nv::Integer, ne::Integer, edgestream::Channel), I think It does not add much toSimpleGraphFromIterator - Keep
Graph{T<:Integer}(nv::Integer) - Use keywords for other generators:
Graph{V<:Integer}(adjmx=adjmx)(Multi)Graph{V}(edge_list=edge_list)(Multi)Graph{V}(vertices=vertices)(Multi)Graph{V}(vertices=vertices::Vector{V})Graph{V}(vertices=vertices::Vector{V}, adjmx=adjmx)(Multi)Graph{V}(vertices=vertices::Vector{V}, edge_list=edge_list)
Is this proposal sound?
Do you have some other ideas of generators? A better proposal?
- Dominant language
- Julia
- Stars
- 11
- Forks
- 2
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from JuliaGraphs/GraphsBase.jl
-
question
Difficulty 5/5 Over a week Newbie friendliness 15/100
JuliaGraphs/GraphsBase.jl#28 ·
-
question
Difficulty 5/5 Over a week Newbie friendliness 25/100
JuliaGraphs/GraphsBase.jl#27 · 1 comment · 1 reaction ·
-
question
Difficulty 5/5 Over a week Newbie friendliness 22/100
JuliaGraphs/GraphsBase.jl#26 · 6 comments · 2 reactions ·
-
question
Difficulty 5/5 Over a week Newbie friendliness 25/100
JuliaGraphs/GraphsBase.jl#25 · 3 comments · 1 reaction ·
-
question
Difficulty 5/5 Over a week Newbie friendliness 25/100
JuliaGraphs/GraphsBase.jl#24 ·
All issues in JuliaGraphs/GraphsBase.jl
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 62/100
JuliaStats/LogExpFunctions.jl#134 · 2 comments ·
-
code bug PowerSystems 6.0
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Sienna-Platform/PowerSystems.jl#1849 ·
Maintainers usually reply within 7 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 1-3 hours Newbie friendliness 86/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
FluxML/Metalhead.jl#407 ·
Maintainers usually reply within 1 day