A pathfinding visualizer made in Python and Pygame. This project aims to provide a fun and interactive way to learn about popular pathfinding algorithms such as Dijkstra's, A* and other supported algorithms.
Demonstration.mp4
- Visualizes popular pathfinding algorithms such as Dijkstra's and A*.
- Visualizes popular maze generation algorithms like Recursive division and Prim's algorithm.
- Feature to run all algorithms b2b to compare their performance.
- Step-by-step animation of the search process, allowing you to see how the algorithms work.
- Option to place obstacles on the grid to create custom maps.
- Selectable starting and ending points on the grid.
- Configurable speed of the animation.
- Configurable grid size
- Clean and intuitive user interface.
The following pathfinding algorithms are currently supported in this visualizer:
- Depth First Search (DFS): A traversal-based algorithm that goes as far as possible along each branch before backtracking. Not commonly used for pathfinding.
- Breadth First Search (BFS): A traversal-based algorithm that explores all neighbors of a node before moving on to the next level. Guaranteed to find the shortest path in unweighted graphs.
- Greedy Best First Search: A heuristic search algorithm that prioritizes visiting nodes closest to the goal. Not guaranteed to find the shortest path, but often faster.
- A* Search: A heuristic search algorithm that combines the strengths of BFS and greedy best first search. Efficient for many types of graphs.
- Dijkstra's Search: A shortest path algorithm that uses a priority queue to prioritize visiting nodes with the smallest known cost. Guaranteed to find the shortest path in weighted graphs.
Each algorithm uses a different approach to finding the shortest path between two points on a graph. Choose the one that best fits your use case and watch it in action.
- Python 3.10 and above: You can download the latest version of Python from the official website (https://www.python.org/downloads/).
- Pygame: You can install Pygame by running 'pip install pygame' in your terminal.
- Download the project repository to your local machine.
- Navigate to the project directory.
- Run
python3 run.pyw
if on Linux or Mac - Run
python run.pyw
if on Windows
--cell-size
Usage:python run.pyw --cell-size:<int>
This project is open to contributions, bug reports, and suggestions. If you've found a bug or have a suggestion, please open an issue.
This project is licensed under the MIT License.
Enjoy visualizing pathfinding algorithms!