Will constantly update the next two hash tables
Pseudo code as shown
summary:
① Breadth-first search is suitable for unweighted graph to find the shortest path
② Dixtra algorithm is used to find the shortest path by weighted graph
③The Dixtra algorithm works only when the weight is positive, otherwise use the Bellmanford algorithm