Finding a fast way leading to a position

Discussion of anything and everything relating to chess playing software and machines.

Moderator: Ras

clyjspdxk
Posts: 6
Joined: Fri Jul 19, 2024 2:53 pm
Full name: Shujingling

Finding a fast way leading to a position

Post by clyjspdxk »

How can I find the fastest way to reach this position? Any search tools?
NNNNN3/NNNNN3/8/8/6k1/8/2K5/8 b
petero2
Posts: 732
Joined: Mon Apr 19, 2010 7:07 pm
Location: Sweden
Full name: Peter Osterlund

Re: Finding a fast way leading to a position

Post by petero2 »

[d]NNNNN3/NNNNN3/8/8/6k1/8/2K5/8 b

I don't know of a software that can calculate the fastest way to reach arbitrary positions, without using an unreasonable amount of time and/or memory.

However, for this particular position, it is possible to show that you need at least 51 moves to reach it from the starting position:
* At least 8 * 5 = 40 moves are needed to promote all the pawns.
* At least 2 moves are needed to get the white king to the target square.
* At least 2 * 3 moves are needed to get the original knights to some target square.
* At least 3 moves are needed to move promoted knights to rank 7.

It is also known that at most 54 moves are needed, as demonstrated by the following proof game:
[pgn]
[Event "?"]
[Site "?"]
[Date "2026.01.01"]
[Round "-"]
[White "?"]
[Black "?"]
[Result "*"]

1. b4 g5 2. e4 c5 3. bxc5 f5 4. exf5 Kf7 5. c4 Kf6 6. g4 d5 7. cxd6 e5 8.
fxe6 h5 9. gxh5 Kf5 10. h4 b5 11. hxg5 a5 12. cxb5 a4 13. d4 a3 14. Nxa3
Qd7 15. exd7 Ba6 16. bxa6 Nf6 17. gxf6 Rh7 18. Kd2 Re7 19. fxe7 Nc6 20.
d8=N Na7 21. e8=N Kf4 22. d5 Kf5 23. f4 Be7 24. dxe7 Nc6 25. dxc6 Rc8 26.
c7 Ra8 27. c8=N Rb8 28. h6 Ra8 29. h7 Ra7 30. Nc7 Ra8 31. a7 Rb8 32. a8=N
Rb4 33. Nab5 Rc4 34. a4 Rxc1 35. a5 Rxd1+ 36. Kc2 Rxa1 37. a6 Rxf1 38. a7
Kg4 39. f5 Rb1 40. f6 Rd1 41. f7 Rd5 42. Nf3 Rd3 43. Ne5+ Kg3 44. Nd7 Rd6
45. h8=N Kg2 46. Ng6 Kxh1 47. e8=N Rb6 48. Nge7 Rb8 49. axb8=N Kg2 50. f8=N
Kh3 51. Nba7 Kh4 52. Nfe6 Kg3 53. Nec5 Kg4 54. Ncb7
*
[/pgn]
User avatar
Ajedrecista
Posts: 2166
Joined: Wed Jul 13, 2011 9:04 pm
Location: Madrid, Spain.

Re: Finding a fast way leading to a position.

Post by Ajedrecista »

Hello:
clyjspdxk wrote: Thu Jan 01, 2026 4:38 am How can I find the fastest way to reach this position? Any search tools?
NNNNN3/NNNNN3/8/8/6k1/8/2K5/8 b
Natch software exactly does what you request, but I fear that your position would need many moves to be reached and Natch will not find the shortest proof game/s in a reasonable time.

I would say that the eight underpromotions to knights take 5×8 = 40 moves at least, plus some moves for getting back the promoted knights to the first rank (4 moves per knight, at least) and the second rank (3 moves per knight, at least), respectively; plus a minimum of 2 moves to move the g1-knight to the queenside. This leaves around 70 moves or 140 plies, being optimistic. Since it is black to move, the solution is an odd number of plies, say 139 for example.

