Solution:
Answer: 212
Consider the diagonals of the board running up and to the right - so the first diagonal is the square 1, the second diagonal is the squares 2 and 3, and so on. The ith ascent is the largest step taken from a square in the ith diagonal to a square in the i+1st. Since you must climb from square 1 to square 49, the sum of the ascents is at least 48. Since there are 12 ascents, the average ascent is at least 4.
The 1st and 12th ascents are at most 2, and the 2nd and 11th ascents are at most 3. The 6th and 7th ascents are at least 6, and the 5th and 8th ascents are at least 5. Because f(x)=x2 is convex, the sum of squares of the ascents is minimized when they are as close together as possible. One possible shortest path is then 1→3→6→10→14→19→25→31→36→40→44→47→49, which has ascents of size 2,3,4,4,5,6,6,5,4,4,3, and 2.
Thus, our answer is 212, the sum of the squares of these ascents. There are other solutions to this problem. One alternative problem involves computing the shortest path to each square of the graph, recursively, starting from squares 2 and 3.