
In the recent project, I encountered a puzzle, thought for several days, I simplified it. I will be very grateful for your help.

In the recent project, I encountered a puzzle, thought for several days, I simplified it. I will be very grateful for your help.
Copyright © 2021 JogjaFile Inc.
A solution for $N=7$ with the smallest value for $\omega_N$ is this:
$$ W = \begin{bmatrix} 25 & 26 & 28 & 29 & 34 & 36 & 37 \end{bmatrix} $$
$$M = \begin{bmatrix} 0 & 24 & 22 & 21 & 16 & 14 & 13 \\ 27 & 0 & 24 & 23 & 18 & 16 & 15 \\ 31 & 30 & 0 & 27 & 22 & 20 & 19 \\ 33 & 32 & 30 & 0 & 24 & 22 & 21 \\ 43 & 42 & 40 & 39 & 0 & 32 & 31 \\ 47 & 46 & 44 & 43 & 38 & 0 & 35 \\ 49 & 48 & 46 & 45 & 40 & 38 & 0 \end{bmatrix}$$
This solution is generated by this z3py script: