Professional Documents
Culture Documents
Class 9.1
Class 9.1
Objectives:
• Uninformed Search Strategies
– Breadth-first Search
– Uniform-cost search
– Depth-first search
– Depth-limited search
– Iterative deepening depth-first search
– Bidirectional search
UNINFORMED SEARCH STRATEGIES:
Depth-first search:
• Always expands the deepest node in the current frontier of the
search tree.
• Implementation:
Depth-first search:
UNINFORMED SEARCH STRATEGIES:
Depth-first search:
UNINFORMED SEARCH STRATEGIES:
Properties of Depth-first search:
• Complete??
• No: fails in infinite-depth spaces, spaces with loops
• Modify to avoid repeated states along path complete infinite spaces
• Time??
• It is bounded by the size of the state space
• O(bm): where m is the maximum depth of any node and it is terrible
if m is much larger than d
• but if solutions are dense, may be much faster than breadth-first
• Space??
• O(bm), i.e., linear space!
• Optimal??
• Depth first search will explore the entire left subtree even if node C
is a goal node, which would be a better solution; hence, depth-first
search is not optimal
UNINFORMED SEARCH STRATEGIES:
Depth-limited search:
• It is a depth-first search with a predetermined depth limit l to solves the infinite-
path problem
• Nodes at depth l are treated as if they have no successors.
UNINFORMED SEARCH STRATEGIES:
Depth-limited search:
• DEPTH-LIMITED-SEARCH: This function initializes the depth-limited
search process by creating a root node from the initial state of the
problem and then calls the recursive DLS function.
• RECURSIVE-DLS: This function recursively explores the search space
up to a specified depth limit. It takes three parameters: the current node,
the problem instance, and the depth limit.
• If the current node satisfies the goal test, it returns a solution.
• If the depth limit is reached (limit = 0), it returns a cutoff.
• Otherwise, it iterates over all possible actions from the current state,
generates child nodes for each action, and recursively calls itself with
the child nodes and a reduced depth limit.
• If the recursive call returns a cutoff, it marks that a cutoff occurred.
• If the recursive call returns a non-failure result, it returns that result.
• If a cutoff occurred during any of the recursive calls, it returns a
cutoff.
• If none of the above conditions are met, it returns failure, indicating
that no solution was found within the depth limit.
UNINFORMED SEARCH STRATEGIES:
Depth-limited search:
• Unfortunately,
– It introduces an additional source of incompleteness if we
choose l < d, that is, the shallowest goal is beyond the
depth limit.
Replace the goal test with a check to see whether the frontiers of the
two searches intersect; if they do, a solution has been found.
UNINFORMED SEARCH STRATEGIES:
Comparing uninformed search strategies: