Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Maze Solver

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.

Usage

Generate Maze

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

Solve 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 when algo is 4, default is 5

Output File

The output file is a JSON file with the following format:

{
    "visited": list of visited nodes,
    "path": list of nodes in the solution path
}

Visualize Solution

To visualize the solution, run the following command:

python visualize_solution.py <maze file> <solution_file>

About

Implementation of different search algorithms for solving perfect and imperfect mazes

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages