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.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_edglist(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.1.tar.gz (256.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.1-cp312-cp312-win_amd64.whl (299.8 kB view details)

Uploaded CPython 3.12Windows x86-64

re_mocd-0.1.1-cp312-cp312-manylinux_2_34_x86_64.whl (387.1 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

re_mocd-0.1.1-cp312-cp312-macosx_11_0_arm64.whl (335.9 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

re_mocd-0.1.1-cp311-cp311-win_amd64.whl (299.9 kB view details)

Uploaded CPython 3.11Windows x86-64

re_mocd-0.1.1-cp311-cp311-manylinux_2_34_x86_64.whl (386.3 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ x86-64

re_mocd-0.1.1-cp311-cp311-macosx_11_0_arm64.whl (337.3 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

re_mocd-0.1.1-cp310-cp310-win_amd64.whl (299.9 kB view details)

Uploaded CPython 3.10Windows x86-64

re_mocd-0.1.1-cp310-cp310-manylinux_2_34_x86_64.whl (386.4 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.34+ x86-64

re_mocd-0.1.1-cp310-cp310-macosx_11_0_arm64.whl (337.2 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

re_mocd-0.1.1-cp39-cp39-win_amd64.whl (300.5 kB view details)

Uploaded CPython 3.9Windows x86-64

re_mocd-0.1.1-cp39-cp39-manylinux_2_34_x86_64.whl (387.1 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.34+ x86-64

re_mocd-0.1.1-cp39-cp39-macosx_11_0_arm64.whl (337.6 kB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

re_mocd-0.1.1-cp38-cp38-win_amd64.whl (300.4 kB view details)

Uploaded CPython 3.8Windows x86-64

re_mocd-0.1.1-cp38-cp38-manylinux_2_34_x86_64.whl (386.6 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.34+ x86-64

re_mocd-0.1.1-cp38-cp38-macosx_11_0_arm64.whl (337.4 kB view details)

Uploaded CPython 3.8macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: re_mocd-0.1.1.tar.gz
  • Upload date:
  • Size: 256.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.1.tar.gz
Algorithm Hash digest
SHA256 02b507d917ebbf360f76667c58641fa32247ebcc5943cfdd750c39ab08e95ab0
MD5 df755fe9be1e2a094fb09d049a829d4f
BLAKE2b-256 7943306de013c9c61f1dcc8a6594f1e4836bafda001548e582b330b5916c3fb8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: re_mocd-0.1.1-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 299.8 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.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 4d8a60b71e4de319351ad832362d4a0e386fc4f168a6bc46afb5332dfcecc3d6
MD5 8705bee351e7c297efb5aeb3bdd03607
BLAKE2b-256 28be33c6720fe6aa452c71816bbe0b36a639927d9feb5b5f51c6f6cb1e23401f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for re_mocd-0.1.1-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 405f6c9b45de7a2215dbf0a1f5979e3c07193dd532dcb5b5350dda484cd11fb7
MD5 6320e92a6987df86c07d33fcafc2a3d3
BLAKE2b-256 18ebad3a4275bfdd10ff036daf590191f623f00ffa5ac169b3382fd5d452044e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for re_mocd-0.1.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f2dc97a5d55232989be6bc04c78f16e781a795b3f08898b52da614c9073b7723
MD5 7ecb556f8602b3c65365142357f52055
BLAKE2b-256 23b1dae8811140e0e427f3eab2bb7352d5b4a1836b1f576b7dc794e8c7158731

See more details on using hashes here.

File details

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

File metadata

  • Download URL: re_mocd-0.1.1-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 299.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.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 f414ea7e903b8f685dfa06d71ff0a989830cef1c4fa03f48c36efca6cf0d01b9
MD5 f5a10b1400c582cfc4867dfd51e2c60f
BLAKE2b-256 a7ec05fca03f123d3339aa84f17e48373e883699cb5292defef25b91b688c4d6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for re_mocd-0.1.1-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 5946277926e8d2e02a0dc46c1763be542b3630ada910de417fbe778c092e661f
MD5 664904ec4836f1392bb779b00a1e4352
BLAKE2b-256 f62dff8a5d5e3cdc7c4d8f64f05aa4be55b969deea3766f0049ee5dcba79c2c8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for re_mocd-0.1.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 653446cf30ed2fb0a9cb89dc8b76637c7caa2c16e94feaf9d12c6d8d23a3e89a
MD5 c174d4dcc9b8e25d01e4ce7a31909446
BLAKE2b-256 c01811e22e0afa7556233585ca9cf80bb9a14910061326f9442f4d0dcbfe230c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: re_mocd-0.1.1-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 299.9 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.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 ee5306fd06e6f4f6f4c981eb58e588c1b915fe95e3a2fd19735e305ef987bb3d
MD5 ae5195ee7d31d9986dec480dfa79283f
BLAKE2b-256 5e0d68cd376e04df7c9639b12633257c590c26f16aa3aacc433de58ff7e8822b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for re_mocd-0.1.1-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 936caa84e8977aa3add0d0b065f5cbc178216a08a64e803e74af8396b2ae8a23
MD5 46090d7973c8f24ad156320a11efc161
BLAKE2b-256 d73d87cf1f894dd50c008059411a70aece29997f3bf5ad95d40afb55c71643a2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for re_mocd-0.1.1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 55f26cef10dc3a9dd5c7be1af972c39cfbf495472bc54e564c706ce3a456f15f
MD5 88b406a7a1f1871375c9084e0e29d358
BLAKE2b-256 05b454918330449e1d4b6c0c504635de98ed55b8bcb3f29330f4793270bcdff2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: re_mocd-0.1.1-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 300.5 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.1-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 42f5f1f8bfcf06477cfdfefde4be6ee4550346c63c2882fa1a22f6888f666c33
MD5 e8a60cd2358eb536220a651e93debb6f
BLAKE2b-256 23aa40614abb7833a527b9bbed94854f8fbbab085d4c7d74d7d8751e1955a20d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for re_mocd-0.1.1-cp39-cp39-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 26951ae457153fc55b57101b81d0e865ad6af31d3458f7efbae20a30986a74b8
MD5 dc82cb9ecb236e559f231ee9d592393a
BLAKE2b-256 96f15a07138965ca4c49922da15ba57915a2df2968195ec152eba1c1b543a29c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for re_mocd-0.1.1-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 23e7aea8a762929d367158e0c6f79358b0d990ddf66d420a479224c4a49db310
MD5 130488a5f9c149d1fe401946299e1287
BLAKE2b-256 9eb2877f3a58768128e21f8acf60b5599ced57c9138531ea343c8a4d305ea52c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: re_mocd-0.1.1-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 300.4 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.1-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 22868f91cb0425762f1b6eb3382535299e85c0a670d0191d19bfdeaa9d81a434
MD5 1bdf734c2e1fb4d8f655882f85c74d74
BLAKE2b-256 ee45e22d6e8ce0d5221ebb5ed95867eebb9893122326fa6e497f760d816bafe7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for re_mocd-0.1.1-cp38-cp38-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 c33c2b81b38a49e9efb900759f55724834b65f8ec8f63ca20096560a97ad93a9
MD5 955d7b9980bf6d59f676b6a533c93d3f
BLAKE2b-256 dfad2a866a675fb7b7bdf08ac388e6207a08c044d92ea5c20e112b3da5d49535

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for re_mocd-0.1.1-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4741dd804a4655845399f4a7ac42080ffc4962b05dab42059e8064b6fc662861
MD5 f70ec08c0ae2cd5f2e513fdc920262b0
BLAKE2b-256 3c9b8766ef89376e6c357f23373c19f74138ce9278279c1c7374ddc8e0658df3

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