Overview
Breadth-First Search uses a queue to expand the current frontier before moving to the next level. In an unweighted graph, this gives shortest-path distances by edge count.
Explores a graph from a start node in increasing number of edges.
Compact metadata for implementation and discovery.
Breadth-First Search uses a queue to expand the current frontier before moving to the next level. In an unweighted graph, this gives shortest-path distances by edge count.
Quick facts
Runtime and memory behavior at a glance.
Best
O(V + E)
Average
O(V + E)
Worst
O(V + E)
Space
O(V)
Show rings of nodes expanding outward from the start.
BFS gives shortest paths by number of edges only in unweighted graphs.
What each reference supports for this entry.
Textbook reference for the algorithmic family and analysis of Breadth-First Search.
Good next jumps from the relationship graph, ranked for useful discovery.
Pathfinding · Core
Lee routing is a grid-based breadth-first search for shortest paths in unweighted grids.
Compare with thisData Structures · Foundation
A deque or queue supports breadth-first frontier order.
Compare with thisImage Processing · Foundation
Flood fill often uses BFS-style frontier expansion over grid cells.
Compare with thisData Structures · Foundation
BFS commonly iterates outgoing neighbors from adjacency lists.
Compare with thisBidirectional search often runs BFS-style expansions from both ends.
Dijkstra's Algorithm extends frontier expansion to weighted graphs.