Breadth-first search (source code)

= Breadth-first search
{c}
{wiki}

Breadth-first search explores a graph in successive distance layers from a starting vertex. Before two exploration branches meet, the explored edges form a tree.