S01 · implies
Before
\text{all permutations of }VAfter
012,021,102,120,201,210
Conditions: none
Rule: work · Uses: G1, work
Leaf basis: work
All3! candidates contain each vertex once.
derivation-mko-topological-ordering-dag-01 · ocme-new142-reader-adoption-20261021
List every valid order and audit source-removal invariants.
Finite graph orders, not topological spaces.
workG1 — V={0,1,2}, E={(0,2),(1,2)}; Kahn selects the least zero-indegree vertex at each step.V,E — complete vertex and edge setspos — order positionmko_definition · cited — A candidate ordering must be a permutation of all vertices and must place u before v for every edge u→v. For a small graph enumerate all valid orders. Kahn source removal chooses the lexically first zero-indegree vertex at each step and retains the trace. If no source exists while vertices remain, give an explicit directed cycle. Multiple orders and edgeless graphs are allowed; a zero-vertex graph has one empty order. One invalid candidate does not show the graph is cyclic. These graph orders are not topological-space notions. · mko-topological-ordering-dagwork · prerequisite — A topological order is a full vertex permutation with pos(u)<pos(v) for every edge u-to-v; Kahn removes a zero-indegree source and updates the residual graph. A DAG has no directed cycle; a topological order is a full vertex permutation placing each edge's source strictly before its target.Before
\text{all permutations of }VAfter
012,021,102,120,201,210
Conditions: none
Rule: work · Uses: G1, work
Leaf basis: work
All3! candidates contain each vertex once.
Before
012,102
After
\operatorname{pos}(0)<\operatorname{pos}(2),\quad\operatorname{pos}(1)<\operatorname{pos}(2)Conditions: none
Rule: work · Uses: G1, S01, work
Leaf basis: work
Both orders place0 and 1 before 2, respecting every edge.
Before
021,120
After
021\text{ violates }1\to2;\quad120\text{ violates }0\to2Conditions: none
Rule: work · Uses: G1, S02, work
Leaf basis: work
Each candidate has an explicit violated edge.
Before
201,210
After
\text{both violate }0\to2\text{ since2 precedes0}Conditions: none
Rule: work · Uses: G1, S03, work
Leaf basis: work
The final two cases fail too, completing all six permutations.
Before
d^-(0,1,2)=(0,0,2)
After
\text{Kahn chooses }0;\quad\text{remaining indegrees }(1:0,2:1)Conditions: none
Rule: work · Uses: G1, S04, work
Leaf basis: work
Delete source0 and its outgoing edge, updating2's indegree.
Before
\text{remaining }\{1,2\},\quad d^-=(0,1)After
\text{choose }1,\text{ then }2;\quad\text{output }012Conditions: none
Rule: work · Uses: G1, S05, work
Leaf basis: work
Removing1 releases2 as a source; then delete2, outputting every vertex.
Before
H:\ E_H=\{(0,1),(1,2),(2,0)\}After
d^-_H=(1,1,1),\quad0\to1\to2\to0\text{ is a cycle}Conditions: none
Rule: work · Uses: G1, S06, work
Leaf basis: work
For the separate graph with no source and remaining vertices, supply an explicit directed cycle.
Before
\operatorname{Orders}(G)=\{012,102\}After
G\text{ is a DAG and Kahn returns }012Conditions: none
Rule: work · Uses: G1, S07, work
Leaf basis: work
Positions strictly increase along edges of a valid order, ruling out a directed cycle.
No substeps in this guide.
S08 · premise_audit · G1, S07, work — A zero-vertex graph has one empty order; a nonempty edgeless graph has every permutation.S07 · premise_audit · G1, S06, work — Do not leave the cycle certificate implicit in Kahn stopping.S06 · premise_audit · G1, S05, work — Each source deletion keeps the output prefix free of violated incoming edges.S05 · premise_audit · G1, S04, work — Track indegrees in the remaining graph, not initial values.S04 · premise_audit · G1, S03, work — The valid orders are exactly012 and 102, so they are not unique.S03 · premise_audit · G1, S02, work — Their failure does not make the original graph cyclic.S02 · premise_audit · G1, S01, work — Both edges, not only0-to2, must be checked.S01 · premise_audit · G1, work — Sequences with duplicates or omissions are excluded.Each of the 3! candidates appears once, with edge evidence for its validity or failure.
Delete outgoing edges and update indegrees at every step.
reject — 012 is a complete valid order.reject — Both012 and 102 are valid.reject — The edge1-to2 remains, leaving indegree1.All valid orders are 012,102; lex-first Kahn outputs012 and the graph is a DAG.
2 declared checks for this guide; only the listed expressions are covered.
b1b2f1dcf8c50d67a93fe52d95f8eef7b3abba9f75e458baf0ea665f57f182f5f2532425a1c004b4b86bffc40d16191b5e5c83e328d6cd464a04e9680e5cb6230b6ecb75b0de6ea8867e0fa97d61121a6898906cSCOPED_LEAD_AND_BILINGUAL_CONTEXT_REVIEWSame-source full JSON (formulas, ASTs, controls and revision log)