Everything below lives in the top-level pymocd namespace. The reference is
generated from pymocd.pyi, the type stub that cargo run --bin stub_gen
writes from the Rust sources, so every signature and default here is the one the
installed package exposes. The docstrings themselves live next to the code, in
src/api/ and
src/core/algorithms/hpmocd/api.rs.
Two conventions hold throughout:
Graphs are NetworkX graphs with integer node ids, or igraph graphs
(see Input graphs).
Partitions are plain dict[int, int] mapping node to community id.
Isolated nodes are assigned community -1.
Run CDRME (Dabaghi-Zarandi, Afkhami & Ashoori, "Community Detection method based on Random walk and Multi objective Evolutionary algorithm in complex networks", Journal of Network and Computer Applications 234:104070, 2025) — softmax-weighted random walks seeded at degree-weighted centres compose a primary community set, a population of stochastic agglomerative merge chains diversifies it under the paper's linkage objective (Eq. 12), and a similarity-driven mutation repairs the weakly attached nodes.
Run MMCoMO (Zhang, Yang, Yang & Zhang, IEEE Computational Intelligence Magazine 18(3):69–86, 2023) — two co-evolving NSGA-II populations, one label-based (micro) and one centre-based (macro), minimizing kernel k-means and ratio cut and coupled through a diffusion-kernel similarity matrix.
Run NSGA-III-CCM (Shaik, Ravi & Deb, SN Computer Science 2(1):1, 2021) — NSGA-III over the three maximized objectives (Community Score, Community Fitness, Modularity).
Run NSGA-III-KRM (Shaik, Ravi & Deb, SN Computer Science 2(1):1, 2021) — NSGA-III over (Kernel-K-Means, Ratio-Cut, Modularity); KKM & Ratio-Cut minimized, Modularity maximized.
Run GDPSO (Cai, Gong, Ma, Ruan, Yuan, Jiao, "Greedy discrete particle swarm optimization for large-scale social network clustering", Information Sciences 316:503–516, 2015) — a swarm of label vectors, each seeded by a short asynchronous label-propagation run, that once per generation turns a sigmoid of the velocity into a binary per-node move mask and offers every masked node an exact single-node modularity move.
Shi-MOCD with the Max-Min Distance (MOCD-D) model selector (Shi et al. 2012, Eqs. 3.9–3.11): returns the Pareto-front member whose (intra, inter) deviates most from rand_networks same-scale Erdős–Rényi control fronts.
pymocd.mr_mocd, pymocd.mr_mocd_fronts and pymocd.mr_mocd_select are the
names RIMPSO carried before it was renamed; pymocd.scale and
pymocd.scale_fronts are older still. All five are the same function objects as
rimpso, rimpso_fronts and
rimpso_select, kept so pinned callers keep working.
They emit no warning and are not in the type stub. Use the new names.