更改

跳到导航 跳到搜索
删除46字节 、 2020年11月1日 (日) 00:31
第49行: 第49行:       −
关于环在有向或无向图中的存在,可以通过'''深度优先搜索 depth-first search(DFS)'''来确定。具体方法是查找是否存在一条连边指向当前顶点的原始点(包括回边)。<ref>{{cite book|last=Tucker|first=Alan|authorlink=Alan Tucker|title=Applied Combinatorics |year=2006|publisher=John Wiley & sons|location=Hoboken|isbn=978-0-471-73507-6|edition=5th|page=49|chapter=Chapter 2: Covering Circuits and Graph Colorings}}</ref>DFS跳过的所有回边都是环的一部分。<ref name="sedgewick">{{citation | first=Robert | last=Sedgewick | title=Algorithms | chapter=Graph algorithms | year=1983 | publisher=Addison–Wesley | url-access=registration | url=https://archive.org/details/algorithms00sedg }}</ref>在无向图中,指向一个节点上级的连边不应算作后边,但是如果找到任何其他已访问的顶点可以视为后边。在无向图的情况下,只需要<math>\mathcal{O}(n)</math>时间即可在<math>n</math>个顶点图中找到一个循环,因为最多<math>n-1</math>个边可以是树边。
+
关于环在有向或无向图中的存在,可以通过'''深度优先搜索 depth-first search(DFS)'''来确定。具体方法是查找是否存在一条连边指向当前顶点的原始点(包括回边)。<ref>{{cite book|last=Tucker|first=Alan|title=Applied Combinatorics |year=2006|publisher=John Wiley & sons|location=Hoboken|edition=5th|page=49|chapter=Chapter 2: Covering Circuits and Graph Colorings}}</ref>DFS跳过的所有回边都是环的一部分。<ref name="sedgewick">{{citation | first=Robert | last=Sedgewick | title=Algorithms | chapter=Graph algorithms | year=1983 | publisher=Addison–Wesley | url-access=registration | url=https://archive.org/details/algorithms00sedg }}</ref>在无向图中,指向一个节点上级的连边不应算作后边,但是如果找到任何其他已访问的顶点可以视为后边。在无向图的情况下,只需要<math>\mathcal{O}(n)</math>时间即可在<math>n</math>个顶点图中找到一个循环,因为最多<math>n-1</math>个边可以是树边。
     
7,129

个编辑

导航菜单