You are on page 1of 2

Lab Report No 6

Artificial Intelligence
All students have to create their own unique manuals. Write each and every step with output
screenshots. Marks will be marked as zero (0) if any student copy the lab manual of any other
student.

The document must be in hard form (font size 14 for headings and 12 for text and sub
headings). Hand written work will not be accepted.

Good Luck to all!

Write Step by Step Procedure with output screenshots for all the given task?

Task no 1:
Write pseudocode for recursive and non-recursive implementation of DFS under the given criteria?
Input: A graph G and a vertex v of G
Output: All vertices reachable from v labelled as discovered

Task no 2:
Write pseudocode for Iterative Deepening Depth-first search?

Task no 3:
Consider the following:
vertexList = ['0', '1', '2', '3', '4', '5', '6']
edgeList = [(0,1), (0,2), (1,0) , (1,3) , (2,0) , (2,4) , (2,5) , (3,1), (4,2) , (4,6), (5,2), (6,4)]
implement depth first search in pycharm or jupyter notebook.

Task no 4:
Write pseudocode for Breath-first search?

Task no 5:
Consider the following:
vertexList = ['0', '1', '2', '3', '4', '5', '6']
edgeList = [(0,1), (0,2), (1,0) , (1,3) , (2,0) , (2,4) , (2,5) , (3,1), (4,2) , (4,6), (5,2), (6,4)]
implement Breath first search in pycharm or jupyter notebook?

Task no 6:
Consider the below graph;
Use BFS to find the shortest path between A and F. (Hint: the distance between any consecutive
vertices is 1, i.e. distance between A and D is 2 ((A to B=1) + (B to D=1) = 2)

Task no 7:
Consider the below graph.

Using DFS, check if there is any path exists between any two nodes? Also the return the path. e.g.
If user use two vertices i.e. 2 and 1; the program should return : Yes the paths exist, which are
[2,1],[2,0,1]?

You might also like