【发布时间】:2017-10-07 19:35:41
【问题描述】:
我的意思是有向图可以有一个自循环,所以我看不出无向图不能拥有它的原因(CLRS 说它是被禁止的,但没有给出正当理由)。
Example:
G_directed = (V,E) is a directed graph
Say this graph has the vertex set V = {1,2,3,4,5,6}
With edges E = {(1,2),(2,2),(2,4),(2,5),(4,1),(4,5),(5,4),(6,3)}
-----------------------------------------------------------------
Say we now decide to turn G_directed into an undirected graph:
G_undirected = (Vu,Eu) is an undirected graph
Vu = {1,2,3,4,5,6}
With edges E = {(1,2),(2,2),(2,4),(2,5),(4,1),(4,5),(6,3)}
在示例中 (2,2) 是 自循环。我真的看不出图遍历有任何问题。
【问题讨论】:
-
您有问题吗?根据定义,无向图中的每条边都会产生一个循环。因此,我应该说,关于无向图中的循环的讨论不如讨论有向图中的循环那么发达。
标签: algorithm graph graph-algorithm