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:
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.