You are on page 1of 11

Session Outcomes

•Student will learn some general-purpose search


algorithms.
Outline
• Uniform cost search
• Depth-limited Search
Uniform cost Search

•Instead of expanding the shallowest node, uniform-cost search


expands the node with the lowest path cost.

•Uniform-cost search does not care about the number of steps a path
has, but only about their total cost.

•Uniform-cost search is guided by path costs rather than depths, so


its complexity is not easily characterized in terms of branching
factor and depth
Uniform Cost-Search(continued…)

Example:
Uniform cost-search(continued…)

•Completeness: UCS is complete, such as if there is a solution,


UCS will find it.
•Time Complexity: Worst-case time complexity of UCS algorithm
is O (where C*is the cost of optimal solution).
•Space Complexity: Worst-case space complexity of UCS
algorithm is O (where C*is the cost of optimal solution).
•Optimality: UCS is optimal. This is because, at every step the
path with the least cost is chosen, and paths never gets shorter as
nodes are added, ensuring that the search expands nodes in the
order of their optimal path cost
•When all step costs are the same, uniform-cost search is similar to
BFS, except that the latter stops as soon as it generates a goal.
Uniform Cost Search(continued…)

Advantages:

•Uniform cost search is optimal.


•It helps to find the path with the lowest cumulative cost inside a
weighted graph having a different cost associated with each of
its edge from the root node to the destination node

Disadvantages:

•It will get stuck in an infinite loop if there is a path with an


infinite sequence of zero-cost actions.
•The storage required is exponentially large.
Depth-Limited Search

•A depth-limited search algorithm is similar to depth-first search


with a predetermined limit.

•Depth-limited search can solve the drawback of the infinite path in


the Depth-first search.

•In this algorithm, the node at the depth limit will treat as it has no
successor nodes further.
Depth Limited Search(continued…)

Example:
Depth Limited Search(continued…)

•Completeness: DLS search algorithm is complete if the solution


is above the depth-limit.

•Time Complexity: Time complexity of DLS algorithm is O(bℓ).


(where ℓ is the depth limit of the search).

•Space Complexity: Space complexity of DLS algorithm is


O(b×ℓ).

•Optimal: Depth-limited search can be viewed as a special case of


DFS, and it is also not optimal even if ℓ>d.
Depth Limited Search(continued…)

Advantages:

•Depth-limited search is Memory efficient.

Disadvantages:

•Depth-limited search also has a disadvantage of


incompleteness.

•It may not be optimal if the problem has more than one
solution.
Thank you

11

You might also like