πŸ—ΊοΈ

Interactive Pathfinding Visualizer

Watch AI search algorithms find the optimal path in real-time

JavaScript A* Algorithm Dijkstra BFS/DFS Graph Theory

Choose Search Algorithm

50ms
0
Nodes Explored
0
Path Length
0ms
Search Time
A* Search
Algorithm

Legend

Start
Goal
Wall
Visited
Current
Path

How to Use

🎯 Setup

  • Click and drag to move start (blue) or goal (red) positions
  • Click empty cells to create walls (black)
  • Click walls to remove them
  • Use "Generate Maze" for random obstacles

πŸƒ Running

  • Select an algorithm from the buttons above
  • Adjust speed with the slider
  • Click "Start Search" to begin visualization
  • Watch the algorithm explore and find the path!

Algorithm Comparison

A* Search

Best for: Most situations

Guarantees: Optimal path

Uses both distance traveled and estimated distance to goal. Usually the fastest optimal algorithm.

Dijkstra

Best for: Weighted graphs

Guarantees: Optimal path

Explores all directions equally. Slower than A* but guaranteed to find the shortest path.

Breadth-First

Best for: Unweighted graphs

Guarantees: Optimal path

Explores level by level. Great for understanding but slower than A*.

Depth-First

Best for: Memory-constrained situations

Guarantees: Finds a path (not optimal)

Goes as deep as possible before backtracking. Not optimal but uses less memory.

Greedy Search

Best for: Quick approximations

Guarantees: Fast (not optimal)

Always moves toward the goal. Very fast but can get trapped by obstacles.