IDS
This commit is contained in:
15
Algorithm/IterativeDeepening/readme.md
Normal file
15
Algorithm/IterativeDeepening/readme.md
Normal file
@@ -0,0 +1,15 @@
|
||||
🔹 基本思想
|
||||
|
||||
广度优先搜索 (BFS):逐层扩展,能保证找到最优解,但需要大量内存。
|
||||
|
||||
深度优先搜索 (DFS):沿一条路径搜索下去,内存消耗小,但可能陷入深层无解分支,不能保证最优解。
|
||||
|
||||
**迭代加深搜索 (IDS) 的做法是:**
|
||||
|
||||
设定一个最大搜索深度限制(depth limit),先用 DFS 在这个深度内搜索。
|
||||
|
||||
如果没找到解,就把深度限制增加 1,再次用 DFS 搜索。
|
||||
|
||||
重复以上过程,直到找到目标或达到全局深度上限。
|
||||
|
||||
> 重点是树没有上限的情况->棋类竞技
|
||||
Reference in New Issue
Block a user