0

I'm trying to understand the space complexity for IDDFS. This is stated as being O(bd) in many sources, for example: https://ai.stackexchange.com/questions/24478/what-is-the-space-complexity-of-iterative-deepening-search#:~:text=Iterative%20deepening%20search%20(IDS)%20is,is%20O(bd).

Looking at this diagram:

enter image description here

From my understanding, all the blackened nodes from node "B" are still in memory when the algorithm begins looking at node "C" and its children (tree labelled 1) - is this correct? Or once we look at node "C" onwards are they removed from memory?

The fact that that all nodes are blackened out at the end of this Limit (tree labelled 2) makes it seem that node "b" and its children are still in memory.

If they are kept in memory, I understand using Big O notation should show the "worst case scenario" of an algorithm, in this case shouldn't it be O(b^d)? (For example where node "G" is the goal in this example)

Crocs123
  • 105
  • 7
  • Those nodes are not kept in memory. The blackness in your diagram just means something else, like "already visited". You diagram also doesn't seem to represent iterative deepening in any way, so I question the source or interpretation in general. – Matt Timmermans Mar 08 '23 at 13:14
  • Here's some more examples showing similar diagrams, to my understanding, that previous branches are kept in memory until the limit is reached: https://www.youtube.com/watch?v=7DLmUKHdi6A And here under part 5: https://iq.opengenus.org/iterative-deepening-search/ – Crocs123 Mar 08 '23 at 14:46
  • Perhaps you're confused because you expect that there's a data structure to keep track of the "explored" nodes. There isn't. – Matt Timmermans Mar 08 '23 at 15:02

0 Answers0