|
From: | Víctor Pascual Cid |
Subject: | [igraph] Generating a clustered graph |
Date: | Wed, 10 Aug 2011 10:32:21 +0200 |
Hi all, I've recently come up with this very nice post that shows how to cluster a network using iGraph in R: http://www.babelgraph.org/wp/?p=1 The proposed script uses the Girvan Newman algorithm, and looks like this: gnc <- edge.betweenness.community(g, directed=FALSE) m <- vector() for (s in 0:nrow(gnc$merges) ) { memb <- community.to.membership(g,gnc$merge,steps=s)$membership m <- c(m,modularity (g, memb, weights=NULL)) } ideal_steps <- which(m==max(m)) - 1 gn.groups <- community.to.membership(g,gnc$merge, steps=ideal_steps)$membership My question is, now that I have an Array (gn.groups) containing the cluster to which each node in the graph belongs to, how can I create a new graph that represents my clustered network? Does iGraph provide any method to do this? Cheers, Víctor |
[Prev in Thread] | Current Thread | [Next in Thread] |