dynamic programming: shortest path in a DAG
dynamic programming: shortest path in a DAG brute force approach