Question: Depth First Search ( DFS ) is a fundamental graph traversal used as building block to solve important graph problems such as Topological Sort, finding
Depth First Search DFS is a fundamental graph traversal used as building block to solve important graph problems such as Topological Sort, finding Strongly Connected Components, and others. Hence, the time efficiency of those algorithms depends heavily on implementing efficiently DFS
Given a directed graph GmathrmVmathrmE encoded as an adjacency list, an efficient implementation of DFS runs in mathrmOmathrmVE steps.
The purpose of this homework is to evaluate experimentally the performance of an efficient implementation of DFS
points Write a program that, given the adjacency list of a directed graph, computes DFS efficiently. Your program should do the following.
Prompt the user to input the number of nodes and the number of edges.
Create an adjacency list choosing the edges at random do not forget that it is a directed graph
Compute DFS including discovery and finishing times following the pseudocode in the textbook attached
Measure and display the running time
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
