Topological Sorting for Lanqiao Cup
1. Topological Sorting Definition: Let $G = (V, E)$ be a directed graph with $n$ vertices. A vertex sequence from $V$ is called a topological sequence if and only if: for any path from vertex $u$ to $v$, $u$ appears before $v$ in the sequence. Basic Idea: Select a vertex with no predecessors (in-deg...