Add Dijkstra's algorithm to find the shortest solution