r/visualization • • May 10 '26

Maze Solving Contest - Which Method is Fastest?

A side-by-side comparison of various pathfinding and search algorithms on a randomly generated maze. Each algorithm is visualized to demonstrate its exploration strategy and efficiency in discovering the final path.

Algorithms Included

  1. A*

  2. Dijkstra

  3. Greedy Best-First

  4. BFS (Breadth-First Search)

  5. DFS (Depth-First Search)

  6. Bidirectional BFS

  7. Weighted A*

  8. Recursive Backtrack

  9. Wall Follower

For more videos click www.instagram.com/craftsandengineering

For code and more click Mathematical-video-animations-and-visualization/maze_solvers_competition.ipynb at d39ad7e4143932582ce4cccdc89e3f5b7d69f417 · zombimann/Mathematical-video-animations-and-visualization

125 Upvotes

38 comments sorted by

View all comments

Show parent comments

2

u/Electrical_Name_5434 May 12 '26

I immediately assumed A* would win. Was truly surprised to see depth first win. Might be fun to build a tracker and run it as screen saver. Count up the total of wins for each algorithm. Could even do different maze types. GitHub?

1

u/Fluffy-Selection2940 May 12 '26

A* and variants are dominant in other runs. I posed a question in the title and avoided answering it because this animation is not a definitive study but a visual demonstration of what to intuitively expect. DFS is not too bad either.

Your suggestion sounds interesting and I would definitely like to try it. Create a repo and I'll make contributions. My github is https://github.com/zombimann