The Search Tree Creation Algorithm: Final Version

Recall that the goal of a state space search tree creation is to find a final state.

If it is found, it must be returned so that the solution path can be constructed.

If the final state is not found following an exhaustive search, null must be returned:

Search(s,adder)
   d[s] = 0
   pred[s] = null
   DEQ = {s}
   while DEQ ≠ {} do
      u = Remove[DEQ]
      if success
         then return u
      else
         for each v ∈ Expand(u) do
             Add(DEQ,v,adder)
   return null