可以修改标准的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

使用LSTM在Python中预测未来值

这段代码可以预测指定股票的当前日期之前的值,但不能预测…

如何在gensim的word2vec模型中查找双词组的相似性

我有一个word2vec模型,假设我使用的是googl…

dask_xgboost.predict 可以工作但无法显示 – 数据必须是一维的

我试图使用 XGBoost 创建模型。 看起来我成功地…

ML Tuning – Cross Validation in Spark

我在https://spark.apache.org/…

如何在React JS中使用fetch从REST API获取预测

我正在开发一个应用程序,其中Flask REST AP…

如何分析ML.NET中多类分类预测得分数组?

我在ML.NET中创建了一个多类分类项目。该项目可以对…

发表回复

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