Skip to content

Topological order

networks

Level 2 of 3

Also called Topological sort and Kahn's algorithm.

fresh numbers

The test's questions that a run answers, asked again on new numbers whenever you like. The answer, its working and the reason for every other choice come from topological order's own run on the numbers shown.

choose one

question 1

On this map, how many roads are crossed off before the queue empties?

B1C1D0F1G2H1D
the answer, and why

the answer is A

D crosses off its 2 roads, which frees H. H has no road out. G still has F to G coming in, so the queue empties.

if you chose another

  • That is every road on the map, but 4 of them sit on a loop.
  • That adds G to C, but G is never taken.
  • That is a ring with no place free, but D has no road coming in.

new numbersthe test page's numbers

question 2

On which map does the run cross off the most roads? A>B means a road from A to B.

the answer, and why

the answer is C

The run crosses off 5 roads on F>A, A>B, G>D, B>C, G>B, the most of the four.

if you chose another

  • That map has 2 roads crossed off, fewer than 5.
  • That map has 3 roads crossed off, fewer than 5.
  • That map has 2 roads crossed off, fewer than 5.

new numbersthe test page's numbers