Topologically sort an iterable of edges.
The topologically sorted array of nodes.
If a cycle is present in the graph, the cycle will be ignored and the return value will be only approximately sorted.
import { topologicSort } from '@lumino/algorithm';let data = [ ['d', 'e'], ['c', 'd'], ['a', 'b'], ['b', 'c']];topologicSort(data); // ['a', 'b', 'c', 'd', 'e']
The iterable object of edges to sort. An edge is represented as a 2-tuple of [fromNode, toNode].
[fromNode, toNode]
Generated using TypeDoc
Topologically sort an iterable of edges.
Returns
The topologically sorted array of nodes.
Notes
If a cycle is present in the graph, the cycle will be ignored and the return value will be only approximately sorted.
Example