Breadth-first search.