Skip to content

Topological order

networks

Level 2 of 3

Also called Topological sort and Kahn's algorithm.

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

Tap a spot to put your pen down there, then tap a spot next to it to draw a road. Keep tapping to draw on.

Places stand in two rows, A to D above and E to H below. A one-way road joins two places next to each other (one road across each square), written with a >, such as A>B for a road from A to B. Separate roads with commas, for example A>B, B>F, A>E, E>F.