有关此伪代码,请参见http://en.wikipedia.org/wiki/Best-first_search#Algorithm_.5B3.5D:
OPEN = [initial state]
while OPEN is not empty or until a goal is found
do
1. Remove the best node from OPEN, call it n.
2. If n is the goal state, backtrace path to n (through recorded parents) and return path.
3. Create n's successors.
4. Evaluate each successor, add it to OPEN, and record its parent.
done
Run Code Online (Sandbox Code Playgroud)
步骤1说"删除最佳节点" - 这意味着使用优先级队列.
归档时间: |
|
查看次数: |
3130 次 |
最近记录: |