Google interview question

Dynamic programming an directed graph