We reviewed the loop invariant for both depth-first search and breadth-first search. We refined that loop invariant to produce Dijkstra's algorithm for finding the shortest paths in a graph.