PyMaze Algorithm Visualizer is an interactive application that allows users to create and solve mazes using various pathfinding algorithms. The platform is designed to provide an educational and engaging experience, helping users understand the mechanics and functionality of algorithms such as BFS, DFS, A*, and Dijkstra. Through this tool, users can explore how different algorithms perform on mazes of varying complexities.
- Create a maze of custom dimensions and complexity.
- Set maze dimensions to any size.
- Control the complexity with a loop percentage, which determines the maze's intricacy.
Visualize and compare the following pathfinding algorithms:
- Breadth-First Search (BFS)
- Depth-First Search (DFS)
- A Search*
- Dijkstra's Algorithm
- Compare the performance of two algorithms:
- Path length
- Execution time
- Maze Dimensions: Set the width and height of the maze.
- Loop Percentage: Determines the complexity of the maze.
- Start and End Points: Define custom start and end points for pathfinding algorithms.
Ensure you have the following installed:
- Python 3.7 or later
- Required libraries:
tkinterpymaze
Install additional dependencies if needed:
pip install pymazeClone the repository:
git clone https://github.com/OmRope/PyMaze.git
cd PyMazeRun the main script:
python main.py- Input maze dimensions (rows and columns).
- Set the loop percentage for complexity (1-100%).
- Choose whether to specify the end coordinates manually or use the default.
- Choose a pathfinding algorithm to solve the maze.
- Select two algorithms to compare their performance metrics.
- Canvas Creation: The GUI enables interactive maze generation and solving.
- Control Panel: Buttons and input fields for algorithm selection and configuration.
- Explores the shortest path by expanding all neighbors at the current depth.
- Explores paths by going deep before backtracking.
- Combines heuristic and path cost for optimal pathfinding.
- Finds the shortest path by expanding nodes with the least cumulative cost.
main.py: Entry point of the application.agents.py: Defines agent behaviors for maze traversal.pymaze: Core library for maze generation and visualization.
Run the application:
python main.pyFollow the prompts in the console to create and solve a maze. Visualize the results on the graphical interface.
- Add more algorithms (e.g., Greedy Best-First Search).
- Implement 3D mazes for advanced visualization.
- Provide detailed performance analysis graphs.
Feel free to fork this repository and submit pull requests. Contributions are always welcome!