additions to the shannon algorithm?

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

flok

additions to the shannon algorithm?

Post by flok »

Hi,

We all know the shannon evaulation algorithm: 1 point for a pawn, 3 points for a knight or bishop, 5 points for rooks, 9 for queens, 0.1 for each move, subtracting ½ point for each doubled pawn, backward pawn, and isolated pawn.
Now I was wondering: since then, were any additional parameters invented? If so: which ones?
User avatar
hgm
Posts: 27811
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: additions to the shannon algorithm?

Post by hgm »

King safety.
flok

Re: additions to the shannon algorithm?

Post by flok »

hgm wrote:King safety.
How is that defined? And what value?


thanks
User avatar
hgm
Posts: 27811
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: additions to the shannon algorithm?

Post by hgm »

Every program defines that differently, and it is the major factor that separates strong engines from weak engines.

For a castled (white) King it is usually implemented as a bonus for being on g1 or c1/b1, and give a penalty for each missing Pawn on f2/g2/h2 or a2/b2/c2, with an extra large penalty if there is no pawn in the file at all. You could also give a penalty for each square from which a King could be checked by a slider, or for each square next to the King that is attacked by an enemy piece (perhaps reducing the penalty if the square is also defended by a friendly piece other than the King). And a penalty if the opponent has a half-open file opposite to your King fortress.

The value of these respective penalties can be made dependent on the amount and type of material the opponent has: the less material he has, the less valuable King safety will be in general. In a Pawn ending you don't have to worry about it at all. And you don't have to worry about open files if the opponent has no Q or R, and not about diagonal checks if the opponent does not have corresponding B or Q.

King safety is a major evaluation term, and can easily be worth 200 - 500 cP.
Uri Blass
Posts: 10312
Joined: Thu Mar 09, 2006 12:37 am
Location: Tel-Aviv Israel

Re: additions to the shannon algorithm?

Post by Uri Blass »

flok wrote:Hi,

We all know the shannon evaulation algorithm: 1 point for a pawn, 3 points for a knight or bishop, 5 points for rooks, 9 for queens, 0.1 for each move, subtracting ½ point for each doubled pawn, backward pawn, and isolated pawn.
Now I was wondering: since then, were any additional parameters invented? If so: which ones?
I did not know it but this is not a good algorithm.

kinght and bishop should be more than rook and pawn so we simply increase the value of knight and bishop.

substracting 1/2 pawns for double pawns backward pawn or isolated pawn is clearly too much.

king safety is important but also mobility is important(maybe it is included in 0.1 for each move but 0.1 for each move is not clearly defined.

king safety is based on attacking squares near the king when the idea is that you give a bonus for heavy pieces that attack squares near the king.

Uri
User avatar
hgm
Posts: 27811
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: additions to the shannon algorithm?

Post by hgm »

A very elementary term that is still missing (apart from piece-square tables, which could be seen as a poor-man's substitute for mobility) is an elephantiasis correction. This term is not very large in normal Chess, but can get substantial (> 100 cP) in games with multiple Queen-class pieces.

Bassically, this is a non-linear material term, that discounts the value of high pieces for each lower piece the opponent has. This term causes a Q to be worth less than R+B in the presence of 4 other Queens (2 black, two white), why a sole Q is worth a lot more than R+B. (Or in other words QQQ < QQRB while Q > RB.)
ernest
Posts: 2041
Joined: Wed Mar 08, 2006 8:30 pm

Re: additions to the shannon algorithm?

Post by ernest »

Have a look at Larry Kaufman's work (he now works on Rybka):

The Evaluation of Material Imbalances in Chess
http://home.comcast.net/~danheisman/Art ... alance.htm

All About Doubled Pawns
http://home.comcast.net/~danheisman/Art ... _pawns.htm
Gian-Carlo Pascutto
Posts: 1243
Joined: Sat Dec 13, 2008 7:00 pm

Re: additions to the shannon algorithm?

Post by Gian-Carlo Pascutto »

I'm surprised nobody mentions passed pawns
User avatar
Graham Banks
Posts: 41473
Joined: Sun Feb 26, 2006 10:52 am
Location: Auckland, NZ

Re: additions to the shannon algorithm?

Post by Graham Banks »

Gian-Carlo Pascutto wrote:I'm surprised nobody mentions passed pawns
I am not a programmer, but from my observations through the testing I've done, the evaluation of king safety, passed pawns and mobility stand out as key areas in defining an engine's strength. Correct material evaluation is also a factor, and the values mentioned originally need to be refined better.
gbanksnz at gmail.com
Uri Blass
Posts: 10312
Joined: Thu Mar 09, 2006 12:37 am
Location: Tel-Aviv Israel

Re: additions to the shannon algorithm?

Post by Uri Blass »

Gian-Carlo Pascutto wrote:I'm surprised nobody mentions passed pawns
You are right that passed pawns are important factors.
I saw mentioning pawn structure so I did not think about them.