algorithm - 统一成本搜索中前沿的理想数据结构是什么(优先级队列似乎不够)?

标签 algorithm data-structures priority-queue a-star

很多时候我们需要丢弃重复的状态,如 uniform-cost search 中所述。 .

  if n is in frontier with higher cost
  replace existing node with n

优先级队列不提供用于搜索项目的优先级然后更新它的接口(interface)。我很惊讶我找不到任何与此相关的资源,任何人都可以提供帮助。

最佳答案

您正在寻找优先搜索队列。

A priority search queue efficiently supports the opperations of both a search tree and a priority queue. A Binding is a product of a key and a priority. Bindings can be inserted, deleted, modified and queried in the queue (usually in logarithmic time), and the binding with the least priority can be retrieved in constant time.

这是一个implementation在 haskell 。

关于algorithm - 统一成本搜索中前沿的理想数据结构是什么(优先级队列似乎不够)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12688364/

相关文章:

java - 使用 ConcurrentSkipListMap 实现的优先级队列,不确定如何让消费者阻塞它

algorithm - 在A*搜索算法中,为什么要加上g(n)?

python - 如何将字典插入空字典?

java - 深度优先搜索提前终止

algorithm - MongoDB 使用什么算法来散列 ObjectId?

c++ - 如何找到一棵树的大小和高度?

java - 为什么有N个节点的AVL树会保持C<=N/2?

algorithm - 如何数一棵树上的 child

c - 树 - 连接的无环图 - 表示

java - 高效的集合使用