DEV Community

Cover image for Dijkstra's algorithm
Paras
Paras

Posted on

Dijkstra's algorithm

Dijkstra's algorithm finds the shortest path from a source node to all nodes in a weighted graph. It uses a priority queue to repeatedly extract the node with the smallest distance, updates neighboring nodes' distances, and marks nodes as visited when their shortest path is confirmed.

Top comments (0)