可以修改标准的A*(A星)算法,使其在一致性启发式/统一成本/迪杰斯特拉搜索下无需更新前沿吗?

标准方法如下: AI: 现代方法

function UNIFORM-COST-SEARCHnode <- INITIAL-STATEfrontier <- priority queue ordered by PATH-COST, with node as the only elementexplored <- an empty setloop do    if frontier is empty then return failure    node <- POP frontier  /* chooses the lowest-cost node in frontier */    if GOAL-TEST(node) then return SOLUTION(node)    add node to explored    for each action in ACTIONS(node) do        child <- CHILD-NODE(problem, node, action)        if child is not in explored or frontier then            frontier.INSERT(child)        else if child is in frontier with higher PATH-COST then            replace that frontier node with child

这里这一步实现起来很复杂,普通的优先级队列无法高效地更新某个元素的优先级。

        else if child is in frontier with higher PATH-COST then            replace that frontier node with child

我在考虑以下方式修改算法:

function UNIFORM-COST-SEARCH-Modifiednode <- INITIAL-STATEfrontier <- priority queue ordered by PATH-COST, with node as the only elementexplored <- an empty setloop do    if frontier is empty then return failure    node <- POP frontier  /* chooses the lowest-cost node in frontier */  > if node is in explored then continue    if GOAL-TEST(node) then return SOLUTION(node)    add node to explored    for each action in ACTIONS(node) do        child <- CHILD-NODE(problem, node, action)  >     if child is not in explored then            frontier.INSERT(child)

所以我不在乎前沿是否包含重复状态。我只扩展前沿中第一个重复状态。由于路径成本是一致的,并且前沿使用优先级队列实现,忽略其他成本更高的重复状态是无害的。

这是合理的吗?

更新

抱歉,我忘了提到我特别关注一致性启发式的情况。


回答:

这个想法原则上是正确的,但有一个错误:

  > if node is in explored then continue

如果启发函数不是单调的(不违反可接受性),这一行可能会导致失败。

A*允许重新探索节点,如果新成本比之前找到的更好。这些情况发生在非单调启发函数中。

你应该仅在新成本“更大”于explored中节点附带的成本时才continue,而不是仅当它存在于其中时。


编辑:(基于评论和问题编辑)

对于h=0,A*实际上退化为迪杰斯特拉算法,并且由于迪杰斯特拉算法永远不需要修改已经“探索”的节点(当然假设权重为正)——该算法在这些情况下是正确的。

一般来说,在单调启发函数中不会重新访问已经访问过的节点,所以这不是问题,这种方法在这些情况下是正确的——但要注意不要将其应用于非单调启发函数中。

Related Posts

L1-L2正则化的不同系数

我想对网络的权重同时应用L1和L2正则化。然而,我找不…

使用scikit-learn的无监督方法将列表分类成不同组别,有没有办法?

我有一系列实例,每个实例都有一份列表,代表它所遵循的不…

f1_score metric in lightgbm

我想使用自定义指标f1_score来训练一个lgb模型…

通过相关系数矩阵进行特征选择

我在测试不同的算法时,如逻辑回归、高斯朴素贝叶斯、随机…

可以将机器学习库用于流式输入和输出吗?

已关闭。此问题需要更加聚焦。目前不接受回答。 想要改进…

在TensorFlow中,queue.dequeue_up_to()方法的用途是什么?

我对这个方法感到非常困惑,特别是当我发现这个令人费解的…

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注