[英]How to find the shortest path cover a specific set of edges in a weighted undirected graph?
Given a weighted undirected graph(say with nodes A,B,C,D,E), and a set of jobs which require to go from one node to another(say A->C,AB,D->E,E->F). 给定一个加权无向图(例如,具有节点A,B,C,D,E),以及一组需要从一个节点移动到另一个节点的工作(例如,A-> C,AB,D-> E,E- > F)。 How to find the shortest path starting from A which covers all jobs in the job set? 如何找到从A开始的最短路径,该路径涵盖了作业集中的所有作业?
PS Triangle inequality applies, which means if there exists an edge from x to y then it is the shortest path from x to y. PS三角不等式适用,这意味着如果存在从x到y的边,那么它是从x到y的最短路径。
Do not need to go back to A. 不需要回到A。
Jobs are directed. 工作是有方向的。
Hinted to use A star algorithm. 提示使用A star算法。
I'm working on something similar. 我正在做类似的事情。 This algorithm might be helpful www.geeksforgeeks.org/travelling-salesman-problem-set-1/ 该算法可能会有所帮助www.geeksforgeeks.org/travelling-salesman-problem-set-1/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.