This package provides a Julia interface, (a wrapper) for the C++ implementation of the Leiden Algorithm for community detection, also known as graph clustering.
To learn more about the Leiden algorithm, see the article From Louvain to Leiden: guaranteeing well-connected communities, by V. A. Traag, L. Waltman & N. J. van Eck, 2019.
For the software library implementing the Leiden algorithm in C++ and Python, please visit the following link. It supports the
following objective functions for graph clustering: Modularity (with a resolution parameter), the Constant Potts Model, and the imod
function [2].
Leiden.jl
is available for the following platforms:
macOS x86_64
(x86_64-apple-darwin
)Linux x86_64 {libc=glibc}
(x86_64-linux-gnu
)
The package is currently under development and not available through
the package manager of Julia
. Instead, you have to manually add the
two dependencies of this package and the package itself:
] add https://github.com/fcdimitr/igraph_jll.jl https://github.com/fcdimitr/leiden_jll.jl https://github.com/pitsianis/Leiden.jl
The module exports a single function, leiden
. The function is used to run
a γ-specific search using Leiden. It returns a clustering configuration.
leiden(A::SparseMatrixCSC, method[;
γ = 1.0, gr_function = 0,
Ω_0 = C_NULL, list_seed = 0:9, n_iter = 2])
method
: aString
specifying the clustering function. Optionsngrb
: The modularity function with the resolution parameter γ.cpm
: The Constant Potts Model with the resolution parameter γ.imod
: Theimod
function described in [2], with the resolution parameter γ.
γ = 1.0
: The value of γgr_function = 0
: The function used in case the "imod" method is selected. Seeleiden_func_code
for more information.Ω_0 = C_NULL
: Initial configuration equivalent to Ω_v where every node is a cluster.list_seed = 0:9
: List of random number seeds to be used, one per run.n_iter = 2
: Number of successive iterations to be used per seed.
A MATLAB
wrapper is also available, under the directory matlab
.
Please check the instructions in the README file.
Contributions are very welcome, as are feature requests and suggestions. Please open an issue if you encounter any problems.
[1] V. A. Traag, L. Waltman and N. J. van Eck, From Louvain to Leiden: guaranteeing well-connected communities, Scientific Reports volume 9, 2019
[2] T. Liu, D. Floros, N. Pitsianis and X. Sun, "Digraph Clustering by the BlueRed Method," 2021 IEEE High Performance Extreme Computing Conference (HPEC), 2021, pp. 1-7, doi: 10.1109/HPEC49654.2021.9622834.
Design and development:
Nikos Pitsianis1,2, Dimitris Floros1, Xiaobai Sun2
1 Department of Electrical and Computer Engineering,
Aristotle University of Thessaloniki, Thessaloniki 54124, Greece
2 Department of Computer Science, Duke University, Durham, NC
27708, USA