I tried Natch at low number of plies to get an idea of solving times:
Problem.txt wrote:SSSSS3/SSSSS3/8/8/6k1/8/2K5/8
39 single moves
S stands for springer (knight in German language), the rest is the usual notation in English. Here, 39 single moves means 39 plies: 20 moves by white and 19 moves by black.

Code: Select all

.\Natch-3.3>Natch --hash-size 64 --language e --output Solutions.txt Problem.txt
Solution found: 0
Position analysed: 0
Resolution time: 0.03 s.
Here are some tries:

Code: Select all

Plies   Time (s)   Solutions found
  19       0.00           0
  29       0.00           0
  39       0.03           0
  49       0.56           0
  59       8.43           0
  69     111.60           0
Resolution times begin to explode with less of half of my former estimate. You can try yorself in a faster computer and way more hash than 64 MB, but I still feel that would not be enough.

OTOH, you have got the guide now: download Natch 3.3, unzip it in a folder, create a TXT like in my post and run Natch from command prompt with similar arguments than me, because Natch is a command line interface, not a graphical user interface. If you do not know how to run from command prompt: suppose that you unzipped the tool in C:\Users\Desktop\Natch-3.3 and now what?
  • Open the command prompt. Just type command prompt (or whatever is called in the language of your Windows) in the task bar.
  • To ensure that you get to the root of paths, type cd\ and press Enter/Intro. (cd means change directory and the backslash points you to the root).
  • Type C: and press Enter/Intro. (This will lead you into C:\).
  • Type cd Users\Desktop\Natch-3.3 (where you unzipped Natch) and press Enter/Intro. You are in the desired folder now.
The default starting path of the command prompt is usually a level up to the desktop, so cd Desktop\Natch-3.3 might be enough. Good luck in your research!

------------

Correction of typos: after reading Peter's answer, I copied the correct FEN string, so Natch worked on the right position; but I misjudged the kinghts being in ranks 1 and 2 instead of ranks 7 and 8. The 40 moves for promoting hold, but the lower bound is less than what I said because there is no need to get back the knights to ranks 1 and 2.

Peter provided a proof game of 107 plies, still far from Natch reasonable limits... but it is an upper bound now, if you still want to try Natch on a fairly long run.

Regards from Spain.

Ajedrecista.
petero2
Posts: 732
Joined: Mon Apr 19, 2010 7:07 pm
Location: Sweden
Full name: Peter Osterlund

Re: Finding a fast way leading to a position

Post by petero2 »

After thinking a bit about this position I gave my proof game searcher 19 carefully selected initial moves, which was enough for it to find an optimal 51-move solution:

[pgn]
[Event "?"]
[Site "?"]
[Date "2026.01.01"]
[Round "-"]
[White "?"]
[Black "?"]
[Result "*"]

1. g4 h5 2. gxh5 g6 3. hxg6 Rh5 4. h4 Rg5 5. hxg5 e5 6. f4 d6 7. fxe5 a5 8.
exd6 f6 9. gxf6 Be7 10. fxe7 Kd7 11. e8=N Ke6 12. b4 b5 13. bxa5 Ra6 14. a4
Rb6 15. axb5 Ba6 16. bxa6 c5 17. Na3 Rb1 18. c4 Rxc1 19. d4 Rxa1 20. dxc5
Rxd1+ 21. Kxd1 Kf5 22. e4+ Kf4 23. c6 Qh4 24. g7 Qxh1 25. c7 Qh8 26. cxb8=N
Nh6 27. g8=N Nf5 28. d7 Ng7 29. d8=N Qh3 30. a7 Qxf1+ 31. Kc2 Qf3 32. Nxf3
Nh5 33. a8=N Ng3 34. c5 Nf5 35. c6 Ng3 36. e5 Ne4 37. a6 Nc3 38. c7 Nd1 39.
c8=N Nb2 40. a7 Nc4 41. e6 Nd2 42. e7 Nb3 43. Nac7 Nc1 44. a8=N Ne2 45. Nb7
Kf5 46. Ne5 Nf4 47. Ned7 Kg5 48. Nab5 Ne6 49. Nba7 Nd8 50. exd8=N Kg4 51.
Nge7
*
[/pgn]