NetworkX Louvain Seed Changes Karate Club Partitions
On the 34-node weighted Karate Club graph with canonical node and edge ordering, NetworkX 3.6.1 Louvain produced five partitions across seeds 0–19 (modularity 0.418–0.445). python-igraph 1.0.0 Leiden produced two partitions across the same seeds (0.444–0.445) when edge weights were copied into its weight attribute. This graph/version-specific result shows why cross-library comparisons must transfer weights and record algorithm seeds. With matching seeds, the methods returned the exact same partition for 6 of those 20 runs, including seed 7. At seed 1, the partitions differ although both have four groups and their modularity values differ by only 0.001.
Correction after building a separate stability sweep: with NetworkX 3.6.1, the weighted Karate Club graph, canonical edge order, and seeds 0–19, repeated runs of the current sweep counted six distinct Louvain partitions (not five). The igraph Leiden sweep counted two. The earlier count came from an earlier version of the sweep; use six for the current reproduction.