# When checkmate is impossible in a position

The laws of chess say

1.5. If the position is such that neither player can possibly checkmate the opponent’s king, the game is drawn (see Article 5.2.2).

5.2.2. The game is drawn when a position has arisen in which neither player can checkmate the opponent’s king with any series of legal moves. The game is said to end in a ‘dead position’. This immediately ends the game, provided that the move producing the position was in accordance with Article 3 and Articles 4.2 – 4.7.

[Articles 3, 4.2-4.7 basically deal with making legal moves.]

This is interesting because it seems possibly non-obvious whether this condition applies (though presumably rare in actual games!). Update here is an interesting example. The game is legally a draw in this position because neither side can possibly checkmate by any sequence of moves. (The game will be a draw before white can checkmate.)

``````[fen "1k6/1P5p/BP3p2/1P6/8/8/5PKP/8 b - - 0 41"]
``````

I think this must have been investigated before. I'm wondering:

(1) How computationally difficult is it to determine that no sequence of legal moves ends in checkmate? Is there a better algorithm than brute force?

(2) Do you know of interesting examples of positions where it is hard for a human to tell whether this condition applies?

(3) Are there any examples of historical games where this law was not followed due to players and officials not realizing the condition held? Especially interesting if the game did not end in a draw due to time expiring for one player.

(edit) See also this closely related question where the accepted answer has a couple more examples where there is sufficient material to mate, but it is impossible from that position.

(edit) Essentially the same question is when a helpmate is possible; here is a closely related question.

(edit) Essentially the same question, is the dead position problem solvable?

• I doubt there are positions hard for human to find out whether there is mate possible or not. Jun 29, 2018 at 6:55
• There is rule 9.3.2 the last 50 moves by each player have been completed without the movement of any pawn and without any capture. which creates a draw. In the back of my mind I remember a computer analysis that showed a forced mate in more moves than that. Such an analysis is NP complete and therefore no polynomial time algorithm could find it.
– MaxW
Jun 29, 2018 at 13:08
• Re (2) It would be impossible for a human to see that these games are winnable.
– MaxW
Jun 29, 2018 at 13:21
• MaxW, note that "winnable" asks if one side can force a checkmate when the other side plays optimally, but this question is if there exists a helpmate.
– usul
Aug 24, 2022 at 16:22

What you're asking goes by the name of "Dead Reckoning" in the domain of problems and retro problems.

(1) There isn't an algorithm I know of except the one mentioned by zaifrun: brute force. The reason is because you can find pretty amazing positions...

(2) Check out many problems relying on Dead Reckoning at Andrew Buchanan's website. Also there are problem databases (like this one) where you can run a search for 'DR' in the stipulation.

A concrete example I recall is this one, which I reproduce here. By Andrew Buchanan, in StrateGems 2002. White to move; what was the last move in this position? (The position is dead but the last move made must have been from a legal and live position - so it's uniquely determinable.)

``````Bb1k1b2/bKp1p1p1/1pP1P1P1/1P6/p5P1/P7/8/8 w - - 0 1
``````

(3) Even grandmasters have technically made moves in a dead position! See François Labelle's page for examples.

Update on the comment by usul. The algorithm is now described here: https://chasolver.org/FUN22-full.pdf

It combines a search of variations with a dedicated mechanism for identifying blocked positions such as: https://lichess.org/hPiwD75i#97

I just learned of an engine that analyzes chess positions to determine if checkmate by one side is impossible: https://elrubiongamma.ddns.net/chess-unwinnability-analyzer/about.html

So you can solve this problem in practice by running the algorithm for both sides.

It is called the Chess Unwinnability Analyzer 2. The source code is available here: https://github.com/miguel-ambrona/D3-Chess

I don't see a description of how the algorithm works, but it seems to be roughly based on brute force. There is a faster mode that is not quite as accurate. If someone knows more about the algorithm, please expand this answer!

Here is an interesting example position linked by the author where checkmate is impossible, but it's not immediately obvious (I've put this in the question now as a motivating example): https://lichess.org/bKHPqNEw#81

Well, this is really 3 questions, not sure I am answering everything here.

But there is an 'algorithm' for this problem, but it is NP complete, that is basically brute force in essence although you can make some Optimizations. This is basically the table base generating algorithm. Of course with large number of pieces this becomes difficult to apply, even for a single position.

This Rule is basically there, so you can claim a draw in positions that are obviously drawn such as bishop and king vs lone king with no pawn and similar positions.

• is the bishops are different colors, mate is possible: k1K5/b7/2B5/8/8/8/8/8 w - - 0 1, do you want me to show you a sequence of legal moves, that can end up in this position? Jun 29, 2018 at 7:52
• Yes, but I meant 1 king and bishop vs 1 king. I have edited the answer Jun 29, 2018 at 10:16
• Strange claim that it is NP complete. What is `n` in this case? Can you explain how you would reduce other NP problems to this? Mar 5, 2019 at 8:29
• @RemcoGerlich In particular, it is a category error to call algorithms NP-complete, only computational problems can be. Computing an optimal strategy for generalised chess on an n×n board is EXPTIME-complete, however. (Wikipedia gives the reference `Aviezri Fraenkel and D. Lichtenstein (1981). "Computing a perfect strategy for n×n chess requires time exponential in n". J. Comb. Th. A (31): 199–214`). Most problems on an 8×8 board are "trivial" in the context of complexity theory, as they can be solved in constant time. (even if that constant is too large to solve it in practice) Jun 17, 2019 at 14:20