A* heuristic, overestimation/underestimation?

后端 未结 5 1910
执笔经年
执笔经年 2020-12-08 03:01

I am confused about the terms overestimation/underestimation. I perfectly get how A* algorithm works, but i am unsure of the effects of having a heuristic that overestimate

5条回答
  •  长情又很酷
    2020-12-08 03:41

    From the Wikipedia A* article, the relevant part of the algorithm description is:

    The algorithm continues until a goal node has a lower f value than any node in the queue (or until the queue is empty).

    The key idea is that, with understimation, A* will only stop exploring a potential path to the goal once it knows that the total cost of the path will exceed the cost of a known path to the goal. Since the estimate of a path's cost is always less than or equal to the path's real cost, A* can discard a path as soon as the estimated cost exceeds the total cost of a known path.

    With overestimation, A* has no idea when it can stop exploring a potential path as there can be paths with lower actual cost but higher estimated cost than the best currently known path to the goal.

提交回复
热议问题