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 from a networkx.Graph()
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.2.0.tar.gz (269.1 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.2.0-cp312-cp312-win_amd64.whl (326.0 kB view details)

Uploaded CPython 3.12Windows x86-64

re_mocd-0.2.0-cp312-cp312-manylinux_2_34_x86_64.whl (415.9 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

re_mocd-0.2.0-cp312-cp312-macosx_11_0_arm64.whl (363.8 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

re_mocd-0.2.0-cp311-cp311-win_amd64.whl (326.4 kB view details)

Uploaded CPython 3.11Windows x86-64

re_mocd-0.2.0-cp311-cp311-manylinux_2_34_x86_64.whl (416.3 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ x86-64

re_mocd-0.2.0-cp311-cp311-macosx_11_0_arm64.whl (364.6 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

re_mocd-0.2.0-cp310-cp310-win_amd64.whl (326.4 kB view details)

Uploaded CPython 3.10Windows x86-64

re_mocd-0.2.0-cp310-cp310-manylinux_2_34_x86_64.whl (416.3 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.34+ x86-64

re_mocd-0.2.0-cp310-cp310-macosx_11_0_arm64.whl (364.4 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

re_mocd-0.2.0-cp39-cp39-win_amd64.whl (326.8 kB view details)

Uploaded CPython 3.9Windows x86-64

re_mocd-0.2.0-cp39-cp39-manylinux_2_34_x86_64.whl (416.7 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.34+ x86-64

re_mocd-0.2.0-cp39-cp39-macosx_11_0_arm64.whl (364.7 kB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

re_mocd-0.2.0-cp38-cp38-win_amd64.whl (326.5 kB view details)

Uploaded CPython 3.8Windows x86-64

re_mocd-0.2.0-cp38-cp38-manylinux_2_34_x86_64.whl (416.3 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.34+ x86-64

re_mocd-0.2.0-cp38-cp38-macosx_11_0_arm64.whl (364.4 kB view details)

Uploaded CPython 3.8macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: re_mocd-0.2.0.tar.gz
  • Upload date:
  • Size: 269.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.21

File hashes

Hashes for re_mocd-0.2.0.tar.gz
Algorithm Hash digest
SHA256 6c2241a429a7524d88fe62ada3d3835190d1fc8271dc4c8bb61944e2e14432cd
MD5 7aba4db3e6ff0c2a648a5465a5748625
BLAKE2b-256 d9f1d63c4c5ea10defbedf787aebe57783b96b3c21ef22847787eb51b3b33777

See more details on using hashes here.

File details

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

File metadata

  • Download URL: re_mocd-0.2.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 326.0 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.21

File hashes

Hashes for re_mocd-0.2.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 f08091768cafe9219bc79b189fdf77724bca9ed22a62ab46fb385ff9357c8744
MD5 a151424a649fdcad77514aef3f2b1014
BLAKE2b-256 534bd84f4e8429e3d7479e83d796f07141c8092a4cc5c8d7fc4ccc3b36f96ede

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for re_mocd-0.2.0-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 64e560b1133179cbc359d3d3934d116b618c224c2faf36631bffee2bc6795581
MD5 649835949e74e3b8d53230788d8ae41e
BLAKE2b-256 ff79502ba9ab5a28ac43dd4aa99d51703fda6a2e662f73ce70fc0efcceadf82a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for re_mocd-0.2.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a722456889bece414c6d07f7f98551f0752f3388122b162957bc4b750382bd47
MD5 162d35e5cc06b917c317cf5f783e6932
BLAKE2b-256 398264ffb8febb8d7aff16430ff81b3ec4359c30b759dbd42cebdc10322db572

See more details on using hashes here.

File details

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

File metadata

  • Download URL: re_mocd-0.2.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 326.4 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.21

File hashes

Hashes for re_mocd-0.2.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 8992fc69e24537c5235bc380ce570094ef3edc1c2d86ae4d03d14c8219343eb1
MD5 1990af93f2f6700f0dd3d540038ccec5
BLAKE2b-256 2ada0b3444d112cd224768c3ec8ee91ee3a4ab8c91a589f00b901eebaa693c5e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for re_mocd-0.2.0-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 e9ec6359dffe26ef9dc743375e8f34015df9a8ae0c9fdd248b3be518493997b2
MD5 d7d71fe0b28439709d89ef20e21ab493
BLAKE2b-256 650b7e5a76a9c95b188ca1afea4e05880fe022da48dcd9e9865e40cd88c99ba1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for re_mocd-0.2.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6f96b4363313dc5a3f6b51bb5a90291008885f9c4df81f619a8048b7d065ca72
MD5 44ef505a0dbcd8356c505697724370e2
BLAKE2b-256 cbf8a6c0c145e93baf9e4e92234a255b4b80558e4d8f17f1c99ab5b7df6b0201

See more details on using hashes here.

File details

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

File metadata

  • Download URL: re_mocd-0.2.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 326.4 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.21

File hashes

Hashes for re_mocd-0.2.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 64f12f76cd00d760645572f12a9e5e9af83c789d32e78d59c44fe99c8bc47abf
MD5 7f5f9cf7952b72f8dbb3c9f8cd7352e0
BLAKE2b-256 2cf2f756e0b64d22044fff71dd66066a55f74a22ebcf379a1d961e29e059548c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for re_mocd-0.2.0-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 3d0769d280c45e60023a7834f17574640aa97dd96dcf33b599c25d23b95a9016
MD5 237891eed1e6584cbbd1e357266186f3
BLAKE2b-256 4e6ea56c975fc341a57f0281e6209c167bb971f89f5a29e64f4ce90edf094de0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for re_mocd-0.2.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 218feac49436676201ec208991fb8faae21c41f0feae8d37b0272e1e7d9107f8
MD5 365892cb9a8ad1f19a8f8ac460482d4e
BLAKE2b-256 08fa3c38b02ee99a6abf1d844486d2286fd87b012f67f309e30c1d99658fbc4a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: re_mocd-0.2.0-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 326.8 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.21

File hashes

Hashes for re_mocd-0.2.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 4b10ff1e5caeb53d3ee51afe9e860174fe740a73b931346c0e5fd9d6bf37f864
MD5 88846c95b606ac9e9989995246dfc73f
BLAKE2b-256 d1e18cb578f3dfced81e1b1bd9dfcc7220460523bd4c49428e0ca423ff15a14f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for re_mocd-0.2.0-cp39-cp39-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 d3d5dd7a3104c8aaf16e04679c811370ded43e5001bee6342e91ace487c3a34e
MD5 da5aa5d378b34c33175996eea4875d5b
BLAKE2b-256 080aba5a35f077850ef3a2246a34376f90fac306aa747ce4c447370d28725a49

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for re_mocd-0.2.0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8cfd184c148c19e3116fe3b9e693d76c7bd94d154486da635925466017044be3
MD5 0b805281552acc01464c536b2e55c984
BLAKE2b-256 d45592e8b234b5e526091014a5ddf6efbef3b2f77288e011ac100c7856627f88

See more details on using hashes here.

File details

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

File metadata

  • Download URL: re_mocd-0.2.0-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 326.5 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.21

File hashes

Hashes for re_mocd-0.2.0-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 f16fea137d249d3af06ffeb3ecc5d7578b7c5b90248fbb5b27e7d6d24561de4c
MD5 4b61d180a1068621861db8222e8950b2
BLAKE2b-256 a8a217b89e2aa0f246352df351a1889775edf7b17d9d39f2dd66365ff3364884

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for re_mocd-0.2.0-cp38-cp38-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 a46124cd1d9da5cbcd086b6e95404f543d4760b7484a2daf2e4f8dcbede8f0ef
MD5 8396570d78ee0585679e4ab03d8b6787
BLAKE2b-256 397fb8f4f5ec67b43ce95661201edaf76f8b3a1aaa5458ba94f191b10fb45457

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for re_mocd-0.2.0-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 06703fbb3a1de4a074ba694194a8b0c892ee4408769a323b68fe61a141081566
MD5 3bf5771b01afea2b518b10343f44357e
BLAKE2b-256 45262c3e2a52acc66bafe0409f2dd216dfc8e87b0accf05423b332c400dade77

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