本文介绍了查找所有周期中无向图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如果我有一个无向图,我怎么能得到所有周期的列表?
If I have an undirected graph, how can I get a list of all cycles?
例如,从下面的图中,我希望循环:
For example, from the following graph, I would want the cycles:
(a,b,d,e,c)
(a,b,c)
(b,d,e)
推荐答案
您presumably只想要简单的周期(那些不重复的顶点),或者还有他们的无限数量。即使这样,也可以是循环的一个指数编号。也许,这是不是你真的想解决这个问题?
You presumably want only simple cycles (those that don't repeat a vertex), or there's an infinite number of them. Even then, there can be an exponential number of cycles. Perhaps this isn't the problem you really want to solve?
这篇关于查找所有周期中无向图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!