igraph-help
[Top][All Lists]
Advanced

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

[igraph] Re: Modularity function on python version


From: Simone Caschili
Subject: [igraph] Re: Modularity function on python version
Date: Mon, 25 Feb 2008 16:18:27 +0100

Dear Tamas,

you were right. I had some problems with my igraph version that was installed. I don't know why because i run igraph on Debian and i use igraph's repository in order to get the last stable version. Anyway, I solved my issue reinstalling igraph (ver 0.5)!

thank you for your help!
Simone

 

Dear Simone,

Which igraph version are you using? This definitely works for me with
0.5:

In [1]: g=igraph.Graph.Full(3)+igraph.Graph.Full(3)
In [2]: weights=[1,1,1,2,2,2]
In [3]: g.modularity([0,0,0,1,1,1], weights)
Out[3]: 0.44444444444444442
In [4]: print igraph.__version__
0.5

--
Tamas

On 2008.02.24., at 13:18, Simone Caschili wrote:

> Hello,
>
> I'm using modularity function on igraph  python version. I would get
> a value of modularity for my graph g that is a weighted graph while
> I would pass an a priori membership. Thus, in order to get what i
> need, i have built a list  that represents my membership, it is like:
>
> memb=[0,0,0,0,1,1,1,1,1]
>
> I would just split my graph into two communities. Edge's weights are
> also stored in a list like:
>
> weighs=[2,3,89,32,1,2,4]
>
> When I run my code I get this error:
>
> >Traceback (most recent call last):
> > File "1.py", line 120, in ?
> >    print g.modularity(memb,weights)
> >TypeError: modularity() takes exactly 2 arguments (3 given)
>
> Since I've tried to use only membership or weights, the code works
> but it doesn't solve my issue because i need a "weighed" modularity
> calculated on a certain membership.
>
> Could anyone help me?
> Thank you
> _______________________________________________
> igraph-help mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/igraph-help





------------------------------

_______________________________________________
igraph-help mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/igraph-help


End of igraph-help Digest, Vol 19, Issue 15
*******************************************


reply via email to

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