pymocd is a Python library, powered by a Rust backend, for performing efficient multi-objective evolutionary community detection in complex networks. This library is designed to deliver enhanced performance compared to traditional methods, making it particularly well-suited for analyzing large-scale graphs.
Navigate the Documentation for detailed guidance and usage instructions.
The HP-MOCD
algorithm, central to pymocd
, identifies community structures within a graph. It proposes a solution by grouping nodes into distinct communities, as illustrated below:
Original Graph | Proposed Community Structure |
---|---|
![]() |
![]() |
Installing the library using pip interface:
pip install pymocd
For an easy usage:
import networkx
import pymocd
G = networkx.Graph() # Your graph
alg = pymocd.HpMocd(G)
communities = alg.run()
Important
Graphs must be provided in NetworkX or Igraph compatible format.
Refer to the official Documentation for detailed instructions and more usage examples.
We welcome contributions to pymocd
! If you have ideas for new features, bug fixes, or other improvements, please feel free to open an issue or submit a pull request. This project is licensed under the GPL-3.0 or later.
If you use pymocd
or the HP-MOCD
algorithm in your research, please cite the following paper:
@article{santos2025high,
title={A High-Performance Evolutionary Multiobjective Community Detection Algorithm},
author={Santos, Guilherme O and Vieira, Lucas S and Rossetti, Giulio and Ferreira, Carlos HG and Moreira, Gladston},
journal={arXiv preprint arXiv:2506.01752},
year={2025}
}