JuliaGraphs / JuliaGraphs/Graphs.jl
add_vertex! should return the added vertex.
Nobody has claimed this yet.
- Dominant language
- Julia
- Stars
- 538
- Forks
- 128
- Avg merge
- 10h 25m
- Merged PRs (30d)
- 2
Description
So I often write code like
add_vertex!(tree) # returns "true" for some reason ???
v = last(vertices(tree))
...
wouldn't it be great if add_vertex! returned something useful, and guaranteed to be the fresh vertex added, instead of a boolean that I can't imagine a use for? PROPOSAL
v = add_vertex!(tree) #new vertex is the return value!
Let me know if I'm missing something. If people love that boolean (Why???) we can always pass it as the first argument but on the whole this would just be way better.
Contributor guide
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.
Research direction
Start by locating the add_vertex! entry point and its current callers, including the vertices(tree) usage shown in the issue. Determine how a newly added vertex is represented and whether existing behavior depends on the boolean return value. Done means add_vertex! returns the fresh vertex consistently, with affected behavior covered by tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- data
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100