且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

算法优化-多点之间的最短路径

更新时间:2022-12-17 10:35:46

对更新后的帖子的回答是,检查各种可能性的解决方案是***的(至少到目前为止,还没有人发现更好的算法).是的,那是一位旅行推销员,他的本质不是触摸每个城市,而是一次.如果您不想寻找***的解决方案,则可能会发现使用工作速度更快的启发式方法很有用,但与理想解决方案之间的差异却有限.

Answering to the updated post, your solution of checking every possibility is optimal (at least, noone has discovered better algorithms so far). Yes, that's a travelling salesman, whose essense is not touching every city, but touching every city once. If you don't want to search for best solution possible, you may find it useful to use heuristics that work faster, but allow for limited discrepancy from ideal solution.

对于将来的答复者: Floyd-Warshall算法和所有Floyd-类似的变体在这里不适用.

For future answerers: Floyd-Warshall algorithm and all Floyd-like variations are inapplicable here.