# Least number of moves to achieve a complete switchover of nonpawns in starting setup

`````` [fen "RNBQKBNR/8/8/pppppppp/PPPPPPPP/8/8/rnbqkbnr w - - 0 1"]
``````

During a comp, my friend an I had a team kill and we decided to make this position(legally) before drawing. Then we continued to find more and more optimal ways of getting the position until I found this:

``````[FEN ""]

1. a4 a5 2. Ra3 Ra6 3. Rb3 Rc6 4. Rb6 Rc3 5. Ra6 Ra3 6. Ra8 Ra1 7. h4 h5 8. Rh3 Rh6 9. Rg3 Rf6 10. Rg6 Rf3 11. Rh6 Rh3 12. Rh8 Rh1 13. e3 e6 14. Qg4 Ke7 15. Ke2 Kd6 16. Kf3 Qf6+ 17. Ke4 Kc5 18. d3 Kb4 19. c3+ Kb3 20. Qg5 Kc2 21. Na3+ Kd1 22. Nh3 Qf3+ 23. Kd4 Ke1 24. Qd8 Qd1 25. Ke5 Nh6 26. Ng5 g6 27. Kf6 Bg7+ 28. Ke7 Nc6+ 29. Ke8 Nd4 30. c4 Nf3 31. b3 b6 32. Nb5 Ng1 33. Ba3 Bb2 34. Bf8 Bc1 35. g3 Bb7 36. Bh3 d6 37. Nh7 e5 38. Bc8 Bg2 39. Nf6 Bf1 40. Ng8 Nf5 41. Na7 Nd4 42. Nc6 Ndf3 43. Nb8 Nd2 44. b4 Nb1 45. d4 d5 46. e4 c5 47. f3 b5 48. f4 f5 49. g4 g5
``````

Is there any faster way of achieving this position? And (as an extra question) does anyone have a position that have the longest legal optimal series of moves to achieve it?

• Thanks for sharing this. It was a nice puzzle for a summer evening, but I'm glad I found the definitive solution! (see my updated answer) Jun 28, 2016 at 21:05
• @Glorfindel You're welcome;) Jun 28, 2016 at 22:48
• I don't know why I straight up can't edit this question, but please don't add `[solved]` to the title! Stack Exchange is not a forum, and the fact the answer is accepted is enough.
– cat
Jun 29, 2016 at 0:54
• So ... what happened in the comp when you guys made this position? Jun 29, 2016 at 2:13

As @chakerian's calculations show, 40 moves is the minimum. After a bit of puzzling, I found the solution.

``````[FEN ""]

1. a4 {First, we need to get the rooks in position. They'll be hard to swap once the board is full.} a5 2. h4 h5 3. Rh3 Rh6 4. Rg3 Rf6 5. Rg6 Rf3 6. Rh6 Rh3 7. Ra3 Ra6 8. Rc3 Rb6 9. Rcc6 Rbb3 10. Ra6 Ra3 {Now, we can start with the knights. They're tricky because they need to swap places via the four center squares. Note that we cannot move the center pawns *before* the knights.} 11. Nf3 Nc6 12. Ne5 Nd4 13. Nc6 Nf6 14. Nc3 Nd5 15. Ne4 Nc3 {It's time for the kings to come out of their hiding, but they have do this carefully because of the knights.} 16. Rh8 d5 17. Ra8 Kd7 18. Nf6+ Kd6 19. e4 Ra1 20. Ba6 b5 21. Nb8 Kc5 {The black monarch chooses queenside - that means his colleague has to take the other one.} 22. Ng8 Nde2 23. d4+ Kc4 24. Kd2 Rh1 25. Ke3 Ng1 26. Kf4 Bh3 27. g4 f5 28. Kg5 e5+ 29. Kg6 Bf1 30. Bh6 {Note how the c1-h6 and a3-f8 diagonals have been left open for the transfer of the last four pieces.} Qg5+ 31. Kf7 Ba3 32. Ke8 Qc1 33. Qd2 Nb1 34. Qg5 {OK, we're almost there now, from here it's a walk in the park.} Qd1 35. b4 Kc3 36. Qd8 g5 37. Bf8 c5 38. Bc8 Kd2 39. c4 Bc1 40. f4 Ke1 {And we're done!}
``````

To answer the second question: you're looking for the longest unique proof game. I found the longest known one here and here.

