This project implements the A* pathfinding algorithm with a graphical user interface to visualize the algorithm in action. It allows users to set start and end points, draw barriers, and visualize the pathfinding process in a grid layout.
- Interactive 50x60 grid for setting up pathfinding scenarios.
- Ability to place start and end points on the grid.
- Functionality to draw barriers on the grid to create complex pathfinding scenarios.
- Toggleable real-time visualization of the A* algorithm.
- Clear Grid function to reset the scenario.
- Performance optimizations for scenarios with long barriers or narrow paths.
- Starting the Application: Run
main.pyto start the application. - Setting Points: Click on a grid cell to set the start point (green cell) and the end point (red cell).
- Drawing Barriers: Click and drag on the grid to draw barriers (black cells).
- Pathfinding:
- Click the "Start Pathfinding" button to find the shortest path from start to end.
- Use the "Toggle Visualization" button to turn on/off the real-time visualization of the algorithm.
- Resetting the Grid: Use the "Clear Grid" button to clear the grid and set up a new scenario.
- Python 3.x
- Tkinter (usually comes pre-installed with Python)
To run the application, ensure you have Python installed on your system. Clone the repository and run main.py:
git clone https://github.com/your-username/astar-pathfinding.git
cd astar-pathfinding
python main.py