I'm trying to analyze opening positions using the Lichess evaluations database. 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?

1 Answer 1


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

  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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.