--- id: rustworkx version: "0.18.1" license: Apache-2.0 license_treatment: permissive maintenance: active --- # rustworkx — A High-Performance Graph Library for Python License: permissive · Maintenance: active · Downloads: 8.0M/mo ## 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 above — 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 pip install rustworkx uv add rustworkx 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_current - Install friction: medium - Maintenance: active - Downloads: 8.0M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags graph library python, network algorithms, directed acyclic graph, shortest path algorithm, graph traversal, high-performance graph, DAG implementation, graph-algorithms, rust-backed, performance-critical [View on SkillFed](https://skillfed.io/packages/rustworkx) · [View on PyPI](https://pypi.org/project/rustworkx/)