How to display the progress of execution of a code with library functions?
import networkx as nx
graph=nx.erdos_renyi_graph(100000,.2)
visited = set() # Set to keep track of visited nodes of graph.
def dfs(visited, graph, node): #function for dfs
if node not in visited:
print (node)
visited.add(node)
for neighbour in graph[node]:
dfs(visited, graph, neighbour)
print("Following is the Depth-First Search")
dfs(visited, graph, '5000')
coms=nx.connected_components(graph)