Implementing breadth-first search for neighborhood.