Given a weighted graph $G$ with $V$ vertices and $E$ edges, where all the weights are non-negative, and a source vertex $s$, the single-source shortest path problem consists of finding the distance from $s$ to all other vertices.
In this article, I describe the problem in a weighted and unweighted graph, as well as
implementations using BFS for unweighted graphs and Dijkstra's algorithm for weighted graphs
using an array and a priority queue.
Published on Fri, Jul 3, 2015 • 6 min read
#graph theory
#single source shortest path
#weighted graph
#unweighted graph