简体   繁体   English

循环图

[英]Cyclical graphs

I have a question about cyclical graphs. 我对循环图有疑问。

I understand that a simple cyclical graph is where one's edges and vertices are distinct. 我知道一个简单的循环图就是一个人的边缘和顶点是不同的。

Am I correct to assume that this means that no edge/vertex is visited more than once when completing a cycle? 我是否正确地假设这意味着完成一个循环后不会多次访问边/顶点? and that the opposite is for a non simple graph? 而对于非简单图则相反吗?

I would also like to know if having a graph with only say two vertices can be cycled through? 我也想知道是否有一个只说两个顶点的图可以循环吗? or is there no need to cycle through a graph with two vertices? 还是不需要遍历具有两个顶点的图?

For example: Can you cycle through this? 例如:您可以循环浏览吗?

A <-> B
  • If the graph is directed and is not a multigraph, eg A -> B , then there's no cycle, because you can only go from A to B and cannot go from B to A . 如果图是有向图而不是多图,例如A -> B ,则没有循环,因为您只能从AB ,而不能从BA
  • If the graph is а directed multigraph, eg A <-> B , then its not cyclic, because A would have been already visited, before you try to get back to it from B . 如果图是有向多重图,例如A <-> B ,则它不是循环的,因为在尝试从B返回到A之前,它已经被访问过。 However, if you want to find a cycle of non-visited edges, then it would be cyclic, as you would track which edges are visited. 但是,如果要查找未访问边缘的周期,那么它将是循环的,因为您将跟踪访问了哪些边缘。
  • If the graph is undirected, eg A - B , then there's no cycle, as A and B will be visited exactly once. 如果图形是无向的,例如A - B ,则没有循环,因为AB将被精确地访问一次。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM