Computing › Algorithms 2D
Pick a tool (wall, mud, water or eraser) and drag across the grid to draw. Drag the green circle (start) and the red target (goal) to move them. Use the generator to create mazes.
Choose an algorithm and press Play. Bluish cells have already been visited (from purple to light blue, in visiting order), yellow cells form the frontier (waiting to be explored) and the red line is the path found. Once the search is over, change the walls or the goal and watch the path update instantly.
Stepping on a normal cell costs 1, mud costs 3 and water costs 5. BFS and DFS ignore these costs; Dijkstra and A* take them into account.
Challenges: guess which algorithm visits fewer cells, or draw the cheapest path yourself and compare it with the optimal one.