{"id":50413605,"url":"https://github.com/guywaldman/rxgraph","last_synced_at":"2026-05-31T05:01:29.319Z","repository":{"id":360542380,"uuid":"1250547359","full_name":"guywaldman/rxgraph","owner":"guywaldman","description":"Rust library with Python bindings for extremely high-performance graph traversal and graph algorithms.  ","archived":false,"fork":false,"pushed_at":"2026-05-26T21:16:54.000Z","size":15,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-26T22:21:22.865Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://pypi.org/project/rxgraph/","language":"Just","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/guywaldman.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-26T18:34:27.000Z","updated_at":"2026-05-26T21:17:58.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/guywaldman/rxgraph","commit_stats":null,"previous_names":["guywaldman/rxgraph"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/guywaldman/rxgraph","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guywaldman%2Frxgraph","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guywaldman%2Frxgraph/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guywaldman%2Frxgraph/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guywaldman%2Frxgraph/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/guywaldman","download_url":"https://codeload.github.com/guywaldman/rxgraph/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guywaldman%2Frxgraph/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33719601,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-31T02:00:06.040Z","response_time":95,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-05-31T05:01:28.747Z","updated_at":"2026-05-31T05:01:29.313Z","avatar_url":"https://github.com/guywaldman.png","language":"Just","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rxgraph\n\nHigh-performance graph traversal and graph algorithms for Python, implemented\nin Rust with an ergonomic object API and Polars expression support.\n\n`rxgraph` supports:\n\n1. Efficient graph construction leveraging Arrow-backed DataFrames as inputs\n1. Optimized stateful search, where the traversal predicates are expressed with Poalrs expressions\n1. Common graph algorithms like BFS, DFS, shortest path, weakly connected components, etc.\n\nFrom initial benchmarks, `rxgraph` is comparable in performance and CPU/memory consumption (and very possibly better in some cases) with `igraph` and `networkx`.\n\nThe place where `rxgraph` really shines is **stateful search** - you can use `rxgraph` for stateful blind search across a very large graph.\nSee the traversal example in [Quickstart](#quick-start).\n\nThe main focus of this library is Python and its Python bindings, but its Rust core is also published as a crate to crates.io.\n\n\u003e [!IMPORTANT]\n\u003e\n\u003e `rxgraph` is under heavy active development - the core implementation (Python bindings \u0026 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.\n\u003e\n\u003e Having said that, the library is usable and should work for most scenarios it supports, and I would love for some initial feedback.\n\n## Installation\n\n```bash\n# uv\nuv add rxgraph polars\n\n# pip\npip install rxgraph polars\n```\n\n\u003e [!NOTE]\n\u003e\n\u003e Requires Python 3.11+ and currently depends on Polars for expression input.\n\n## Quick Start\n\n```python\nimport rxgraph as rxg\n\ngraph = rxg.Graph.from_edges(\n    [(\"a\", \"b\"), (\"a\", \"c\"), (\"b\", \"d\"), (\"c\", \"d\")],\n    nodes=[\"a\", \"b\", \"c\", \"d\", \"isolated\"],\n)\n\nassert graph.node_count == 5\nassert graph.edge_count == 4\nassert graph.bfs(\"a\") == [\"a\", \"b\", \"c\", \"d\"]\nassert graph.shortest_path(\"a\", \"d\") == [\"a\", \"b\", \"d\"]\nassert graph.reachable_nodes(\"isolated\") == [\"isolated\"]\n```\n\nFor the most powerful capability of `rxgraph`, see the [Stateful Search](#stateful-search) example.\n\n## Data Model\n\nFor small or Python-native graphs, use `Graph.from_edges` with hashable node\nlabels:\n\n```python\nroutes = rxg.Graph.from_edges(\n    [\n        (\"a\", \"b\", {\"price\": 5, \"kind\": \"route\"}),\n        (\"b\", \"c\", {\"price\": 6, \"kind\": \"route\"}),\n        (\"a\", \"c\", {\"price\": 100, \"kind\": \"skip\"}),\n    ],\n    nodes=[\n        (\"a\", {\"closed\": False}),\n        (\"b\", {\"closed\": False}),\n        (\"c\", {\"closed\": False}),\n    ],\n)\n```\n\nFor table-backed graphs, pass Polars `DataFrame`s directly:\n\n```python\nimport polars as pl\nimport rxgraph as rxg\n\nnodes = pl.DataFrame(\n    {\"id\": [10, 20, 30]},\n    schema={\"id\": pl.UInt64},\n)\nedges = pl.DataFrame(\n    {\"id\": [1, 2], \"src\": [10, 20], \"dest\": [20, 30]},\n    schema={\"id\": pl.UInt64, \"src\": pl.UInt64, \"dest\": pl.UInt64},\n)\n\ntable_graph = rxg.Graph(nodes, edges)\nassert table_graph.shortest_path(10, 30) == [10, 20, 30]\n```\n\nNode tables require an `id` column. Edge tables require `id`, `src`, and `dest`.\nAll identity columns must be either unsigned integers or strings. Extra columns\nremain available to traversal expressions.\n\n## Algorithms\n\nThe high-level object API includes:\n\n- `bfs(start, max_depth=None)`\n- `dfs(start, max_depth=None)`\n- `reachable_nodes(start)`\n- `shortest_path(source, target)`\n- `out_degrees()`, `in_degrees()`, and `degrees()`\n- `weakly_connected_components()`\n\nThese methods return the same labels or IDs used to build the graph.\n\n## Stateful Search\n\n`Graph.search` evaluates Polars expressions against candidate edges. Expressions\ncan read source-node fields (`src.*`), destination-node fields (`dest.*`), edge\nfields (`edge.*`), and path state (`state.*`).\n\nUsing the `routes` graph from the data model example:\n\n```python\ns = lambda name: rxg.col(f\"state.{name}\")\nd = lambda name: rxg.col(f\"dest.{name}\")\ne = lambda name: rxg.col(f\"edge.{name}\")\n\nresult = routes.search(\n    start_nodes=[\"a\"],\n    visit=(~d(\"closed\")) \u0026 (e(\"kind\") != \"skip\") \u0026 ((s(\"spent\") + e(\"price\")) \u003c 20),\n    next_state={\"spent\": s(\"spent\") + e(\"price\")},\n    stop=rxg.col(\"dest.id\") == rxg.lit(routes.node_id(\"c\")),\n    initial_state={\"spent\": 0},\n    max_depth=3,\n    max_paths=10,\n)\n\npath = result.paths[0]\nassert path.nodes == [\"a\", \"b\", \"c\"]\nassert path.edges == [0, 1]\nassert path.state == {\"spent\": 11}\n```\n\nSearch supports DFS or BFS ordering, optional Rayon-backed parallel traversal,\ndepth/path limits, and optional intermediate state materialization.\n\n## Architecture\n\nThe Python package is backed by a Rust core. Internally, `rxgraph` stores node\nand edge tables as Arrow `RecordBatch` values, validates graph identity columns\nonce, and builds compact CSR topology for traversal. User columns stay in\ncolumnar form and remain available to stateful search expressions.\n\n## Rust Crate\n\nThe Rust engine is published as the `rxgraph` crate and exposes the same\ntraversal kernel model used by the Python bindings.\n\nSee `crates/rxgraph/README.md` for crate-specific usage.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguywaldman%2Frxgraph","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fguywaldman%2Frxgraph","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguywaldman%2Frxgraph/lists"}