Our goal is to find a path from left to right through it which minimizes the sum of the score of all edges. Of course left/right is just a convention here as it could be top/down too. Similarly the minimum could be the maximum by just flipping the sign.