[Top][All Lists]

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

Re: [igraph] use of community detection functions

From: Tamas Nepusz
Subject: Re: [igraph] use of community detection functions
Date: Wed, 14 May 2008 19:38:40 +0200

Hi Simone,

I should get 2 partitions and I suppose a higher modularity value.
No, you shouldn't necessarily get two partitions. I mean, the fact that the Zachary karate club network was split into two parts during the study of Zachary does not necessarily mean that it _actually_ has two partitions and it attains the highest modularity with two partitions. E.g., there is a small separated subgroup of 5 people that are connected to the rest of the network only via node 1, this subgroup frequently becomes another community according to many other methods.

I just checked the Zachary karate club network with the original implementation of the fast greedy algorithm of Clauset. It found exactly the same partition as igraph with the same number of communities: the highest modularity was attained with three communities and Q=0.3806, while the modularity was slightly lower for two communities: Q=0.3718.

The implementation of the walktrap community detection algorithm is exactly the same what the authors used in their paper (actually they contributed their code to igraph, Gabor just made a wrapper around their code), so this one should also give the same results as the original implementation.

Note that the walktrap community detection method can attain higher modularity when invoked with random walks of length 3 instead of 4 (the default):

In [1]: g=load("zachary.graphml")
In [2]: cl=g.community_walktrap()
In [3]: cl.q
Out[3]: 0.35322156548500061
In [4]: cl=g.community_walktrap(steps=3)
In [5]: cl.q
Out[5]: 0.41978961229324341
In [6]: len(cl)
Out[6]: 4


reply via email to

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