Leiden.jl
A Julia implementation of the Leiden algorithm for community detection.
Install / Use
/learn @bicycle1885/Leiden.jlREADME
Leiden
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
node-connect
351.2kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
110.6kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
351.2kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
351.2kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
