CoChat

From Louvain to Leiden: guaranteeing well-connected communities

Open access
Traag, V. A., Waltman, L., van Eck, N. J. · 2019 · Scientific Reports

The DOI matches its Crossref record; 30 of the 30 references it cites were found in a registry or an index; 1 of the 26 sources its claims cite were checked for support.

Abstract

Community detection is often used to understand the structure of large and complex networks. One of the most popular algorithms for uncovering community structure is the so-called Louvain algorithm. We show that this algorithm has a major defect that largely went unnoticed until now: the Louvain algorithm may yield arbitrarily badly connected communities. In the worst case, communities may even be disconnected, especially when running the algorithm iteratively. In our experimental analysis, we observe that up to 25% of the communities are badly connected and up to 16% are disconnected. To address this problem, we introduce the Leiden algorithm. We prove that the Leiden algorithm yields communities that are guaranteed to be connected. In addition, we prove that, when the Leiden algorithm is applied iteratively, it converges to a partition in which all subsets of all communities are locally optimally assigned. Furthermore, by relying on a fast local move approach, the Leiden algorithm runs faster than the Louvain algorithm. We demonstrate the performance of the Leiden algorithm for several benchmark and real-world networks. We find that the Leiden algorithm is faster than the Louvain algorithm and uncovers better partitions, in addition to providing explicit guarantees.

Overview

CoChat Summary

TL;DR

The Louvain algorithm can yield arbitrarily badly connected communities, including disconnected ones, especially when iterated. The Leiden algorithm guarantees connected communities and, under iteration, converges to subset-optimal partitions while running faster and finding higher-quality partitions.

Key findings

  • Louvain may produce arbitrarily badly connected communities; in experiments up to 25% of communities were badly connected and up to 16% were disconnected. First-iteration badly connected percentages included Amazon 23%, DBLP 16%, and Web UK 14%; disconnected communities were usually around 1%, but exceeded 5% for Web of Science in the first iteration and jumped to 16% for DBLP in later iterations. After four iterations, Amazon had 5% disconnected but 25% badly connected communities.
  • Leiden guarantees all communities are connected after each iteration, and also γ-separated and γ-connected. After a stable iteration, all nodes are locally optimally assigned and all communities are subpartition γ-dense; asymptotically, all communities are uniformly γ-dense and subset optimal.
  • Leiden was faster than Louvain: first iteration roughly 2–20 times faster on empirical networks, including more than 7× faster for Live Journal, more than 11× for Web of Science, and more than 20× for Web UK. On benchmark networks with difficult partitions (μ = 0.9), Louvain required almost 2.5 days while Leiden needed fewer than 10 minutes; for largest networks Leiden reached 10–100 times faster runtimes.
  • Leiden found higher modularity on all six empirical networks: DBLP 0.8387 vs 0.8262, Amazon 0.9341 vs 0.9301, IMDB 0.7069 vs 0.7062, Live Journal 0.7739 vs 0.7653, Web of Science 0.7951 vs 0.7911, and Web UK 0.9801 vs 0.9796.

Methods

  • The paper introduces the Leiden algorithm, which combines local moving, refinement of the partition, and aggregation; proofs of guarantees are relegated to Supplementary Information. It compares Leiden with Louvain on six empirical networks and on benchmark networks.
  • Empirical networks: DBLP (317,080 nodes, degree 6.6), Amazon (334,863, 5.6), IMDB (374,511, 80.2), Live Journal (3,997,962, 17.4), Web of Science (9,811,130, 21.2), and Web UK (39,252,879, 39.8). Modularity was used with γ = 1; Table 2 reports maximal modularity after 10 replications of 10 iterations each. Badly connected community analysis was repeated 10 times, with Leiden run on each community’s subnetwork until a stable iteration.
  • Benchmark networks ranged from n = 10^3 to n = 10^7 nodes, with community size 50 and CPM as the quality function; the mixing parameter μ varied, 10 iterations were performed, and each parameter set was repeated 10 times. The refinement randomness parameter was θ = 0.01.

