You are on page 1of 8

Home Assignment 01

Name Muhammad Haroon Safdar

ID 190986

Class BEMTS-VII-A

Submitted to Dr. Hammad Nazir Gillani

Subject Artificial Intelligence

Date 09-11-2022
Question 01:
Following is the state space from states 1 – 13:

16
8 17
4 9 21
13
20
10 21
2
5 11 25
15
18
9 19
23
24
1 12 25
6 13 29
7 17
3
22
11 23
14 27
7 15
19
 Breadth-First Search:
1-2-3-7-4-5-9-6-11-14-15-19-8-13-10-15-18-19-23-12-17
Nodes visited: 21
 Depth-First Search:
1-2-4-8-16-17
Nodes visited: 6
 Depth-limited Search:
Using depth limit = l = 4
1-2-4-8-16-17
Nodes visited: 6

 Iterative deepening Search:


At depth = d = 0:
1
1
At d = 1:
1-2-3-7

2
1 3
7
At d = 2:
1-2-4-5-9-3-6-7-11-7-14-15-19
At d = 3: At d = 4:
1-2-4-8-9-13-5-10-11-15- 1-2-4-8-16-17
9-18-19-23-3-6-12-13-17

Total no of iterations: 5
Total no of nodes visited: 43

Question 02:
By comparing the above methods used we can see that for Depth-
first and Depth-limited Search minimum nodes were visited as
compared to others.
Breadth-first and iterative deepening search visited 21 and 43
nodes respectively which is significantly larger than the previous
two methods.
So, in conclusion BFS and iterative deepening search took more
memory and time as compared to the other two methods.
Question 03:
 Breadth-First Search:
Arad-Zerind-Sibiu-Timisoara-Oradea-Fagaras-Rimnicu Vilcea-
Lugoj-Bucharest
 Depth-First Search:
Arad-Zerind-Oradea-Sibiu-Fagaras-Bucharest
 Depth-limited Search:
Arad-Zerind-Oradea-Sibiu-Fagaras
 Iterative deepening Search:

At depth = d = 0:
Arad

At d = 1:
Arad-Zerind-Sibiu-Timisoara

At d = 2:
Arad-Zerind-Oradea-Sibiu-Fagaras-Rimnicu Vilcea- Timisoara-
Lugoj

At d = 3:
Arad-Zerind-Oradea-Sibiu-Fagaras-Bucharest

You might also like