Added a new type of dijkstra algorithm.