This project provides a visual demonstration of popular pathfinding algorithms navigating through mazes. Watch Breadth-First Search (BFS), Depth-First Search (DFS), and A* (A-star) in action as they find the shortest path from a start to an end point in a dynamically generated or predefined maze!
- Visual Maze Representation: Displays the maze grid, walls, open paths, start (๐ข), and goal (๐ด) points.
- Algorithm Visualization:
- See visited cells (๐ง) as the algorithm explores.
- Watch the final path (๐ฃ/๐ฆ) being drawn.
- Multiple Algorithms: Choose between:
- ๐ Breadth-First Search (BFS)
- ๐ฒ Depth-First Search (DFS)
- โญ A* Search (using Manhattan distance heuristic)
- Dynamic Maze Generation:
- Starts with a predefined maze.
- Generate new, random, solvable mazes with a click (๐).
- Interactive Controls:
- Buttons to select algorithms.
- Button to generate a new maze.
- Step Counter: Track the number of steps (๐ข) each algorithm takes to find the solution or explore.
- Step-by-Step Animation: Clearly visualizes the decision-making process of each algorithm, making it a great educational tool.
Example placeholder:
- Python 3.12 (๐)
- Pygame (๐ฎ): For graphics, event handling, and the main game loop.
- Asyncio (โณ): For managing the asynchronous main loop, allowing for smooth step-by-step visualization.
- Standard Python libraries:
collections.deque,heapq,random.
-
Clone the repository:
git clone https://github.com/JvFg92/Maze_Solver cd Maze_Solver -
Install dependencies (Pygame is the main external library):
pip install pygame
(If you don't have
pip, ensure you have Python installed and look up how to install pip for your system.)
Once Pygame is installed, navigate to the directory containing solve.py and run:
python solve.py