# Chess pieces attacking exactly once

Inspired by this question. Actually the same but in a more generic manner.

What is the maximum number of chess pieces of the same type (e.g. kings, bishops, rooks, knights) which can be placed on a standard $$8\times8$$ chess board (or $$N\times N$$ in generic case), such that each piece attacks (and is attacked by) only one other piece?

Note: For pawns, assume that they are coloured (and move/capture in different directions, just as in chess). (Pawns are allowed to be placed on their home rank, e.g. white on 1st and black on 8th, when using standard board.)

• Thanks for the follow up question. I think we should also ask the more interesting version where there are black and white pieces and they need to attack the opposite color. – Dmitry Kamenetsky Mar 2 at 23:37

Knights

Here is a symmetric way to place 32

Bishops

Here is a way to place 20 bishops

Pawns

Here is a valid (I think) way to do 56

As pointed out by Steve in the comments, we may want to disallow pawns attacking pawns of the same colour. In this case the best we can do is 48.

I cannot outdo JMP's answers for Kings and Rooks.

• Cool answer! Is there a non-symmetric version for knights? – Dmitry Kamenetsky Mar 2 at 23:51
• "Pawns" seems to be solving a different problem to the others... for the pawns, many of them are "attacked" or "protected" by others of the same colour. For other pieces, they're divided into mutually-attacking pairs, where one of each pair could be switched for a black piece, and after any capture would not be attacking (or attacked by) anything else. – Steve Mar 3 at 14:02
• @Steve yes this is the case but the pawns problem must be different as, if we stick with a single colour, there will always be a pawn not attacking any other pawn. – hexomino Mar 3 at 14:12
• Yes, but the others could be converted to a solution where half the pieces are black... which would still not be the same as the pawns solution, because none of the pieces are "protected" by another piece the same colour (which is the same as "attacked" from the POV of the problem). If gaps are inserted to avoid white or black pawns protecting each other, there's only space for 42 on an otherwise-equivalent layout... – Steve Mar 3 at 14:21
• @Steve Ah, okay I see your point, I can do a bit better than this I think so will edit in this alternative – hexomino Mar 3 at 14:22

Kings:

26

Rooks:

10

Graphics from lichess

After coming up with many solutions, my roommate and I spent some time on a C++ algorithm to solve this problem. The numbers below are the maximum the algorithm can achieve before it starts taking a very long time to compute. If allowed to complete, all possible solutions will be found.

The program can be viewed online here: https://repl.it/repls/DrearyHardtofindAssignments

We have not implemented the pawn problem since it is a different type of problem than the others.

### Knights

$$32 \text{ knights}$$

### Bishops

$$20 \text{ bishops}$$

### Rooks

$$10 \text{ rooks}$$

### Kings

$$26 \text{ kings}$$

### Pawns (2 colors)

$$56 \text{ pawns}$$

• 8 of your knights are attacked by 2 pieces. – JMP Mar 2 at 11:58
• @JMP True. I will see what I can do to fix that. – DenverCoder1 Mar 2 at 11:59
• Pawns solution not valid – Daniel Mathias Mar 2 at 12:36
• @DanielMathias Changed it – DenverCoder1 Mar 2 at 12:53

Using "standard chess rules" (like in several answers to the linked problem)

Pawns

Already covered by other answers - 56 are possible, 28 of each colour

All other pieces could use the solutions using colour-agnostic pieces that attack every other piece, as shown in several other answers, but changing one of each pair to black. e.g. 20 bishops and 32 knights (10 of each colour and 16 of each colour respectively)
The remaining solutions below all make use of the fact that same-colour pieces are NOT attacking each other.

Rooks

64 are possible, 32 of each colour

Kings - the answer under standard chess rules would be zero, as a king cannot attack another king... but that's boring, so

if we modify the rules to allow multiple kings, and to allow kings to attack kings of an opposing colour (but kings of the same colour would be "protecting" each other and therefore not attacking), this makes 32 (16 of each colour) easily possible, for example

Knights

With same-colour knights treated as not "attacking" each other, we can place 48 (24 of each colour) as follows:
or
The left-hand one builds on the known solution for 32 colour-agnostic knights, by arranging the colours in patterns that allow two more similar blocks of 8 to be added. The right-hand one arranges 6 blocks of 8 in a ring around the edge of the board.

Bishops

52 are possible, 26 of each colour.

(this looks a lot less complicated when you isolate only the dark or white squares...)

• wow that bishops one is amazingly dense! – Dmitry Kamenetsky Mar 5 at 6:21
• @DmitryKamenetsky if you squint, bishops kind-of look like rooks rotated 45° :) – Steve Mar 5 at 8:09

I found non-symmetrical solutions for bishops and knights that obtain the optimal number of pieces:

Bishops

26

Knights

24

Or this