Member-only story

Algorithm

JIN
6 min readAug 18, 2021

--

Dijkstra’s algorithm

Please read this blogger, he did a great job, his explanation of Dijkstra’s Algorithm is quite clear.

https://www.dougmahugh.com/dijkstra/

My purpose to write this piece of the article: to make this algorithm simpler and clearer.

Dijkstra’s algorithm purpose: to calculate the shortest path from a starting node/vertex to all other nodes in the graph.

Dijkstra’s algorithm can be considered a part of graph theory.

Criteria: 1) the distance between nodes must be positive, otherwise the algorithm may not work
2) the starting node and destination node must be connected
3) create a tree of the shortest distances from the starting node to all nodes in graph
4) concerned with finding the shortest path to the destination node.

Step 1 is to create a list of the unvisited nodes. We haven’t visited any nodes yet, so initially, the unvisited list will…

--

--

No responses yet