Breadth-first search demonstration