What is Dijkstra’s Algorithm?

What if you were shown a graph of nodes in which each node is connected to a number of other nodes at different distances? What is the shortest path to every other node in the graph if you start from one of the nodes in the graph?

Well, Dijkstra’s Algorithm is a simple algorithm that is used to find the shortest distance, or path, from a starting node to a target node in a weighted graph.

The shortest path from the starting node, the source, to all other nodes (points) in the graph is created by this algorithm.

Dijkstra’s algorithm…

Manuj Bahety

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store