Limitations

  • The paper states that benchmark networks have only limited value because they are not representative of empirical real-world networks and have a rather simple structure.
  • The paper states that counting communities split by Leiden gives only a lower bound on the number of badly connected communities; if Leiden does not find subcommunities, there is no guarantee that modularity cannot be increased by splitting the community.
  • Evident from the text: there is no dedicated limitations section; technical details and proofs are relegated to Supplementary Information, and the experimental analysis fixes θ = 0.01 although values roughly in [0.0005, 0.1] are said to provide reasonable results.

Model-written summary. Check it against the paper before relying on it.

Integrity signals

Registry

Crossref · 10.1038/s41598-019-41695-z

Cites

30 of 30 references verified0 citation errors · 0 not checkable

Statistics

Nothing to recompute.

Figures

Figure 1 Louvain algorithm. The Louvain algorithm starts from a singleton partition in which each node is in its own community (a). The algorithm moves individual nodes from one community to another to find a partition (b). Based on this partition, an aggregate network is created (c). The algorithm then moves individual nodes in the aggregate network (d). These steps are repeated until the quality cannot be increased further.
Figure 1 Louvain algorithm. The Louvain algorithm starts from a singleton partition in which each node is in its own community (a). The algorithm moves individual nodes from one community to another to find a partition (b). Based on this partition, an aggregate network is created (c). The algorithm then moves individual nodes in the aggregate network (d). These steps are repeated until the quality cannot be increased further.CC BY · PubMed Central
Figure 2 Disconnected community. Consider the partition shown in (a). When node 0 is moved to a different community, the red community becomes internally disconnected, as shown in (b). However, nodes 1–6 are still locally optimally assigned, and therefore these nodes will stay in the red community.
Figure 2 Disconnected community. Consider the partition shown in (a). When node 0 is moved to a different community, the red community becomes internally disconnected, as shown in (b). However, nodes 1–6 are still locally optimally assigned, and therefore these nodes will stay in the red community.CC BY · PubMed Central
Figure 3 Leiden algorithm. The Leiden algorithm starts from a singleton partition (a). The algorithm moves individual nodes from one community to another to find a partition (b), which is then refined (c). An aggregate network (d) is created based on the refined partition, using the non-refined partition to create an initial partition for the aggregate network. For example, the red community in (b) is refined into two subcommunities in (c), which after aggregation become two separate nodes in (d), both belonging to the same community. The algorithm then moves individual nodes in the aggregate network (e). In this case, refinement does not change the partition (f). These steps are repeated until no further improvements can be made.
Figure 3 Leiden algorithm. The Leiden algorithm starts from a singleton partition (a). The algorithm moves individual nodes from one community to another to find a partition (b), which is then refined (c). An aggregate network (d) is created based on the refined partition, using the non-refined partition to create an initial partition for the aggregate network. For example, the red community in (b) is refined into two subcommunities in (c), which after aggregation become two separate nodes in (d), both belonging to the same community. The algorithm then moves individual nodes in the aggregate network (e). In this case, refinement does not change the partition (f). These steps are repeated until no further improvements can be made.CC BY · PubMed Central
Figure 4 Badly connected communities. Percentage of communities found by the Louvain algorithm that are either disconnected or badly connected compared to percentage of badly connected communities found by the Leiden algorithm. Note that communities found by the Leiden algorithm are guaranteed to be connected.
Figure 4 Badly connected communities. Percentage of communities found by the Louvain algorithm that are either disconnected or badly connected compared to percentage of badly connected communities found by the Leiden algorithm. Note that communities found by the Leiden algorithm are guaranteed to be connected.CC BY · PubMed Central
Figure 5 Scaling of benchmark results for network size. Speed and quality of the Louvain and the Leiden algorithm for benchmark networks of increasing size (two iterations). For larger networks and higher values of μ, Louvain is much slower than Leiden. For higher values of μ, Leiden finds better partitions than Louvain.
Figure 5 Scaling of benchmark results for network size. Speed and quality of the Louvain and the Leiden algorithm for benchmark networks of increasing size (two iterations). For larger networks and higher values of μ, Louvain is much slower than Leiden. For higher values of μ, Leiden finds better partitions than Louvain.CC BY · PubMed Central
Figure 6 Runtime versus quality for benchmark networks. Speed and quality for the first 10 iterations of the Louvain and the Leiden algorithm for benchmark networks (n = 106 and n = 107). The horizontal axis indicates the cumulative time taken to obtain the quality indicated on the vertical axis. Each point corresponds to a certain iteration of an algorithm, with results averaged over 10 experiments. In general, Leiden is both faster than Louvain and finds better partitions.
Figure 6 Runtime versus quality for benchmark networks. Speed and quality for the first 10 iterations of the Louvain and the Leiden algorithm for benchmark networks (n = 106 and n = 107). The horizontal axis indicates the cumulative time taken to obtain the quality indicated on the vertical axis. Each point corresponds to a certain iteration of an algorithm, with results averaged over 10 experiments. In general, Leiden is both faster than Louvain and finds better partitions.CC BY · PubMed Central
Figure 7 Scaling of benchmark results for difficulty of the partition. Speed of the first iteration of the Louvain and the Leiden algorithm for benchmark networks with increasingly difficult partitions (n = 107). In the most difficult case (μ = 0.9), Louvain requires almost 2.5 days, while Leiden needs fewer than 10 minutes.
Figure 7 Scaling of benchmark results for difficulty of the partition. Speed of the first iteration of the Louvain and the Leiden algorithm for benchmark networks with increasingly difficult partitions (n = 107). In the most difficult case (μ = 0.9), Louvain requires almost 2.5 days, while Leiden needs fewer than 10 minutes.CC BY · PubMed Central
Figure 8 First iteration runtime for empirical networks. Speed of the first iteration of the Louvain and the Leiden algorithm for six empirical networks. Leiden is faster than Louvain especially for larger networks.
Figure 8 First iteration runtime for empirical networks. Speed of the first iteration of the Louvain and the Leiden algorithm for six empirical networks. Leiden is faster than Louvain especially for larger networks.CC BY · PubMed Central
Figure 9 Runtime versus quality for empirical networks. Speed and quality for the first 10 iterations of the Louvain and the Leiden algorithm for six empirical networks. The horizontal axis indicates the cumulative time taken to obtain the quality indicated on the vertical axis. Each point corresponds to a certain iteration of an algorithm, with results averaged over 10 experiments. Leiden is both faster than Louvain and finds better partitions.
Figure 9 Runtime versus quality for empirical networks. Speed and quality for the first 10 iterations of the Louvain and the Leiden algorithm for six empirical networks. The horizontal axis indicates the cumulative time taken to obtain the quality indicated on the vertical axis. Each point corresponds to a certain iteration of an algorithm, with results averaged over 10 experiments. Leiden is both faster than Louvain and finds better partitions.CC BY · PubMed Central
Figure 10 Number of iterations until stability. Number of iterations before the Leiden algorithm has reached a stable iteration for six empirical networks. In a stable iteration, the partition is guaranteed to be node optimal and subpartition γ-dense.
Figure 10 Number of iterations until stability. Number of iterations before the Leiden algorithm has reached a stable iteration for six empirical networks. In a stable iteration, the partition is guaranteed to be node optimal and subpartition γ-dense.CC BY · PubMed Central

