igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] shortest path calculation


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

Hi Gabor,
You got it right. There is no weight in the file. Assigning one does the trick.
My graph is unweighted, is there any way to assign 1 during the file reading or do I have to change the file to include an useless column with ones ?
Thank you very much.
Thiago

On Fri, Jan 30, 2009 at 11:33 AM, Gábor Csárdi <address@hidden> wrote:
Impossible to tell for sure without knowing what is in the file "b".
My guess is that all edges have weight zero, but can be something
else.

G.

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
>
>
>
> _______________________________________________
> igraph-help mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/igraph-help
>
>



--
Gabor Csardi <address@hidden>     UNIL DGM


_______________________________________________
igraph-help mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/igraph-help




reply via email to

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