Viualization of Different maze Solving Algorithm banner

Viualization of Different maze Solving Algorithm

8 devlogs
5h 57m 42s

I have made a visualization system of different maze solving algorithm using C++, visualization is done through openGl.

To use this Project:

  • Press "R" key to reset the maze or generate a new maze
  • Press "D" to solve this maze.

( thi…

I have made a visualization system of different maze solving algorithm using C++, visualization is done through openGl.

To use this Project:

  • Press “R” key to reset the maze or generate a new maze
  • Press “D” to solve this maze.

( this is a project that i build upon an opengl template that i made before flavourtown, but the contents for this project is made after 19th Dec i.e anything except the basic setup is done after 19th dec)

Demo Repository

Loading README...

Ablag

I added the code for setup, and steps of Dijkstra’s algorithm and also edited the render function to be able to render the solution. Also added the key detection for “D” key where if it it pressed then the solution will start provided that the maze has been generated.

In this code, the green part is the part generated by the DFS maze generation and the blue part is the cells explored by dijkstra’s algorithm and the line is the “solution”.

But there is a bug on this, it does show an solution but it is not the correct one, like it goes over the maze walls. I will need to fix that. ( you can see the problem in the image attached)

Attachment
0
Ablag

Changed the code such that the state switching for different cases ( generating and idle before) from a boolien to a enum to add multiple cases for adding different algorithm.
Added code for nodes, shortest distance to cells, and other variables needed for some maze solving algorithms.

Attachment
0
Ablag

I added two boxes indicating the starting and end point of the maze and added the keypress of “R” key resetting the maze, recreating a maze.

Attachment
0
Ablag

I made a simple version of my project that is generating maze using DFS.

It takes a grid and uses DFS to choose a random side and then go though there then again check if there are any open sides and if not then the process repeats making the mazes.

Attachment
0