{"id":21106399,"url":"https://github.com/airstrike/pathfinder","last_synced_at":"2025-08-30T14:17:17.448Z","repository":{"id":259323327,"uuid":"877578950","full_name":"airstrike/pathfinder","owner":"airstrike","description":"Interactive pathfinding visualization demonstrating optimal path discovery around polygonal obstacles.","archived":false,"fork":false,"pushed_at":"2024-11-18T19:21:27.000Z","size":4056,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-17T09:41:25.582Z","etag":null,"topics":["a-star","iced","iced-rs","pathfinding","pathfinding-visualizer"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/airstrike.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2024-10-23T22:35:24.000Z","updated_at":"2024-12-16T14:54:41.000Z","dependencies_parsed_at":"2024-10-24T11:57:43.218Z","dependency_job_id":"15c925ea-0c7b-4301-bf45-40c8d58fe5c5","html_url":"https://github.com/airstrike/pathfinder","commit_stats":null,"previous_names":["airstrike/pathfinder"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/airstrike/pathfinder","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/airstrike%2Fpathfinder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/airstrike%2Fpathfinder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/airstrike%2Fpathfinder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/airstrike%2Fpathfinder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/airstrike","download_url":"https://codeload.github.com/airstrike/pathfinder/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/airstrike%2Fpathfinder/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272858568,"owners_count":25005100,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-30T02:00:09.474Z","response_time":77,"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":["a-star","iced","iced-rs","pathfinding","pathfinding-visualizer"],"created_at":"2024-11-20T00:21:39.959Z","updated_at":"2025-08-30T14:17:17.430Z","avatar_url":"https://github.com/airstrike.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n# Pathfinder\n\nInteractive pathfinding visualization demonstrating optimal path discovery around polygonal obstacles.\n\n\u003cimg src=\"./assets/logo.png\" alt=\"Pathfinder Logo\" width=\"100\"/\u003e\n\n[![Made with iced](https://iced.rs/badge.svg)](https://github.com/iced-rs/iced)\n\n  \u003cimg src=\"./assets/demo.gif\" alt=\"Pathfinder Demo\" width=\"600\"/\u003e\n\n\u003c/div\u003e\n\n## Installation\n\n\u003e Note: You will need the Rust toolchain installed. You can install it by following the instructions at [rustup.rs](https://rustup.rs/).\n\n```bash\n# Clone the repository, build and run\ngit clone https://github.com/airstrike/pathfinder\ncd pathfinder\ncargo run --release\n```\n\n## Overview\n\nPathfinder is built in Rust using the [`iced`](https://iced.rs) GUI framework.\nThe application provides an extensible framework for implementing and\nvisualizing different pathfinding strategies between start and goal points\nwhile avoiding polygonal obstacles.\n\n### Features\n\n- Interactive visualization with play/pause and step-by-step controls\n- Click to place start/goal points\n- Multiple pathfinding strategies (A* and Visibility Graph)\n- Choice of distance heuristics (Euclidean, Manhattan)\n- Real-time visualization of search progress\n- Polygon-based obstacles with robust intersection testing\n- Pastel color scheme for clear obstacle identification\n\n### Code Structure\n\nThe codebase is organized into several key modules:\n\n- `main.rs`: Entry point and GUI implementation using iced. Handles user\n  interaction, visualization loop, and keyboard/mouse controls.\n\n- `board.rs`: Defines the game board and its polygonal obstacles. Handles\n  drawing the board and provides interfaces to query board state.\n\n- `polygon.rs`: Sophisticated polygon representation with robust geometric\n  operations:\n  - Intersection detection using orientation predicates\n  - Point-in-polygon testing via ray casting\n  - Special case handling for collinear points and edge cases\n  - Colored visualization with pastel shades\n\n- `pathfinder.rs`: Defines the core `Pathfinder` trait that all pathfinding\n  implementations must satisfy. Provides default implementations for:\n  - Path reconstruction\n  - Distance calculations\n  - State management\n  - Visualization\n  - Step controls (forward/back/reset)\n\n- `search/`: Contains concrete pathfinding implementations:\n  - `simple.rs`: Classic A* implementation that explores points dynamically\n  - `visibility.rs`: Visibility graph-based implementation that pre-computes\n    valid paths between visible vertices\n\n### Pathfinding Implementations\n\n#### Common Interface (`Pathfinder` trait)\n\nThe core `Pathfinder` trait defines a common interface that all pathfinding strategies must implement. This includes:\n- Board and state access (current board configuration, search state)\n- Path management (reconstruction, scoring, validation)\n- Algorithm control (initialization, stepping, reset)\n- Visualization support (drawing current state, history)\n- Heuristic configuration\n- Solution access and validation\n\nThe trait provides default implementations for visualization, path reconstruction, scoring, and state management, allowing implementations to focus on their core pathfinding logic.\n\n#### A* Implementation (`AStarPathfinder`)\n\n- Follows the textbook approach with OPEN/CLOSED lists\n- Dynamically explores points without preprocessing\n- Reopens CLOSED nodes when better paths are found\n- Maintains comprehensive path history for visualization\n\n#### Visibility Graph Implementation (`VisibilityGraphPathfinder`)\n\n- Pre-computes a visibility graph connecting mutually visible vertices\n- Uses a geometric approach to determine vertex visibility\n- Performs A* search on the reduced graph\n- More efficient for static environments\n- Guarantees optimal paths through vertex-vertex movements\n\n### Visualization\n\nThe visualization system leverages iced's `Canvas` widget to provide:\n\n- Real-time rendering of the search process\n- Color-coded elements:\n  - Open nodes (blue)\n  - Closed nodes (red)\n  - Current best path (green)\n  - Historical paths (gray)\n  - Polygonal obstacles (pastel colors)\n- Interactive controls:\n  - Play/pause/step buttons\n  - Navigation slider\n  - Algorithm selection\n  - Heuristic selection\n  - Solution overlay toggle\n\n## TODOs\n\nIf I had infinite free time, I'd implement some or all of the below:\n\n- [ ] Add more pathfinding implementations:\n  - [ ] Dijkstra's algorithm\n  - [ ] RRT (Rapidly-exploring Random Trees)\n  - [ ] Potential fields\n- [ ] Support custom boards and obstacle placement\n- [ ] Add more visualization modes (heatmaps, path costs)\n- [ ] Implement dynamic obstacle avoidance\n- [ ] Add comparative performance metrics\n- [ ] Support for weighted edges and terrain costs\n- [ ] Path smoothing and optimization\n\n## Contributing\n\nNew pathfinding implementations can be added by:\n1. Creating a new implementation of the `Pathfinder` trait\n2. Adding the implementation to the `Search` enum\n3. Including comprehensive test cases\n4. Ensuring proper visualization support\n\nThe project emphasizes intuitive, interactive visualizations that help users\nunderstand how different pathfinding algorithms work. The modular architecture,\nbuilt around the `Pathfinder` trait, makes it straightforward to add new\nalgorithms while maintaining a consistent visualization and interaction model.\n\n## Acknowledgements\n\n- [Rust Programming Language](https://www.rust-lang.org/)\n- [iced](https://iced.rs)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fairstrike%2Fpathfinder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fairstrike%2Fpathfinder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fairstrike%2Fpathfinder/lists"}