igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] Extracting the largest component


From: Gábor Csárdi
Subject: Re: [igraph] Extracting the largest component
Date: Fri, 9 Dec 2011 10:04:27 -0500

Dear Andrew,

see this email for the giant component:
http://lists.gnu.org/archive/html/igraph-help/2009-08/msg00064.html

Unfortunately this will *not* work in the coming 0.6 igraph version,
so be careful after you upgrade!

Best,
Gabor

On Thu, Dec 8, 2011 at 5:50 PM, Andrew Papachristos
<address@hidden> wrote:
> Greetings, fellow igraphers.
>
> I have a quick question that has me frustrated, so after a few hours and a
> bit of frustration.  I'm trying to do something that should be pretty
> straight forward: I'm trying to extract the large component of a network.
>  The basic code I'm using is something like this (I apologize, I'm not
> programmer by nature, so this might be a pretty 'ugly').
>
> g <- erdos.renyi.game(100, 2/100)
>
> V(g)$comps<-clusters(g)$membership
>
> nodes<-which(V(g)$comps!=0)    #the "0" component is the largest component
>
> largec<-delete.vertices(g, nodes)
>
> When I get to this last step, I get the following error message:
>
> Error in delete.vertices(g, nodes) :
>   At iterators.c:722 : Cannot create iterator, invalid vertex id, Invalid
> vertex id
>
>
> Any thoughts?  Or easier solutions that I'm overlooking?
>
> thanks
> andrew
>
>
> Andrew V. Papachristos
> Robert Wood Johnson Health & Society Scholar ~ Harvard University
> Assistant Professor (on leave) ~ UMass, Amherst - Dept. of Sociology
> address@hidden
> www.papachristos.org
> (413) 545 - 0443
>
>
> _______________________________________________
> igraph-help mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/igraph-help
>



-- 
Gabor Csardi <address@hidden>     MTA KFKI RMKI



reply via email to

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