Skip to content
Solve and generate mazes in JS
JavaScript HTML
Branch: master
Clone or download
Latest commit 9b575d7 Jan 28, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information. Update Jan 28, 2019
app.js Update Jan 27, 2019
bfsgraph.gif Update Jan 28, 2019
index.html Initial commit Jan 27, 2019
rd.gif Add gifs Jan 28, 2019

Maze Solver and Generator

This website generates mazes with recursive divsion and solves them with BFS. The maze and the solution are visualized on the HTML <canvas>.

Recursive Division - Maze Generation

Essentially, at every step, the algorithm bisects the maze horizontally or vertically - then, it chooses a random cell along this bisection to leave open (that way the 2 resulting regions are still connected). Then, the same algorithm is performed on the 2 new regions. Recursion continues until it no longer makes sense to continue bisecting.

Wikipedia GIF:

Breadth-First Search - Maze Solving

Breadth-first search (BFS) is an algorithm for traversing or searching tree or graph data structures. It starts at the tree root (or some arbitrary node of a graph, sometimes referred to as a 'search key'[1]), and explores all of the neighbor nodes at the present depth prior to moving on to the nodes at the next depth level.

You can’t perform that action at this time.