igraph-help
[Top][All Lists]
Advanced

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

[igraph] fastgreedy.community in R, iterative function to divide huge co


From: Janos Moldvay
Subject: [igraph] fastgreedy.community in R, iterative function to divide huge communities
Date: Wed, 1 Apr 2009 17:26:30 +0200

Hello,

while trying out the fastgreedy.community implementation in R I wondered if anyone tried to build a function around it which would further divide huge communities into smaller ones. It would maybe look something like this:


g <- read.graph("c:\\data\\sample.ncol", format="ncol")
com <- fastgreedy.community(g)
memb <- community.to.membership(g, com$merges, steps=(which.max(com$modularity)-1))

Now I extract nodes belonging to the biggest cluster/communities, to further devide them into smaller communities:

tmp <- which(memb$membership == which.max(memb$csize)-1)-1
g2 <- subgraph(g,tmp)
memb2 <- community.to.membership(g2, com2$merges, steps=(which.max(com2$modularity)-1))

Since I am not really familiar with R I am having trouble merging the two, (respectively n) community_membership vectors (memb and memb2) so that I have one community membership per node. Furthermore would I continue to iteratively divide large communities into smaller ones till I either reached a modularity-threshold or all communities are smaller than a defined maximum-clustersize-threshold.
I'll appreciate any kind of help very much!

Thanks in advance
János Moldvay


reply via email to

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