BFS, again with initial and final vertex