Four generation algorithms — DFS Backtracker, Prim's, Kruskal's and Wilson's loop-erased random walk — animated live. Then solve instantly with BFS to find the shortest path.
Each algorithm creates a different "texture" of maze. DFS makes long corridors, Prim's creates branching patterns, Kruskal's is uniform, Wilson's is unbiased.
Pick a generation algorithm and watch it carve the maze. Then click Solve to see BFS find the shortest path from start to finish.
Wilson's algorithm produces a perfectly uniform random spanning tree — every possible maze is equally likely. It uses loop-erased random walks, discovered by David Wilson in 1996.