[英]Traversing weighted graph through all vertecies ending up at the same point
Is there an algorithm that will allow me to traverse a weighted graph in the following manner? 是否有一种算法可以让我以以下方式遍历加权图?
Sounds like the Travelling Salesman Problem to me. 听起来对我来说是旅行商问题 。 An NP-hard problem.
一个NP难题。 There is no polynomial time algorithm that will give you the optimum solution.
没有多项式时间算法可以为您提供最佳解决方案。 You could use a search heuristic to get a close to optimal solution though.
您可以使用搜索试探法获得接近最佳的解决方案。
I am not sure, if any efficient algorithm exists, but a brute force approach would surely give you the answer. 我不确定是否存在任何有效的算法,但是蛮力方法肯定会给您答案。
In any case, can you give the constraints on the number of vertices/edges. 在任何情况下,都可以限制顶点/边的数量。
As Greg Sexton stated before me, it is a classic example of the Travelling Salesman Problem. 正如格雷格·塞克斯顿(Greg Sexton)在我面前所说的那样,这是旅行商问题的一个典型例子。 There are many advanced algorithms about for handling this style of problem, which is best for your particular situation rather depends on the graph.
有许多用于处理此类问题的高级算法,这最适合您的特定情况,而不是取决于图表。 If the number of vertices is high, you will need substantial computational power to get it done within a realistic time frame.
如果顶点数量很多,您将需要大量的计算能力才能在现实的时间内完成。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.