简体   繁体   中英

Can Dijkstra's algorithm be applicable to the Travelling Salesman Problem?

This is a general query. Dijkstra's algorithm is able to find the shortest distances between each of the nodes while the TSP problem says to start and end on the same node by traveling each node at least once with the shortest path. Is there any way I can solve it using Dijkstra's algorithm approach because I am unable to implement the complex approach using dynamic programming?

Dijkstra's algorithm can be used but it doesn't help (a lot). First you need to see that the graph you "need to use" to find a solution is not the input graph G=<V,E> but a graph which is derived from the input graph. Which can be Gd=<Vd,Ed> where Vd is a ordered subset of V and Ed is a pair from Vd , where an edge '([v1,..,vn],[v1,..,vn,vm]) in Ed exists if (vn,vm)\\in E . Now the cost of an edge in Gd correspond to the cost in G . A node is a goal state when it contains all nodes from G

Brute-force Depth/Bredth/Iterative would work. How about dijkstra. You need to have

a consistent heuristic which estimate is always less than or equal to the estimated distance from any neighboring vertex to the goal, plus the step cost of reaching that neighbor.

Obviously, the constant zero is such a heuristic. Can you get a better heuristic? Not really due to the NP nature of TSP. Interestingly in real world problems you can sometimes find in-consistent heuristics, which still produce good results.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM