简体   繁体   English

在具有正权重的有向图中找到最短循环

[英]Find the shortest cycle in a directed graph with positive weights

A similar question of mine was asked in the below link, where one of the comments states that "The problem is certainly NP-hard because TSP can be reduced to it".在下面的链接中提出了我的一个类似问题,其中一条评论指出“这个问题肯定是 NP 难的,因为 TSP 可以减少到它”。

Finding shortest circuit in a graph that visits X nodes at least once 在至少访问 X 节点一次的图中查找最短路

On the other hand, in another link shown below, one of the solutions says that by modifying Dijkstra's algorithm, the complexity would be $O(n^3)$.另一方面,在下面显示的另一个链接中,其中一个解决方案表示通过修改 Dijkstra 算法,复杂度将为 $O(n^3)$。

Find cycle of shortest length in a directed graph with positive weights 在具有正权重的有向图中找到最短长度的循环

I am wondering which solution in one of those links is correct.我想知道其中一个链接中的哪个解决方案是正确的。

From your description you only want to find any shortest cycle, so the second link applies to you and you can find an efficient algorithm.根据您的描述,您只想找到最短的周期,因此第二个链接适用于您,您可以找到一种有效的算法。 In the first case the question asked for the shortest cycle going through some set of vertices.在第一种情况下,问题要求通过某些顶点集的最短周期。

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

相关问题 在具有正权重的有向图中找到最短长度的环 - Find cycle of shortest length in a directed graph with positive weights 在仅通过特定节点(而不是其他节点)的正加权有向图中找到最短循环 - Find the shortest cycle in a positive weighted directed graph passing through only specific nodes (not the other nodes) 具有正权重和循环的有向图 Dijkstra 算法 - Dijkstra's algorithm for directed graph with positive weights and a cycle 找到有向图的最短路径 - Find a shortest path for a directed graph 如何在线性时间内边缘权重为0或1的有向图中找到最短路径? - How to find shortest path in a directed graph that has edge weights either 0 or 1 in linear time? 具有设定权重数的有向加权图中的最短路径 - Shortest path in a directed, weighted graph with set number of weights 正加权有向无环图中的k边最短路径 - k-Edge Shortest Path in Positive Weighted Directed Acyclic Graph Dijkstra:在有向图中找到最短路径 - Dijkstra: Find Shortest path in directed graph 具有正权重和直径 D 的图中的单源最短路径 - Single-source shortest path in a graph with positive weights and diameter D 具有负权重,允许重复的边和顶点的图形中的最短循环 - Shortest cycle in a graph with negative weights, repeated edges and vertices allowed
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM