Graphs 0/61

Topological sort: ordering directed graphs · 3 of 3

Cycle detection

See why a directed cycle rules out every order, find and print one with a DFS that tracks unseen, active and finished vertices, and get a topological order from the same search.

2,122 words · 10 min read