Sorts a directed acyclic graph (DAG) using depth-first search (DFS).
const edges = [ ["a", "b"], ["a", "c"], ["a", "e"], ["b", "d"], ["c", "d"], ["d", "e"],];const order = sort_dag_dfs(edges); // ["a", "c", "b", "d", "e"] Copy
const edges = [ ["a", "b"], ["a", "c"], ["a", "e"], ["b", "d"], ["c", "d"], ["d", "e"],];const order = sort_dag_dfs(edges); // ["a", "c", "b", "d", "e"]
Generated using TypeDoc
Sorts a directed acyclic graph (DAG) using depth-first search (DFS).