Definition
Depth-First Search
Properties
Completeness
No, DFS is not generally complete. It fails in infinite-depth spaces and state spaces with loops (free-like search)
It can be modified to avoid repeated state along path (explored set, frontier). Then, DFS is complete in finite spaces.
Time Complexity
The time complexity is
Space Complexity
The space complexity is
Optimality
DFS is not generally optimal. But there ‘s a variant with backtracking (keep one successor node at a time)’, which is optimal.
