You are on page 1of 3

Artificial Intelligence (CS607) Total marks = 20

Assignment # 01 Deadline
th
15 of November
Fall 2023 2023
Name: Rameeza Sumair
ID: BS190201671

Questions No. 01 10 Marks


State the situation in which BFS applied and also draw a tree data structure for the given
nodes. You are required to traverse the tree and state the path as per BFS with height 4. The
nodes and height of the tree are given as:
Given Data:
Number of nodes =11
Number of Tree Levels= 3
Nodes Labeling: 1, 2, 7, 8, 3, 6, 9, 12, 4, 5, 10, 11 (Target Node)
You are required to draw a tree for path searching using BFS.
1
/ \
2 7
/ / \
8 3 9
/ \ / \
12 4 6 10
/ \
5 11
Required:
 Reason for using BFS
BFS is used to find shortest path from the root node (1) to the target node (11).It ensures
that we explore all nodes at the current level before moving to next levels, making it
suitable for finding the shortest path.

 Number of Nodes in Operation


11 nodes

 Levels of Tree
The tree has 4 levels, including 0

 Path of Tree
1--> 2 --> 7 --> 8 --> 3 --> 9 --> 12 --> 4 --> 6 --> 10 --> 5 --> 11

 Last Node / Target Node of Tree


The last node in the path is called target node which is 11

Questions No. 02 10 Marks


Convert the mentioned below undirected Tree into an undirected Graph.
Undirected Tree:
1

3
2

7
6
4 5

Undirected Graph

You might also like