Dynamic Programming Shortest Path (DAG)