Breadth-first tree search