Algorithm-Dixtra algorithm code implementation

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

 

Guess you like

Origin www.cnblogs.com/zhangshengchao/p/12732600.html