A breadth-first search algorithm in Java.