``````[Title "Dmitri W. Pronkin & Andriy Frolkin, Die Schwalbe 06/1989, 1st Prize, PG in 57.5"]
[FEN ""]

1. a4 h5 2. a5 h4 3. a6 h3 4. axb7 hxg2 5. h4 d5 6. h5 d4 7. h6 d3 8. h7 dxc2 9. d4 a5 10. Bh6 c1=R 11. e4 Rc5 12. Ne2 Rh5 13. e5 c5 14. e6 Nc6 15. b8=R a4 16. Rb4 a3 17. Ra4 c4 18. b4 c3 19. b5 c2 20. b6 c1=R 21. b7 Rc4 22. b8=R Qa5+ 23. Rbb4 Bb7 24. N1c3 O-O-O 25. exf7 e5 26. Rc1 Bc5 27. f8=R a2 28. Rf3 a1=R 29. Na2 g1=R 30. Rfa3 Rg6 31. f4 Re6 32. f5 g5 33. f6 g4 34. f7 g3 35. f8=R g2 36. Rf5 g1=R 37. Bf8 Rg7 38. Ng3 e4 39. Bd3 e3 40. O-O e2 41. Rcc3 e1=R 42. Bc2 R1e3 43. d5 Rdd7 44. d6 Rdf7 45. d7+ Kb8 46. Qd6+ Ka8 47. Qc7 Nge7 48. d8=R+ Nc8 49. Rdd3 Rhg8 50. h8=R Rae1 51. Rh6 R1e2 52. R1f2 Rce4 53. Kf1 Bd4 54. Rfc5 Ne5 55. Nf5 Nc4 56. Nd6 Nb2 57. Rbc4 Nb6 58. Qb8+
``````

What this really means, is that the final position can be reached in 57.5 moves (not less), and that there is only one way to do this. In your example, moves 48 and 49 (and many others) could be switched. Also, currently there is no other position with this characteristic known which takes more moves to obtain.

• Thanks @GloriaVictis - I caught Black's castling but not White's. As a sidenote, it shouldn't be too hard to have the PGN viewer accept 0-0 (zero dash zero) as valid castling ... Jun 28, 2016 at 10:39
• – user2668
Jun 28, 2016 at 15:06
• @RickyDemer feel free to post it as a new answer. It's not a proof game but definitely something like the OP's position/game. Jun 28, 2016 at 16:51
• @RickyDemer interestingly there are pawn moves on moves 82, 132, and 182. It seems the author intentionally did this to avoid a 50-move rule violation, although I'm not sure why , seeing as the draw must be claimed, and in a "help" scenario such as a proof game, the player would opt to not claim the draw
– M.M
Jun 30, 2016 at 2:43

Shouldn't the minimum be 40?. I don't have any result to show yet but it seems that:

Pawns (black and white): 8 moves

Rooks (black and white): 10 moves

Kings (black and white): 7 moves

Queens (black and white): 3 moves

Knights (black and white): 8 moves

Bishops (black and white): 4 moves

I could be wrong

Something to consider is that the e pawns for black and white can't be pushed up together until the kings have passed to their opposite positions.

Possibly it takes an extra two moves for the last two knights in which case it would be 42.

• Yeah, minimum should be 40, you can get knights to correct position in 8 moves Jun 28, 2016 at 17:37

I came up with this, which is 43 moves, but I think it could be optimized further:

``````[fen ""]
1. h4 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.

``````[FEN ""]

1. a4 a5 2. Ra3 Ra6 3. Rb3 Rc6 4. Rb6 Rc3 5. Ra6 Ra3 6. Ra8 Ra1 7. h4 h5 8. Rh3
Rh6 9. Rg3 Rf6 10. Rg6 Rf3 11. Rh6 Rh3 12. Rh8 Rh1 13. e3 e6 14. Qg4 Ke7 15. Ke2
Kd6 16. Kf3 Qf6+ 17. Ke4 Kc5 18. d3 Kb4 19. c3+ Kb3 20. Qg5 Kc2 21. Na3+ Kd1 22.
Nh3 Qf3+ 23. Ke5 Ke1 24. Qd8 Qd1 25. Ng5 Nh6 26. c4 g6 27. Kf6 Bg7+ 28. Ke7 Nc6+
29. Ke8 Nd4 30. b3 Nf3 31. Nb5 Ng1 32. Ba3 Bb2 33. Bf8 Bc1 34. g3 b6 35. Bh3 Bb7
36. Nh7 Bg2 37. Nf6 d5 38. Ng8 e5 39. Bc8 Bf1 40. Na7 Nf5 41. Nc6 Nd4 42. Nb8
Ndf3 43. b4 Nd2 44. d4 Nb1 45. e4 b5 46. g4 g5 47. f3 c5 48. f4 f5 *
``````

