Repeat the following until no more vertices with d < ∞ can be selected:

Tip: You can drag the nodes of the graph if the edges overlap.