Skip to content

A Julia implementation of the Leiden algorithm for community detection.

License

Notifications You must be signed in to change notification settings

bicycle1885/Leiden.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Leiden

Build Status Codecov

A Julia implementation of the Leiden algorithm for community detection.

Traag, Vincent A., Ludo Waltman, and Nees Jan van Eck. "From Louvain to Leiden: guaranteeing well-connected communities." Scientific reports 9 (2019). https://doi.org/10.1038/s41598-019-41695-z

Usage

# Create an adjacent matrix.
using SparseArrays
A = spzeros(6, 6)
edges = [
    (1, 2),
    (2, 3),
    (3, 1),
    (4, 5),
    (5, 6),
    (6, 4),
    (1, 4),
]
for (u, v) in edges
    A[u,v] = A[v,u] = 1
end

# Run the Leiden algorithm.
using Random
using Leiden
Random.seed!(1234)
result = Leiden.leiden(A, resolution = 0.25)
@show result
# result = (quality = 4.5, partition = Array{Int64,1}[[1, 2, 3], [4, 5, 6]])

About

A Julia implementation of the Leiden algorithm for community detection.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages