An interactive pathfinding visualizer implemented in Python with Pygame.
This project has been migrated from a JavaScript/React app to a Python desktop app. The algorithms and behavior are preserved, including:
- BFS, DFS, A*, Hill Climbing, Best First, MiniMax
- Best, Average, and Worst case modes
- Interactive wall drawing and Start/End placement
- Animated visited order and final path
- Runtime metrics and time-complexity panel
- Python 3.10+
- Pygame
- Create and activate a virtual environment (recommended):
python3 -m venv .venv
source .venv/bin/activate- Install dependencies:
pip install -r requirements.txt- Run the visualizer:
python pathfinding_visualizer.py- Mouse Left: Draw/apply selected tool on grid
- Mouse Right: Erase wall
- 1-6: Select algorithm
- B / A / W: Best / Average / Worst case mode
- D / S / E: Tool = Wall / Start / End
- Space: Visualize
- C: Clear path animation
- R: Reset entire grid
- Up / Down: Increase or decrease animation speed
- V: Show/hide heuristic values
- Esc: Quit
.
├── pathfinding_visualizer.py
├── requirements.txt
├── assets/
├── ai-pathfinding-visualizer.jsx # legacy JS source
├── src/ # legacy JS source
├── package.json # legacy JS metadata
└── README.md
- The Python app is now the primary implementation.
- Legacy JavaScript files are kept for reference and can be removed later if you want a Python-only repository.