Can Astar visit nodes more than once?

后端 未结 1 1918
死守一世寂寞
死守一世寂寞 2021-01-03 02:53

I\'ve been reading wikipedia\'s Astar article. In their implementaion, they check each node if it\'s in the closed set, and if so they skip it. Isn\'t it possib

1条回答
  •  一生所求
    2021-01-03 03:26

    The answer to your question is below the psuedocode on the linked page, and also in the Description section on that page. From the remark below the psuedo code:

    Remark: the above pseudocode assumes that the heuristic function is monotonic (or consistent, see below), which is a frequent case in many practical problems, such as the Shortest Distance Path in road networks. However, if the assumption is not true, nodes in the closed set may be rediscovered and their cost improved. In other words, the closed set can be omitted (yielding a tree search algorithm) if a solution is guaranteed to exist, or if the algorithm is adapted so that new nodes are added to the open set only if they have a lower f value than at any previous iteration.

    So yes, the pseudocode does assume the heuristic is consistent and would have to be modified if it was not.

    0 讨论(0)
提交回复
热议问题