{"id":14992256,"url":"https://github.com/evenfurther/pathfinding","last_synced_at":"2026-04-07T19:31:58.153Z","repository":{"id":15042632,"uuid":"77476246","full_name":"evenfurther/pathfinding","owner":"evenfurther","description":"Pathfinding library for rust","archived":false,"fork":false,"pushed_at":"2026-03-10T12:37:24.000Z","size":1535,"stargazers_count":1039,"open_issues_count":22,"forks_count":85,"subscribers_count":9,"default_branch":"main","last_synced_at":"2026-03-10T16:10:13.263Z","etag":null,"topics":["astar","dijkstra","edmonds-karp","graph","hacktoberfest","kuhn-munkres","pathfinding","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/evenfurther.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2016-12-27T18:53:12.000Z","updated_at":"2026-03-10T12:35:44.000Z","dependencies_parsed_at":"2026-01-03T04:08:34.172Z","dependency_job_id":null,"html_url":"https://github.com/evenfurther/pathfinding","commit_stats":null,"previous_names":["evenfurther/pathfinding","samueltardieu/pathfinding"],"tags_count":120,"template":false,"template_full_name":null,"purl":"pkg:github/evenfurther/pathfinding","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evenfurther%2Fpathfinding","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evenfurther%2Fpathfinding/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evenfurther%2Fpathfinding/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evenfurther%2Fpathfinding/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/evenfurther","download_url":"https://codeload.github.com/evenfurther/pathfinding/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evenfurther%2Fpathfinding/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31526666,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-07T16:28:08.000Z","status":"ssl_error","status_checked_at":"2026-04-07T16:28:06.951Z","response_time":105,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["astar","dijkstra","edmonds-karp","graph","hacktoberfest","kuhn-munkres","pathfinding","rust"],"created_at":"2024-09-24T15:00:53.706Z","updated_at":"2026-04-07T19:31:58.146Z","avatar_url":"https://github.com/evenfurther.png","language":"Rust","funding_links":[],"categories":["Path Planning","Rust"],"sub_categories":[],"readme":"# pathfinding\n\n[![Current Version](https://img.shields.io/crates/v/pathfinding.svg)](https://crates.io/crates/pathfinding)\n[![Documentation](https://docs.rs/pathfinding/badge.svg)](https://docs.rs/pathfinding)\n[![License: Apache-2.0/MIT](https://img.shields.io/crates/l/pathfinding.svg)](#license)\n\nThis crate implements several pathfinding, flow, and graph algorithms in [Rust](https://rust-lang.org/). The algorithms are generic over their arguments. See [the documentation](https://docs.rs/pathfinding) for more information about the various algorithms.\n\n## Using this crate\n\nIn your `Cargo.toml`, put:\n\n``` ini\n[dependencies]\npathfinding = \"4.15.0\"\n```\n\nYou can then pull your preferred algorithm (BFS in this example) using:\n\n``` rust\nuse pathfinding::prelude::bfs;\n```\n\n## Example\n\nWe will search the shortest path on a chess board to go from (1, 1) to (4, 6) doing only knight\nmoves.\n\n``` rust\nuse pathfinding::prelude::bfs;\n\n#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]\nstruct Pos(i32, i32);\n\nimpl Pos {\n  fn successors(\u0026self) -\u003e Vec\u003cPos\u003e {\n    let \u0026Pos(x, y) = self;\n    vec![Pos(x+1,y+2), Pos(x+1,y-2), Pos(x-1,y+2), Pos(x-1,y-2),\n         Pos(x+2,y+1), Pos(x+2,y-1), Pos(x-2,y+1), Pos(x-2,y-1)]\n  }\n}\n\nstatic GOAL: Pos = Pos(4, 6);\nlet result = bfs(\u0026Pos(1, 1), |p| p.successors(), |p| *p == GOAL);\nassert_eq!(result.expect(\"no path found\").len(), 5);\n```\n\n## Working with Graphs\n\nIf you want to use this library with traditional graph structures (nodes, edges, and weights), see the [Graph Guide](GRAPH_GUIDE.md) for comprehensive examples showing:\n\n- How to represent graphs (adjacency lists, adjacency matrices, edge lists)\n- Using A* and Dijkstra with weighted graphs\n- Using BFS and DFS with unweighted graphs\n- Practical examples for spatial shortest paths\n- Converting from other languages (R, Python)\n- Tips and best practices\n\n## License\n\nThis code is released under a dual Apache 2.0 / MIT free software license.\n\n## Benchmarking\n\nThis repository includes two types of benchmarks:\n\n### Wall-time Benchmarks (Criterion/CodSpeed)\n\nTraditional wall-time benchmarks using Criterion (with CodSpeed compatibility) are located in `benches/` with names like `algos.rs`, `edmondskarp.rs`, etc. These can be run with:\n\n```bash\ncargo bench --bench algos --bench edmondskarp --bench kuhn_munkres --bench separate_components\n```\n\n### Deterministic Benchmarks (iai-callgrind)\n\nFor more precise and deterministic performance measurements, we use iai-callgrind which counts CPU instructions, cache hits/misses, and estimated cycles using Valgrind. These benchmarks are prefixed with `iai_` and require the `iai` feature flag:\n\n```bash\n# Install valgrind first (required by iai-callgrind)\nsudo apt-get install valgrind  # On Ubuntu/Debian\n\n# Run the benchmarks with the feature flag\ncargo bench --features iai --bench iai_algos --bench iai_edmondskarp --bench iai_kuhn_munkres --bench iai_separate_components\n```\n\nThe iai-callgrind benchmarks provide consistent results across runs and are not affected by system load, making them ideal for detecting performance regressions. They run automatically in CI for all pull requests, comparing performance against the base branch.\n\n## Contributing\n\nYou are welcome to contribute by opening [issues](https://github.com/evenfurther/pathfinding/issues)\nor submitting [pull requests](https://github.com/evenfurther/pathfinding/pulls). Please open an issue\nbefore implementing a new feature, in case it is a work in progress already or it is fit for this\nrepository.\n\nIn order to pass the continuous integration tests, your code must be formatted using the latest\n`rustfmt` with the nightly rust toolchain, and pass `cargo clippy` and [`pre-commit`](https://pre-commit.com/) checks.\nThose will run automatically when you submit a pull request. You can install `pre-commit` to your\nchecked out version of the repository by running:\n\n```bash\n$ pre-commit install --hook-type commit-msg\n```\n\nThis repository uses the [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) commit message style, such as:\n\n- feat(matrix): add `Matrix::transpose()`\n- fix(tests): remove unused imports\n\nEach commit must be self-sufficient and clean. If during inspection or code review you need to make further changes to a commit, please squash it. You may use `git rebase -i`, or more convenient tools such as [`jj`](https://martinvonz.github.io/jj/latest/) or [`git-branchless`](https://github.com/arxanas/git-branchless), in order to manipulate your git commits.\n\nIf a pull-request should automatically close an open issue, please\ninclude \"Fix #xxx# or \"Close #xxx\" in the pull-request cover-letter.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevenfurther%2Fpathfinding","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fevenfurther%2Fpathfinding","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevenfurther%2Fpathfinding/lists"}