【发布时间】:2012-01-12 13:02:59
【问题描述】:
贪婪最佳优先搜索算法与最佳优先搜索算法不同吗?
wiki page 有一个单独的段落是关于 Greedy BFS 但有点不清楚。
我的理解是,贪婪 BFS 只是 BFS,其中维基百科算法中的“来自 OPEN 的最佳节点”是一个为节点计算的启发式函数。所以实现这个:
OPEN = [initial state]
CLOSED = []
while OPEN is not empty
do
1. Remove the best node from OPEN, call it n, add it to CLOSED.
2. If n is the goal state, backtrace path to n (through recorded parents) and return path.
3. Create n's successors.
4. For each successor do:
a. If it is not in CLOSED: evaluate it, add it to OPEN, and record its parent.
b. Otherwise: change recorded parent if this new path is better than previous one.
done
“来自 OPEN 的最佳节点”是一个启发式函数,用于估计节点与目标的接近程度,实际上是贪婪 BFS。我说的对吗?
编辑:评论 Anonymouse 的回答:
所以本质上,贪婪的 BFS 不需要“开放列表”,并且应该仅基于当前节点做出决定?这个算法是GBFS吗:
1. Set START as CURRENT node
2. Add CURRENT to Path [and optinally, to CLOSED?]
3. If CURRENT is GOAL, exit
4. Evaluate CURRENT's successors
5. Set BEST successor as CURRENT and go to 2.
【问题讨论】:
标签: algorithm search artificial-intelligence best-first-search