Breadth-first search
Given a graph and a source node , breadth-first search systematically discovers every vertex available from , producing a "breadth-first tree", where is the root and the simplest path in the tree from to an arbitrary vertex corresponds to the shortest walk from to in .