rxgraph
High-performance graph traversal engine for Rust, built for usage in the Python library rxgraph.
This crate focuses on fast traversal, explicit stateful search, and a small API surface for common graph algorithms.
[!IMPORTANT]
rxgraphis under heavy active development - the core implementation (Python bindings & Rust crate) are usable with decent test coverage, but it is not ready for production and you should use it at your own risk. The public API is likely to change as well.Having said that, the library is usable and should work for most scenarios it supports, and I would love for some initial feedback.
Architecture
Internally, rxgraph stores node and edge tables as Arrow RecordBatch values,
validates graph identity columns once, builds compact CSR topology, and
evaluates stateful traversal kernels without copying user columns out of Arrow.
Install
[]
= "0.0.5"
Data Model
Graph::new(nodes, edges) expects:
- nodes:
id - edges:
id,src,dest - all identity columns uniformly
UInt64or uniformly string - optional
typecolumns as strings
Additional node and edge columns can be read by traversal DSL expressions.
Topology Queries
Use the graph methods for common directed graph algorithms:
bfs/dfsreachable_nodesshortest_pathout_degrees,in_degrees,degreesweakly_connected_components
Integer-ID graphs also have _u64 variants that avoid materializing borrowed
GraphId values.
use Arc;
use ;
use Graph;
Stateful Search
Traversal uses a DslKernel with three parts:
visit: whether a candidate edge is acceptednext_state: how named path state changes after accepting the edgestop: whether the accepted path should be returned
use ;
#
Search can run depth-first or breadth-first, with optional Rayon-backed parallelism and optional per-node intermediate state materialization.
Python Bindings
Python bindings are published separately as the rxgraph package on PyPI from
the same repository.