Recap Breadth-first search is used to calculate the shortest path for an unweighted graph. Dijkstra’s algorithm is used to calculate the shortest path for a weighted graph. Dijkstra’s algorithm works when all the weights are positive. If you have negative weights, use the Bellman-Ford algorithm.

