Dijkstra's algorithm for directed graphs added