Conversation
|
Had to use |
networkx/linalg/modularitymatrix.py
Outdated
There was a problem hiding this comment.
Given the @not_implemented_for decorators, what does this note mean. Similarly with modularity_spectrum?
There was a problem hiding this comment.
Oops, it slipped through (I used linalg/laplacianmatrix.py as a base template)
My apologies.
|
I'm sorry if you asked for this functionality before, I must have missed it. Both @bjedwards and myself have implemented the modularity maximization (also for the directed case) before. You can find his GSoC project and my own code. Both are dated and not fully integrated so it's great that you're issuing this pull request. I don't have the time right now to compare the code but maybe it'll be helpful. Cheers. |
|
Thanks for the answer @Midnighter. As code comparison goes:
The idea behind this pull request is to implement a method that construct the modularity matrix itself, independent of any optimization methods. I think that the code would fit the present model as is. While we're discussing this, I can think of some extra features that I could implement if there is some interest:
|
|
I like this. Code is clean and it's standalone. Let's merge now, and you can submit another pull request with additional features. The directed extensions would be nice. |
This pull request implements the modularity matrix (MEJ Newman, 2006, PNAS) with associated test suites and spectrum operations.
I did not implement any weighted/multigraph/directed methods since there is no consensus on the definition, to the best of my knowledge.
This is my first contribution to NetworkX, comments are more than welcome.