Skip to main content

Rapid multi-objective community detection with parallel computation and caching to efficiently handle large-scale graphs. With networkx compatibilityy

Project description

logo

rapid evolutionary multi-objective community detection

PyPI - Implementation PyPI - Python Version PyPI - Downloads PyPI - Stats


[!NOTE]
This project is in its early stages. Performance and results may not be optimal yet.

Overview

re-mocd is a Rust-based library designed for efficient and high-performance community detection in graphs. By leveraging the speed and memory safety of Rust, the project aims to handle large-scale graphs while addressing limitations in traditional algorithms, such as Louvain.


Installation

Via PyPI

Install the library using pip:

pip install re-mocd

Usage

From networkx.Graph()

Using re-mocd with a networkx.Graph() is simple. For example:

import networkx as nx 
import re_mocd

# Create a graph
G = nx.Graph([
    (0, 1), (0, 3), (0, 7), 
    (1, 2), (1, 3), (1, 5), 
    (2, 3), 
    (3, 6), 
    (4, 5), (4, 6), 
    (5, 6), 
    (7, 8)
])

# Detect communities
partition = re_mocd.fast(G)

# You can also use a PESA-II method (experimental)
partition = re_mocd.from_nx(G)

# Check modularity
mod = re_mocd.get_modularity(G, partition)

From an Edge List File

Prepare an edge list file formatted as:

0,1,{'weight': 4}
0,2,{'weight': 5}
0,3,{'weight': 3}
...
0,10,{'weight': 2}

The weight attribute is optional and can be omitted ({}). Save your networkx graph as an edge list:

nx.write_edgelist(G, file_path, delimiter=",", data=False)

Run the algorithm:

import re_mocd

edgelist_file = "my.edgelist"
partition = re_mocd.from_file(edgelist_file)

Examples


Example Plot

Running from Scratch

Build and Run

  1. Clone the repository:

    git clone https://github.com/0l1ve1r4/re_mocd
    cd re_mocd
    
  2. Compile and execute the algorithm:

    cargo run --release mygraph.edgelist
    

Debug Mode

Use the -d flag for additional debug output:

cargo run --release mygraph.edgelist -d

Debug mode helps troubleshoot and monitor the algorithm's progress effectively.


Contributing

Contributions are welcome! Feel free to submit issues, feature requests, or pull requests to improve the project.

License: GPL-3.0 or later
Author: Guilherme Santos

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

