One of the most famous algorithm and widely used around the world.

What is the algorithm? finding the shortest and fastest way from two vertices.

Who invented the Dijkstra’s algorithm?

Edsger Dijkstra is a Dutch programmer, physicist, mathematician and many more. He is a very influential person that led a lot of discoveries and algorithms in academic discipline. A very popular person for all the contributions he provided for the computer science world and many more studies.

What are the uses of the Dijkstra’s algorithm? There are a lot of uses for the algorithm like finding the fastest route, the shortest route, cheapest route and many more.

The Dijkstra’s Algorithm

The algorithm itself is a little complex but easy to understand after learning how it works.

Finding the shortest path from point A to point C. Dijkstra’s algorithm will visit the nodes with the smallest distance from each other. let’s say from point A to B the distance is 6 so we will put 6 first but then from point A to D is 1, therefore we will update the new distance to 1 which is A to D. Now lets try to find a way from point D to C. Lets go to point E which the distance is 1 and if we go to point B it is 2 so we will not go to B because going to E is shorter. Now from point A to E the shortest path is equal to 2. Now the last part is going to point C from E. If we take the path E to C the distance is 5 but if we take E to B to C the distance is equal to 7. so we will go to the path point E to C. now we reached the end vertex. For the final answer to the question the shortest distance from A to C is the path going through A, D, E, and C with a total of 7 making it the shortest path.

Just coding