Professional Documents
Culture Documents
Search Techniques -
Uninformed Search
Searching for Solution
❖ Start state
❖ s0 ∈ S : initial state
This example
illustrates how we can
start from a given
state and follow the
successors, and be
able to find solution
paths that lead to a
goal state.
Graph Search
1 1 1 3
S 5 C 2 G
3 2 0
1 3 3 4
B E
2 1
2
Graph and Tree
S 5 C 2 G D C D G E C E
3 2
2 0 3 2 3 0 1 2
4
1
3 1 2 3 3 4 1 2 3 4
1 3 3 4 G D G E G G D G E G
0 3 0 1 0 0 3 0 1 0
B E
3 4 3 4
2 1
G G G G
0 0 0 0
Searching for Solution
state corresponds
❖ Parent-Node: the node in the search graph that
search tree
❖ Depth (d) of a solution with minimal
Uninformed Search
Uninformed Search
Uninformed Search
1. Breadth-First Search (BFS)
2. Depth-First Search (DFS)
3. Depth-Limited Search (DLS)
4. Iterative-Deepening Search (IDS)
5. Uniform-Cost Search (UCS)
6. Bidirectional Search (BDS)
Breadth-First Search
Fringe: A Fringe: B C
Breadth-First Search
Fringe: C D E Fringe: D E D G
Breadth-First Search
Fringe: E D G C F Fringe: D G C F
Breadth-First Search
Fringe: G C F B F
Node G is expanded and found to be a goal node. The
solution path A--C--G is returned and the algorithm
terminates.
Breadth-First Search
Depth-First Search
Fringe: A Fringe: B C
Depth-First Search
Fringe: D E C Fringe: C F E C
Depth-First Search
Fringe: G F E C
❖ Optimal/Admissible
d
❖ Exponential time and space complexity, O(b )
Uniform Cost Search
Function UCS( )
Insert the root into the queue
While the queue is not empty
Dequeue the maximum priority element from the
queue
(If priorities are same, alphabetically smaller path is
chosen)
If the path is ending in the goal state, print the path
and exit
Else
Insert all the children of the dequeued element,
with
Uniform Cost Search
Initialization: { [ S , 0 ] }
Iteration 1: { [ S->A , 1 ] , [ S->G , 12 ] }
Iteration 2: { [ S->A->C , 2 ] , [ S->A->B , 4 ] , [ S->G ,
12] }
Iteration 3: { [ S->A->C->D , 3 ], [ S->A->B , 4 ], [
S->A->C->G , 4 ], [ S->G , 12 ] }
Iteration 4: { [ S->A->B , 4 ] , [ S->A->C->G , 4 ] , [
S->A->C->D->G , 6 ] , [ S->G , 12 ] }
Iteration 5: { [ S->A->C->G , 4 ] , [ S->A->C->D->G , 6 ] , [
S->A->B->D , 7 ] , [ S->G , 12 ] }
Iteration 6: gives the final output as S->A->C->G.
Bidirectional Search
successor
❖ This may not always be easy to compute!