Dijkstra algorithm to find the shortest path from given source node