拓扑排序是图的顶点的一个排列 ,使得边
意味着
在
中出现在
之前 (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.net.cn/TopologicalSort.html