Skip to main content

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 93 algorithms. Its measured cutoffs keep small or conversion-heavy calls on NetworkX; backend="rustworkx" explicitly tries the rustworkx implementation.

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.

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

nx_rustworkx-0.1.1.tar.gz (45.2 kB view details)

Uploaded Source

Built Distribution

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

nx_rustworkx-0.1.1-py3-none-any.whl (40.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: nx_rustworkx-0.1.1.tar.gz
  • Upload date:
  • Size: 45.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for nx_rustworkx-0.1.1.tar.gz
Algorithm Hash digest
SHA256 a714b745e493404556859f510501ac2ef9c589e7e74a15a281c2c37fcb76f188
MD5 d8ddc2949d65dbf007082f7fabfb0802
BLAKE2b-256 b33e2d789adb3f531e4d0d995ceb74fa68338c4b31b5c7709512b0f10801752d

See more details on using hashes here.

Provenance

The following attestation bundles were made for nx_rustworkx-0.1.1.tar.gz:

Publisher: publish.yml on thevilledev/nx-rustworkx

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nx_rustworkx-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: nx_rustworkx-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 40.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for nx_rustworkx-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 45bb238d62284451b18e739010cc494fcb74acd863d82b7fdc31ee8d6babfd8d
MD5 39f257c31aa98ff8acde0e287efc42f8
BLAKE2b-256 e8398c8d381e7e14757f60daaad69f4657f2386994f9df8ff9523437d9cf8cc3

See more details on using hashes here.

Provenance

The following attestation bundles were made for nx_rustworkx-0.1.1-py3-none-any.whl:

Publisher: publish.yml on thevilledev/nx-rustworkx

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.2.1

2 files

0.2.0

2 files

This release

0.1.1 This release

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page