A* / Dijkstra Pathfinding (Grid)

This interactive simulator explores A* / Dijkstra Pathfinding (Grid) in Engineering. Interactive 40×28 grid pathfinder: A* (f=g+h), Dijkstra, or greedy best-first; Manhattan / octile / Euclidean heuristics, 4- vs 8-connectivity, paint walls + weighted cells, watch open / closed sets expand. Use the controls to change the scenario; watch the visualization and any graphs or readouts to connect the model with lectures, labs, and homework.

Who it's for: Best once you already know the basic definitions and want to build intuition. Typical context: Engineering.

Key terms

  • dijkstra
  • pathfinding
  • grid
  • astar dijkstra grid
  • engineering

How it works

**Interactive A\* / Dijkstra / Greedy best-first pathfinding** on a 40×28 grid. Pick **A\*** (f = g + h, optimal with admissible heuristic), **Dijkstra** (f = g, ignores the goal — optimal but explores everywhere), or **Greedy best-first** (f = h alone — fast but not optimal). Paint walls, drag the **S** / **G** markers, drop **weighted cells** (cost ×5), toggle **8-connectivity**, and watch the open / closed sets expand frame-by-frame. Try a maze with **Manhattan vs Euclidean** heuristic and 4- vs 8-connectivity to see how the heuristic biases the search.

Key equations

A*: f(n) = g(n) + h(n), open := min-heap by f
Manhattan h = |Δr| + |Δc|; Octile h = max + (√2−1)·min