vtraag / leidenalg

Implementation of the Leiden algorithm for various quality functions to be used with igraph in Python.
GNU General Public License v3.0
606 stars 78 forks source link

Can new functions of modularity be added to leidenalg #125

Closed mbdjalal closed 1 year ago

mbdjalal commented 1 year ago

Hello, I want to use other functions measuring modularity. These functions are new and does not exists in leidenalg. How can I add theses functions, please ? Do I need the source of the .so file used by leidenalg ?

Thanks

vtraag commented 1 year ago

In principle this is not too difficult, but you would need to do this in C++. You can read more about it here: https://leidenalg.readthedocs.io/en/stable/implement.html.

However, I've recently externalised the C++ core to a separate library, which is available from https://github.com/vtraag/libleidenalg. If you want to contribute another quality function, you should hence first add the function there. In principle, the main instructions at https://leidenalg.readthedocs.io/en/stable/implement.html remain the same, but you should now apply them in the libleidenalg repository when they concern the C++ part.

If you want to start doing this, I would recommend to first get the libleidenalg to work separately on your computer. Once you have set that up, you can try to add a new quality function. If you want, you can then open a draft PR on the libleidenalg repo with your preliminary changes to discuss further.

vtraag commented 1 year ago

I'll leave this open until I've fully updated the documentation about how to contribute new quality functions.

vtraag commented 1 year ago

I've now update the documentation, and should be available (shortly) on https://leidenalg.readthedocs.io/en/latest/implement.html. It essentially just separates the parts of how to contribute to C++ and Python in the two different repositories. I'll now close this issue.