Note that the absolute minimum amount of moves to achieve the position is at least 38, and without 'crossing the knights' and with moving the bishops in 3 turns the minimum is already 44.

So that would mean that without drastic changes, and improvement would need to depend on only 3 additional 'suboptimal' moves, like moving a pawn twice. As such I don't think there is much room left for improvement, but perhaps 1 or 2 moves could still be shaved off.

I interpret the OP's <a position that have the longest legal optimal series of moves to achieve it?> as a request for a position which, for the largest known n, can be reached in n moves but cannot be reached in fewer. I don't see any request for there to be a unique n-move sequence.

``````[Title "Remotest possible chess position?"]
[FEN "Kr6/8/1r6/8/8/1PPPPpPP/kpbrrP1R/qbrnrrbn w KQkq - 0 1"]
[StartFlipped "0"]
``````

One of the shortest known series of moves that reach this position is:

``````[FEN ""]
[StartPly "370"]

1. a4 c5 2. a5 c4 3. a6 c3 4. b3 d5 5. Bb2 cxb2 6. Na3 Kd7 7. Nc4 Kc6 8. Ne5+ Kb5 9. Ra5+ Kb4 10. Rb5+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kf7 Ref1 100. Kg7 Bc2 101. Kf7 Bab1 102. Kg7 a5 103. Kf7 a4 104. Kg7 a3 105. Kf7 a2 106. Kg7 a1=R 107. Kf7 Ba2 108. Kg7 Rc1 109. Kf7 Bcb1 110. Kg7 Rc2 111. Kf7 Re2 112. Kg7 Ree1 113. Kf7 Bc2 114. Kg7 Bab1 115. Kf7 a5 116. Kg7 a4 117. Kf7 a3 118. Kg7 a2 119. Kf7 a1=R 120. Kg7 Ba2 121. Kf7 Rc1 122. Kg7 Bcb1 123. Kf7 Rc2 124. Kg7 Ke2 125. Kf7 Kd2 126. Kg7 Kc1 127. Kf7 Rce2 128. Kg7 Kd2 129. Kf7 Bc2 130. Kg7 Bab1 131. Kf7 Ra1 132. Kg7 Ba2 133. Kf7 Rc1 134. Kg7 Bcb1 135. Kf7 Rc2 136. Kg7 Kc1 137. Kf7 Rcd2 138. Kg7 Bc2 139. Kf7 Kb1 140. Kg7 Ka1 141. Kf7 Bab1 142. Kg7 Ka2 143. Kf7 Ka3 144. Kg7 Ba2 145. Kf7 Bcb1 146. Kg7 Rc2 147. Kf7 Rc1 148. Kg7 Bc2 149. Kf7 Ra1 150. Kg7 Bcb1 151. Kf7 Rc2 152. Kg7 Qd5 153. Kf6 Qf3 154. Kf7 Qe2 155. Kg7 Qd2 156. Kf7 Qc1 157. Kg7 Rce2 158. Kf7 Qd2 159. Kg7 Bc2 160. Kf7 Rc1 161. Kg7 Bcb1 162. Kf7 Rc2 163. Kg7 Qc1 164. Kf7 Rcd2 165. Kg7 f3 166. Kf7 Bc2 167. Kg7 Qa1 168. Kf7 Bcb1 169. Kg7 Rc2 170. Kf7 Rc1 171. Kg7 Bc2 172. Kf7 Bab1 173. Kg7 Ka2 174. Kf7 Red2 175. Ke7 Ree2 176. Kd7 Rfe1 177. Kc7 Rgf1 178. Kb7 Bg1 179. Ka7 R4h6 180. Rh2 Rb6 181. Rg2 Rh7+ 182. Ka8 Rhb7 183. Rh2 Rb8+
``````

The construction was published in Am Rande des Schachbretts in 1947 by Luigi Ceriani and Karl Fabel. Here is a direct link to its entry in PDB.