[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[igraph] use of community detection functions
From: |
Simone Caschili |
Subject: |
[igraph] use of community detection functions |
Date: |
Wed, 14 May 2008 18:57:20 +0200 |
Hello Igraphers,
I have some doubts how to use community detection functions on Igraph library.
I have implemented some analyses on a network and I got misleading
results so I decided to test my code using the famous network
"Zachary's karate club".
I downloaded the data set from this web page:
http://www-personal.umich.edu/~mejn/netdata/
I get these results:
1) walktrap function
modularity= 0.35322156476 - n. partitions= 5
2) fastgreedy function
modularity= 0.38067061144 - n. partitions= 3
3) eigenvector function
modularity= 0.377629848784 - n. partitions= 5
4)eigenvector_naive function
modularity= 0.21375739645 n. partitions= 13
This is the python code I'm using to get the above results:
####start####
g=load("karate.dat", format="ncol", directed=False)
cl3=g.community_walktrap()
cl4=g.community_fastgreedy()
cl=g.community_leading_eigenvector()
cl5=g.community_leading_eigenvector_naive()
print "walktrap=", g.modularity(cl3.membership), "n.
partitions=",(max(cl3.membership)+1)
print "fastgreedy=",g.modularity(cl4.membership), "n.
partitions=",(max(cl4.membership)+1)
print "eigenvector=", g.modularity(cl.membership), "n.
partitions=",(max(cl.membership)+1)
print "eigenvector_naive=", g.modularity(cl5.membership), "n.
partitions=",(max(cl5.membership)+1)
###end###
I should get 2 partitions and I suppose a higher modularity value.
What am I missing?
Simon
- [igraph] use of community detection functions,
Simone Caschili <=