Professional Documents
Culture Documents
Lecture04 Uninformed Search (Part 2)
Lecture04 Uninformed Search (Part 2)
Lecture04 Uninformed Search (Part 2)
Fundamentals
All the nodes generated at depth d in the search tree are expanded
before the nodes at depth d+1.
Arad
Arad
75 118
140
Zerind Sibiu Timisoara
75 140 118
75 111
71 118
Arad Oradea Arad Lugoj
150 146 236 229
• Depth-first search always expands one of the nodes at the deepest level of the tree.
• Only when the search hits a dead end (a nongoal node with no expansion) search go
back and expands nodes at shallower levels.
• Space:
• Implementation:
• Nodes at depth l have no successors
Arad
Arad
Arad
• Time: O(bd)
• Space:
Notes:
• Maximum space is same as depth-first
• Time complexity is the same order as breadth-first, and when branching factor
is large, time is very close even with repeated searches:
Example: b=10, d=5: BFS -> 111,111 expansions
IDS -> 123,456 expansions
binary trees: IDS twice as long as depth-first
Summary
• All of the search techniques so far are “blind” in that they do not look at how far
away the goal may be: next we will look at informed or heuristic search, which
directly tries to minimize the distance to the goal.