uninformed search strategies
TRANSCRIPT
Presented by –SHRUTI KAUSHIK
08MECS118
UNINFORMED SEARCH
DEFINITION
• Uninformed search uses no information about the likely “direction” of the goal node(s).• It uses only the information available in the
problem definition.• Initial state• Search operators• Goal Test• Path Cost
MEASURING PERFORMANCE
• Completeness• Optimality• Time Complexity• Space Complexity• Branching Factor(b)• Depth (d)
UNINFORMED SEARCH METHODS
• Breadth First Search (BFS)• Depth First Search (DFS)• Depth Limited Search• Iterative deepening Search(IDS)• Bidirectional
BREADTH FIRST SEARCH
• Breadth-first search goes through the tree level by level, visiting all of the nodes on the top level first, then all the nodes on the second level, and so on. • The fringe is a FIFO QUEUE i.e. new successors go
at end.
Level 1
Level 2
Level 3
Root node
BREADTH-FIRST SEARCH
1
12
111098765
432
SG
…
SI
S
CBA
D GE
31
8
37
1520
5
Expanded nodes: S A B C D E GSolution found: S A G , cost 18Number of nodes expanded (including goal node) = 7
BREADTH FIRST SEARCH
• Completeness: Yes• Optimality: Yes, for the shortest path• Time complexity:
1 + b + b2 +…..+ b d = O(b d )• Space complexity: O(bd)
DEPTH FIRST SEARCH
• Depth-first search goes through the tree branch by branch, going all the way down to the leaf nodes at the bottom of the tree before trying the next branch.• The fringe is a LIFO queue i.e. new successors go
at the beginning.Root node
Level 1
Level 2
Level 3
DEPTH FIRST SEARCH
1
7
8
6
5
2
3
4… SG
SI
S
CBA
D GE
31
8
37
1520
5
Expanded node: S A D E GSolution found: S A G , cost 18Number of nodes expanded (including goal node) = 5
DEPTH FIRST SEARCH
• Completeness: No, halts on infinite path• Optimality: No• Time complexity:
1 + b + b2 +…..+ b d = O(b m )• Space complexity:
O(bm)
DEPTH LIMITED SEARCH
• It works exactly like depth-first search• Solves the infinite-path problem• Imposes a maximum limit on the depth of
the search.• The choice of the depth parameter is an
important factor
DEPTH LIMITED SEARCH
Not explored
l
Limit l = 2l = 0
l = 2
l = 1
S
CBA
D GE
31
8
37
1520
5
Expanded node: S A D E GSolution found: S A G , cost 18Number of nodes expanded (including goal node) = 5
Limit l = 2l = 0
l = 1
l = 2
DEPTH LIMITED SEARCH
• Completeness: Yes, if depth < or = to the limit(l) • Optimality: No• Time complexity:
1 + b + b2 +…..+ bl = O(bl )• Space complexity:
O(bl)
ITERATIVE DEEPENING SEARCH
• Combines the benefit of DFS and BFS with only moderate computational overhead.• Depth-Limited Search is run repeatedly,
increasing the depth limit with each iteration until it reaches d, the depth of the shallowest goal state. • On each iteration it visits the nodes in the same
order as depth-first search.
ITERATIVE DEEPENING SEARCH
Limit 0
Limit 1
Limit 2
S
CBA
D GE
31
8
37
1520
5
Expanded node: S S A B C S A D E GSolution found: S A G , cost 18Number of nodes expanded (including goal node) = 10
l = 0
l = 1
l = 2
ITERATIVE DEEPENING SEARCH
• Completeness: Yes, • Optimality: Yes, for the shortest path• Time complexity:
1 + b + b2 +…..+ bd = O(bd )• Space complexity:
O(bd)
BI-DIRECTIONAL SEARCH
• Simultaneously search forward from initial state and backwards from Goal State • Stop when both “meet in the middle”• Cuts the depth of the search tree by half
Initial State Goal State
d/2 d/2
d
BI-DIRECTIONAL SEARCH
• Merge the solution, if the same state is reached from the other side
Equal?
Initial State Goal State
BI-DIRECTIONAL SEARCH
1
3 4
8 9 10 11 12
2
13
75 6
SG
SI
…
BI-DIRECTIONAL SEARCH
• Completeness: Yes• Optimality: Yes, for the shortest path• Time complexity:
O(bd/2 )• Space complexity:
O(bd/2)
COMPARISON
Criterion BFS Bi-directional
DFS DLS IDS
Complete Yes Yes No Yes,if l d
Yes
Time O(bd) O(bd/2) O(bm ) O(bl ) O(bd)
Space O(bd) O(bd/2) O(bm) O(bl) O(bd)
Optimal Yes Yes No No Yes
THANK YOU