A Python tool to visualize pathfinding algorithms on real-world maps with 3D effects and dynamic sound.
- Multiple Algorithms: BFS, A*, Dijkstra, and Greedy Best-First Search.
- 3D/2D Visualization: Toggle between 3D perspective and 2D top-down views.
- Rich 2D Maps: 2D mode includes rendering for rivers, lakes, forests, parks, and buildings.
- Dynamic Sound: Growing pitch sound effects during search and a triumphant "found" sound.
- Real Map Data: Fetches street networks from OpenStreetMap.
- Video/GIF Export: Export animations to high-quality MP4 with audio or silent GIFs.
| Algorithm | Type | Description |
|---|---|---|
| BFS | Unweighted | Explores equally in all directions. Guarantees shortest path on unweighted graphs. |
| Dijkstra | Weighted | Explores based on actual road distance. Guarantees the shortest path. |
| A* | Weighted + Heuristic | Uses distance to target to guide search. Efficiently finds the shortest path. |
| Greedy BFS | Heuristic | Moves directly towards the target. Fast but not guaranteed to be shortest. |
- Python 3.10+
- FFmpeg: Required for video export (
--mode export).
-
Install Dependencies:
poetry install
-
Run Visualization:
poetry run path-viz
path-viz --mode [view|export|preview] --algo [bfs|astar|dijkstra|greedy] --dim [2d|3d] --duration 10 --output demo.gif--mode:view(interactive),export(save to mp4/gif),preview(static check).--algo: Choose the search algorithm.--dim:2dor3dvisualization.--duration: Total animation length in seconds (default: 10).--output: Optional filename (e.g.,result.mp4ordemo.gif).
- Videos: Saved in the
output/directory. - Cache: Map data and features are cached in the
cache/directory.
This project is licensed under the MIT License - see the LICENSE file for details.
