notebook.community
Edit and run
In [ ]: #4-1 find if there is route between two notes in a direct graph. #use BFS or DFS to solve the problem. #BFS from collections import deque def hasroute(graph,node_start,node_end):
#4-1 find if there is route between two notes in a direct graph. #use BFS or DFS to solve the problem. #BFS from collections import deque def hasroute(graph,node_start,node_end):