The most basic way to explore a network: start at a node and visit everything one step away, THEN everything two steps away, rippling outward like a stone dropped in a pond. A simple queue does it, and it hands you the shortest path in any unweighted graph for free. It’s the skeleton under maze-solvers, web crawlers, and social-degree counters. Slide to watch the wave spread.
Breadth-first search explores a graph in layers using a FIFO QUEUE: enqueue the source, then repeatedly dequeue a node and enqueue its unvisited neighbours, marking each with a distance one greater than its parent. Every node is reached by a shortest (fewest-edge) path, so BFS solves single-source shortest paths on UNWEIGHTED graphs in O(V+E). It underlies maze solving, web crawling, connected-component finding, and ‘degrees of separation’. A fail-loud self-check throws unless BFS assigns the correct level distances on a test graph. ◆ real graph algorithm, node-verified.
Gives shortest paths only when edges are UNWEIGHTED (equal cost); weighted graphs need [[the-dijkstra]]. The FIFO-queue level order is exact; the graph shown is illustrative.