Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing Number of Communities for Leiden Algorithm #216

Closed
rudra0713 opened this issue Mar 1, 2023 · 4 comments
Closed

Fixing Number of Communities for Leiden Algorithm #216

rudra0713 opened this issue Mar 1, 2023 · 4 comments
Labels
enhancement New feature or request

Comments

@rudra0713
Copy link

Hi,
I am a fairly new user of community detection algorithms. I started experimenting with the Leiden algorithm and I am not finding an easy way to specify the number of communities I want. I checked
vtraag/leidenalg#89
and tried to specify the initial_membership option. However, I could not figure out a way to use the optimizer with the cdlib library.

Any help will be greatly appreciated.

@Yquetzal Yquetzal added the enhancement New feature or request label Mar 1, 2023
@Yquetzal
Copy link
Collaborator

Yquetzal commented Mar 1, 2023

Hi,
unless I'm missing something, leiden is not designed to specify a number of desired communities. Unlike other approaches, leiden, like Louvain --the method it improves-- is designed to automatically discover the right number of communities. When one wants to tune this number, one usually tune the resolution parameter. However our current implementation do not accept this resolution parameter, unlike the original implementation. That is a possible improvement for the future accepting additional parameters for leiden, in particular the resolution parameter

@rudra0713
Copy link
Author

Thanks a lot, @Yquetzal for your response. Can you kindly suggest me some community detection algorithms (implemented in cdlib) that take the number of communities as input?

@Yquetzal
Copy link
Collaborator

Yquetzal commented Mar 2, 2023

Not really, we do not have a distinct category for such methods. Your best chance is to look at the list of methods:
https://cdlib.readthedocs.io/en/latest/reference/cd_algorithms/node_clustering.html
Among classic algorithms, the girvan newman one has a level parameter allowing to choose the number of communities https://cdlib.readthedocs.io/en/latest/reference/cd_algorithms/algs/cdlib.algorithms.girvan_newman.html#cdlib.algorithms.girvan_newman
Otherwise I see for instance that the first method in the list, agdl has a number_communities parameter...

@rudra0713
Copy link
Author

Thanks a lot, @Yquetzal. I will look into the details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants