On Fri, Jan 30, 2009 at 5:30 PM, Thiago M. Venancio
<
address@hidden> wrote:
> 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
>
>
>