算法像贝尔曼

编程入门 行业动态 更新时间:2024-10-22 03:02:30
本文介绍了算法像贝尔曼 - 福特,只为多重启动,单一目的地是哪里?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

像Bellman-Ford算法​​和Dijkstra算法的算法存在上找到的图中每个顶点由单一的起始顶点的最短路径。然而,在我写的程序,开始顶点往往比目标顶点确实改变了很多。有什么算法,做相反的工作 - 也就是说,给定一个目标的顶点,找到最短路径从每一个的启动的顶点

Algorithms like the Bellman-Ford algorithm and Dijkstra's algorithm exist to find the shortest path from a single starting vertex on a graph to every other vertex. However, in the program I'm writing, the starting vertex changes a lot more often than the destination vertex does. What algorithm is there that does the reverse--that is, given a single destination vertex, to find the shortest path from every starting vertex?

推荐答案

刚刚扭转所有的边缘,并处理目的地开始节点。问题解决了。

Just reverse all the edges, and treated destination as start node. Problem solved.

更多推荐

算法像贝尔曼

本文发布于:2023-11-30 20:57:12,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1651447.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:贝尔   算法

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!