作者热门文章
- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
我的意思是有向图可以有自环,所以我不明白为什么无向图不能有自环(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) 是自循环。我真的没有看到这对图形遍历有任何问题。
最佳答案
有几类无向图。在不允许循环(自引用)的地方,它们被称为 simple graphs .但确实没有理由考虑在同一对节点之间具有循环甚至多条边的无向图:这些被称为 multigraphs :
A loop is an edge (directed or undirected) that connects a vertex to itself; it may be permitted or not, according to the application.
A multigraph, as opposed to a simple graph, is an undirected graph in which multiple edges (and sometimes loops) are allowed.
关于algorithm - 无向图可以有自循环吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46624329/
为了获得我的瓷砖,我这样做: style(styleUri = Style.MAPBOX_STREETS) { +vectorSource(id = "parcel-source") {
我是一名优秀的程序员,十分优秀!