の実装、私はグラフ function IDDFS(root)
for depth from 0 to ∞
found ← DLS(root, depth)
if found ≠ null
return found
function DLS(node, depth)
if depth = 0 and node is a goal
これはFind first null in binary tree with limited memoryへのフォローアップです。 ウィキペディアは、反復深化深度の最初の検索では最短経路が見つかることを示しています。私は、k個のノードに限定されたメモリに実装されており、ツリーに最も少ない回数アクセスしています。例えば 、私のバイナリツリーがある場合: 0
1 2
3 4 5