What is the total number of nodes generated by Iterative Deepening depth first search and Breadth First search in terms of branching factor "b" and depth of shallowest goal "d"
2 Answers
Here i found this on this website, it might help what you are looking for, the number really depends on the values for d and b :
https://mhesham.wordpress.com/tag/depth-first-search/
Iterative Deepening DFS worst case # of nodes:
N(IDS) = (b)d + (d – 1)b2 + (d – 2)b3 + …. + (2)bd-1 + (1)bd = O(bd)
BFS worst case # of nodes generated:
N(BFS) = b + b2 + b3 + b4 + …. bd + (bd + 1 – b) = O(bd + 1)
Example using real numbers:
branching factor = 10 and depth of shallowest goal = 5
N(IDS) = 50 + 400 + 3000 + 20000 + 100000 = 123450
N(BFS) = 10 + 100 + 1000 + 10000 + 100000 + 999990 = 1111100

- 63
- 1
- 8
As seen on Wikipedia:
"In an iterative deepening search, the nodes at depth d are expanded once, those at depth d-1 are expanded twice, and so on up to the root of the search tree, which is expanded d+1 times.[5] So the total number of expansions in an iterative deepening search is IDS number of expansions
Example: For b=10 and d=5 example "
Reference: https://en.wikipedia.org/wiki/Iterative_deepening_depth-first_search#Proof

- 86
- 2
- 6