nx-rustworkx
A NetworkX 3.x backend that accelerates selected graph algorithms with rustworkx.
Keep import networkx as nx. nx-rustworkx converts an nx.Graph, runs the
rustworkx kernel, and remaps the result to the original node IDs. Unsupported
calls stay on NetworkX.
Install
pip install nx-rustworkx
Requires Python 3.10+, NetworkX 3.4+, and rustworkx 0.18+.
Use
Set rustworkx as a preferred backend:
NETWORKX_BACKEND_PRIORITY=rustworkx python your_script.py
Or configure it in Python:
import networkx as nx
G = nx.erdos_renyi_graph(2_000, 0.01, seed=1)
nx.config.backend_priority = ["rustworkx"]
scores = nx.betweenness_centrality(G)
The backend implements 111 algorithms. Its measured cutoffs keep small or
conversion-heavy calls on NetworkX; backend="rustworkx" explicitly tries the
rustworkx implementation.
Generators such as nx.path_graph and nx.gnp_random_graph can construct
rustworkx-backed graphs directly, so whole pipelines skip conversion; the
usage guide covers enabling
generator dispatch.
Documentation
Usage, configuration, supported algorithms, caveats, and benchmarks: ville.dev/nx-rustworkx
Limits
- Simple graphs and digraphs only; no multigraphs.
- No custom weight callables.
- The rustworkx-backed graph object does not implement drawing or I/O.
- Some valid results may differ in ordering or floating-point rounding.
- Seeded random generators reproduce NetworkX's graphs unless
native_seeded_generatorsis enabled; the opt-in draws from rustworkx's RNG, so the same seed gives a different, equally valid graph.
The algorithm reference lists the exact behavior and fallback conditions.
Development
uv sync --extra test
uv run pytest tests
See the development guide for the full test, lint, benchmark, and architecture notes.
License
BSD-3-Clause.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nx_rustworkx-0.2.0.tar.gz.
File metadata
- Download URL: nx_rustworkx-0.2.0.tar.gz
- Upload date:
- Size: 67.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0150225e56a27e4311325f951152df84423dd91c906feff6df61094625b15e7d
|
|
| MD5 |
13ac3a3d68a11c38220392f6d9a2450c
|
|
| BLAKE2b-256 |
d9dbe07b6ed790d18ecdb500066d077015048f88f0d8c18f414ae6e8da183238
|
Provenance
The following attestation bundles were made for nx_rustworkx-0.2.0.tar.gz:
Publisher:
publish.yml on thevilledev/nx-rustworkx
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nx_rustworkx-0.2.0.tar.gz -
Subject digest:
0150225e56a27e4311325f951152df84423dd91c906feff6df61094625b15e7d - Sigstore transparency entry: 2571761472
- Sigstore integration time:
-
Permalink:
thevilledev/nx-rustworkx@1d2fd9a2884dce52b691ba61663b4722e1325cc3 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/thevilledev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@1d2fd9a2884dce52b691ba61663b4722e1325cc3 -
Trigger Event:
push
-
Statement type:
File details
Details for the file nx_rustworkx-0.2.0-py3-none-any.whl.
File metadata
- Download URL: nx_rustworkx-0.2.0-py3-none-any.whl
- Upload date:
- Size: 55.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a672db5ec69cc6158037b7e5ee19e80f05b026ceee0892287d4ae7dc46591fd2
|
|
| MD5 |
05ae3480282a5310cefa35e861b8f903
|
|
| BLAKE2b-256 |
2741e51247b87f822bcbf2de28cd52efe3622debed8566355f8857968c8b8d88
|
Provenance
The following attestation bundles were made for nx_rustworkx-0.2.0-py3-none-any.whl:
Publisher:
publish.yml on thevilledev/nx-rustworkx
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nx_rustworkx-0.2.0-py3-none-any.whl -
Subject digest:
a672db5ec69cc6158037b7e5ee19e80f05b026ceee0892287d4ae7dc46591fd2 - Sigstore transparency entry: 2571761507
- Sigstore integration time:
-
Permalink:
thevilledev/nx-rustworkx@1d2fd9a2884dce52b691ba61663b4722e1325cc3 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/thevilledev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@1d2fd9a2884dce52b691ba61663b4722e1325cc3 -
Trigger Event:
push
-
Statement type: