Pathfinding Algorithm Visualiser Comparing Four Approaches

Apps & experiments · Creator, sole engineer · shipped

Pathfinding algorithms are usually taught one at a time, so their comparative behaviour - which explores more, which guarantees the shortest path, what a heuristic actually buys you - is never visible.

Code: https://github.com/vasu-devs/Maze-Pathfinder-Visualizer

The detail

This runs four classic algorithms on the same procedurally generated maze with distinct colour coding, so the difference in how much of the grid each one explores before finding the exit is immediately obvious.

Mazes are generated by recursive backtracking, which produces exactly one solution path. Path reconstruction uses parent pointers stored during traversal. The heuristic used for informed search is admissible for this grid, meaning it never overestimates and the shortest path is guaranteed.

Runs at 60 frames per second with path length and execution time reported per run.

Python, Pygame.

What I did

  • Implemented four pathfinding algorithms and a procedural maze generator from scratch
  • Built side-by-side comparison so the difference in exploration behaviour is visible rather than described
  • Implemented path reconstruction through parent pointers
  • Rendered at 60 frames per second with per-algorithm metrics

Stack

Python, Pygame, Algorithms, Data Structures, Data Visualization

Case study: https://www.siddhvasudev.com/projects/pathfinding-algorithm-visualiser-comparing-four-approaches