Computer Science / Algorithms
Part of the Graph Traversal (BFS & DFS) Learning Experience βSee breadth-first search explore an unweighted maze grid, one queue pop at a time, until it finds the shortest (fewest-moves) path.
This visualizer runs breadth-first search (BFS) on an unweighted grid: every move costs the same, so BFS's fewest-edges guarantee is exactly the shortest path here (see Graph Traversal for why that guarantee depends on uniform cost). BFS expands outward in rings, using a queue to always explore the next-closest unvisited cell first, until it reaches the end β at which point the path it found is guaranteed shortest. For graphs where edges have different weights, BFS's guarantee no longer holds; that's what the dedicated Dijkstra's Algorithm Visualizer demonstrates instead, with real weighted relaxation.
No β this grid is unweighted, so it runs plain breadth-first search (BFS). BFS's fewest-moves guarantee only equals 'shortest path' when every move costs the same, which is true here but not in a general weighted graph. See the dedicated Dijkstra's Algorithm Visualizer for real weighted relaxation.
The question doesn't quite apply β this grid has no weights at all (every move costs 1). Weighted graphs, including the question of negative weights, are covered by the Dijkstra's Algorithm topic and its visualizer.