Maze Solver is an implementation of different search algorithms to solve perfect and imperfect mazes.
The original submission Jupyter notebook and report pdf for CSE537: Artificial Intelligence is also included.
To generate a maze, run the following command:
python generate_maze.py <dim> <type> <output_file>
-
dim: generate a maze of dimension$2*\text{dim}+1$ -
type: 0 for imperfect maze, 1 for perfect maze
To solve a maze, run the following command:
python maze_solver.py <maze_file> <algo> [max memory used by SMA*] <output_file>
algo: 0 for BFS, 1 for DFS, 2 for IDDFS, 3 for A*, 4 for SMA*max memory used by SMA*: only used whenalgois 4, default is 5
The output file is a JSON file with the following format:
{
"visited": list of visited nodes,
"path": list of nodes in the solution path
}
To visualize the solution, run the following command:
python visualize_solution.py <maze file> <solution_file>