Here is the algorithm for shortest path in a DAG:
Compute topological order
Initialize dp[source] = 0, all others to
For each node in topological order: For each edge : dp[v] = min(dp[v], dp[u] + w(u,v))
Output dp[destination] here is why this works: when you process node , all nodes that can reach have already updated it. So dp[u] is finalized and you can safely use it to update neighbors.
This runs in time and uses space.