igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] a problem with simplify()


From: Gábor Csárdi
Subject: Re: [igraph] a problem with simplify()
Date: Thu, 21 Oct 2010 19:34:18 +0200

On Thu, Oct 21, 2010 at 7:21 PM, Simone Gabbriellini
<address@hidden> wrote:
> Thanks Tamas, Gabor
>
> actually, I should have the 1-based vertex indexing. BTW, the edge indexing 
> is 0-based, right?

No. Either both vertex and edge ids are indexed from zero (0.5 branch)
or both of them are indexed from one (recent 0.6 branch).

>> V(g)
> Vertex sequence:
>  [1] "user138" "user300" "user301" "user290" "user93"  "user145" "user223" 
> "user96"  "user148" "user154"
>  [11] "user152" "user467" "user104" "user317" "user111" "user143" "user292" 
> "user91"  "user31"  "user90"

This is misleading, try

as.vector(V(g))

Gabor

>
>> E(g)
> Edge sequence:
>
> [0]   user85  -> user85
> [1]   user33  -> user33
>
>
> best,
> simone
>
> Il giorno 21/ott/2010, alle ore 19.06, Tamas Nepusz ha scritto:
>
>>> Definitely, because your code does not take into account that edges are 
>>> reindexed after every deletion. I'd go for delete.edges(g, seq(0, 
>>> ecount(g)-1)[is.loop(g)])
>> Or, even better: delete.edges(g, which(is.loop(g))-1) if your igraph version 
>> uses 0-based indexing. Note that  the R interface of igraph 0.6 has recently 
>> switched to 1-based indexing, so if you installed igraph 0.6 in the last few 
>> days, you don't have to subtract 1.
>>
>> --
>> T.
>>
>>
>> _______________________________________________
>> igraph-help mailing list
>> address@hidden
>> http://lists.nongnu.org/mailman/listinfo/igraph-help
>
>
> _______________________________________________
> 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]