I am doing DFS search using python. I am using networkx library to store the nodes in a graph data structure. The dataset contains 5000000 nodes. Then i converted the stored data into adjacency list using to_dict_to_list() function. Now when i call dfs() function error : maximum recursion depth limit increased. I tried to raise this with sys but same error came. what should i do?
def DFS(graph,start,visited):
if start not in visited:
visited.append(start)
for i in graph[start]:
print(start, graph[start])
DFS(graph,i,visited)
return visited
if __name__=="__main__":
g = nx.DiGraph()
with open('web-Google.txt', newline = '\n') as files:
file_1 = csv.reader(files, delimiter='\t')
for i,line in enumerate(file_1):
from_node= int(line[0])
to_node= int(line[1])
g.add_edge(from_node, to_node)
a = nx.to_dict_of_lists(g)
#print(a)
b=depth_first_search(a, 0)
Can u all help me???