拓撲排序是圖的頂點的一個排列 ,使得邊
意味著
在
中出現在
之前 (Skiena 1990, p. 208)。只有有向無環圖才能進行拓撲排序。可以使用以下方法計算圖的拓撲排序:TopologicalSort[g] 在 Wolfram 語言包中Combinatorica`
.
拓撲排序
使用 探索
參考文獻
Skiena, S. "拓撲排序。" §5.4.3 in Implementing Discrete Mathematics: Combinatorics and Graph Theory with Mathematica。 Reading, MA: Addison-Wesley, pp. 208-209, 1990。在 上被引用
拓撲排序請這樣引用
Weisstein, Eric W. "拓撲排序。" 來自 --一個 資源。 https://mathworld.tw/TopologicalSort.html