0

I have a set data which is a collection of node - node - associated cost. This cost is represented as a distance in feet.

I also have a x-y-coordinate for each node. Now in the A* algorithm I will need to add the cost from node to node + the heuristic cost from the middle node to the destination. However, these two values needs to be having the same metric/unit. I can't have one in feet and the other one in coordinate distance.

I know that in order to do this I first need to find a scaling factor, to scale the cost from feet to x-y-coordinate distance. Right? All I can say is that all this cost is scalable. So this beta value will be the same for all pair of node-node.. Question is how do I find this value?

What I've done right now is to find the coordinate distance between node - node and then from that compare with the cost in feet. And I can therefore find a beta, which is a constant and should work for every node-node-cost (feet)... I am not sure if this is true though. I am not looking for a magic trick here, just a simple way/math to solve this

4

1 回答 1

0

通常我们知道网格是以某种比例因子对物理世界进行建模。你还不知道吗?

无论如何,我认为你的直觉是正确的。也就是说,计算您知道实际成本的两点之间的坐标距离(以英尺为单位),除以另一点,这就是您的比例因子。当然,假设“成本”是两个节点之间的直线距离。

也就是说,如果 node1 和 node2 之间的距离是 3 英尺,并且节点的坐标分别是[0,0][0,9],那么“比例因子”是 3/9 ... 或 9/3,这取决于你想要的方式进行转换。

在这种情况下,坐标距离的一个单位是 1/3 英尺。或者一英尺的坐标距离是 3 个单位。所以从坐标到脚,你除以 3。从脚到坐标,你乘以 3。

于 2011-03-05T01:51:31.403 回答