Figure 3: The depth-first control strategy algorithm

 Put the start node on list OPEN (unexpanded nodes).

IF start node is a goal node, show solution.

while searching for a solution

   IF list OPEN is empty, no solution exists, quit.

   Remove first node n from list OPEN and place it 
   on list CLOSED (expanded nodes).

   IF depth of node n > maximum depth, quit.

   Expand node n.

   Place all successors of node n at beginning of list OPEN.

   IF any successor is a goal node, show solution.

end while