Finding the shortest path from A to B.