About

Maze Solver is a web application that lets users build and generate their own mazes and visualize their solutions with pathfinding algorithms. Works on large screen devices and web browsers that support JavaScript and HTML Canvas.

Pathfinding Algorithms

Pathfinding algorithms check if a path exists between two nodes on a graph. Various pathfinding algorithms will use different techniques to search the graph from a start node to a target node.

Depth-First-Search (DFS)

Depth-First Search searches every branching path in a maze one at a time until it finds the target node. DFS typically works better if the start and target nodes are far apart. However, DFS doesn't always find the shortest path between two nodes in a maze.

An image of DFS on a graph

Breadth-First-Search (BFS)

Breadth-First Search searches every branching path in a maze simultaneously until it finds the target node. BFS typically works better if the start and target nodes aren't far apart. However, unlike DFS, BFS will always find the shortest path between two nodes in a maze.

An image of BFS on a graph

Bidirectional Search

Bidirectional Search uses the same algorithm as BFS except it searches from both nodes simultaneously. Similar to BFS, Bidirectional Search typically works better if the start and target nodes aren't far apart. Additionally, Bidirectional Search will also find the shortest path between two nodes in a maze.

An image of Bidirectional Search on a graph

A Star Search Algorithm (A*)

A* Search utilizes heuristic values assigned to each node to prioritize which nodes to search first. For example, nodes closer to the target node are given a higher heuristic value since they have a higher chance of leading to a valid path. However, the efficiency of A* depends on the accuracy of the hueristic values. A* will always find the shortest path between two nodes in a maze.

An image of A* on a graph