0% found this document useful (0 votes)
43 views

Bs 190201671

The document is an assignment for an artificial intelligence course that includes two questions. The first question asks to apply breadth-first search (BFS) to find the shortest path from the root node to a target node in a given tree structure with 11 nodes and 4 levels. The second question asks to convert an undirected tree into an undirected graph.

Uploaded by

Bisma Ghaffar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
43 views

Bs 190201671

The document is an assignment for an artificial intelligence course that includes two questions. The first question asks to apply breadth-first search (BFS) to find the shortest path from the root node to a target node in a given tree structure with 11 nodes and 4 levels. The second question asks to convert an undirected tree into an undirected graph.

Uploaded by

Bisma Ghaffar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 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