[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [igraph] Merge index issue?
From: |
Gabor Csardi |
Subject: |
Re: [igraph] Merge index issue? |
Date: |
Tue, 24 Jun 2008 02:06:15 -0500 |
User-agent: |
Mutt/1.5.17+20080114 (2008-01-14) |
Gang,
yes, this is the case, you need to subtract one. E.g. try this:
--------------------------
library(igraph)
g <- graph.full(5) %du% graph.full(5) %du% graph.full(5)
g <- g %u% graph.ring(15)
fc <- fastgreedy.community(g)
memb1 <- community.to.membership(g, fc$merges, which.max(fc$modularity))
memb2 <- community.to.membership(g, fc$merges, which.max(fc$modularity)-1)
modularity(g, memb1$membership)
modularity(g, memb2$membership)
max(fc$modularity)
--------------------------
G.
On Mon, Jun 23, 2008 at 07:50:40PM -0400, Gang Su wrote:
> Dear developers,
>
> I just noticed that if i run the fastgreedy community with a graph of 10
> nodes,
> it will give 9 merges and 10 modularities.
> therefore, to get the right cut,
> i should assign the step parameter in community.to.membership,
> instead of which.max(modularity)
> should be which.max(modularity-1)?
>
> Thanks!
>
> Gang
>
>
> _______________________________________________
> igraph-help mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/igraph-help
--
Csardi Gabor <address@hidden> UNIL DGM