skillfed

retworkx

A High-Performance Graph Library for Python

retworkx v0.17.1 98.9K downloads/30d#13,053 on PyPI1,738
Permissive license Apache-2.0 Active released

What it is and what it does

retworkx is the deprecated package name for rustworkx, a high-performance graph library for Python implemented in Rust. It provides graph data structures (directed and undirected) and a suite of graph algorithms including shortest-path calculations, traversals, and other network operations. The package is designed for performance and is suitable for applications ranging from quantum computing transpilers to general network analysis.

The package has been retired in favor of rustworkx, which is described as a drop-in replacement. Users installing retworkx will actually get rustworkx as its runtime dependency. The library supports Python 3.9 through 3.13 and offers optional visualization modules via matplotlib or graphviz when those dependencies are installed separately.

Use it for:

  • Computing shortest paths and other algorithms on directed or undirected graphs
  • Building and manipulating network structures for quantum computing transpilers or DAG-based workflows
  • Analyzing network topology and connectivity in scientific or research applications
  • Visualizing graphs using matplotlib or graphviz integration when optional dependencies are present

Worth the install?

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

A deprecated package name for rustworkx, a high-performance graph library written in Rust that provides graph data structures and algorithms for Python.

No—retworkx is deprecated and retired. Install rustworkx instead, which is the active successor and is described as a drop-in replacement. The fact sheet itself recommends rustworkx over retworkx. If you are already using retworkx, migration to rustworkx is the appropriate path forward.

Install

retworkx on PyPI

pip

pip install retworkx

uv

uv add retworkx

poetry

poetry add retworkx

Installing retworkx

Before you install

Low install friction with precompiled wheels available for common platforms. Active maintenance with last commit on 2026-08-07. However, this is the deprecated package name; rustworkx is the actively maintained successor and recommended replacement.

License in practice

Licensed under Apache-2.0 (permissive), allowing commercial and private use with minimal restrictions.

Quickstart

pip install retworkx

import rustworkx

graph = rustworkx.PyGraph()
a = graph.add_node("A")
b = graph.add_node("B")
graph.add_edges_from([(a, b, 1.5)])

Requires Python >= 3.9. Building from source requires Rust >= 1.79 and cargo. Precompiled binaries available for x86_64, i686, ppc64le, s390x, aarch64 Linux; x86_64 macOS; and 32/64-bit Windows.

Verify before relying

  • Whether retworkx will continue to receive security updates or if users must migrate to rustworkx immediately
  • Exact compatibility guarantees between retworkx 0.17.1 and rustworkx as a drop-in replacement

Package facts

License Apache-2.0 (permissive)
Python support supports the current Python release (>=3.9)
Install friction low — pure-Python wheel
Runtime dependencies 1 — rustworkx
Maintenance actively maintained — 333 days since the last release
Last repo commit
First released
Downloads 98,881/month — #13,053 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: retworkx-0.17.1-py3-none-any.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.9Programming Language :: Rust

Tags

graph library pythonnetwork algorithmsdirected acyclic graphshortest path algorithmgraph data structurehigh-performance graphrust graph library
graph-algorithmsrust-bindingdeprecated

More Scientific/Engineering packages