Posts

Showing posts with the label Shortest path

Implementing Dijkstra’s Algorithm using Sedgewick's C++ Code

Image
Introduction Dijkstra's algorithm solves the shortest path problem for a graph with nonnegative edge weights, producing a shortest path tree. This algorithm is often used in routing and as a subroutine in other graph algorithms, the k-shortest paths algorithm, for example.