<div align="center">
<!-- <img src="" alt="logo" style="width: 50%;"> -->
<p align="center">
<strong>Rapid Multi-Objective Community Detection</strong>
</p>
<hr>
![PyPI - Implementation](https://img.shields.io/pypi/implementation/re_mocd)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/re_mocd)
![PyPI - Downloads](https://img.shields.io/pypi/dm/re_mocd)
[![PyPI - Stats](https://img.shields.io/badge/More%20Info-F58025?logo=PyPi)](https://pypistats.org/packages/re_mocd)
</div>
> **Warning:**
>
> This project is in its early stages, and the algorithm is still being refined. Performance and results may not be optimal yet.
## Overview
This project aims to develop a high-performance genetic algorithm in Rust to detect communities in a graph. The goal is to optimize the community detection process to handle large-scale graphs efficiently. This algorithm also tries to handle some problems that happens with louvain algorithm.
> **Why Rust?**
>
> Rust is one of the fastest programming languages available, offering high-performance execution and memory safety without a garbage collector. It has a rich ecosystem of libraries.
## Usage
### Requirements
Before running the algorithm, you'll need an edge list file formatted as follows:
```plaintext
0,1,{'weight': 4}
0,2,{'weight': 5}
0,3,{'weight': 3}
...
0,10,{'weight': 2}
```
The **weight** attribute is optional. If not provided, it can be represented by an empty dictionary: `{}`. You can save a `networkx` graph like this with: `networkx.write_edgelist(G, file_path, delimiter=",", data=False)`
### Installation via PyPI
The library is available on PyPI. You can install it using `pip`:
```bash
pip install re_mocd
```
#### Simple Example (Python)
Here's a simple example of how to use the library in Python, the function return a dict of the partition found:
```python
import re_mocd
edgelist_file = "res/graphs/artificials/article.edgelist"
partition = re_mocd.run(edgelist_file)
```
You can see an [example of plotting](res/example.py), or an example of how to [make comparisons](res/example.py) with other algorithms in `res/`.
<center>
![Example Plot](res/example.png)
</center>
### Running from Scratch
#### Build and Run
1. Clone the repository and navigate to the project folder:
```bash
git clone https://github.com/0l1ve1r4/re_mocd
cd re_mocd
```
2. Compile and run the algorithm with your edge list file:
```bash
cargo run --release mygraph.edgelist
```
#### Debug Mode
To run the algorithm in debug mode, use the `-d` flag:
```bash
cargo run --release mygraph.edgelist -d
```
This will provide additional debug output, useful for troubleshooting and monitoring the algorithm's progress.
Raw data
{
"_id": null,
"home_page": null,
"name": "re-mocd",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "rust, python, community detection, multi-objective optimization, graph analysis",
"author": "Guilherme Santos",
"author_email": "Guilherme Santos <gs.oliveira.dev@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/49/67/c07a1a99b23006a23eef94be39beee5937dc68c39cb2f5d78c7439b22894/re_mocd-0.1.0.tar.gz",
"platform": null,
"description": "<div align=\"center\">\n <!-- <img src=\"\" alt=\"logo\" style=\"width: 50%;\"> -->\n\n<p align=\"center\">\n <strong>Rapid Multi-Objective Community Detection</strong>\n </p>\n\n<hr>\n\n![PyPI - Implementation](https://img.shields.io/pypi/implementation/re_mocd)\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/re_mocd)\n![PyPI - Downloads](https://img.shields.io/pypi/dm/re_mocd)\n[![PyPI - Stats](https://img.shields.io/badge/More%20Info-F58025?logo=PyPi)](https://pypistats.org/packages/re_mocd)\n\n</div>\n\n\n> **Warning:** \n>\n> This project is in its early stages, and the algorithm is still being refined. Performance and results may not be optimal yet.\n\n## Overview\n\nThis project aims to develop a high-performance genetic algorithm in Rust to detect communities in a graph. The goal is to optimize the community detection process to handle large-scale graphs efficiently. This algorithm also tries to handle some problems that happens with louvain algorithm.\n\n> **Why Rust?** \n>\n> Rust is one of the fastest programming languages available, offering high-performance execution and memory safety without a garbage collector. It has a rich ecosystem of libraries.\n\n## Usage\n\n### Requirements\n\nBefore running the algorithm, you'll need an edge list file formatted as follows:\n\n```plaintext\n0,1,{'weight': 4}\n0,2,{'weight': 5}\n0,3,{'weight': 3}\n...\n0,10,{'weight': 2}\n```\n\nThe **weight** attribute is optional. If not provided, it can be represented by an empty dictionary: `{}`. You can save a `networkx` graph like this with: `networkx.write_edgelist(G, file_path, delimiter=\",\", data=False)`\n\n### Installation via PyPI\n\nThe library is available on PyPI. You can install it using `pip`:\n\n```bash\npip install re_mocd\n```\n\n#### Simple Example (Python)\n\nHere's a simple example of how to use the library in Python, the function return a dict of the partition found:\n\n```python\nimport re_mocd\n\nedgelist_file = \"res/graphs/artificials/article.edgelist\"\npartition = re_mocd.run(edgelist_file)\n```\n\nYou can see an [example of plotting](res/example.py), or an example of how to [make comparisons](res/example.py) with other algorithms in `res/`.\n\n<center>\n\n![Example Plot](res/example.png)\n\n</center>\n\n### Running from Scratch\n\n#### Build and Run\n\n1. Clone the repository and navigate to the project folder:\n ```bash\n git clone https://github.com/0l1ve1r4/re_mocd\n cd re_mocd\n ```\n\n2. Compile and run the algorithm with your edge list file:\n ```bash\n cargo run --release mygraph.edgelist\n ```\n\n#### Debug Mode\n\nTo run the algorithm in debug mode, use the `-d` flag:\n```bash\ncargo run --release mygraph.edgelist -d\n```\n\nThis will provide additional debug output, useful for troubleshooting and monitoring the algorithm's progress.\n",
"bugtrack_url": null,
"license": "GPL-3.0-or-later",
"summary": "Rapid multi-objective community detection with parallel computation and caching to efficiently handle large-scale graphs.",
"version": "0.1.0",
"project_urls": {
"Issues": "https://github.com/0l1ve1r4/re_mocd/issues",
"Repository": "https://github.com/0l1ve1r4/re_mocd"
},
"split_keywords": [
"rust",
" python",
" community detection",
" multi-objective optimization",
" graph analysis"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "d230dcdd520e99c7839592b62875540300189e0a2d19771967d8d722c2744a74",
"md5": "32839feaa5d99be4ae5798b27ad8f808",
"sha256": "c36bca8397e185d6a4107e27c47e704e70626b0c021ea0b3b7e22b01b7f8304c"
},
"downloads": -1,
"filename": "re_mocd-0.1.0-cp310-cp310-macosx_11_0_arm64.whl",
"has_sig": false,
"md5_digest": "32839feaa5d99be4ae5798b27ad8f808",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": null,
"size": 340453,
"upload_time": "2024-12-30T11:58:50",
"upload_time_iso_8601": "2024-12-30T11:58:50.084294Z",
"url": "https://files.pythonhosted.org/packages/d2/30/dcdd520e99c7839592b62875540300189e0a2d19771967d8d722c2744a74/re_mocd-0.1.0-cp310-cp310-macosx_11_0_arm64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "24c6c2b9188648d46280f507270c5301b3b337ab403df8cd3303b39591bc9144",
"md5": "5842b2c3cfff9cb475d13423b858d06a",
"sha256": "388bfbe6fff02624711a78942cadefe79345fc8a082ac7ec22e995df839fcc4e"
},
"downloads": -1,
"filename": "re_mocd-0.1.0-cp310-cp310-manylinux_2_34_x86_64.whl",
"has_sig": false,
"md5_digest": "5842b2c3cfff9cb475d13423b858d06a",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": null,
"size": 390363,
"upload_time": "2024-12-30T11:58:52",
"upload_time_iso_8601": "2024-12-30T11:58:52.792706Z",
"url": "https://files.pythonhosted.org/packages/24/c6/c2b9188648d46280f507270c5301b3b337ab403df8cd3303b39591bc9144/re_mocd-0.1.0-cp310-cp310-manylinux_2_34_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "fb26a99b0e67e3ebc2e95271e77d0f01491c43db5de3f47f093dd2ecbba689c7",
"md5": "ec0073db4e90303fbc4c8b3c7d4f4501",
"sha256": "54d652777146221f1982f0b8329c51352a7f33b886e4c6274e5ebdcb184b8b95"
},
"downloads": -1,
"filename": "re_mocd-0.1.0-cp310-cp310-win_amd64.whl",
"has_sig": false,
"md5_digest": "ec0073db4e90303fbc4c8b3c7d4f4501",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": null,
"size": 303720,
"upload_time": "2024-12-30T11:58:55",
"upload_time_iso_8601": "2024-12-30T11:58:55.276580Z",
"url": "https://files.pythonhosted.org/packages/fb/26/a99b0e67e3ebc2e95271e77d0f01491c43db5de3f47f093dd2ecbba689c7/re_mocd-0.1.0-cp310-cp310-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "762c9cbf28e498d861c955ceeb8b4f3804c45adf9bcc964569bba6acf119a2e5",
"md5": "cd510b50cee69b726a81955850497655",
"sha256": "3407dbb490f8a4f57d231f86e640d65e82ebfc68c2a68bb42fb8b76dc3b48c0c"
},
"downloads": -1,
"filename": "re_mocd-0.1.0-cp311-cp311-macosx_11_0_arm64.whl",
"has_sig": false,
"md5_digest": "cd510b50cee69b726a81955850497655",
"packagetype": "bdist_wheel",
"python_version": "cp311",
"requires_python": null,
"size": 340545,
"upload_time": "2024-12-30T11:58:56",
"upload_time_iso_8601": "2024-12-30T11:58:56.650443Z",
"url": "https://files.pythonhosted.org/packages/76/2c/9cbf28e498d861c955ceeb8b4f3804c45adf9bcc964569bba6acf119a2e5/re_mocd-0.1.0-cp311-cp311-macosx_11_0_arm64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "675fd755814d788193c16f069898991d0d183ca7cfecd62df02dfb494c74acb0",
"md5": "63af8fd0dc9c868583fb863492abe1f0",
"sha256": "7b0242efcfe262482aedad539c33783d78b79b3f5d20604e7f57de0a0602ba82"
},
"downloads": -1,
"filename": "re_mocd-0.1.0-cp311-cp311-manylinux_2_34_x86_64.whl",
"has_sig": false,
"md5_digest": "63af8fd0dc9c868583fb863492abe1f0",
"packagetype": "bdist_wheel",
"python_version": "cp311",
"requires_python": null,
"size": 390287,
"upload_time": "2024-12-30T11:58:57",
"upload_time_iso_8601": "2024-12-30T11:58:57.912290Z",
"url": "https://files.pythonhosted.org/packages/67/5f/d755814d788193c16f069898991d0d183ca7cfecd62df02dfb494c74acb0/re_mocd-0.1.0-cp311-cp311-manylinux_2_34_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "dd95f6c0229d8051779c2caae724eaec75a180308484001034359197ccdb1688",
"md5": "3f8f1c50b9d3c788b7b69110d5f7d546",
"sha256": "60fa6ec3b7bd95bf1a5017f3b450aa0894dffb978e914dcc1a71419b7364adef"
},
"downloads": -1,
"filename": "re_mocd-0.1.0-cp311-cp311-win_amd64.whl",
"has_sig": false,
"md5_digest": "3f8f1c50b9d3c788b7b69110d5f7d546",
"packagetype": "bdist_wheel",
"python_version": "cp311",
"requires_python": null,
"size": 303680,
"upload_time": "2024-12-30T11:59:00",
"upload_time_iso_8601": "2024-12-30T11:59:00.446083Z",
"url": "https://files.pythonhosted.org/packages/dd/95/f6c0229d8051779c2caae724eaec75a180308484001034359197ccdb1688/re_mocd-0.1.0-cp311-cp311-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "c50e7e2f2f7cf74ad6264ddea3aa61fbe9e3946485cffd50659ffcc33b255dfa",
"md5": "4e89bd12a5ef45b7f4612ddbae88191c",
"sha256": "5fdcd3bac08252a0e80af175902ca237994a44f818452dc41986cd689561f230"
},
"downloads": -1,
"filename": "re_mocd-0.1.0-cp312-cp312-macosx_11_0_arm64.whl",
"has_sig": false,
"md5_digest": "4e89bd12a5ef45b7f4612ddbae88191c",
"packagetype": "bdist_wheel",
"python_version": "cp312",
"requires_python": null,
"size": 339256,
"upload_time": "2024-12-30T11:59:02",
"upload_time_iso_8601": "2024-12-30T11:59:02.755937Z",
"url": "https://files.pythonhosted.org/packages/c5/0e/7e2f2f7cf74ad6264ddea3aa61fbe9e3946485cffd50659ffcc33b255dfa/re_mocd-0.1.0-cp312-cp312-macosx_11_0_arm64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "381226e23ba104e1bb3d47856b54344ce97535f311098cfc693cf07b6a50e849",
"md5": "33a35b49b5bfd31ee6ee95bb9a09c57b",
"sha256": "1ba47b9690de3eeb78f3beb2afd045886b297362ac9058134f427ea40f56bf6e"
},
"downloads": -1,
"filename": "re_mocd-0.1.0-cp312-cp312-manylinux_2_34_x86_64.whl",
"has_sig": false,
"md5_digest": "33a35b49b5bfd31ee6ee95bb9a09c57b",
"packagetype": "bdist_wheel",
"python_version": "cp312",
"requires_python": null,
"size": 390422,
"upload_time": "2024-12-30T11:59:05",
"upload_time_iso_8601": "2024-12-30T11:59:05.244731Z",
"url": "https://files.pythonhosted.org/packages/38/12/26e23ba104e1bb3d47856b54344ce97535f311098cfc693cf07b6a50e849/re_mocd-0.1.0-cp312-cp312-manylinux_2_34_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "790c4440a2cc6ff77b71c3c4524f3d30b5bd91be569220535072b2382ef49675",
"md5": "f2163573c5968019401b5310c27a179a",
"sha256": "69b5a1249546473438cf707619dc2e5b0517aabab5352d850a290efe0506e979"
},
"downloads": -1,
"filename": "re_mocd-0.1.0-cp312-cp312-win_amd64.whl",
"has_sig": false,
"md5_digest": "f2163573c5968019401b5310c27a179a",
"packagetype": "bdist_wheel",
"python_version": "cp312",
"requires_python": null,
"size": 303217,
"upload_time": "2024-12-30T11:59:06",
"upload_time_iso_8601": "2024-12-30T11:59:06.562840Z",
"url": "https://files.pythonhosted.org/packages/79/0c/4440a2cc6ff77b71c3c4524f3d30b5bd91be569220535072b2382ef49675/re_mocd-0.1.0-cp312-cp312-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "f0e3105c5fd602764cd6d784a1512225b69c12584e862622aeb03c940cdb39a7",
"md5": "d1e6492985ebea5dcd5890bbb47f3d6c",
"sha256": "3c3925a6563f57eca5803ffe875c4b48f4869410da8035fe4c3a566ba7f35215"
},
"downloads": -1,
"filename": "re_mocd-0.1.0-cp38-cp38-macosx_11_0_arm64.whl",
"has_sig": false,
"md5_digest": "d1e6492985ebea5dcd5890bbb47f3d6c",
"packagetype": "bdist_wheel",
"python_version": "cp38",
"requires_python": null,
"size": 340302,
"upload_time": "2024-12-30T11:59:09",
"upload_time_iso_8601": "2024-12-30T11:59:09.011506Z",
"url": "https://files.pythonhosted.org/packages/f0/e3/105c5fd602764cd6d784a1512225b69c12584e862622aeb03c940cdb39a7/re_mocd-0.1.0-cp38-cp38-macosx_11_0_arm64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "e61fcf3e042fc47ac493d3649e7478cb9473af58b1f0a0735e2d9bd82150c862",
"md5": "8db08341731080297b60ac3754f03bf8",
"sha256": "90486c46bdc41bf2a5cc9d989545d6a6a9fe82a6e15d9ff90061fbc8f733cf84"
},
"downloads": -1,
"filename": "re_mocd-0.1.0-cp38-cp38-manylinux_2_34_x86_64.whl",
"has_sig": false,
"md5_digest": "8db08341731080297b60ac3754f03bf8",
"packagetype": "bdist_wheel",
"python_version": "cp38",
"requires_python": null,
"size": 390048,
"upload_time": "2024-12-30T11:59:10",
"upload_time_iso_8601": "2024-12-30T11:59:10.256933Z",
"url": "https://files.pythonhosted.org/packages/e6/1f/cf3e042fc47ac493d3649e7478cb9473af58b1f0a0735e2d9bd82150c862/re_mocd-0.1.0-cp38-cp38-manylinux_2_34_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "eb08f78bb29c8cebc83590b21a4b9587e671cef42a79b323a923411d27b149ac",
"md5": "c3d1d8d43ddec0df3462fa02488c6e1b",
"sha256": "0aebf6e4c0e196f8ce1910a04417f72de521e06f372a07188a89596cc78e0792"
},
"downloads": -1,
"filename": "re_mocd-0.1.0-cp38-cp38-win_amd64.whl",
"has_sig": false,
"md5_digest": "c3d1d8d43ddec0df3462fa02488c6e1b",
"packagetype": "bdist_wheel",
"python_version": "cp38",
"requires_python": null,
"size": 303440,
"upload_time": "2024-12-30T11:59:13",
"upload_time_iso_8601": "2024-12-30T11:59:13.019734Z",
"url": "https://files.pythonhosted.org/packages/eb/08/f78bb29c8cebc83590b21a4b9587e671cef42a79b323a923411d27b149ac/re_mocd-0.1.0-cp38-cp38-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "57dbeb829b45970d3756d244cb946d6869f6ea803513a305400c2720a5079c68",
"md5": "2c05b7ff1079a9a8b06ab5cae523cdb1",
"sha256": "99738dad98239331362ec9825c74f3591701e1b6b875434b642dd96111b30e82"
},
"downloads": -1,
"filename": "re_mocd-0.1.0-cp39-cp39-macosx_11_0_arm64.whl",
"has_sig": false,
"md5_digest": "2c05b7ff1079a9a8b06ab5cae523cdb1",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": null,
"size": 340444,
"upload_time": "2024-12-30T11:59:17",
"upload_time_iso_8601": "2024-12-30T11:59:17.618838Z",
"url": "https://files.pythonhosted.org/packages/57/db/eb829b45970d3756d244cb946d6869f6ea803513a305400c2720a5079c68/re_mocd-0.1.0-cp39-cp39-macosx_11_0_arm64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "3eb56474d7051a07d0bab3bbf2e17b84f3b13b08105b5cae69e3982f2aef257a",
"md5": "e7e0d17d7a2b4a15a20ce7a0a66d7c6b",
"sha256": "ed4b495da32296cdf00b80efb7c91c1d806f05a9ccb1f2d2bac91f0803adf79e"
},
"downloads": -1,
"filename": "re_mocd-0.1.0-cp39-cp39-manylinux_2_34_x86_64.whl",
"has_sig": false,
"md5_digest": "e7e0d17d7a2b4a15a20ce7a0a66d7c6b",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": null,
"size": 390394,
"upload_time": "2024-12-30T11:59:19",
"upload_time_iso_8601": "2024-12-30T11:59:19.313074Z",
"url": "https://files.pythonhosted.org/packages/3e/b5/6474d7051a07d0bab3bbf2e17b84f3b13b08105b5cae69e3982f2aef257a/re_mocd-0.1.0-cp39-cp39-manylinux_2_34_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "afc7991e296045b34ee485b86aac33bcee70f731f61b0fac7a37f899f6dd4f43",
"md5": "b97d5518c8914b8c0e41bc490fccafcd",
"sha256": "29394c15283745e9b357582efe5581b5e233339be7fd977d428d679ae1d1cb4a"
},
"downloads": -1,
"filename": "re_mocd-0.1.0-cp39-cp39-win_amd64.whl",
"has_sig": false,
"md5_digest": "b97d5518c8914b8c0e41bc490fccafcd",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": null,
"size": 303712,
"upload_time": "2024-12-30T11:59:21",
"upload_time_iso_8601": "2024-12-30T11:59:21.790022Z",
"url": "https://files.pythonhosted.org/packages/af/c7/991e296045b34ee485b86aac33bcee70f731f61b0fac7a37f899f6dd4f43/re_mocd-0.1.0-cp39-cp39-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "4967c07a1a99b23006a23eef94be39beee5937dc68c39cb2f5d78c7439b22894",
"md5": "1de9db88b1b96be2aa59a5ba9ef853b9",
"sha256": "1ef8110ee8b8679e1440473b469926fe54b466645c35f952bc1c0462104f9f40"
},
"downloads": -1,
"filename": "re_mocd-0.1.0.tar.gz",
"has_sig": false,
"md5_digest": "1de9db88b1b96be2aa59a5ba9ef853b9",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 129961,
"upload_time": "2024-12-30T11:59:23",
"upload_time_iso_8601": "2024-12-30T11:59:23.321886Z",
"url": "https://files.pythonhosted.org/packages/49/67/c07a1a99b23006a23eef94be39beee5937dc68c39cb2f5d78c7439b22894/re_mocd-0.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-30 11:59:23",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "0l1ve1r4",
"github_project": "re_mocd",
"github_not_found": true,
"lcname": "re-mocd"
}