0. | while limit < maximum tree depth |
1. | add initial node to stack |
2. | while stack is not empty |
3. | remove node x from stack |
4. | if node x is goal node then return |
5. | for each node y connected to node x |
6. | if node y in explored or stack then continue |
7. | if depth of node y > limit then continue |
8. | add node y to stack |
9. | order stack by path length |
10. | if stack contains goal node then return |
11. | add node x to explored |
12. | increase limit |