LinkedIn interview question

A dynamic programming question. Graph theory