Recall The Expansion Algorithm

Suppose: Then for any search tree state u we can define the expansion algorithm as:

Expand(u)
   children = {}
   for each move ∈ moves do
      child = move.doMove(u)
      if child ≠ null and not OccursOnPath(child, u)
         then d[child] = d[u] + 1
              pred[child] = u
              add child to children
   return children