To find shortest walk in DAG, can has negative weighted edges.

Pseudo-code

Runtime