n-queens Mexican Standoff
The first day back at work has proved fruitful in the form of someone coming up with the opposite of the traditional n-queens problem: the n-queens Mexican standoff. Instead of minimising the number of mutually attacking queens (to zero), the objective of the standoff version is to maximise the number of attacks.
We haven’t done an exhaustive search yet, but I’ve been running a simulated-annealing-ish script for a while, and it looks like the most attacks is 34 (17 pairs of mutual attacks), in two configurations:
QQ. .QQ. QQQ or QQQQ QQQ .QQ.
…either of which can be expanded by adding gaps between the queens, or rotating by multiples of 45 degrees.
Q.Q.. .Q.Q. Q...Q..
..... Q.Q.Q .......
Q.Q.Q .Q.Q. ..Q...Q
..... ..Q.. .......
Q.Q.Q Q...Q..
.......
..Q...Q
Q...Q...
Update: Python code below the fold.


