igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] Community detection in unconnected graph


From: Gabor Csardi
Subject: Re: [igraph] Community detection in unconnected graph
Date: Mon, 31 Mar 2008 22:55:47 +0200
User-agent: Mutt/1.5.13 (2006-08-11)

On Mon, Mar 31, 2008 at 11:54:26AM +0200, Tamas Nepusz wrote:
> >It is a pity that my graph is not connected, so the  
> >walktrap.community and spinglass.community can not handle it.  
> >However, I am only interested in the largest cluster of the graph,  
> >how can I do that?
> >
> Use clusters(...) to determine the connected components of the graph,  
> then find the largest one and use subgraph(...) to extract it. See:
> http://cneurocvs.rmki.kfki.hu/igraph/doc/R/clusters.html

Right, it should be something like:

cl <- clusters(g)
subgraph(g, which(cl$membership == which.max(cl$csize)-1)-1)

G.

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

-- 
Csardi Gabor <address@hidden>    UNIL DGM




reply via email to

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