You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 21, 2021. It is now read-only.
julia> using Graphs
julia> g = graph([3, 4], Edge{Int}[])
Directed Graph (2 vertices, 0 edges)
julia> add_edge!(g, 3, 4)
ERROR: BoundsError()
in add_edge! at /Users/canjo/.julia/v0.4/Graphs/src/graph.jl:86
in add_edge! at /Users/canjo/.julia/v0.4/Graphs/src/graph.jl:98
julia> edges(g)
1-element Array{Edge{Int64},1}:
edge [1]: 3 -- 4
From #114 it looks like this is expected behavior because Int indices must be consecutive.
But this was very unexpected to me, because for vertices of other types, I can use arbitrary values:
The special behavior of Int vertices seems like it is bound to cause this issue to come up again and again for new users.
Despite throwing the BoundsError, it looks like add_edge! accomplished its work successfully. Can this issue be resolved by something as simple as not throwing the error?
The text was updated successfully, but these errors were encountered:
Following up on: https://groups.google.com/forum/#!topic/julia-users/G5zArVhEd3M
This error was very surprising:
From #114 it looks like this is expected behavior because
Int
indices must be consecutive.But this was very unexpected to me, because for vertices of other types, I can use arbitrary values:
The special behavior of Int vertices seems like it is bound to cause this issue to come up again and again for new users.
Despite throwing the
BoundsError
, it looks likeadd_edge!
accomplished its work successfully. Can this issue be resolved by something as simple as not throwing the error?The text was updated successfully, but these errors were encountered: