algorithm - 最小路径 - 所有边至少一次

标签 algorithm graph graph-theory cycle chinese-postman

我有一个有很多环的有向图,可能是强连通的,我需要从中得到一个最小环。我的意思是我需要得到循环,这是图中最短的循环,并且每条边至少被覆盖一次。

我一直在寻找一些算法或一些理论背景,但我唯一找到的是中国 postman 算法。但是这个解决方案不适用于有向图。

有人能帮帮我吗?谢谢

编辑>> 该图的所有边都具有相同的成本 - 例如 1

最佳答案

看看这篇论文 - Directed Chinese Postman Problem .这是正确的问题分类(假设没有更多限制)。

如果您只是阅读理论,请仔细阅读 this page ,来自算法设计手册。

重点引述(导引版下半部分):

The optimal postman tour can be constructed by adding the appropriate edges to the graph G so as to make it Eulerian. Specifically, we find the shortest path between each pair of odd-degree vertices in G. Adding a path between two odd-degree vertices in G turns both of them to even-degree, thus moving us closer to an Eulerian graph. Finding the best set of shortest paths to add to G reduces to identifying a minimum-weight perfect matching in a graph on the odd-degree vertices, where the weight of edge (i,j) is the length of the shortest path from i to j. For directed graphs, this can be solved using bipartite matching, where the vertices are partitioned depending on whether they have more ingoing or outgoing edges. Once the graph is Eulerian, the actual cycle can be extracted in linear time using the procedure described above.

关于algorithm - 最小路径 - 所有边至少一次,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2359078/

相关文章:

algorithm - 图中的独立集

python - 使用数据框分组显示折线图

algorithm - 如何找到通过一组集合的最短路径?

algorithm - 找到一条通过最大点数的直线

c# - 手动记录算法 session 超时

ruby - 学习数据结构和算法的书籍/方法?

javascript - HTML class = Ajax action,如何让点击的类调用好的action?

algorithm - 从图形中消除对称性

algorithm - 这个算法的效率是多少

algorithm - 查找权重为 K 或更低的从节点 A 到 B 的加权图中的所有路径