Skip to content
This repository has been archived by the owner on Oct 21, 2021. It is now read-only.

test_cyclic_by_dfs throws a BoundsError #220

Open
nikagra opened this issue Apr 22, 2016 · 0 comments
Open

test_cyclic_by_dfs throws a BoundsError #220

nikagra opened this issue Apr 22, 2016 · 0 comments

Comments

@nikagra
Copy link

nikagra commented Apr 22, 2016

BoundsError can be thrown during processing of test_cyclic_by_dfs if ids of edges are not in order. The error is thrown in Graphs/src/depth_first_visit.jl:28 which is:

e_color = edgecolormap[edge_index(v_edge, graph)]

In other words edgecolormap is indexed with ids of edges assuming that if there are n edges, than their ids are in {1,...,n} which is not always the case (we can assemble graph manually or remove some edges)
Example:

v = [1,2,3,4,5,6,7]
e = [edge [1]: 1 -- 2,edge [3]: 3 -- 4,edge [4]: 1 -- 4,edge [8]: 5 -- 6,edge [9]: 5 -- 7,edge [11]: 1 -- 6]
ERROR: BoundsError: attempt to access 6-element Array{Int64,1}:
 1
 0
 0
 1
 0
 0
  at index [11]
 in depth_first_visit_impl! at /home/user/.julia/v0.4/Graphs/src/depth_first_visit.jl:28
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants