带 boost 图库的 A* Dijkstra 算法的启发式函数
我对 A* Dijkstra 算法没有太多详细的了解。我知道这也是一种最短路径算法,它还考虑 h(x) 启发式和 g(x)。我在我的项目中使用 Boost Graph Library,该库中有 A* 算法。
有人可以向我展示一个简单的例子来定义简单无向图的启发式吗?这对我以后的发展会有很大的帮助。
I have no much detailed knowledge about A* Dijkstra algorithm. I know it is also a shortest path algorithm which also considers h(x) heuristic along with g(x). I am using Boost Graph Library for my project and there is A* algorithm in the library.
Can anybody show me with a simple example to define a heuristic for a simple undirected graph? It would be of great help to me in moving further.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果没有实现示例,A* 的启发式就像“我知道路径至少有这个长度(而不是更短)”。一个例子是地图,其中两个节点之间的道路距离不能短于空中距离(或欧几里得距离或您使用的任何坐标系)。因此,启发式函数的一个示例是返回两个节点之间的空中距离的函数。
Without having an example implemented, a heuristic for A* is something like "I know that the path has at least this leghth (and not shorter)". An example would be a map where the road distance between two nodes cannot be shorter than the aerial distance (or Euclidean distance or whatever coordinate system you use). So an example for a heuristic function would be a function returning the aerial distance between two nodes.