【问题标题】:Can there be self loops for undirected graphs?无向图可以有自循环吗?
【发布时间】: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


【解决方案1】:

有几种类别的无向图。在不允许循环(自引用)的地方,它们被称为simple graphs。但是确实没有理由考虑在同一对节点之间具有循环甚至多条边的无向图:这些称为multigraphs

循环是将顶点连接到自身的边(有向或无向);根据应用程序可能允许或不允许。

与简单图相反,多重图是一个无向图,其中允许多条边(有时是循环)。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-01-18
    • 1970-01-01
    相关资源
    最近更新 更多