Maze Visualisation is a Python application using Pygame to visualize popular maze solving algorithms like BFS, DFS, Dijkstra, and A*. This tool helps in understanding the mechanics of these algorithms by providing a visual representation of their paths and decisions in real-time.
- Interactive Drawing: Draw walls, set start and end points to create custom mazes.
- Visualise Algorithms: Watch in real-time how algorithms like BFS, DFS, Dijkstra, and A* find their way through the maze.
- Performance Metrics: After the path is found, see metrics like "number of cells covered" to understand the efficiency of each algorithm.
- Python 3.x
- Pygame
- Clone this repository:
git clone https://github.com/faw01/maze-visualisation.git
- Navigate to the directory:
cd maze-visualisation
- Install the required packages:
pip install pygame
Run the gui.py
script:
python gui.py
Follow the on-screen instructions to draw a maze, select an algorithm, and visualize the pathfinding process.
- Breadth-First Search (BFS): Explores the closest nodes first before moving further, guaranteeing the shortest path.
- Depth-First Search (DFS): Explores as far as possible before backtracking, not always resulting in the shortest path.
- Dijkstra: Finds the shortest path from the start to every position in the maze.
- A*: Uses heuristics to prioritize paths that seem more promising, often resulting in faster solutions than Dijkstra.
- Incorporate more algorithms like Kruskal, Prim, etc.
- Allow saving and loading of mazes.
- Improve performance for larger grid sizes.