algorithmbreadth-first-searchiterative-deepening

What is the total number of nodes generated by Iterative Deepening depth first search and Breadth First search


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"


Solution

  • 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