Checkerboard pattern is optimal, as long as the top left corner (or, indeed, at least one corner) has an adjacent diagonal. [![][1]][1] Observe that the smallest possible distance between opposite corners of an $h \times w$ rectangle in any diagonal orientation is $h + w - (\sqrt{2} - 1)\cdot \min(h, w)$. One can see further that the checkerboard pattern achieves this bound for all rectangles with $h \neq w$, and is short $\sqrt{2} - 1$ to achieve it for about half of square corner pairs. Let us show that no orientation can do better than that. A corner pair of a square is at optimum distance iff it is connected by an unbroken chain of diagonals. Consider any square with odd side length $k$; clearly, at most one of its diagonals can be unbroken. Hence, there can be at most $(n - k)^2$ optimum corner pairs, a bound that checkerboard readily achieves. Squares with even side length $k$ require a bit more thought. Let's choose one of two diagonals in each $k \times k$ so that adjacent (= different by a shift of distance 1) squares have different orientations. There are two ways to do that, take any one of them. [![][2]][2] Observe that in any pair of adjacent squares, at most one can have an unbroken diagonal of the chosen type. It follows that among the chosen diagonals at most $\lceil (n - k)^2 / 2 \rceil$ can be unbroken (since this is the maximum size of an independent set in an $(n - k) \times (n - k)$ grid). Accounting for two ways to choose orientation, there can be at most $2 \lceil (n - k)^2 / 2 \rceil$ optimal corner pairs in $k \times k$ squares. With a little case work, one can see that this is exactly how many optimal pairs of this kind a checkerboard pattern has. [1]: https://i.sstatic.net/brl54.png [2]: https://i.sstatic.net/DRXSO.png