Shortest path implemented.