Co-authored-by: nilbuild <4921183+nilbuild@users.noreply.github.com>
316 B
316 B
Dijkstra's Algorithm
Dijkstra's algorithm finds the shortest path from a source node to all other nodes in a weighted graph with non-negative edge weights. It uses a priority queue to always process the nearest unvisited node. The result is a set of shortest distances and the corresponding paths from the source.