This project is a visualizer for various pathfinding algorithms implemented using Pygame. It allows users to interactively set obstacles, start and end points, and observe how different algorithms navigate through them to find the shortest path.
clone the repository:
git clone https://github.com/abouabra/Path-Finding-Visualizer.git
change the directory to the cloned repository.
cd Path-Finding-Visualizer
Use the package manager pip to install the required libraries.
pip install -r requirements.txt
To run the game, simply run:
python PathFindingVisualizer.py
- Left-click to set the start point (orange) and end point (turquoise), and draw obstacles (black) by dragging the mouse.
Press keys for additional functionality:
A: Switch between different algorithms (A*, BFS, DFS, GBFS, Dijkstra).
M: Generate a random maze.
C: Clear the board.
Space: Start/stop the selected algorithm.
Esc: Quit the game.
-
Dynamic Visualization: Watch as the chosen algorithm navigates through obstacles to find the shortest path from the start to the end point.
-
Multiple Algorithms: Choose from a variety of pathfinding algorithms, including :
A* (A-star)
BFS (Breadth-First Search)
DFS (Depth-First Search)
GBFS (Greedy Best-First Search)
Dijkstra (Dijkstra's Algorithm)
- Maze Generation: Generate a random maze to test the algorithms' performance in complex environments.
Contributions are welcome! If you'd like to add new features, improve existing ones, or fix bugs, feel free to open a pull request.