TalkChess.com
Hosted by Your Move Chess & Games

Author Message
Sven Schüle

Joined: 15 May 2008
Posts: 2246
Location: Berlin, Germany

Post subject: Re: KQKP and KRKP endgames    Posted: Sat Jun 23, 2012 12:08 pm

lucasart wrote:
Sven Schüle wrote:
 lucasart wrote: I don't want to use a table base, just to programmatically detect some general cases where such an endgame is a known draw. I google it and couldn't find anything useful. But surely there must be some theory on that, right ? I think KQKP can be important: typically it raises from a KPKP which becomes a pawn race, one side queens, but that doesn't always guarantee a win. Obviously my stupid eval will return pretty much the material difference, which could lead to blunders (ie. choosing to simplify to obtain an apparently winning KQKP that is in fact a draw, when another choice could have won). KRKP should be relatively similar, I suppose.

KQKP can be solved statically for many cases, even though it is not always "trivial". In general, assuming a white queen and a quiet position with white to move, the position is a known draw, beneath possible other cases, if

a) the pawn is on the 2nd rank, and
b) the pawn is on the a-, c-, f-, or h-file, and
c) the pawn's promotion square is not occupied by a white piece, and
d) the pawn's promotion square can't be safely occupied by a white piece in the next move, and
e) the bK defends the pawn OR we have one of the patterns like Ka1/Pc2, Kc1/Pa2 (not sure about the latter!) where a distance of 2 squares between bK and pawn can be sufficient for a draw, and
f) the wK is "far enough" away from the pawn.

Conditions a)-e) are exact while in f) the term "far enough" depends on the position of all other pieces. There are distinct zones where the wK must be inside to win.

EDIT: Of course the second part of e) is also not "exact" ...

There are also rare exceptions with pawns on the 3rd rank which are drawn.

For KRKP the rules seem to be slightly more complex, and I can't give you any rules here. I don't think it is very similar to KQKP.

Sven

Thanks for the link. It appears to be much more complex than I initially envisaged. What I was basically hoping for is:
1/ determine simple rules when it's a known draw, if the pawn is on the 7th rank
2/ any other drawish position should not be more than a few good moves away from 1/, so a bit of search combined with 1/ should more or less do the trick

However, rule 1/ must tolerate no exceptions, even "rare" ones, or else it's a disaster and I'm better off without it. I thought a 7th rank pawn with the king at distance 1 and attacking king at distance >=2 for example was a sufficiant condition, but even that seems to be wrong...

"attacking king at distance >= 2" is obviously wrong in many cases but you can try to find a better value instead of "2" for each interesting class of bP-bK positions by writing a program (or adding code to your engine) that enumerates all legal, non-terminal, quiet, white-to-move positions for a given bP-bK position class (restricted to Pa2/c2/a3/c3 based on symmetry and other knowledge), looks up their true values in a tablebase/bitbase, and determines the smallest wK-bP distance for which the position is always a draw for all positions of the same class, and maybe also the largest wK-bP distance for which the position is always won (the latter only if you want to get safe predictions for "always won" positions as well). That should not be too difficult. (Here I assume that the wK-bP distance is the relevant number, which I am not 100% sure about: it might also be the distance of the wK to the promotion square.)

A suitable definition of "quiet" could be: wK not in check and no safe capture of bP possible in one ply. My conditions c) and d) above would have to be considered, too, since occupying the promotion square would make all wK-bP distance calculations obsolete. So you might extend the term "quiet" by "promotion square not occupied by white and can't be safely occupied in one ply".

Maybe someone has already done something similar.

The result would be interesting, even though I am not sure whether the overall effort would really pay off when considering that KQKP is quite a special case.

Sven
 Display posts from previous: All Posts1 Day7 Days2 Weeks1 Month3 Months6 Months1 Year Oldest FirstNewest First
Subject Author Date/Time
Lucas Braesch Fri Jun 22, 2012 2:30 pm
Mincho Georgiev Fri Jun 22, 2012 4:10 pm
Sven Schüle Fri Jun 22, 2012 4:11 pm
Lucas Braesch Sat Jun 23, 2012 7:12 am
Kevin Hearn Sat Jun 23, 2012 8:45 am
Re: KQKP and KRKP endgames Sven Schüle Sat Jun 23, 2012 12:08 pm
Sven Schüle Sat Jun 23, 2012 12:24 pm
Lucas Braesch Sat Jun 23, 2012 12:36 pm
Sven Schüle Sat Jun 23, 2012 3:19 pm
Ronald de Man Sat Jun 23, 2012 1:49 pm
Miguel A. Ballicora Sat Jun 23, 2012 2:45 pm
Ronald de Man Sat Jun 23, 2012 4:05 pm
Sven Schüle Sat Jun 23, 2012 4:19 pm
Ronald de Man Sat Jun 23, 2012 5:11 pm
Miguel A. Ballicora Sat Jun 23, 2012 5:37 pm
Michel Van den Bergh Sat Jun 23, 2012 6:09 pm
Joona Kiiski Sat Jun 23, 2012 6:16 pm
Daniel Shawul Sat Jun 23, 2012 6:27 pm
Tord Romstad Sun Jun 24, 2012 6:32 pm
Daniel Shawul Sun Jun 24, 2012 11:17 pm
Robert Hyatt Mon Jun 25, 2012 12:21 am
Ronald de Man Sat Jun 23, 2012 6:21 pm
Miguel A. Ballicora Sun Jun 24, 2012 7:19 pm
Robert Hyatt Mon Jun 25, 2012 12:32 am
Robert Hyatt Mon Jun 25, 2012 12:17 am
Thomas Petzke Sat Jun 23, 2012 4:21 pm
Joona Kiiski Sat Jun 23, 2012 4:44 pm
Lucas Braesch Sun Jun 24, 2012 3:14 am
Sven Schüle Sun Jun 24, 2012 10:14 am
Ronald de Man Sun Jun 24, 2012 11:05 am
Sven Schüle Sun Jun 24, 2012 11:51 am
Ronald de Man Sun Jun 24, 2012 12:39 pm
Sven Schüle Sun Jun 24, 2012 2:15 pm
Ronald de Man Sun Jun 24, 2012 2:24 pm
Uri Blass Sun Jun 24, 2012 1:24 pm
Sven Schüle Sun Jun 24, 2012 1:46 pm
Uri Blass Sun Jun 24, 2012 1:30 pm
Thomas Petzke Mon Jun 25, 2012 7:27 am
Joona Kiiski Sun Jun 24, 2012 5:13 pm

 Jump to: Select a forum Computer Chess Club Forums----------------Computer Chess Club: General TopicsComputer Chess Club: Tournaments and MatchesComputer Chess Club: Programming and Technical DiscussionsComputer Chess Club: Engine Origins Other Forums----------------Chess Thinkers ForumForum Help and Suggestions
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum