searchdata-structurestreeartificial-intelligenceiterative-deepening

Iterative Deepening Without Specified Depth Limit


I have a question regarding the search technique iterative deepening. My question is, what is the difference between normal Depth-First search and Iterative Deepening without a specified depth limit? So I have a tree with a goal node but have no specified limit in my iterative deepening search. Would this output the same traversal sequence as if I were to do a regular depth-first search?


Solution

  • Suppose that the goal is at a depth level of 3 (with root being at depth = 0), and it's not all the way on the "left" side of the tree (where it would be found immediately by a Depth-First Search (DFS)).

    A normal DFS may spend a lot of time search at depth levels of 4, 5, 6, etc., beforing moving back "up" the tree, "to the right", and then finally finding the goal at depth 3. With Iterative Deepening, if there is a goal at depth = 3, you will never waste time looking at nodes at depth = 4. This is because Iterative Deepening first does a DFS with a depth limit of 1, then a DFS with a depth limit of 2, and finally a DFS with a depth limit of 3 (which will find the goal and therefore terminate the search).

    Note that in this example situation, Breadth-First Search (BrFS) would also not waste time at a depth of 4, and probably would be a bit faster due to not re-doing some work that was already done previously. It would take a lot more memory though.

    Another advantage of Iterative Deepening is that it cannot get stuck in an infinitely long path. Now in most practical situations an infinitely long path is unlikely anyway, but it's definitely possible. DFS could get stuck in such an infinite path.

    Finally, Iterative Deepening has an advantage compared to DFS in that it can provide more useful results when terminating it due to running out of processing time. This is especially important in search algorithms for game-playing (think of a Chess engine). Since you explicitly specified that there is a goal node in your situation, I don't think this is relevant for you, but let me know if you're interested and I can write the explanation for this advantage as well.