Guide/Start here
TL;DR
2 min readFrom the README
On this page 3
The Problem
NetworkX is the canonical Python graph library: rich, correct, comprehensive, and slow on anything that isn't toy-sized. Its pure-Python adjacency, Python-level inner loops, and per-call dict bookkeeping turn graph analytics over even modest graphs (10⁵–10⁶ nodes) into multi-minute affairs. Most "alternatives" pay for speed in compatibility: they expose a different API, change tie-break behavior, lose attribute fidelity, or drop entire algorithm families.
The Solution
FrankenNetworkX is a Rust port of NetworkX that treats observable behavior as a hard constraint. Graph mutation semantics, iteration order, tie-break choices, exception classes, error message wording, and serialization round-trip behavior are all part of the contract. Where pure-Python NetworkX would call dict[unhashable], FrankenNetworkX raises the same TypeError. Where NetworkX iterates a dict_keys in insertion order, FrankenNetworkX does too. Where NetworkX returns a generator, FrankenNetworkX returns a generator, not a list with a different repr.
That contract is checked by a Python parity test suite of about 1,100 files, by NetworkX's own test suite run with fnx as the backend, by a curated Rust differential conformance harness, and by five generated audit ledgers (coverage matrix, raw-vs-public, delegation, upstream divergence, API ergonomics). The coverage matrix is regenerated and drift-checked on every DSR quality run; the other four are regenerated on demand. The current structural surface result achieves complete coverage: the pinned NetworkX 3.6.1 FeatureUniverse has 4,129 strictly present paths out of 4,129 applicable paths (100.0%), with 0 partial and 0 missing.
Why FrankenNetworkX?
| Feature | NetworkX 3.x | FrankenNetworkX |
|---|---|---|
| Backing language | Pure Python | Rust 2024 (#![forbid(unsafe_code)]) |
| Graph types | Graph, DiGraph, MultiGraph, MultiDiGraph |
Same four core types; class/member signature gaps are measured in docs/coverage.md |
| Adjacency storage | nested dict |
deterministic IndexMap-based, insertion-order preserving |
| GIL release on heavy work | n/a (pure Python) | yes; hundreds of py.allow_threads(...) sites |
| Declared import/signature surface | NetworkX 3.6.1 FeatureUniverse | 4,129 / 4,129 strictly present; 0 partial, 0 missing (the classifier rejects shapes declared only through __signature__/__module__ metadata, on classes and functions) |
| NetworkX's own test suite, fnx as backend | 6,816 tests pass on plain NetworkX 3.6.1 (0 fail) | 6,815 pass, 0 fail, 0 error with fnx as the backend (2026-09-24; 80 skipped against plain NetworkX's 78 skipped and 1 xfailed). artifacts/upstream_suite/ratchet_v1.json holds that floor with no allowed failures, and DSR fails on any failure |
| Backend-dispatch surface | n/a | 476 algorithms registered in backend.py |
| Tie-break determinism | implicit | explicit CGSE (13-variant TieBreakPolicy) |
| Complexity audit | none | ComplexityWitness per call, length-prefixed Blake3 decision-path ledger |
| Strict vs hardened parsing | n/a | mode-aware CgsePolicyEngine with fail-closed defaults |
| Durable conformance artifacts | n/a | RaptorQ erasure-coded sidecars with decode-proof receipts |
| Fuzz harness | none | 33 cargo-fuzz binaries across parsers + algorithm families |
| Quality gate | project CI | DSR (dsr quality --tool franken_networkx): fmt → check → clippy -D warnings → Rust tests (11 crates, conformance fixture replay included) → fuzz smoke (33 targets) → docs/examples/coverage drift → generated-report checks → NetworkX's own suite → the full Python parity suite; see Quality Gates |