[Top][All Lists]

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

Re: [igraph] Error: "At iterators.c:721 : Cannot create iterator, inval

From: Gábor Csárdi
Subject: Re: [igraph] Error: "At iterators.c:721 : Cannot create iterator, invalid vertex id, Invalid vertex id" while computing shortest path
Date: Mon, 21 Jun 2010 10:06:13 +0200

On Mon, Jun 21, 2010 at 10:02 AM, Tamas Nepusz <address@hidden> wrote:
>> Hi,
>> I invoked  "shortest.paths (graph,row) " function in R in order to
>> compute shortest path in the graph. But I get the following error
>> after a while:
> I made a typical error in my original email; in igraph, vertex indices go 
> from zero to N-1, so you have to type this:
> for (i in 0:vcount(g)-1) {
> instead of this:
> for (i in 1:vcount(g)) {

Well, this seems still wrong, but anyway, the correct way to do this is

for (i in seq_len(vcount(g))-1) {

or maybe even better:

for (i in V(g)) {


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

Gabor Csardi <address@hidden>     UNIL DGM

reply via email to

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