use dijkstra algorithm to find all shortest path