Many DP problems can be presented in the graph theory language. It is good to see a relation between those two worlds. Very often it helps to come up with the solution faster and in a more structured way.

Let's solve a simple problem:

**Simple Problem**

You are given two dimensional array NxM, which is a map of the forest. Each cell contains the information about the number of blueberries in that place. Alice is standing at the north-west corner of the forest and she wants to move to south/east directions only. Help her get to home which at the opposite corner while collecting the largest number of blueberries.