BFS explores a graph in “waves” from a source. In an unweighted graph, BFS gives the
shortest path (fewest edges) to every node.
Click a node to set source. Optional: set a target to show the shortest path.
V 6 · E 7Source 0Target —Step 0
Legend: yellow = current “dequeue” node, green = visited, purple = discovered (in queue), blue/orange edge = the neighbor being checked.
If target is set, the final path is highlighted.