Answers.Body: <p>Given any possible chess position, finding a lower bound is probably equivalent than finding (one of) the shortest game that leads to the position. There are softwares that do that (Natch, Euclid, Stelvio, Jacobi) and are pretty efficient, provided that</p>
  <ol>
  <li>the position can be reached in a sufficiently small number of moves;</li>
  <li>there are enough pieces left on the board.</li>
  </ol>
  <p>Examples on not-so-obvious positions can be found on <a href="https://en.wikipedia.org/wiki/Proof_game" rel="nofollow noreferrer">https://en.wikipedia.org/wiki/Proof_game</a>.</p>
  <p>However, in your case, you will be looking at chess positions from plausible chess games, and mostly opening positions. I think your best bet would be to use one of those proof game solving program to find the shortest proofgame that leads to a given position, hence giving you the exact lower bound you are seeking for each position.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-04-10T08:33:42.267Z
Answers.LastActivityDate: 2024-04-10T08:33:42.267Z
Answers.UserDisplayName: Étienne
Body: <p>I'm trying to analyze opening positions using the <a href="https://database.lichess.org/#evals" rel="nofollow noreferrer">Lichess evaluations database</a>. Loading the entire database into memory is somewhat costly, so I'd like to filter out positions that occur after, say, 10 moves.</p>
  <p>The problem is that FENs are not recorded with move numbers in the database. Therefore I need a way to estimate the move number just by the position itself. Of course a given position can be reached in a number of different ways; I'm really just interested in a lower bound.</p>
  <p>The database FENs include everything else about the position: pieces, active color, castling rights, and en passant square. How can I get a lower bound on the number of moves from this information? There are some obvious heuristics like looking at the number of pieces on their original squares or at the number of captures so far. Is there anything more sophisticated?</p>
  
Tags: <software><programming><retrograde-analysis>
Title: Lower bound on the number of moves to reach given position
ThreadText: # Lower bound on the number of moves to reach given position
  
  (Asked by: username_0 on 2024-04-08)
  
  I'm trying to analyze opening positions using the [Lichess evaluations database](https://database.lichess.org/#evals). Loading the entire database into memory is somewhat costly, so I'd like to filter out positions that occur after, say, 10 moves.
  
  The problem is that FENs are not recorded with move numbers in the database. Therefore I need a way to estimate the move number just by the position itself. Of course a given position can be reached in a number of different ways; I'm really just interested in a lower bound.
  
  The database FENs include everything else about the position: pieces, active color, castling rights, and en passant square. How can I get a lower bound on the number of moves from this information? There are some obvious heuristics like looking at the number of pieces on their original squares or at the number of captures so far. Is there anything more sophisticated?
  
  **Tags:** software, programming, retrograde-analysis
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2024-04-10. Score: 0
  
  Given any possible chess position, finding a lower bound is probably equivalent than finding (one of) the shortest game that leads to the position. There are softwares that do that (Natch, Euclid, Stelvio, username_0i) and are pretty efficient, provided that
  
  1. the position can be reached in a sufficiently small number of moves;
  2. there are enough pieces left on the board.
  
  Examples on not-so-obvious positions can be found on <https://en.wikipedia.org/wiki/Proof_game>.
  
  However, in your case, you will be looking at chess positions from plausible chess games, and mostly opening positions. I think your best bet would be to use one of those proof game solving program to find the shortest proofgame that leads to a given position, hence giving you the exact lower bound you are seeking for each position.
  
  
  ---
  
  