Algorithm 360: shortest-path forest with topological ordering H | Synapse