Problem: Let $D = (V,A)$ be a directed acyclic graph, i.e., there exists no directed cycle in D, and let $w : A → R$ be arc weights. Assume that you are given a topological sort of the vertices. Show how the above ordering can be used to compute single-source shortest paths, with respect to $w$, in $O(m)$ arithmetic operations.
Solution: Let $s \in V$ be the vertex that we want to compute the shortest paths from. Consider the vertices in the order of the topological sort, starting from $s$. For each vertex, relax all its outgoing edges. That means if we consider $v ∈ V$ , then for all $(v, u) ∈ A$ set $d ( u ) = \min \{ d ( u ) , d ( v ) + w ( v , u ) \}$. Recall that there are no edges from $v$ to $u$ if $u$ proceeds $v$ in the ordering. Thus, the vertices on any path starting from s obey the ordering. Hence, the sizes of the shortest paths are found by considering each arc at most once.
I am not sure I understood why this function $d$ would give us the "lightest" path from a fixed vertex $s$.