aMAZEd is a c++ program that lets you create and solve a rectangular maze rendered using OpenGL. It can be watched as it processes the maze itself.
The algorithms used for this project are RandomDFS for generation and A* search, DFS, BFS and Dijkstra for solving. It can be used as a tool for visualizing these algorithms as they work. See Example and Description section for a better understanding of colors.
- Demo-Preview
- Installation
- Usage
- Examples and description
- Additional material (Italian only)
- Contribute
- Release History
- License
- C++ Compiler (at least C++17)
- CMake (at least version 3.12)
- GLFW (at least version 3.4)
- Boost (at least version 1.84)
If you're willing to use conda
, or if you already do, all the above dependencies can be installed via
$ conda env create -f requirements.yaml
You must do this after the downloading part.
Note that this creates a maze
conda environment that needs to be activated.
You can download the last release here and unpack it
$ tar -xvf /path/to/tar #or zip file -C /path/to/your/directory
or if you want, you can clone this repository
$ git clone https://github.com/ottyanna/aMAZEd.git
Once done this, follow the instructions below in order to compile this code in your own directory.
$ cd /path/to/your/directory
$ # (if you're using conda -> conda activate <envname>)
$ mkdir build
$ cd build
$ cmake -DBUILD_SHARED_LIBS=ON ..
$ make
To execute the program run
$ ./exe [OPTIONS]
The [OPTIONS]
are:
0
to generate a simple 50x50 maze without solving it. The program also adds some loops.a
to generate and solve (A* search) a 50x50 maze with fixed delay of generationb
to generate a 180x100 maze with loops and solve it with all the algorithms with fixed delay in between to see the resultc
same asb
to time the solving algorithms without the visualizing partd
same asb
but without loopse
same asc
but without loops
Feel free to tweak the main.cpp
to set the delay variables (in milliseconds) and watch how the path finding algorithms work or change the dimension or the starting and ending point of the maze.
Running ./exe a
will generate the following:
-
the 50x50 maze with loops, where green and cyan represent the starting and ending points, respectively.
-
the shortest path in pink found by A*, where the violet and yellow represent the explored nodes.
There is a little presentation of the project in the Presentation folder. Feel free to check that out.
If you wish to contribute or you found any bug, feel free to open an issue or a pull request on the GitHub repository.
See CHANGELOG file.