This project is a visualization of the A* pathfinding algorithm using Pygame. The algorithm uses Euclidean distance as the heuristic to find the shortest path between a start and an end point on a grid, while navigating around barriers.
- Visual representation of the A* pathfinding algorithm.
- Adjustable grid size.
- Ability to place start and end points.
- Ability to place barriers.
- Visualization of the pathfinding process.
- Reset and clear the grid for new searches.
- Ensure you have Python installed. You can download it from python.org.
- Install the required dependencies:
pip install pygame
- Clone the repository:
git clone https://github.com/LordZeusIsBack/astar-pathfinding-visualization.git
- Navigate to the project directory:
cd astar-pathfinding-visualization - Run the script:
python astar_visualization.py
-
Left Click:
- Place the start point (orange).
- Place the end point (turquoise).
- Place barriers (black).
-
Right Click:
- Remove the start point.
- Remove the end point.
- Remove barriers.
-
Space Key: Start the pathfinding algorithm.
-
C Key: Clear the grid.

This is the basic start screen

Here the algorithm is finding the path to the destination

The shortest path was found by the algorithm and constructed on the pygame window
If you would like to contribute to this project, please fork the repository and submit a pull request. We welcome improvements and bug fixes.
This project is licensed under the MIT License. See the LICENSE file for details.
- The Pygame community for their excellent resources and support.
For any inquiries or feedback, please contact [anubhavsharma5645@gmail.com].