Breadth-first search

Breadth-first search visits vertices from a queue, all those one edge away before any two away, so it finds the path with the fewest edges to every vertex, in $O(V + E)$.

From Data Structures and Algorithms.