Shortest path using BFS in mapreduce