知识卡片
有向环使拓扑序不可能
若有向图存在环,沿环每条边都要求前者早于后者,最终又要求末点早于起点,无法形成满足所有边的线性序。拓扑排序只对 DAG 定义。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- 第20章 基本图算法 · 查看原书依据
Topological sorting is defined only on directed graphs that are acyclic; no linear ordering is possible when a directed graph contains a cycle. Think of a topological sort of a graph as an ordering of its vertices along a horizontal line so that
参考来源
- 位置:《算法导论(第4版)》第20章《基本图算法》(OEBPS/chapter020.xhtml,文本字符[45000,50000))。
- 结论依据:原文限定只能排序有向无环图;环上的先后要求构成矛盾。
- 原始内容:Topological sorting is defined only on directed graphs that are acyclic; no linear ordering is possible when a directed graph contains a cycle. Think of a topological sort of a graph as an ordering of its vertices along a horizontal line so that