Question: You must explore the following algorithms. Breadth First Search ( BFS ) and Depth - First Search ( DFS ) . For each of the
You must explore the following algorithms. Breadth First Search BFS and DepthFirst Search DFS For each of the node pairs in the table, you must run BFSDFS with the start node as Node and terminate the algorithm
when Node is reached. For example, to find the distance between O and N the start node is The algorithm terminates when is visited or "explored" by the algorithm. The distance is the total number of nodes visited by the algorithm before reaching the target vertex.
Your report should also have a brief description of the data structure that you will use to represent the graph and a short justification.
The goal of this assignment is to analyze how long it takes for BFS and DFS to reach nodes at different depths. Based on your experiments above, briefly answer the following questions with an example:
Suppose you want to find a path between nodes at a shallow depth to your start node. Would you use BFS or DFS
Suppose that the end node is at a very large depth from the start node. Would you use BFS or DFS
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
