简体   繁体   English

直径为k <| V |的连通加权有向图,找到最短路径

[英]connected weighted directed graph with diameter k< |V|, find the shortest path

You are given a connected weighted directed graph G = (V,E) with diameter k < |V| 给出了一个连接的加权有向图G =(V,E),其直径k <| V | and I am trying to find a way to give the most efficient (running time) algorithm to find the shortest path from S (source) to any node v in V. I cant figure it out how to use the given diameter to make the algorithm more efficient? 我试图找到一种方法,给出最有效的(运行时间)算法,以找到从S(源)到V中任何节点v的最短路径。我无法弄清楚如何使用给定的直径来制作算法更高效?

Thanks for you help. 感谢您的帮助。

The diameter doesn't help at all, you can ignore it. 直径根本没有帮助,您可以忽略它。 Take an extreme example, a fully connected graph. 举一个极端的例子,一个完全连接的图。 It's diameter will be 1 (every node is just one link away). 直径为1(每个节点只有一个链接)。

However you can imagine that all the edges have a very large weight except for a path like 1->2->3->4->5->..->N that have a very low weight, so the path will have to go through the low cost edges and therefore through all the nodes. 但是,您可以想象,除了像1-> 2-> 3-> 4-> 5-> ..-> N这样的路径的权重非常低之外,所有边缘的权重都非常大,因此该路径将具有穿越低成本的边缘,从而穿越所有节点。

If the diameter is expressed in weight you can optimize dijkstra to ignore any update that grows over the diameter. 如果直径以重量表示,则可以优化dijkstra以忽略直径上的任何更新。

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

相关问题 正加权有向无环图中的k边最短路径 - k-Edge Shortest Path in Positive Weighted Directed Acyclic Graph 最多使用 k 个顶点的有向加权图中的最短路径 - Shortest path in a directed weighted graph that uses at most k vertices 加权有向图中的最短路径 - Shortest path in weighted directed graph 给定有一个负边(u,v)的有向加权图,找到最短路径(s,t) - Given directed weighted graph that has one negeative edge (u,v), find shortest path (s,t) 在有向加权图中找到两个节点之间的最短路径 - Find shortest path between two nodes in directed weighted graph 加权有向图最短路径的最佳方法 - Weighted Directed Graph best method for shortest path 如何从加权图中的顶点找到长度为k的最短路径? - How to find the shortest path of length k from a vertex in a weighted graph? 找到有向图的最短路径 - Find a shortest path for a directed graph 在源列表和目标列表中的有向加权图中查找最短路径 - Find Shortest Path in a directed weighted graph from list of sources and list of destinations 为了找到最短路径,如何在有向加权图中将一个边精确设置为零? - How to set exactly one edge to zero in directed weighted graph in order to find shortest path?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM