all shortest paths not working in 0.6

Bug #688884 reported by Tamás Nepusz
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
igraph
Fix Released
High
Tamás Nepusz

Bug Description

Hi
I installed igraph_nightly_0.6-2244-20101203.tar.gz on mac I installed (libxml2 and GLPK).
I want to compute all the shortest path, it worked only when the from set to 1, but when I tried to compute the shortest paths from any vertex , R quit unexpectedly!

Here I provide an example,

> sessionInfo()
R version 2.12.0 (2010-10-15)
Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit)

locale:
[1] en_US.UTF-8/en_US.UTF-8/C/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats graphics grDevices utils datasets methods base

other attached packages:
[1] igraph_0.6

loaded via a namespace (and not attached):
[1] tools_2.12.0

 x
     [,1] [,2] [,3] [,4] [,5]
[1,] 0 2 8 4 7
[2,] 2 0 5 2 5
[3,] 8 5 0 4 7
[4,] 4 2 4 0 5
[5,] 7 5 7 5 0

g=graph.adjacency(x, mode="undirected",weighted=TRUE, diag=FALSE )
> g
IGRAPH U-W- 5 10 --
+ attr: weight (e/n)
+ edges:
1 -- 2 3 4 5 2 -- 1 3 4 5 3 -- 1 2 4 5 4 -- 1 2 3 5 5 -- 1 2 3 4

> shortest.paths(g)
     [,1] [,2] [,3] [,4] [,5]
[1,] 0 2 7 4 7
[2,] 2 0 5 2 5
[3,] 7 5 0 4 7
[4,] 4 2 4 0 5
[5,] 7 5 7 5 0

> get.all.shortest.paths(g, 1,1:5)
$res
$res[[1]]
[1] 1

$res[[2]]
[1] 1 2

$res[[3]]
[1] 1 2 3

$res[[4]]
[1] 1 2 4

$res[[5]]
[1] 1 4

$res[[6]]
[1] 1 5

$res[[7]]
[1] 1 2 5

$nrgeo
[1] 1 1 1 2 2

 get.all.shortest.paths(g, 2,1:5)

R quit unexpectedly!

Tamás Nepusz (ntamas)
summary: - all shortest paths not working in ö.6
+ all shortest paths not working in 0.6
Revision history for this message
Gábor Csárdi (gabor.csardi) wrote :

This is probably not R specific, it happens with the C interface as well, a sample program is attached.

Interestingly, it only happens if 'to' is a vector of vertices, it does not happen if it is 'igraph_vss_all'.

Revision history for this message
Tamás Nepusz (ntamas) wrote :

It also fails if 'to' is igraph_vss_all if the source vertex is 1 in the example and not zero.

Tamás Nepusz (ntamas)
Changed in igraph:
status: New → In Progress
assignee: nobody → Tamás Nepusz (ntamas)
importance: Undecided → High
status: In Progress → Fix Committed
Tamás Nepusz (ntamas)
Changed in igraph:
status: Fix Committed → Fix Released
Revision history for this message
Gábor Csárdi (gabor.csardi) wrote : Continue on github

The development of igraph has moved to github, so please do not comment on this bug here. You are of course welcome to comment on github, here:
https://github.com/igraph/igraph/issues/81

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.