Repeat the following until no more vertices with d < ∞ can be selected:
- Select an unselected vertex s with minimal d
- Update the d values of its unselected neighbors n. For each of them, n.d is the smaller of:
- the current n.d
- s.d + the weight of the edge joining s and n. In this case, also set the predecessor n.π = s
Tip: You can drag the nodes of the graph if the edges overlap.