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.
using Graphs
g =adjlist(Int)
add_vertex!(g, 1)
add_vertex!(g, 3)
add_edge!(g, 3, 1)
This code throws the following error:
~/tmp $ julia hello.jl
ERROR: BoundsError()
in add_edge! at /Users/kenta/.julia/v0.3/Graphs/src/adjacency_list.jl:58
in include at ./boot.jl:245
in include_from_node1 at loading.jl:128
in process_options at ./client.jl:285
in _start at ./client.jl:354
in _start at /Users/kenta/vendor/julia/usr/lib/julia/sys.dylib
while loading /Users/kenta/tmp/hello.jl, in expression starting on line 6
The problem is apparently the implementation of vertex_index, which ignores the actual location of a vertex in the graph.
The next case also throws an error:
g =adjlist(Int)
add_vertex!(g, 3)
add_vertex!(g, 4)
add_edge!(g, 3, 4)
ERROR: BoundsError()
in add_edge! at /Users/kenta/.julia/v0.3/Graphs/src/adjacency_list.jl:58
in include at ./boot.jl:245
in include_from_node1 at loading.jl:128
in process_options at ./client.jl:285
in _start at ./client.jl:354
in _start at /Users/kenta/vendor/julia/usr/lib/julia/sys.dylib
while loading /Users/kenta/tmp/hello.jl, in expression starting on line 12
Maybe I'm misunderstand the usage of this library.
The text was updated successfully, but these errors were encountered:
Ah, now I understand my misconception of the usage.
Vertices should have an index associated with it and these indices should be added sequentially from 1. Integer's subtypes (Int, in this case) are already qualified as vertex type and its index is defined as itself.
Hence any codes which add integer vertices separately into a graph cause an unexpected behavior like BoundsError.
Please close this issue if my understanding is right.
And new users like me will really need some hello-world examples and expected use case of this library in the documentation.
This code throws the following error:
I'm using the revision 3231261 on Julia 0.3.
The problem is apparently the implementation of
vertex_index
, which ignores the actual location of a vertex in the graph.The next case also throws an error:
Maybe I'm misunderstand the usage of this library.
The text was updated successfully, but these errors were encountered: