Skip to main content

An experimental parallel backend for NetworkX

Project description

nx-parallel

nx-parallel is a NetworkX backend plugin that uses joblib and multiprocessing for parallelization. This project aims to provide parallelized implementations of various NetworkX functions to improve performance.

Features

nx-parallel provides parallelized implementations for the following NetworkX functions:

├── centrality
│   ├── betweenness_centrality
│   ├── closeness_vitality
├── tournament
│   ├── is_reachable
├── efficiency_measures
│   ├── local_efficiency

alt text

See the /timing folder for more heatmaps and code for heatmap generation!

Development install

To setup a local development:

  • Fork this repository.
  • Clone the forked repository locally.
git clone git@github.com:<your_username>/networkx.git
  • Create a fresh conda/mamba virtualenv and install the dependencies
pip install -e ".[developer]"
  • Install pre-commit actions that will run the linters before making a commit
pre-commit install

Usage

Here's an example of how to use nx-parallel:

In [1]: import networkx as nx; import nx_parallel

In [2]: G = nx.path_graph(4)

In [3]: H = nx_parallel.ParallelGraph(G)

In [4]: nx.betweenness_centrality(H)
Out[4]: {0: 0.0, 1: 0.6666666666666666, 2: 0.6666666666666666, 3: 0.0}

Testing

To run tests for the project, use the following command:

PYTHONPATH=. \
NETWORKX_GRAPH_CONVERT=parallel \
NETWORKX_TEST_BACKEND=parallel \
NETWORKX_FALLBACK_TO_NX=True \
    pytest --pyargs networkx "$@"

Contributing

We'd love to have you contribute to nx-parallel! Here are some guidelines on how to do that:

  • Issues: Feel free to open issues for any problems you face, or for new features you'd like to see implemented.
  • Pull requests: If you'd like to implement a feature or fix a bug yourself, we'd be happy to review a pull request. Please make sure to explain the changes you made in the pull request description.

Additional Information

This project is part of the larger NetworkX project. If you're interested in contributing to NetworkX, you can find more information in the NetworkX contributing guidelines.

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

nx_parallel-0.1.tar.gz (376.7 kB view details)

Uploaded Source

Built Distribution

nx_parallel-0.1-py3-none-any.whl (10.7 kB view details)

Uploaded Python 3

File details

Details for the file nx_parallel-0.1.tar.gz.

File metadata

  • Download URL: nx_parallel-0.1.tar.gz
  • Upload date:
  • Size: 376.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for nx_parallel-0.1.tar.gz
Algorithm Hash digest
SHA256 36652fb7e077f58c04ad5ba5ad9e86297ca1ce49f84327114d8994ca54a19f1c
MD5 8accc9d30917a6d0bad1628e27df8521
BLAKE2b-256 23934d4616df4d4207e1cf9337362a508490e01c76ee44b32513fb0263fcb014

See more details on using hashes here.

File details

Details for the file nx_parallel-0.1-py3-none-any.whl.

File metadata

  • Download URL: nx_parallel-0.1-py3-none-any.whl
  • Upload date:
  • Size: 10.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for nx_parallel-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 91a04bd5fee55fb2fee0bc82ef4db23bd9670aab62bffdf468b88a4146f5d23a
MD5 cf900f6729df2315b524afde89ee8345
BLAKE2b-256 128f5e6bfc140070a7b4ddbbb5ad7d4f424065ffa414f0b575ad7bb3ccd43eae

See more details on using hashes here.

Supported by

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