Leiden algorithim implementation in Julia

I was wondering if anyone was aware of an implementation of the Leiden algorithm for Julia? It is a community detection algorithm which avoids the disconnected /poorly connected community problem associated with the louvain algorithm. I found this implementation here:

However the documentation is a bit sparse. After playing around with it I have encountered several issues. One is that it will randomly flag my input matrix as not symmetric at certain resolution parameters. I am also having a hard time telling if it is calculating values based off of modularity and how to set the null values.

I can dig through the source code in more detail, however, I am still relatively new at Julia and it seems to be taking advantage of a lot of tricks which I don’t know yet. I would appreciate it if anyone could point me in the direction of some more documentation for this implementation or perhaps a different implementation altogether!


The Julia CommunityDetection.jl from JuliaGraphs is somewhat abandoned. There is an open PR from someone that I was helping to be merged to the repo that implemented Louvain.

Maybe we could add another PR to implement the Leiden and hope that the CommunityDetection.jl comes back to life.

I would definitely recommend adding the Leiden algorithm, if possible! It resolves issues the louvain algorithm has of forming weekly connected communities with each collapse step:


I have a version of the louvain algorithm that I made from scratch. However, I used it as a practice project when I was just getting to know Julia and is a complete mess. I’ve been working through Tom Kwong’s “design patterns and best practices with Julia” maybe when I finish it I can clean up my code and offer it up to the community :slight_smile:

I’m currently in a bit of research pinch at the moment, so I’ll probably just use the python version of the Leiden algorithm, but if there’s nothing here by summer, it could be a fun summer project!


Sure I can help you out in your “summer” project. Call me up when you are available.

Awesome, will do!

here is a julia wrapper for Leiden algorithm.

1 Like