What is the longest path in a square grid from one corner to the diagonally opposite corner?
Edges in the grid may only be traversed once, but grid points can be used multiple times (in a square grid that means maximum twice).
After fiddling with this a while, it seems to me the following paths are the longest:
In a $2 \times 2$ grid, the longest path is $8$.
In a $3 \times 3$ grid, the longest path is $18$.
In a $4 \times 4$ grid, the longest path is $32$.
In a $5 \times 5$ grid, the longest path is $50$.
In general, the rule seems to be that the longest path for an $n \times n$ grid is $2n^2$.
Can anyone confirm this? I've searched for a proof of this, but wasn't able to find it.