skillfed

rustworkx

A High-Performance Graph Library for Python

rustworkx v0.18.1 8.0M downloads/30d#1,676 on PyPI1,738
Permissive license Apache-2.0 Active released

What it is and what it does

rustworkx is a graph library that wraps Rust graph algorithms in a Python interface, letting you build and analyze graphs—directed, undirected, weighted, or multigraphs—without leaving Python. It exposes graph types like PyGraph and PyDiGraph, plus algorithm functions like dijkstra_shortest_paths, all importable from a single module. The library runs on modern Python (3.10+) and comes with precompiled wheels for most platforms, so installation is typically a single pip command.

The package is designed for applications that need both ease of use and speed: it originated as a replacement for NetworkX in Qiskit's transpiler DAG but has grown into a general-purpose tool. You construct graphs by adding nodes and edges, then call algorithm functions to compute paths, detect cycles, or traverse the graph. Optional dependencies (matplotlib, graphviz, pillow) unlock visualization functions. It has no known vulnerabilities and is actively maintained.

Use it for:

  • Build and analyze directed acyclic graphs (DAGs) for compiler or workflow optimization tasks
  • Compute shortest paths and other graph algorithms on large networks where performance matters
  • Construct knowledge graphs or dependency networks for scientific computing or data analysis
  • Implement graph-based algorithms in quantum computing or circuit simulation workflows
  • Visualize graph structures using matplotlib or graphviz renderers for debugging or reporting

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

A high-performance graph library for Python, written in Rust, providing graph construction, traversal, and algorithm operations with a single import.

Yes. rustworkx is actively maintained, has no known vulnerabilities, and offers a permissive Apache-2.0 license. Install friction is moderate but manageable for common platforms thanks to precompiled wheels. It is worth installing if you need fast graph operations and can work with Python 3.10+; avoid it only if you are locked to older Python versions or a platform without precompiled binaries and cannot install Rust.

Install

rustworkx on PyPI

pip

pip install rustworkx

uv

uv add rustworkx

poetry

poetry add rustworkx

Installing rustworkx

Before you install

Medium install friction due to compiled Rust binaries, but precompiled wheels are available for common platforms (x86_64, aarch64, ppc64le, s390x Linux; x86_64 macOS; 32/64-bit Windows). Building from source requires Rust >= 1.85 and maturin >= 1.9. Active maintenance with a release 15 days ago.

License in practice

Apache-2.0 permissive license allows commercial and private use with minimal restrictions; attribution and license notice required.

Quickstart

pip install rustworkx
import rustworkx
graph = rustworkx.PyGraph()
a = graph.add_node("A")
b = graph.add_node("B")
graph.add_edges_from([(a, b, 1.5)])
rustworkx.dijkstra_shortest_paths(graph, a, b, weight_fn=float)

Requires Python >= 3.10. On platforms without precompiled binaries, building from source requires Rust >= 1.85 and cargo installed.

Verify before relying

  • Whether visualization modules (mpl_draw, graphviz_drawer) are production-ready or experimental
  • Performance benchmarks compared to NetworkX or other Python graph libraries
  • API stability guarantees or deprecation policy across minor versions

Package facts

License Apache-2.0 (permissive)
Python support supports the current Python release (>=3.10)
Install friction medium — platform-specific wheel
Runtime dependencies 1 — numpy
Maintenance actively maintained — 15 days since the last release
Last repo commit
First released
Downloads 7,974,860/month — #1,676 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: rustworkx-0.18.1-cp310-abi3-macosx_10_12_x86_64.whl; rustworkx-0.18.1-cp310-abi3-macosx_11_0_arm64.whl; rustworkx-0.18.1-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl; rustworkx-0.18.1-cp310-abi3-manylinux_2_28_aarch64.whl; rustworkx-0.18.1-cp310-abi3-manylinux_2_28_ppc64le.whl; rustworkx-0.18.1-cp310-abi3-manylinux_2_28_s390x.whl; rustworkx-0.18.1-cp310-abi3-musllinux_1_2_aarch64.whl; rustworkx-0.18.1-cp310-abi3-musllinux_1_2_x86_64.whl; rustworkx-0.18.1-cp310-abi3-pyemscripten_2026_0_wasm32.whl; rustworkx-0.18.1-cp310-abi3-win32.whl; rustworkx-0.18.1-cp310-abi3-win_amd64.whl; rustworkx-0.18.1-cp314-cp314t-macosx_10_15_x86_64.whl; rustworkx-0.18.1-cp314-cp314t-macosx_11_0_arm64.whl; rustworkx-0.18.1-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl; rustworkx-0.18.1-cp314-cp314t-manylinux_2_28_aarch64.whl; rustworkx-0.18.1-cp314-cp314t-manylinux_2_28_ppc64le.whl; rustworkx-0.18.1-cp314-cp314t-musllinux_1_2_aarch64.whl; rustworkx-0.18.1-cp314-cp314t-musllinux_1_2_x86_64.whl

Keywords: Networks, Network, Graph, Graph Theory, DAG

Intended Audience :: DevelopersIntended Audience :: Science/ResearchOperating System :: MacOS :: MacOS XOperating System :: Microsoft :: WindowsOperating System :: POSIX :: LinuxProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Rust

Tags

graph library pythonnetwork algorithmsdirected acyclic graphshortest path algorithmgraph traversalhigh-performance graphDAG implementation
graph-algorithmsrust-backedperformance-critical

More Mathematics packages