Heuristic-Maze-Solver is a Python project designed to solve complex mazes. It includes functionalities to generate, solve, and visualize mazes using various algorithms and techniques, leveraging both Python and C++ (dont work rn) for improved performance.
- Maze Generation: Create mazes of various sizes and complexities.
- Maze Solving: Implement different algorithms to find solutions to the generated mazes.
- Visualization: Render mazes and their solutions graphically.
- Bindings: Interface with C++ code using pybind11 for performance-critical parts.
- Python 3.9 or higher
- CMake
- pybind11
-
Clone the repository:
git clone https://github.com/lhlRahman/Heuristic-Maze-Solver.git cd Heuristic-Maze-Solver -
Create a virtual environment and activate it:
python3 -m venv venv source venv/bin/activate -
Build the C++ extensions (dont work rn):
mkdir build cd build cmake .. make
You can genrate mazes using maze.py
python maze.pyYou can run the maze solver from the command line with the following syntax:
python -m maze_solver <maze_file> --algorithm <algorithm> --animation --delay <delay>To solve the large_example.maze file using the BFS algorithm with an animation delay of 0.1 seconds, run:
python -m maze_solver large_example.maze --algorithm bfs --animation --delay 0.1<maze_file>: Path to the maze file.--algorithm: Algorithm to use for solving the maze (bfs,dfs,dijkstra,greedy,wall-follower,dead-end,recursive-bt).--animation: Show an animated solution.--delay: Delay between animation steps (in seconds).
large_example.maze: Example maze file.make.py: Script to build and run the project.src/maze_solver/: Main Python package for the maze solver.src/maze_solver/graphs/: Contains graph algorithms for maze solving.src/maze_solver/models/: Maze model definitions.src/maze_solver/persistence/: File format and serialization utilities.src/maze_solver/view/: Visualization components.src/maze_solver.cpp,src/maze_solver.h: C++ source and header files.pybind11/: Pybind11 library for C++ bindings..vscode/: VSCode configuration files.CMakeLists.txt,Makefile: Build system files.
- Fork the repository.
- Create a new branch for your feature or bugfix.
- Commit your changes and push your branch.
- Create a pull request to the main branch.