Verification

Claims the paper makes

1 Valid · 2 Not valid · 17 Not checked · 142 Own results and interpretations

115 more claims

Create a free account to see all 162 claims and to verify the 24 references still open.

See all claims — free account
  • Probably not a substantial claim. 23
  • It may state two separate claims as one. 23
  • The quote only partly states this claim. 1

Create a free account to see these claims.

Claims other papers make about this one

Each is checked against this paper’s own text: does it say what the citing paper says it does?

6 more claims about this paper

Create a free account to see every claim other papers make about this one.

See all claims — free account

Citations

Cites

Research works printed but not linked: 2

  1. Porter MA Onnela J-P Mucha PJ Communities in Networks Not. AMS 2009 56 1082 1097
  2. Luecken, M. D. Application of multi-resolution partitioning of interaction networks to the study of complex disease. Ph.D. thesis, (University of Oxford, 2016).

Cited by

See all 7,288

Metadata

Authors
Traag, V. A., Waltman, L., & van Eck, N. J.
Affiliations
Leiden University (NL)
Corresponding author
Traag, V. A.
Venue
Scientific Reports
Published
2019-03-26
Volume
9
Issue
1
Pages
5233-5233
ISSN
2045-2322 (ISSN-L)
OpenAlex
W2897249806
Cited by
5,635
References
27
Citations by year
2026: 1250 · 2025: 1281 · 2024: 980 · 2023: 757 · 2022: 639 · 2021: 466 · 2020: 213 · 2019: 46
FWCI
158.78
Type
journal article
Language
en
Open access
Licence
Locations
  • Scientific Reports (publishedVersion, cc-by)
  • Europe PMC (PubMed Central) (publishedVersion, other-oa)
  • PubMed Central (publishedVersion, cc-by)
  • PubMed (publishedVersion)
  • arXiv (Cornell University) (submittedVersion)
  • Leiden Repository (Leiden University) (submittedVersion, cc-by)
  • Data Archiving and Networked Services (DANS) (submittedVersion, cc-by)
  • DOAJ (DOAJ: Directory of Open Access Journals) (submittedVersion)
  • Leiden Repository (Leiden University) (submittedVersion)
  • arXiv (Cornell University)
