A clean, offline-capable maze solving application with multiple algorithms and real-time visualization.
- Multiple maze solving algorithms:
- Breadth-First Search (BFS)
- Depth-First Search (DFS)
- A* Search
- Real-time visualization of the solving process
- Supports both text file and visual maze creation
- Offline-capable (no internet required)
- Clean, modern UI
- Create a virtual environment:
python -m venv venv- Activate the virtual environment:
- Windows:
.\venv\Scripts\activate- Unix/MacOS:
source venv/bin/activate- Install dependencies:
pip install -r requirements.txt- Run the application:
python app.py- Open a browser and navigate to:
http://localhost:5000
Text files should use the following format:
15 20
####################
#S # #
# ###### # ###### #
# # # # # #
###### # # # ## # #
# # # # # # #
# ## ##### #### # #
# # # # #
## ##### ######## #
# # # #
# ## # ########## #
# # # # #
## # ########## # #
# # #E#
####################
Where:
- First line: height width
- '#' = Wall
- 'S' = Start
- 'E' = End
- ' ' = Path
- Guarantees shortest path
- Explores uniformly in all directions
- Memory usage: O(w*h)
- May not find shortest path
- Memory efficient
- Memory usage: O(w+h)
- Guarantees shortest path
- Uses heuristics to optimize search
- Memory usage: O(w*h)
Here is the project's file structure:
MAZE_WALKER-MAIN/
├── maze_solver/
│ ├── __init__.py
│ ├── algorithms.py # Contains BFS, DFS, and A* solving algorithms
│ ├── generators.py # Contains DFS and Prim's maze generators
│ └── maze.py # Maze class to handle grid logic
│
├── templates/
│ └── index.html # Main frontend page for the UI
│
├── .gitignore
├── app.py # Main Flask application file
├── maze1.txt # Example maze file
├── maze2.txt # Example maze file
├── README.md # Project documentation
├── requirements.txt # Python dependencies
└── setup.py # Project setup script