Computer Chess Club Archives


Search

Terms

Messages

Subject: How do you detect trapped pieces in a program?

Author: KarinsDad

Date: 11:29:54 03/14/00

Go up one level in this thread


On March 14, 2000 at 13:49:17, Dann Corbit wrote:

>Crafty plans the same thing (in a round-about way) but changes its mind in ply
>16.  I do think the original 1. ... Bd4+ 2. Kh1 Bxc3 plan seems better, but I
>must confess, I can't really see 8 fullmoves ahead in all directions, so crafty
>probably knows much better than I do.  In any case, Rf8 is probably a pretty
>good move too.  I do like the idea of paralyzing the bishop, and probably the
>chess programs can't see that it is shut in permanently.

This is a good example of a trapped piece.

I have been thinking a long time about how to detect trapped pieces in a
program, but I have not yet come up with anything solid.

Yes, certain types of trapped pieces such as the knights on the edge can be
detected fairly easy. If a knight is on the a file (not a1 or a8), check if it's
two c file escape squares are empty; if all of it's escape squares are either
covered with it's own piece or not protected; and if an opposing bishop or queen
is on the appropriate square on the d file. Use similar methods for the other
edges and a slightly different method for the corner squares.

It would be interesting though to come up with a mechanism to detect more
advanced forms of trapped pieces such as the one in the position in this thread.

However, the main problem with checking trapped piece conditions is that it has
to be checked in every single position evaluation and even if you lower the
score due to a trapped piece, it may not be a permanently trapped piece, so the
score may raise later on.

Effectively what you have is the "Never" situation. The program cannot search
deeply enough to distinquish between a piece that will never get out (without
losing material) and one that may eventually get out.

The best you might have is that the program detects the limited current mobility
of the trapped piece and that does not change throughout the search. This may be
the mechanism that some of the programs on the example position in this thread
use to come up with the solution. Other moves allow the knight to move, the c
pawn to advance, and the bishop to escape (and gain more mobility). Hence, moves
whose scores do not result in that eventually result in Bxc3.

This is an extremely set of interesting problems which do not necessarily have
nice solutions.

KarinsDad :)



This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.