Topics
  • Physical Sciences › Physics and Astronomy › Statistical and Nonlinear Physics › Complex Network Analysis Techniques
  • Physical Sciences › Computer Science › Artificial Intelligence › Advanced Clustering Algorithms Research
  • Life Sciences › Biochemistry, Genetics and Molecular Biology › Molecular Biology › Bioinformatics and Genomic Networks
Keywords
community detection, Louvain algorithm, Leiden algorithm, network partitioning, community connectivity, complex networks

About these checks

Registry, retraction, Cites and statistics results are computed, not judged, with one exception: a printed reference that no index lists is read once by a model before it counts as a citation error. Claims are extracted by a model and kept only when their quote appears verbatim in the text; each cited source is then checked, with a model’s help, for whether it says what the claim relies on. Those verdicts can be wrong — read the claim’s quote and the cited source before relying on one.

The claim verdicts this report counts are experimental: their accuracy is not yet measured.

A language model drew the claims from the paper on 2026-11-23, under version 3 of the claim definition (model deepseek-v4.1-flash, prompt extract-v3).

A second model labelled each claim on 2026-11-23 (model jev-1.13-20260917, definition revision gold-guideline-v0.2).

Cited sources are checked with a language model’s help (qwen3.8-omni-flash).

Statistics and arithmetic are recomputed, not judged.

Confidence bands are shown only for fields calibrated on our annotated test set. None is calibrated yet, so no band is shown.

What counts as a claim ›How we measure confidence ›How we check this ›

Are you an author, or do you see a problem with this page? Request a review

Data sources

Bibliographic data: Semantic Scholar, OpenAlex, Crossref.

Contains information from the Semantic Scholar Academic Graph Datasets, made available under the ODC Attribution License (ODC-BY 1.0).

Semantic Scholar’s data is described in: Kinney, R., et al. (2023). The Semantic Scholar Open Data Platform. arXiv:2301.10140.