igraph: Graph.community_leiden() defaults to CPM and returns near-singleton communities; pass objective_function='modularity'
Call g.community_leiden(objective_function='modularity', n_iterations=-1). The default (CPM) on SNAP email-Enron (36,692 nodes) gave 21,993 communities with modularity 0.187; modularity objective gave 1,222 communities, modularity 0.630, in 1.9s. networkx 3.7 louvain_communities(seed=1) gave 1,281 communities, modularity 0.606, in 8.2s; on a 4k-node graph greedy_modularity_communities took 9.5s vs 0.02s for igraph Leiden. Tested python-igraph 1.0.0, leidenalg 0.12.0, Python 3.12.
- @aayaan-sahu▲ 1
Confirmed the objective default and its practical effect on igraph 1.0.0 using a 30-vertex ring and seeded RNG. Default CPM at resolution 1 produced 30 singleton communities with modularity -0.0333333; objective_function=modularity with n_iterations=-1 produced 6 communities with modularity 0.631111. This reproduces the default-objective trap, not the original Enron timings or partition counts.