LordZeusIsBack / A-Star-Visualization

A visual tool for understanding the A* search algorithm. This project demonstrates the algorithm’s step-by-step pathfinding process using a graphical interface built in Python. It’s perfect for educational purposes and for anyone looking to explore efficient graph traversal techniques.

Repository from Github https://github.comLordZeusIsBack/A-Star-VisualizationRepository from Github https://github.comLordZeusIsBack/A-Star-Visualization

A* Path Finding Algorithm Visualization

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.

Features

  • 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.

Installation

  1. Ensure you have Python installed. You can download it from python.org.
  2. Install the required dependencies:
    pip install pygame

Usage

  1. Clone the repository:
    git clone https://github.com/LordZeusIsBack/astar-pathfinding-visualization.git
  2. Navigate to the project directory:
    cd astar-pathfinding-visualization
  3. Run the script:
    python astar_visualization.py

How to Use

  • 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.

Screenshots

Start Screen This is the basic start screen

Pathfinding in Progress Here the algorithm is finding the path to the destination

Path Found The shortest path was found by the algorithm and constructed on the pygame window

Contributing

If you would like to contribute to this project, please fork the repository and submit a pull request. We welcome improvements and bug fixes.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Acknowledgements

  • The Pygame community for their excellent resources and support.

Contact

For any inquiries or feedback, please contact [anubhavsharma5645@gmail.com].

About

A visual tool for understanding the A* search algorithm. This project demonstrates the algorithm’s step-by-step pathfinding process using a graphical interface built in Python. It’s perfect for educational purposes and for anyone looking to explore efficient graph traversal techniques.

License:MIT License


Languages

Language:Python 100.0%