Uninformed Search
Uninformed Search
Uninformed Search
STEPS FOLLOWED
▪ Goal Formulation:
⮚It is the first and simplest step in problem-solving.
⮚ It organizes the steps/sequence required to formulate one goal out of multiple goals as
well as actions to achieve that goal.
⮚Goal formulation is based on the current situation and the agent’s performance measure
▪ Problem Formulation:
⮚ It is the most important step of problem-solving which decides what actions should be
taken to achieve the formulated goal.
▪ Path cost: It assigns a numeric cost to each path that follows the goal. The problem-solving agent
selects a cost function, which reflects its performance measure.
3/21/2024 4
TWO TYPES OF PROBLEM
APPROACHES
▪ Toy Problem: It is a concise and exact description of the problem which is used by
the researchers to compare the performance of algorithms.
▪ States: Arrangement of all the 8 queens one per column with no queen attacking the other queen.
▪ Actions: Move the queen at the location where it is safe from the attacks.
This formulation is better than the incremental formulation as it reduces the state space from 1.8 x
1014 to 2057 , and it is easy to find the solutions.
3/21/2024 7
SEARCH TECHNIQUES
Search: Step by step procedure to solve a search-problem in a given search space. A
search problem can have three main factors:
1.Search Space: Search space represents a set of possible solutions, which a system
may have.
3.Goal test: It is a function which observe the current state and returns whether the goal
state is achieved or not.
3/21/2024 8
PROBLEM’S STATE-SPACE
▪ State-space of a problem-Set of all states which can be reached from the initial state
followed by any sequence of actions.
▪ Directed map or graph where nodes are the states, links between the nodes are actions,
and the path is a sequence of states connected by the sequence of actions.
3/21/2024 9
MEASURING PROBLEM-
SOLVING PERFORMANCE
There are four ways to measure the performance of an algorithm:
▪ Completeness: It measures if the algorithm guarantees to find a solution
(if any solution exist).
▪ Optimality: It measures if the strategy searches for an optimal solution.
▪ Time Complexity: The time taken by the algorithm to find a solution.
▪ Space Complexity: Amount of memory required to perform a search.
3/21/2024 10
TYPES OF SEARCH STRATEGIES
• Breadth-first search
• Uniform-cost search
• Depth-first search
Uninformed • Depth-limited search
search • Iterative deepening depth-first search
• Bidirectional search
3/21/2024 11
BREADTH-FIRST SEARCH
( BFS )
▪ Expand shallowest unexpanded node first
▪ Frontier is a FIFO Queue
3/21/2024 12
3/21/2024 13
BFS - PSEUDOCODE
3/21/2024 14
BFS- PROPERTIES
▪Complete? Yes (if b is finite)
3/21/2024 16
UCS - PSEUDOCODE
3/21/2024 17
UCS- PROPERTIES
▪ Complete? Guaranteed only if all the step costs are positive
3/21/2024 19
DFS- PROPERTIES
▪ Time? O(b^m): terrible if m is much larger than d but if solutions are dense, may be
much faster than breadth-first.
▪Optimal? No ( the number of steps & cost spent in reaching the solution is high )
3/21/2024 20
DEPTH-LIMITED SEARCH
( DLS )
▪ 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.
3/21/2024 21
DLS - PSEUDOCODE
3/21/2024 22
DLS- PROPERTIES
▪Complete? No, if L<=d
▪ Time? O(b^L)
▪Space? O(bL)
3/21/2024 23
ITERATIVE DEEPENING
DEPTH-FIRST SEARCH ( IDS )
▪ What if solution is deeper than L?
▪ Increase L iteratively
▪ Solves both infinite depth problem & optimality problem in DFS & DLS
3/21/2024 24
3/21/2024 25
IDS/ IDLS- PROPERTIES
▪Complete? Yes, Increases depth iteratively till goal reached
▪ Time? O(b^d)
▪Space? O(bd)
3/21/2024 26
SUMMARY OF UNINFORMED
SEARCH STRATEGIES
3/21/2024 27
BIDIRECTIONAL SEARCH
▪ Runs two simultaneous searches, one form initial state called as forward-search and other from
goal node called as backward-search, to find the goal node.
▪ Replaces one single search graph with two small subgraphs in which one starts the search from an
initial vertex and other starts from goal vertex.
▪ The search stops when these two graphs intersect each other.
▪ Bidirectional search can use search techniques such as BFS, DFS, DLS, etc.
Advantages:
• Bidirectional search is fast.
• Bidirectional search requires less memory
Disadvantages:
• Implementation of the bidirectional search tree is difficult.
• In bidirectional search, one should know the goal state in advance.
3/21/2024 28
BIDIRECTIONAL SEARCH
3/21/2024 29
BDS- PROPERTIES
▪ Complete? Yes, if BFS used in both searches
▪ Time? O(b^(d/2))
▪ Space? O(b^(d/2})
▪ Optimal? Yes, if BFS used in both searches & paths have uniform cost
3/21/2024 30