Calculates the shortest distances by vertices in Dijkstra's method.
The Monoid instance for W.
Monoid
W
The total order for W.
The shortest distances by vertices.
Calculates the shortest distances by vertices in Dijkstra's method.