# Knights Problem

There are 2 white knights and 2 black knights positioned at a (3 X 3) chess board. Find the minimum number of moves required to replace the blacks with whites and the whites with blacks.

I guess the catch here is to position the knights in

0w0
w0b
0b0

or

0b0
w0b
0w0

0 -> empty space | w -> white knight | b -> black knights

What is your take on this? Here is my solution, but it seems that my answer takes longer number of steps.

EDIT

For some of those who still have some doubts regarding the question, the final configuration should be:

BoW ooo BoW 

• Welcome to Puzzling SE! If you haven't already done so, please take the tour! You'll also get a free badge :). Normally, asking questions like these are slightly frowned upon as in can bring a lot of speculations or a variety of answers. This one might be okay though, so I would need some confirmation. – North Jan 30 at 3:03
• Do you have to source of the puzzle by chance? – North Jan 30 at 3:03
• @North Didn't get your first comment. What type of question is this? Is it not suitable to ask at this platform. Sorry, but I don't have any source. – Jos Jan 30 at 12:13
• This is a classic puzzle, which I think I've seen discussed in a Martin Gardner book/column, and maybe also in one of H.E. Dudeney's books. Variants of this puzzle have been posted here before, e.g. Desegregate the knights with a different goal, and Switch the knights on a 3x4 board, and Swapping knights on a 4x4 board. – Jaap Scherphuis Jan 30 at 13:25
• @jay No, no, this puzzle is fine, I was just concerned it might warrant a lot of different answers. clearly it didn't though :) – North Jan 30 at 14:09

If you numbered the board like this:

Then it is easy to notice that:

The route of each knights is a cycle of:
$$\dots - 1 - 6 - 7 - 2 - 9 - 4 - 3 - 8 - \dots$$

(i.e. from $$2$$ can go to $$7$$ or $$9$$ and etc.)

Therefore:

We want to move white from $$1\&7$$ to $$9\&3$$, for black from the $$9\&3$$ to $$1\&7$$.
It is straightforward that the minimum movement we should take is shifting them all $$4$$ times to right or left.

Hence, $$4 \times 4 = 16$$ moves is the optimal one.

• that's a much better proof than what I did - which was to sit down to a 3x3 chessboard I happened to have leftover from a woodworking project. Proof > brute force. – Van Jan 30 at 3:39

Although @athin seems to have proven it impossible, I can't find any problem with my solution in

8 moves

Here it is:

1. Na3 Nc3
2. Nc1 Na1
3. Nc2 Nb2
4. Na2 Nb3

Since the path is cyclic, there are working positions reached along the way too, of course.

• Eh, can the starting positions be different than the one given by OP? – athin Jan 30 at 6:22
• @athin, OP seems to have given three different starting positions, and there's nothing forbidding it, so, yes, I guess? – Bass Jan 30 at 6:49
• OP gave 1 starting position, and 2 "almost there" positions that they were aiming at (neither of which were ever actually reached in the solution I devised - I suspect that it was "forcing" those positions that pushed OPs score up to 19 instead of 16) – Chronocidal Jan 30 at 13:23
• @Chronocidal, ah, it is indeed possible to interpret "I tried the above" as meaning "I tried the above, which also had the fixed starting position below", and "position the knights" as "position the knights by moving them from the fixed starting position". Judging from OP's later edit, this might even be what OP meant. That didn't really occur to me at all. – Bass Jan 30 at 13:31

I can get you down to 16 moves. I don't know if I can do any better.

Start off by

moving all four corners onto the black squares, giving
oWo
BoW
oBo

Then, instead of returning to the original square, move

them onto a corner one rotation away from where they started. This gives:

BoB
ooo
WoW

Eight moves total, so far.

Follow the same process for four more moves, and you wind up with:

oWo
WoB
oBo

and then, four more moves (for a total of sixteen):

BoW
ooo
BoW