开发者

How is iterative deepening more efficient than just scanning the nodes at a specified depth level.

开发者 https://www.devze.com 2023-03-25 19:26 出处:网络
Isn\'t it redundant to rescan n-1 levels of nodes f开发者_运维问答or each iteration?I quote from Artificial Intelligence: A Modern Approach:

Isn't it redundant to rescan n-1 levels of nodes f开发者_运维问答or each iteration?


I quote from Artificial Intelligence: A Modern Approach:

Iterative deepening search may seem wasteful because states are generated multiple times. It turns out this is not too costly. The reason is that in a search tree with the same (or nearly the same) branching factor at each level, most of the nodes are in the bottom level, so it does not matter much that the upper levels are generated multiple times. In an iterative deepening search, the nodes on the bottom level (depth d) are generated once, those on the next-to-bottom level are generated twice, and so on, up to the children of the root, which are generated d times. So the total number of nodes generated in the worst case is

N(IDS) = (d)*b+(d-1)*b^2+...+(1)*b^d

which gives a time complexity of O(b^d) - asymptotically the same as breadth-first search.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号