Lecture-4 (Search Algorithms)
Lecture-4 (Search Algorithms)
Strategies are;
- Breadth-first search,
- depth-first search.
Main Idea:-
①Use the knowledge of the problem domain to build an evaluation function f.
②For every node n in the search space, f ( n ) quantifies the desirability of expanding
n in order to reach the goal.
③Then, use the desirability value of the nodes in the fringe (destination) to decide
which node to expand next.
@Copyrights: Artificial Intelligence Organized by Ms. Zullatun Gull Khan
1. Uninformed Vs Informed Search Strategies (Cont…)
Informed Search Strategies:
Special cases:
Best-first search
Uniform-cost search
Greedy search
A* search
19 6 11 9 14 23
i e u i a a 17 o
16 12 26 3 54
8 15 7
13 14
t a r g 3 g m t s z w t
31 0 27
l h y
Parent Node Total level (max) Total Estimated distance Total number of nodes
S 4 34 18
D 3 46 16
R 2 23 12
A 5 69 27
I 2 18 9
P 3 25 14
Step 4:- Open list: B(2) E(2) O(3) P(5) {T(1) is excluded}
Step 6:- Open list: E(2) O(3) A(3) S(5) P(5) R(6)
Step 7:- Open list: O(3) A(3) S(5) P(5) R(6) {E(2) at stack}
Step 8:- Open list: O(3) A(3) S(5) P(5) R(6) G(7)
Step 9:- Open list: A(3) S(5) P(5) R(6) G(7) {O(3) at stack}
Step 10:- Open list: A(3) I(4) S(5) N(5) P(5) R(6) G(7)
Step 11:- Open list: I(4) P(5) S(5) N(5) R(6) G(7)
{A(3) is excluded}
@Copyrights: Artificial Intelligence Organized by Ms. Zullatun Gull Khan
3. Uniform Cost Search Algorithm (UCS Example) (Cont…)
Step 12:- Open list: P(5) S(5) N(5) R(6) Z(6) G(7)
{I(4) at stack}
Step 13:- Open list: S(5) N(5) R(6) Z(6) F(6) G(7) D(8) L(10)
{P(5) at stack}
Step 14:- Open list: N(5) R(6) Z(6) F(6) G(7) D(8) L(10)
{S(5) is excluded}
Step 15:- Open list: R(6) Z(6) F(6) G(7) D(8) L(10)
{N(5) is excluded}
A) 16
B E
26
5 2 30
14
A 10 D Goal
3 12
4
8
18
C F
B)
2 1 2
1 2 3 4
1 1
5 1 5
5 6 7 8
1 15
8 3 1
9 10 11 12 Goal
DF BF UC
S S S
Complete N Y Y
Optimal N N Y
Heuristic N N N
Time bm bd+1 bm
Space bm bd+1 bm
Optimal? No
Arad = (140+140)+366
Arad = 280+366
Fagaras= (140+99)+176
Fagaras= 239+176
Oradea= (140+151)+380
Oradea = 291+380
First threshold is 1
- If do not find solution, increment threshold
and repeat.
Problem:-
What about the repeated work?
Time complexity (number of generated nodes)
[b] + [b @Copyrights:
+ b2] +Artificial
.. +Intelligence b2 +by ..Ms. +
[b +Organized b d]
Zullatun Gull Khan
6. Iterative Deepening Search Algorithm (Cont…)
Implemented results