Welcome to the A* Algorithm Repository! Here, you'll find an implementation of the A* algorithm, which is used to find the shortest path between two points in a graph.
Astar_singular.shortest.path.mp4
Astar Algorithm using one bot
Astar_multiple.shortest.path.mp4
Astar Algorithm using multiple bots
Before running this code, ensure the pyamaze library is installed on your machine. Follow these steps based on your operating system:
- Open the command prompt by pressing the Windows key + R and typing cmd.
- Enter the following command:
pip install pyamaze
- Open the terminal by pressing Command + Spacebar and typing terminal.
- Enter the following command:
pip install pyamaze
To get started, simply navigate to the code and uncomment the relevant sections based on your needs. We've included detailed comments to guide you through the process.
This implementation supports two heuristics - Manhattan and Euclidean - to efficiently find paths. However, please note that the current code only checks for neighbors in the East, South, West, and North directions, excluding diagonal neighbors. I initially developed the "maze" using pyamaze (Class_Setup1), but you can alter the maze, create a new one using pyamaze, or use the same maze to run the code.
Additionally, this supports up to three agents or robots for pathfinding. If you need more agents, it's easy to modify the code using similar lines. Simply refer to the provided comments for guidance.
I hope this implementation aids you in finding the shortest paths in your graphs.
Contributions are welcome! Feel free to open issues or submit pull requests.
This project is licensed under the MIT License - see the LICENSE file for details.