re_mocd-0.1.2.tar.gz (262.9 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

re_mocd-0.1.2-cp312-cp312-win_amd64.whl (327.5 kB view details)

Uploaded CPython 3.12Windows x86-64

re_mocd-0.1.2-cp312-cp312-manylinux_2_34_x86_64.whl (414.0 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

re_mocd-0.1.2-cp312-cp312-macosx_11_0_arm64.whl (362.6 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

re_mocd-0.1.2-cp311-cp311-win_amd64.whl (328.9 kB view details)

Uploaded CPython 3.11Windows x86-64

re_mocd-0.1.2-cp311-cp311-manylinux_2_34_x86_64.whl (414.4 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ x86-64

re_mocd-0.1.2-cp311-cp311-macosx_11_0_arm64.whl (363.9 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

re_mocd-0.1.2-cp310-cp310-win_amd64.whl (328.8 kB view details)

Uploaded CPython 3.10Windows x86-64

re_mocd-0.1.2-cp310-cp310-manylinux_2_34_x86_64.whl (414.4 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.34+ x86-64

re_mocd-0.1.2-cp310-cp310-macosx_11_0_arm64.whl (363.8 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

re_mocd-0.1.2-cp39-cp39-win_amd64.whl (329.3 kB view details)

Uploaded CPython 3.9Windows x86-64

re_mocd-0.1.2-cp39-cp39-manylinux_2_34_x86_64.whl (415.1 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.34+ x86-64

re_mocd-0.1.2-cp39-cp39-macosx_11_0_arm64.whl (364.1 kB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

re_mocd-0.1.2-cp38-cp38-win_amd64.whl (329.0 kB view details)

Uploaded CPython 3.8Windows x86-64

re_mocd-0.1.2-cp38-cp38-manylinux_2_34_x86_64.whl (414.8 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.34+ x86-64

re_mocd-0.1.2-cp38-cp38-macosx_11_0_arm64.whl (364.1 kB view details)

Uploaded CPython 3.8macOS 11.0+ ARM64

File details

Details for the file re_mocd-0.1.2.tar.gz.

File metadata

  • Download URL: re_mocd-0.1.2.tar.gz
  • Upload date:
  • Size: 262.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.9.20

File hashes

Hashes for re_mocd-0.1.2.tar.gz
Algorithm Hash digest
SHA256 5788450ece26772430ff4d227c10718a89571bd48b20071c16dfb8e1f96f6f03
MD5 f31325f375e765d99bfd8ae7bfcdf8ca
BLAKE2b-256 7932f193895e5c9599d342fcd205d8a461ccc3aa510fe3d9ad422cce591728a5

See more details on using hashes here.

File details

Details for the file re_mocd-0.1.2-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: re_mocd-0.1.2-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 327.5 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.9.20

File hashes

Hashes for re_mocd-0.1.2-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 013252acaf80e2f2492350a0026683050e10e8b6c79f6918dd71a3615050e9f7
MD5 b2ae0e652f873ac51b5af470babd9c68
BLAKE2b-256 b033998caae6f36d2af56a119bde0e2007219f546bc4ef95bc84a8e42b7a9be2

See more details on using hashes here.

File details

Details for the file re_mocd-0.1.2-cp312-cp312-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for re_mocd-0.1.2-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 3c5fa87d9eee77b42b96cea44ce94e2570a7dd36878173a561521b3e14c58017
MD5 e2ce8f1bd021f42920fb644eb50071dc
BLAKE2b-256 2b2a16b201ddce38dd7685f0144ac10c60cf3646a5b101c45385ca99b52fd705

See more details on using hashes here.

File details

Details for the file re_mocd-0.1.2-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for re_mocd-0.1.2-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c704eba83a417e7e933760466693833b80b47e99459ca1b4240cfc82cafa742b
MD5 d392271442422c44e5b698303873e823
BLAKE2b-256 faacbf463c73388b63e11457bce81652490231ca3b9c4ff2185dd784f2226438

See more details on using hashes here.

File details

Details for the file re_mocd-0.1.2-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: re_mocd-0.1.2-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 328.9 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.9.20

File hashes

Hashes for re_mocd-0.1.2-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 04269911dd783a8997b3fdd0175100c054d73ea8ac7ea3b22682244cabd264d0
MD5 59585f28331c7c2ce949ff15a73f992f
BLAKE2b-256 8d7510c9fcba3b46f60ceac28419e03de83cdd75291fd24edc5e3c9e6622ffa7

See more details on using hashes here.

File details

Details for the file re_mocd-0.1.2-cp311-cp311-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for re_mocd-0.1.2-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 101e9846bfe0220aa3aa6963ca071f7836fdf91daf0966cc1021c4a658e637ac
MD5 8218c5c343f962f0840fd9b27d4b4e8d
BLAKE2b-256 163c3dc1dd81d06e1c8fde6ca9a7f8eb7c51a31587a3bad1d28aea18143fc825

See more details on using hashes here.

File details

Details for the file re_mocd-0.1.2-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for re_mocd-0.1.2-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b11007b038c4d4941cd7fe26193d49cdaf39c94adb525b0f0e992bca97d389ed
MD5 a7fdfd2e96f51d41b412bcb002a8a5d6
BLAKE2b-256 ed5f15e3cbd8c825b788b455bfa010abf7dc2b4e11a746a60ea7edda352faffc

See more details on using hashes here.

File details

Details for the file re_mocd-0.1.2-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: re_mocd-0.1.2-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 328.8 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.9.20

File hashes

Hashes for re_mocd-0.1.2-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 cdcb670352e5bffaeebd8b347696ab07df0734c6b3133426c8f123e1eb8b7227
MD5 d8346d14dd4fc15cd6f4a4e3502e7e60
BLAKE2b-256 54f0bb3c5e318fef4faf42498c3fe080283fdccf763f35394ae96fc39906337a

See more details on using hashes here.

File details

Details for the file re_mocd-0.1.2-cp310-cp310-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for re_mocd-0.1.2-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 9d0b31c4b730f08ae4cd428d358504008cc0bdd0cd2df72cdde3886fbe27201b
MD5 51cae188bfe99a047858a136544720a0
BLAKE2b-256 65dfcaef8c0e15cc2308ed6846caaa650d9fead25189fc9e59d462209654bb94

See more details on using hashes here.

File details

Details for the file re_mocd-0.1.2-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for re_mocd-0.1.2-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7e77e340dd64a2114aea85e4eb6154f1328e845e0ef2b1bcd0569b497fd92819
MD5 9d2e1e08de028e468145730bb03f54c8
BLAKE2b-256 c365bee6180bab8cb993c3579cc8121bc7ee5460a242570cd69ba55403c44670

See more details on using hashes here.

File details

Details for the file re_mocd-0.1.2-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: re_mocd-0.1.2-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 329.3 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.9.20

File hashes

Hashes for re_mocd-0.1.2-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 8a6d5d85f5439924cc8aa5921dd0af49bc2d75008938a782a9b7d878c227496b
MD5 dfc5704771880c391beef6179db74d50
BLAKE2b-256 e1c09ac9835ba1a3a6d86a1d0cc6b82049bc3307e70d7c73733b93c15b908667

See more details on using hashes here.

File details

Details for the file re_mocd-0.1.2-cp39-cp39-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for re_mocd-0.1.2-cp39-cp39-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 f99989cb98a64aa6f6ac51f7491a687a29dc9282876eb3c0229af9dabc4219d2
MD5 c3df37e0473bf0cc0e897a6a0db80904
BLAKE2b-256 c63eec4022a57077e0501998edde5bbd90fefcee8569f26c3b8a0b41cf9d0b1e

See more details on using hashes here.

File details

Details for the file re_mocd-0.1.2-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for re_mocd-0.1.2-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6d39e1cae4824736fc5af84049a698f27768c9af9cb51aeb7827e220d6ec8eb9
MD5 e100e95bbb04d13acd75996a341007e7
BLAKE2b-256 0e59c973d666c637e04c46f773ef10f0eedc1dd127195915b1b59241e9accd9b

See more details on using hashes here.

File details

Details for the file re_mocd-0.1.2-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: re_mocd-0.1.2-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 329.0 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.9.20

File hashes

Hashes for re_mocd-0.1.2-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 3f7b0cad85526f51e695b8e613998c8e3a485c952680229d9fa9b24a956ff94d
MD5 7e81dbb520cc7e2e7b01f034b442873f
BLAKE2b-256 225605e8827f58c73cea1462855b879db2900d04223f7c47d8ec4bc6346cb6cb

See more details on using hashes here.

File details

Details for the file re_mocd-0.1.2-cp38-cp38-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for re_mocd-0.1.2-cp38-cp38-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 d70aaef161f1563adbbc151fd0a8b321cd892cca78880f5fe1c92ca23edb8d43
MD5 7a90d28d271f58defa4abc5e376be33a
BLAKE2b-256 862724f9f1de09e738fa775cc398c9bbc527cc11a1b49b05aaa6620796348db9

See more details on using hashes here.

File details

Details for the file re_mocd-0.1.2-cp38-cp38-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for re_mocd-0.1.2-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 912d058db22fb77d2b4fe07daf57f5989e5569aa226048a5fd4ba0b571d4459b
MD5 999665c4d7e3f7aff3e6d4e8c51a2dda
BLAKE2b-256 a6e5a905da38d87f46096659eaf9747ecc9ae428bade1d36c6460aa5f4e8d6ab

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page