DFS - RANDOM MAZE GENERATOR AND SOLUTION

Programmed and developed a random maze generator that's able to find it's own solution using a septh First Search algorithm and implented on wxWidgets for GUI and C++.

Step 1

Created a maze on a Pane with a two dimensional array of Cells using wxWidgets

Step 2

Using wxSmith to automatically write framework code in wxWidgets where the algorithm can be implemented. The algorithm checks for available neighbors of a cell. An origin cell is specified and then each neighbor (top, right, bottom, left) is checked to see if it is an available edge. The maze is explored while neighbor edges are available. Cells being explored are marked pink color. The algorithm stops when "No Neighbors" are available.

Step 3

the previous wxWidgets framework with simple modifications. In this step, we will be clearing the Walls for the Current Cell and also the 'from' Cell. A link for the 'from' cell is saved in the current cell for tracing the solution.

Step 4 (Last Step)

All cells in the Matrix are explored using a stack of available cells. Once all the backtracking is complete, all cells have been explored and the Maze is complete. The a path from any target cell in the Maze can be found to the the graph origin.

Resources