最短点之间的最短路径距离,以X-Y坐标给出 [英] Shortest Path distance between points given as X-Y coordinates

查看:765
本文介绍了最短点之间的最短路径距离,以X-Y坐标给出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在处理一个包含X和Y坐标的向量包含大约800点的项目。这些点表示线路的电网。
我的目标是计算点A和点B之间的最短距离路径,它可以或不能沿着包含电线的X-Y坐标的矢量给出的路径定位。

I am currently working on a project that has a vector containing X and Y coordinates for approximately 800 points. These points represent an electric network of lines. My goal is to compute the shortest distance Path between a Point A and Point B that can be or can not be located along the path given by the vectors containing the X-Y coordinates of the electric lines.

我已经阅读过Dijkstra算法,但由于我不太熟悉,我不知道我是否应该朝这个方向走。

I have read about the Dijkstra Algorithm but since i am not that much familiar with it, I am not sure if I should go in that direction. I will be very thankful if I can get any feedback or comments from you that can direct me to solve this matter.

推荐答案

如果我能收到任何反馈或意见,我将非常感谢。计算最短路径Dijakstra会很好。

For computing the shortest path Dijakstra would be fine.

您可以使用 A * ,它使用最佳的距离猜测,以便将搜索聚焦到正确的方向,从而更快地到达。

You may get faster results from using A*, which uses a best guess of the distance in order to focus its search in the right direction, thereby getting there quicker.

如果您反复查询相同的数据集,则记忆可以。

If you are repeatedly querying the same data set, then memoization is fine.

那些推荐使用强力算法的人是傻瓜 - 值得花一点时间学习如何编写高效的解决方案。但您可以使用 Floyd-Warshall算法。不幸的是,这不会告诉你最短路径只是多久。

Those people who recommend a brute-force algorithm are fools - it's worth taking a little time to learn how to program an efficient solution. But you could calculate the shortest path between all points using the Floyd-Warshall algorithm. Unfortunately, this won't tell you what the shortest path is just how long it is.

这篇关于最短点之间的最短路径距离,以X-Y坐标给出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