Add a BFS solution to the shortest-path problem.