implementation of ShortestPath Dijkstra algorithm