Closed XiaoxiaLin closed 4 years ago
Hello, The current best_partition has only been tested on graph and never on MultiGraph. Your solution seems reasonable for multigraph, considering that 2 links of weights W1 and W2 is equivalent to 1 link of weight W1+W2.
I think considering this it would be easier and clearer to first transform your Multigraph to a Graph with this hypothesis and then apply louvain method on it rather than implementing more cases for Multigraph in the algorithm.
Best,
The current modularity function in community_louvain.py will always set the edge_weight to 1 in case of multigraph.
For multigraph, we would need edge keys to get the weight:
Does it make sense? Is the current best_partition function only work for Graph, and not MultiGraph?