Here's a solver in python with z3: <a href="https://gist.github.com/sielicki/fd86d68733133f654128519b3c4e12c2" rel="nofollow">https://gist.github.com/sielicki/fd86d68733133f654128519b3c4...</a><p>(note, most of the code coming from here, I just slopped together the additional constraints, <a href="https://ericpony.github.io/z3py-tutorial/guide-examples.htm" rel="nofollow">https://ericpony.github.io/z3py-tutorial/guide-examples.htm</a> )<p><pre><code> $ time python3 game.py
[[4, 8, 3, 7, 2, 6, 1, 5, 9],
[7, 2, 6, 1, 5, 9, 4, 8, 3],
[1, 5, 9, 4, 8, 3, 7, 2, 6],
[8, 3, 7, 2, 6, 1, 5, 9, 4],
[2, 6, 1, 5, 9, 4, 8, 3, 7],
[5, 9, 4, 8, 3, 7, 2, 6, 1],
[3, 7, 2, 6, 1, 5, 9, 4, 8],
[6, 1, 5, 9, 4, 8, 3, 7, 2],
[9, 4, 8, 3, 7, 2, 6, 1, 5]]
python3 game.py 7.47s user 0.15s system 97% cpu 7.801 total</code></pre>