Skip to content

Glossary: Algorithms Beyond the Basics

graphlib

Also written: TopologicalSorter, graphlib.CycleError, static_order

A Python standard-library module with a `TopologicalSorter` class. It takes a dict from each task to the tasks it depends on, and `static_order()` returns a valid order or raises `CycleError`.

Where the book teaches it

Related terms

Topological orderKahn's algorithmCycle