SkillAgentSearch skills...

Leiden.jl

A Julia implementation of the Leiden algorithm for community detection.

Install / Use

/learn @bicycle1885/Leiden.jl
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

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]])

Related Skills

View on GitHub
GitHub Stars22
CategoryDevelopment
Updated1y ago
Forks6

Languages

Julia

Security Score

75/100

Audited on Oct 25, 2024

No findings