# Computer Chess Club Archives

## Messages

### Subject: Question about static exchange evaluation

Author: Larry Coon

Date: 09:13:26 11/12/98

```(Long question follows -- sorry.)

I know I saw SEE talked about recently, but I couldn't
locate the discussion here, on rgcc or anybody's web
page (I don't remember where I saw it).  Can somebody

1kq5/3n2p1/5p2/8/6N1/5R2/5RK1 w

Would a SEE do the following?
1. Find all attackers on the square in question (f5).
2. For each side, order the attackers in value, lowest
to highest.  Include the piece that is initially
captured to start off the exchange.  Put them into
two....whatever, I'll say stacks just to make it
easy to talk about.  The lowest valued pieces will
be at the top of the stack.  Only the values of the
pieces need to be pushed onto the stack.
4. Pop the next value for the side NOT to move (black's
stack if it's white's move) and SUBTRACT it from
the trade balance, then do the same for the other
stack.  (This works because at least in my program
opposing pieces have opposite signs).
5. When all values have been popped off either one of
the stacks, then the exchange is over and the trade
balance lets you know where you stand.
6. However, neither side has to follow the exchange
through to its completion.  So if either of the
following happen:
a. You pop the next value of "your" stack and
subtract it from the trade balance and it ends
up negative (for white, positive for black)
b. You do the same for the opponent's stack and
the result is positive (if black is the
opponent, otherwise negative)
Then you can assume that the side to move will not
continue the exchange, exit the loop now, and the
current trade balance will be the final balance.

So in my example position, the stacks would look like
(top of stack to the left):
white:  3,  5,  5
black: -1, -1, -3, -9

And the process would be as follows:
Step   stack   value   balance
----   -----   -----   -------
0                       0
1      b      -1        1
2      w       3       -2
3      b      -1       -1  *
4      w       5       -6  **
5      b      -3       -3
6      w       5       -8
7      b      -9        1

So at the point I marked *, the value is negative
with black to move and the loop can actually stop
here.  Black doesn't have to play NxR, and he's
won the exchange.  Therefore, the initial capture

However, if black DOES play NxR the following move
takes him to an even better position (**).  Maybe
I keep track of "most positive after an odd-numbered
step" and "most negative after an even numbered
step"?  Then the "most negative" would be the
assumed jumping-out point for black, and the "most
positive" would be the jumping-out point for white.

Or is it like beta-cutoff in alpha-beta where you
don't care how big the cutoff is, as long as you
find -a- cutoff?  So in this case, it doesn't
matter if the next exchange takes black from -1 to
-6, because the -1 by itself means the initial

I think I'm missing something obvious here about
the essence of this problem.  Can anybody help?

Thanks,

Larry Coon

```