Topological Order

Write a LEDA program that generates a topological order for a randomly generated graph, in O(n+e) time, i.e., using the ideas presented in the text pp.381-382.

Hints

Here's sample output:
geoff@duck:~/c++> TO 5 5
Creating random graph with 5 nodes and 5 edges ...

[0] : [0]---->[4][0]---->[3]
[1] :
[2] : [2]---->[4][2]---->[1][2]---->[0]
[3] :
[4] :

[2][0][3][4][1]
There's an executable version ~geoff/c++/TO available on duck for you to experiment with.

Answer