Skip to content

Maze generation through randomized DFS and solving through Backtracking

License

Notifications You must be signed in to change notification settings

Karthick47v2/maze-gen-and-solver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

A simple command-line based program made using c++.

Maze generated using randomized DFS(Depth First Search), to make sure that there is only one path leads to destination. Maze will be generated and saved into 'SquaredMaze.txt' file. And Maze solved using Backtracking algorithm. Maze solver will take text file as input, solve the maze and outputs 'SquaredMazeSolved.txt' file. As there are n^2 cells, from each cell there are 3 unvisited neighbouring cells. So, the time complexity for solving maze using this algorithm is, **O(3^(n^2)). --Text files will be saved to 'maze' folder.

*Starting point is denoted as 'A'
*Destination is denoted as 'B'
*Mazer border is marked as '1' and free space is marked as '0'
*Shortest valid path is shown by '#'  

Technologies:

  • C++

About

Maze generation through randomized DFS and solving through Backtracking

Topics

Resources

License

Stars

Watchers

Forks

Languages