igraph-help
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[igraph] shortest path calculation


From: Thiago M. Venancio
Subject: [igraph] shortest path calculation
Date: Fri, 30 Jan 2009 11:30:18 -0500

Hi,

I am experiencing some problems in calculating the shortest path length matrix. Note that it is giving zeroes for all the cells, even when vertices are connected.
I noticed the V() function return indexes in the indexes and in my graph return quoted numbers. Explicitly telling the indexes also does not solve the problem.
The example in the documentation is working. I do not know what is the problem in my code.
Below is a toy example.

Thanks.

Thiago

test = read.graph("b", format="ncol", names=T)
> test
Vertices: 4
Edges: 3
Directed: FALSE
Edges:

[0] a -- b
[1] b -- c
[2] c -- d

> shortest.paths(test)
     [,1] [,2] [,3] [,4]
[1,]    0    0    0    0
[2,]    0    0    0    0
[3,]    0    0    0    0
[4,]    0    0    0    0

> shortest.paths(test,v=1:2)
     [,1] [,2] [,3] [,4]
[1,]    0    0    0    0
[2,]    0    0    0    0



reply via email to

[Prev in Thread] Current Thread [Next in Thread]