Finding shortest path for DAG using dynamic programming vs topological sort?
To use dynamic programming, you need to choose the order in which you fill in values for the vertices.  The correct order is a topologically sorted order (any other order won't work).  So, the two solutions are in some sense equivalent.  Any solution is likely to use both components: topological sorting to determine the order to enumerate the vertices, and something like dynamic programming to fill in the value at each vertex.