This is a repository for the Maze Runner project. It was implemented in Java. The main goal was to practice Java, data structures and algorithms.
Example compilation and run:
javac -d bin src/*.java
java -classpath bin Main
The project consists of a couple of components:
- Random maze generator – the maze is represented as a grid (two-dimensional array of Cell objects). The Depth-First Search algorithm implemented as recursive backtracker is used to go through a grid and generate passes and walls.
- Breadth-First Search algorithm to find all neighboring vertices with the path cost for every graph node to represent maze as a graph
- Dijkstra's Shortest Path First algorithm to solve a graph and find a path from entry to exit
When run, the user can generate a random maze. The app will ask for a dimension. The valid dimension range is <2,65>.
The generated maze can be solved using the next option. The path will be marked on the maze and the shortest path from entry to exit through graph vertices will be displayed.
The project and algorithms do not aim for efficiency or speed. That's why you should avoid generating too big mazes (may cause memory flood or can take some time to solve!). Its purpose was to get familiar with simple algorithms and to follow them step by step. In some cases, they are slightly changed to meet my curiosity and requirements.
- Kamil Kaliś - kamkali