all shortest paths not working in version 6
Hi
I installed igraph_
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-
locale:
[1] en_US.UTF-
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.
> 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.
$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.
R quit unexpectedly!
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- igraph Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply: