There are many search algorithms, but today we present a site that puts several of them into practice. It is PathFinding.js, a site that uses various algorithms to solve mazes.
Pathfinding (or pathing) is the process by which a computer application traces the shortest path between two points. It is a very practical variant for solving mazes. This field of research is largely based on Dijkstra's algorithm to find a shortest path in a weighted graph. Starting from this definition, today we present PathFinding.js, a site that uses various algorithms to solve mazes.
Creating Mazes and Downloading Libraries
Upon entering, you will find a series of instructions: the green node represents the starting position while the red node is the final position. Both nodes can be dragged to the position you want. By clicking inside the white grid and dragging the cursor you can create obstacles. This way you can build a maze with PathFinding.js in just a couple of minutes.
On the right side you will see a panel where you can choose an algorithm (including Dijkstra's algorithm), each with its options. When you select Start Search at the bottom corner, below the right panel, the animation will begin with a stroke starting from the green node to the red node.
You can also pause the search by clicking on Pause Search, or start from scratch with Clear Walls. The goal of this project, according to its creator, is to provide a pathfinding library that can be easily integrated into 2D games. Super useful if this is what you were looking for. You can access the algorithm library by clicking here.
Official site: PathFinding