Topological order
Puts places in an order where every one-way road runs forwards, as tasks that must come before others. Start with the places no road leads into; each time one takes its place, cross off its roads, and any place left with none coming in is ready next.
the map
the queue
- roads crossed off
- 0
- places put in order
- 0
step 1 of 1
Examples