Skip to content

TopologicalOrderResult = { acyclic: true; order: Int32Array; } | { acyclic: false; cycle: Int32Array; }

Defined in: packages/graph/src/topological-order.ts:9

A topological order, or the directed cycle that rules one out. Exactly one of the two answers holds, and acyclic says which.

{ acyclic: true; order: Int32Array; }

readonly acyclic: true

readonly order: Int32Array

Every vertex, each after all of its predecessors.


{ acyclic: false; cycle: Int32Array; }

readonly acyclic: false

readonly cycle: Int32Array

The vertices of one directed cycle in walk order: each has an edge to the next, and the last to the first.