Function header for Dijkstra's added.