leidenalg
Leiden is a general algorithm for methods of community detection in large networks.
Decision gist · record as of 2026-08-14
Yes, if you need flexible community detection on large graphs and can accept GPL-3.0-or-later licensing. The active maintenance, prebuilt wheels for modern Python, and lack of known vulnerabilities make it reliable. Medium install friction is manageable via wheels on major platforms. Not suitable for proprietary closed-source applications without license negotiation.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires igraph as a runtime dependency.
- On Windows, binary wheels are recommended; on Unix-like systems, C++ compilation tools and igraph C core (version >= 1.0.0) may be needed if building from source.
- Medium install friction due to compiled C++ dependencies.
License · maintenance · safety
GPL-3.0-or-later (copyleft) — GPL-3.0-or-later copyleft license means any derivative work or linked application must also be open-source under compatible terms. Suitable for research and open-source projects; commercial use requires careful licensing review.
last release 2026-05-24 (82 days)
0 known vulnerabilities (OSV.dev, 2026-08-14) · 771,839 downloads/mo, #5,100 on PyPI
Alternatives
Verify before relying
pip install leidenalg
import leidenalg
import igraph as ig
G = ig.Graph.Erdos_Renyi(100, 0.1)
part = leidenalg.find_partition(G, leidenalg.ModularityVertexPartition)- Whether the package supports directed graphs or only undirected (description mentions igraph's internal implementation is undirected-only, but leidenalg's flexibility is unclear).
- Performance characteristics and scalability limits for graphs with millions of nodes on typical hardware.
What it is and what it does
leidenalg is a Python interface to a C++ implementation of the Leiden algorithm, a community detection method for partitioning large networks into cohesive groups. It extends the Louvain algorithm with improvements to guarantee well-connected communities and supports multiple optimization objectives: modularity, Reichardt-Bornholdt models, Constant Potts Model (CPM), Significance, and Surprise. The package can handle graphs with millions of nodes (memory-permitting) and includes support for multiplex networks (e.g., temporal or multi-layer graphs) and bipartite graphs, with the option to fix some community assignments during optimization.
The package depends on igraph for graph representation and manipulation. It is designed for research and scientific computing, where flexibility in community detection methods is valued. Prebuilt wheels are available for Python 3.9+ on Windows, macOS, and Linux, though source builds require C++ compilation tools and igraph's C core library.
Use it for
- Detect communities in social networks or collaboration graphs to identify groups of closely connected entities.
- Analyze temporal networks by applying Leiden to multiple time slices to track community evolution.
- Optimize modularity or other quality metrics on large graphs to find the best partition into communities.
- Perform community detection on multiplex networks with positive and negative links or multiple relationship types.
- Identify clusters in bipartite graphs such as author-paper or user-item networks.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need flexible community detection on large graphs and can accept GPL-3.0-or-later licensing.
The active maintenance, prebuilt wheels for modern Python, and lack of known vulnerabilities make it reliable. Medium install friction is manageable via wheels on major platforms. Not suitable for proprietary closed-source applications without license negotiation.
Install
leidenalg on PyPI
Before you install
Medium install friction due to compiled C++ dependencies. Prebuilt wheels are available for modern Python versions (3.9+) on major platforms, reducing friction significantly. Maintenance is active with a recent release.
Requires igraph as a runtime dependency. On Windows, binary wheels are recommended; on Unix-like systems, C++ compilation tools and igraph C core (version >= 1.0.0) may be needed if building from source.
License in practice
GPL-3.0-or-later copyleft license means any derivative work or linked application must also be open-source under compatible terms. Suitable for research and open-source projects; commercial use requires careful licensing review.
Quickstart
pip install leidenalg
import leidenalg
import igraph as ig
G = ig.Graph.Erdos_Renyi(100, 0.1)
part = leidenalg.find_partition(G, leidenalg.ModularityVertexPartition)
Verify before relying
- Whether the package supports directed graphs or only undirected (description mentions igraph's internal implementation is undirected-only, but leidenalg's flexibility is unclear).
- Performance characteristics and scalability limits for graphs with millions of nodes on typical hardware.
Package facts
| License | GPL-3.0-or-later copyleft |
| Python support | Supports the current Python release >=3.7 |
| Install friction | Medium. Platform-specific wheel |
| Runtime dependencies | 1 packageigraph |
| Maintenance | Actively maintained 82 days since the last release |
| First released | |
| Downloads | 771,839 / month, #5,100 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 4 - BetaEnvironment :: ConsoleIntended Audience :: DevelopersIntended Audience :: End Users/DesktopIntended Audience :: Science/ResearchOperating System :: MacOS :: MacOS XOperating System :: Microsoft :: WindowsOperating System :: POSIXProgramming Language :: C++Programming Language :: PythonTopic :: Scientific/Engineering :: Information AnalysisTopic :: Scientific/Engineering :: MathematicsTopic :: Sociology |
Evidence: leidenalg-0.12.0-cp38-abi3-macosx_10_9_x86_64.whl; leidenalg-0.12.0-cp38-abi3-macosx_11_0_arm64.whl; leidenalg-0.12.0-cp38-abi3-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl; leidenalg-0.12.0-cp38-abi3-manylinux_2_26_i686.manylinux_2_28_i686.whl; leidenalg-0.12.0-cp38-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; leidenalg-0.12.0-cp38-abi3-musllinux_1_2_i686.whl; leidenalg-0.12.0-cp38-abi3-musllinux_1_2_x86_64.whl; leidenalg-0.12.0-cp38-abi3-win32.whl; leidenalg-0.12.0-cp38-abi3-win_amd64.whl; leidenalg-0.12.0-pp311-pypy311_pp73-macosx_10_15_x86_64.whl; leidenalg-0.12.0-pp311-pypy311_pp73-macosx_11_0_arm64.whl; leidenalg-0.12.0-pp311-pypy311_pp73-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl; leidenalg-0.12.0-pp311-pypy311_pp73-manylinux_2_26_i686.manylinux_2_28_i686.whl; leidenalg-0.12.0-pp311-pypy311_pp73-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “graph clustering leiden”
- leidenalgImplements the Leiden community detection algorithm for graphs,…
- graspologic-nativeProvides a high-performance Rust implementation of the Leiden…
- graspologicGraspologic provides graph statistical algorithms and utilities for…
Give your agent the search over MCP, or paste the wish link into any chat.
More Information Analysis packages
A drop-in replacement for Python's standard `re` module that adds advanced regex features like nested sets, fuzzy matching, lookaround in conditionals, and full Unicode case-folding while maintaining backward compatibility.
pyarrow provides Python bindings to Apache Arrow's C++ libraries for efficient columnar data processing, serialization, and interoperability with pandas, NumPy, and other Python ecosystem tools.
NetworkX provides data structures and algorithms for creating, analyzing, and manipulating graphs and networks, supporting everything from simple undirected graphs to complex directed and weighted networks.
Connects Python applications to Snowflake data warehouses using the DB API 2.0 specification, enabling SQL queries, data transfers, and warehouse operations.
ContourPy calculates contours of 2D quadrilateral grids using C++11 algorithms wrapped in Python, offering serial and multithreaded implementations without requiring Matplotlib as a dependency.
Snowpark Python provides APIs to query and process data directly in Snowflake without moving data to your local system, with support for both native Snowpark and pandas-compatible interfaces.
Install it if you use Snowflake and want to process data without moving it to your application layer.
See also graspologic-native · python-igraph · igraph · pm4py · ldpc · kneed · lap · scikit-network · graspologic