June 06, 2023
University of Management and Technology
Data Structures & Algorithms
Section-V1
Assignment-03 CLO: 1, 2
In this assignment, you will learn the graphs concepts to solve the following problems.
The shortest path problem.
Find the length of the shortest path.
Find out if there is any cycle in the graph or not.
We have discussed Breadth First Graph and Depth First Graph algorithm to solve the above-mentioned
problems. In this assignment, you are required to perform BFS on directed graphs and DFS on undirected
graphs. It is recommended that provide the complete working of each step of the algorithm on the paper.
Your assignment should be neat and easy to read.
Graph 1:
Directed
Undirected
Page 1 of 4
June 06, 2023
Graph 2:
Directed
Undirected
Graph 3:
Directed
Page 2 of 4
June 06, 2023
Undirected
Source Vertex:
Select the source vertex as per the following instructions.
Case 1:
A vertex i.e. (2713 in Graph 3) will be your source vertex iff (if & only iff) its last digit i.e., 3 is same as the
last digit of your roll number i.e., F2021266093.
Case 2:
Otherwise, if there is not any such vertex, then choose the vertex i.e. (2094 in Graph 3) if its second last
digit i.e., 9 is same as the last digit of your roll number i.e., F2021266093.
Instructions:
1. Assignment Group
Assignment is an individual task and there is no need for grouping.
2. Plagiarism Policy
Plagiarism is highly unappreciated and any such case(s) falling into plagiarism will get zero.
3. Submission
Only handwritten submission is allowed via CR.
4. Marks Distribution & Deadline
Deliverables Due Date Sub Tasks Marks
Deliverable 10:00 1. BFS Graph 1 10%
2. BFS Graph 2 20%
Page 3 of 4
June 06, 2023
3. BFS Graph 3 25%
4. DFS Graph 1 10%
09/06/2023 5. DFS Graph 2 20%
6. DFS Graph 3 20%
Page 4 of 4