Q2 — SEARCH FOR OPTIMAL SOLUTION

DFID is provably optimal only because every iteration re-inspects nodes it closed in earlier iterations.

The Question

#QuestionOfficial answer
2Which of the following variants of Depth First Iterative Deepening (DFID) is guaranteed to find an optimal solution?C

The Topic in 60 Seconds

DFID runs depth-limited DFS with limit 1,2,3,…1, 2, 3, \dots, throwing away all bookkeeping between iterations. With unit edge costs, the iteration with limit dd re-explores every node at depth ≤d\le d from scratch — so the first iteration that reaches the goal reaches it at minimum depth. BFS optimality at DFS memory cost.

Deep-dive: browse the Concepts section for iterative deepening.

Solutions

2 — Which DFID variant guarantees an optimal solution?

Options:

OptionVerdict
A — inspects only new nodesFails: skipping previously seen nodes lets an early iteration close a node on the shallow path; later iterations refuse to walk through it
B — inspects new as well as open nodesNot enough: reusing stale OPEN entries can still block rediscovery; textbook DFID keeps no cross-iteration frontier at all
C — inspects new as well as closed nodesCorrect — see below
D — None of theseWrong: C is exactly the case

Answer: C

Why C is right

The optimality argument lives in the redundant work:

  1. Suppose a goal sits at minimum depth kk (unit costs).
  2. Iterations 1…k−11 \dots k-1 never reach depth kk → they cannot report it.
  3. Iteration kk explores all paths of length ≤k\le k afresh — closed-node history from earlier rounds is discarded, so nothing blocks reaching the goal via its shortest route.
  4. First success happens at depth exactly kk: shortest path guaranteed.

If DFID respected old CLOSED entries (the spirit of A), a node first closed at depth jj would never be re-expanded, and a strictly shorter route discovered only later could be missed. DFID's wastefulness (re-expanding closed nodes every iteration) is not a bug — it is the optimality proof.

Tricks & Tips

Answers: 2 C