Changes

Jump to: navigation, search

Static Exchange Evaluation

17,730 bytes added, 10:02, 30 April 2018
Created page with "'''Home * Search * Move Ordering * Static Exchange Evaluation''' FILE:Kleine Welten IX (Small Worlds IX) MET DP855300.jpg|border|right|thumb| [[Arts#K..."
'''[[Main Page|Home]] * [[Search]] * [[Move Ordering]] * Static Exchange Evaluation'''

[[FILE:Kleine Welten IX (Small Worlds IX) MET DP855300.jpg|border|right|thumb| [[Arts#Kandinsky|Wassily Kandinsky]] - Small Worlds IX <ref>[[Arts#Kandinsky|Wassily Kandinsky]] - [https://commons.wikimedia.org/wiki/File:Kleine_Welten_IX_(Small_Worlds_IX)_MET_DP855300.jpg?uselang=en Small Worlds IX], 1922, [https://en.wikipedia.org/wiki/Metropolitan_Museum_of_Art Metropolitan Museum of Art]</ref> ]]

A '''Static Exchange Evaluation (SEE)''' examines the consequence of a series of exchanges on a single [[Squares|square]] after a given [[Moves|move]], and calculates the likely evaluation change ([[Material|material]]) to be lost or gained, [[Donald Michie]] coined the term [[SOMA#Swapoff|swap-off value]]. A positive static exchange indicates a "winning" move. For example, PxQ will always be a win, since the Pawn side can choose to stop the exchange after its Pawn is recaptured, and still be ahead. Some programs optimize the SEE function to only return a losing or equal/winning flag, since they only use SEE to determine if a move is worth searching and do not need the actual value. SEE is useful in [[Move Ordering|move ordering]], [[Futility Pruning|futility pruning]] and especially in [[Quiescence Search|quiescence search]] in conjunction with [[Delta Pruning|delta pruning]], as well to [[Reductions|reduce]] "bad" [[Captures|captures]] and [[Check|checks]] <ref>[http://www.talkchess.com/forum/viewtopic.php?t=40100 Reducing/Pruning Bad Captures (SEE < 0)] by [[Edsel Apostol]], [[CCC]], August 19, 2011</ref> .

=Implementation=
A [https://en.wikipedia.org/wiki/Didactic_method didactic] [[Recursion|recursive]] implementation of SEE is shown below <ref>[http://www.talkchess.com/forum/viewtopic.php?t=30905 SEE algorithm on chessprogramming wiki] by [[Sven Schüle]], [[CCC]], December 02, 2009</ref> . In most programs, however, an [[Iteration|iterative]] version is used, as demonstrated in [[SEE - The Swap Algorithm]] with [[Bitboards|bitboards]]. In [[CCC]], [[Harm Geert Muller]] deduced an iterative SEE approach directly from [[Alpha-Beta]] <ref>[http://www.talkchess.com/forum/viewtopic.php?topic_view=threads&p=310782&t=30905 Re: SEE algorithm on chessprogramming wiki] by [[Harm Geert Muller]], [[CCC]], December 20, 2009</ref> .
<pre>
int see(int square, int side)
{
value = 0;
piece = get_smallest_attacker(square, side);
/* skip if the square isn't attacked anymore by this side */
if ( piece )
{
make_capture(piece, square);
/* Do not consider captures if they lose material, therefor max zero */
value = max (0, piece_just_captured() -see(square, other(side)) );
undo_capture(piece, square);
}
return value;
}
</pre>
This uses a trick, equivalent to [[Negamax|negamax]] in tree search, where the loss for the current side is the gain for the opposite side. This can be seen in the expression piece_just_captured() - see(square); which is the value of the piece captured (piece_just_captured()) minus the gain that the opponent might make after the move by recapturing. If that term becomes negative, one would better choose [[Quiescence Search#StandPat|standing pat]] rather than to capture, which can be done by a conditional assignment, or by a [[Avoiding Branches#Max|max]] function with zero as second argument.

=Seeing a Capture=
To statically evaluate a [[Captures|capture]], that particular capture should be forced, because it might not be the lowest attacker that makes the capture, and must not allow the option of standing pat <ref>[http://www.talkchess.com/forum/viewtopic.php?topic_view=threads&p=387694&t=37582 Re: Simple question about SEE] by [[Harm Geert Muller]], [[CCC]], January 12, 2011</ref> .
<pre>
int seeCapture(int from, int to, int side)
{
value = 0;
piece = board[from];

make_capture(piece, to);
value = piece_just_captured() - see(to, other(side));
undo_capture(piece, to);
return value;
}
</pre>
=SOMA=
Instead of using a [[Quiescence Search|quiescence search]], some (early) chess programs aimed to determine the material balance of a position by a static analysis of '''all''' possible capture-move sequences. These routines are often referred to as [[SOMA#SOMAALGO|SOMA]] ('''S'''wapping '''O'''ff '''M'''aterial '''A'''nalyzer) <ref>[[Hiroyuki Iida]], [[Makoto Sakuta]], [[Jeff Rollason]] ('''2002'''). ''Computer Shogi''. Artificial Intelligence, Vol. 134, [https://en.wikipedia.org/wiki/Elsevier Elsevier], [http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.130.2727 CiteSeerX]</ref> based on the [[SOMA#Swapoff|swap-off algorithm]] used in the one-ply analyzing "paper machine" [[SOMA]] by [https://en.wikipedia.org/wiki/Evolutionary_biologist evolutionary biologist] [[John Maynard Smith]], the '''S'''mith '''O'''ne-'''M'''ove '''A'''nalyzer designed in the early 60s <ref>[[John Maynard Smith]], [[Donald Michie]] ('''1961'''). ''Machines that play games''. [https://en.wikipedia.org/wiki/New_Scientist New Scientist], 12, 367-9. [http://books.google.com/books?id=lo7r0zX_T0sC&lpg=PA369&dq=Machines%20that%20play%20games.%201961%2C%20New%20Scientist%2C%2012&pg=PA367#v=onepage&q&f=false google books]</ref> .

=See also=
* [[Negamax]]
* [[Futility Pruning]]
* [[Delta Pruning]]
* [[Guard Heuristic]]
* [[Quiescence Search]]
* [[MVV-LVA]]
* [[Attack and Defend Maps#EDsLookup|Ed's Lookup]] from [[Attack and Defend Maps]]
* [[SEE - The Swap Algorithm]] with [[Bitboards]]
* [[SOMA]]
: [[SOMA#Swapoff|Swap-off algorithm]]
* [[Helmut Richter#Swapoff|Swap-off]] by [[Helmut Richter]]

=Publications=
* [[John Maynard Smith]], [[Donald Michie]] ('''1961'''). ''Machines that play games''. [https://en.wikipedia.org/wiki/New_Scientist New Scientist], 12, 367-9. [http://books.google.com/books?id=lo7r0zX_T0sC&lpg=PA369&dq=Machines%20that%20play%20games.%201961%2C%20New%20Scientist%2C%2012&pg=PA367#v=onepage&q&f=false google books] » [[SOMA]]
* [[Donald Michie]] ('''1966'''). ''Game Playing and Game Learning Automata.'' Advances in Programming and Non-Numerical Computation, [https://en.wikipedia.org/wiki/Leslie_Fox Leslie Fox] (ed.), pp. 183-200. Oxford, Pergamon. » Includes Appendix: ''Rules of SOMAC'' by [[John Maynard Smith]] <ref>see [[Helmut Richter#Swapoff|Swap-off]] by [[Helmut Richter]]</ref>
* [[Donald Michie]] ('''1974'''). ''On Machine Intelligence''. Edinburgh: University Press, ISBN 10: 085224262X, ISBN 13: 9780852242629, [http://www.abebooks.com/servlet/SearchResults?isbn=085224262X abebooks.com], [http://www.alibris.com/search/books/qwork/4836304/used/On%20machine%20intelligence alibris.com], [http://www.biblio.com/isbn/9780852242629.html biblio.com]
* [[Dan Spracklen]], [[Kathe Spracklen]] ('''1978'''). ''[https://archive.org/stream/byte-magazine-1978-11/1978_11_BYTE_03-11_The_Sky_is_the_Limit#page/n17/mode/2up An Exchange Evaluator for Computer Chess]''. [[Byte Magazine#BYTE311|BYTE, Vol. 3, No. 11]] <ref>[http://www.andreadrian.de/schach/sargon.asm Sargon Z80 assembly listing] by [[Dan Spracklen|Dan]] and [[Kathe Spracklen]], hosted by [[Andre Adrian]], see XCHNG</ref>
* [[David Levy]] ('''1979'''). ''Chess Programming - Before You Begin''. [[Personal Computer World]], May 1979
* [[Jeff Rollason]] ('''2000'''). ''SUPER-SOMA - Solving Tactical Exchanges in Shogi without Tree Searching''. Lecture Notes In Computer Science; Vol. 2063, [[CG 2000]], [http://www.aifactory.co.uk/downloads/SUPER-SOMA.doc Word preprint]<ref>[http://www.aifactory.co.uk/newsletter/2006_03_quiescence_alts.htm Looking for Alternatives to Quiescence Search] by [[Jeff Rollason]], [[AI Factory]], December 2006</ref>
* [[Hiroyuki Iida]], [[Makoto Sakuta]], [[Jeff Rollason]] ('''2002'''). ''Computer Shogi''. Artificial Intelligence, Vol. 134, [https://en.wikipedia.org/wiki/Elsevier Elsevier], [http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.130.2727 CiteSeerX]
* [[Fritz Reul]] ('''2009'''). ''New Architectures in Computer Chess'', Ph.D. Thesis, Chapter 4, Static Exchange Evaluation, [http://www.personeel.unimaas.nl/uiterwijk/Theses/PhD/Reul_thesis.pdf pdf]
* [[Fritz Reul]] ('''2010'''). ''Static Exchange Evaluation with αβ-Approach''. [[ICGA Journal#33_1|ICGA Journal, Vol. 33, No. 1]]

=Forum Posts=
==1990 ...==
* [http://groups.google.com/group/rec.games.chess/browse_frm/thread/638ca70e88930bb4 efficient algorithm for safety of pieces] by [[Deniz Yuret]], [[Computer Chess Forums|rgc]], March 18, 1993
* [http://groups.google.com/group/rec.games.chess/browse_frm/thread/dd1c55ecc9f48717 Computer Chess: swap down evaluators vs capture search] by [[Jon Dart]], [[Computer Chess Forums|rgc]], October 24, 1994
==1995 ...==
* [http://groups.google.com/group/rec.games.chess.computer/browse_frm/thread/1fa5e36362f5dde4 mvv/lva vs SEE capture ordering test results] by [[Robert Hyatt]], [[Computer Chess Forums|rgcc]], August 10, 1995
* [http://groups.google.com/group/rec.games.chess.computer/browse_frm/thread/645f44f84102e450 MVV/LVA vs SEE move ordering - more test results] by [[Robert Hyatt]], [[Computer Chess Forums|rgcc]], August 25, 1995
: [http://groups.google.com/group/rec.games.chess.computer/msg/1951744da404fc33 Re: MVV/LVA vs SEE move ordering - more test results] by [[Brian Sheppard]], [[Computer Chess Forums|rgcc]], August 27, 1995
* [https://www.stmintz.com/ccc/index.php?id=17016 Quiescence vs swapoff] by [[Peter Fendrich]], [[CCC]], April 15, 1998
* [https://www.stmintz.com/ccc/index.php?id=32703 Question about static exchange evaluation] by Larry Coon, [[CCC]], November 12, 1998
* [https://www.stmintz.com/ccc/index.php?id=60880 Help with Static Exchange Evaluator] by [[William Bryant]], [[CCC]], July 18, 1999
* [https://www.stmintz.com/ccc/index.php?id=63511 SEE for forward pruning in Q. Search] by [[Tom King]], [[CCC]], August 04, 1999 » [[Quiescence Search]]
* [https://www.stmintz.com/ccc/index.php?id=64357 SEE for forward pruning in the Q. search - I'm confused!] by [[Tom King]], [[CCC]], August 11, 1999
==2000 ...==
* [https://www.stmintz.com/ccc/index.php?id=134986 Re: Explain SEE (static exchange evaluator)?] by [[Bruce Moreland]], [[CCC]], October 25, 2000
* [https://www.stmintz.com/ccc/index.php?id=141230 Qsearch problems...(about sorting and SEE)] by [[Severi Salminen]], [[CCC]], November 26, 2000 » [[Quiescence Search]]
* [https://www.stmintz.com/ccc/index.php?id=141813 MVV/LVA or SEE - liability?] by [[Severi Salminen]], [[CCC]], November 29, 2000 » [[MVV-LVA]]
'''2001'''
* [https://www.stmintz.com/ccc/index.php?id=147977 About SEE] by [[Severi Salminen]], [[CCC]], January 04, 2001
* [https://www.stmintz.com/ccc/index.php?id=152256 Should an engine using SEE beat another not using it?] by [[Severi Salminen]], [[CCC]], January 27, 2001
* [https://www.stmintz.com/ccc/index.php?id=161209 SEE and possible EXChess bug] by [[Gian-Carlo Pascutto]], [[CCC]], April 01, 2001 » [[EXchess]] <ref>[https://www.stmintz.com/ccc/index.php?id=162704 EXchess v4.02 released] by [[Dan Homan]], [[CCC]], April 10, 2001</ref>
* [https://www.stmintz.com/ccc/index.php?id=179023 Static Exchange Eval (SEE)] by [[Leen Ammeraal]], [[CCC]], July 10, 2001
* [https://www.stmintz.com/ccc/index.php?id=178979 Static Exchange Eval] by [[Artem Petakov|Artem Pyatakov]], [[CCC]], August 02, 2001
* [https://www.stmintz.com/ccc/index.php?id=202931 I want to SEE] by [[Matthias Gemuh]], [[CCC]], December 21, 2001
: [https://www.stmintz.com/ccc/index.php?id=202933 Re: I want to SEE] by [[Matthias Gemuh]], [[CCC]], December 21, 2001
'''2002'''
* [https://www.stmintz.com/ccc/index.php?id=206056 Value of King in SEE] by [[David Rasmussen]], [[CCC]], January 07, 2002
* [https://www.stmintz.com/ccc/index.php?id=262577 Static exchange evaluator and 0x88] by Pierre Bokma, [[CCC]], October 30, 2002
'''2003'''
* [https://www.stmintz.com/ccc/index.php?id=311899 Static Exchange Evaluation (SEE) for pruning in quiescence (?)] by [[Omid David]], [[CCC]], August 19, 2003
* [https://www.stmintz.com/ccc/index.php?id=330947 table-based SEE or "evaluation in rebel (hanging pieces)"] by [[Martin Fierz]], [[CCC]], November 27, 2003 » [[Hanging Piece]], [[Rebel]]
'''2004'''
* [https://www.stmintz.com/ccc/index.php?id=343790 A SIMD idea, eg. Piece/Gain of a capture target] by [[Gerd Isenberg]], [[CCC]], January 21, 2004
* [https://www.stmintz.com/ccc/index.php?id=357382 SEE and FH-%] by [[Jan Renze Steenhuisen|Renze Steenhuisen]], [[CCC]], March 30, 2004
* [https://www.stmintz.com/ccc/index.php?id=381606 SEE results] by [[Stuart Cracraft]], [[CCC]], August 10, 2004
* [https://www.stmintz.com/ccc/index.php?id=385126 SEE and pin detection] by [[Dan Honeycutt]], [[CCC]], August 30, 2004 » [[Pin]]
* [https://www.stmintz.com/ccc/index.php?id=390108 Pin aware SEE] by [[Dan Honeycutt]], [[CCC]], October 03, 2004
==2005 ...==
* [https://www.stmintz.com/ccc/index.php?id=410423 Help on how to implement move ordering with a Static Exchange Evaluator] by Carlos Magno, [[CCC]], February 09, 2005
* [http://www.open-aurec.com/wbforum/viewtopic.php?t=1961 Static Exchange Evaluation Methods] by [[Pradu Kannan]], [[Computer Chess Forums|Winboard Forum]], March 14, 2005
'''2007'''
* [http://www.open-aurec.com/wbforum/viewtopic.php?t=6104 SEE with magic bitboards] by [[Pradu Kannan]], [[Computer Chess Forums|Winboard Forum]], January 24, 2007 » [[Magic Bitboards]]
* [http://www.talkchess.com/forum/viewtopic.php?t=12706 SEE on non-capture moves in main search] by [[Gary Linscott|Gary]], [[CCC]], March 28, 2007 » [[Move Ordering]]
* [http://www.open-aurec.com/wbforum/viewtopic.php?f=4&t=6421 How good is your SEE?] by [[Mark Lefler|mjlef]], [[Computer Chess Forums|Winboard Forum]], April 24, 2007
* [http://www.talkchess.com/forum/viewtopic.php?topic_view=threads&p=123511&t=14168 Re: Movei added to Crafty vs Rybka comparison data] by [[Edsel Apostol]], [[CCC]], June 06, 2007
* [http://www.talkchess.com/forum/viewtopic.php?t=18163 SEE algorithm] by [[Robert Pope]], [[CCC]], December 02, 2007
'''2008'''
* [http://www.talkchess.com/forum/viewtopic.php?t=20646 SEE problem] by [[Tord Romstad]], [[CCC]], April 13, 2008
* [http://www.talkchess.com/forum/viewtopic.php?t=24357 How is SEE used?] by [[Mathieu Pagé]], [[CCC]], October 13, 2008
'''2009'''
* [http://www.talkchess.com/forum/viewtopic.php?t=29216 SEE Observation] by [[Brian Richardson]], [[CCC]], August 02, 2009 » [[Tinker]]
* [http://www.talkchess.com/forum/viewtopic.php?t=30905 SEE algorithm on chessprogramming wiki] by [[Sven Schüle]], [[CCC]], December 02, 2009
==2010 ...==
* [http://www.talkchess.com/forum/viewtopic.php?t=31464 SEE Improvement Idea] by [[Mark Lefler]], [[CCC]], January 04, 2010
'''2011'''
* [http://www.talkchess.com/forum/viewtopic.php?t=37514 Using SEE to prune in main search] by [[Tom King]], [[CCC]], January 08, 2011 » [[Pruning]], [[Reductions]]
* [http://www.talkchess.com/forum/viewtopic.php?t=37582 Simple question about SEE] by [[Andres Valverde]], [[CCC]], January 12, 2011
* [http://www.talkchess.com/forum/viewtopic.php?t=40046 Implementing SEE] by colin, [[CCC]], Aug 12, 2011
* [http://www.talkchess.com/forum/viewtopic.php?t=40054 SEE with alpha beta] by [[Onno Garms]], [[CCC]], August 14, 2011 » [[Onno]]
* [http://www.talkchess.com/forum/viewtopic.php?t=40100 Reducing/Pruning Bad Captures (SEE < 0)] by [[Edsel Apostol]], [[CCC]], August 19, 2011 » [[Reductions]], [[Pruning]]
* [http://www.talkchess.com/forum/viewtopic.php?t=40283 question about SEE] by [[Alberto Sanjuan]], [[CCC]], September 05, 2011
'''2013'''
* [http://www.talkchess.com/forum/viewtopic.php?t=47330 SEE] by [[Rasjid Chan]], [[CCC]], February 25, 2013
* [http://www.talkchess.com/forum/viewtopic.php?t=48609 Static Exchange Evaluation...] by [[Steve Maughan]], [[CCC]], July 10, 2013 <ref>[http://www.chessprogramming.net/computerchess/static-exchange-evaluation-in-chess/ Static Exchange Evaluation in Chess] by [[Steve Maughan]], [http://www.chessprogramming.net/ Chess Programming Blog], July 9, 2013</ref>
* [http://www.talkchess.com/forum/viewtopic.php?t=48899 SEE() is slow and SEE() is fast] by [[Steven Edwards]], [[CCC]], August 09, 2013
'''2014'''
* [http://www.talkchess.com/forum/viewtopic.php?t=51272 SEE] by [[Richard Delorme]], [[CCC]], February 13, 2014
* [http://www.talkchess.com/forum/viewtopic.php?t=51518 SEE logic] by [[Youri Matiounine]], [[CCC]], March 08, 2014 » [[Piece-Square Tables]]
==2015 ...==
* [http://www.talkchess.com/forum/viewtopic.php?t=57045 SEE Map] by [[Matthew Lai]], [[CCC]], July 20, 2015 <ref>[[Russell M. Church]], [[Kenneth W. Church]] ('''1977'''). ''Plans, Goals, and Search Strategies for the Selection of a Move in Chess''. [[Chess Skill in Man and Machine]]</ref>
* [http://www.talkchess.com/forum/viewtopic.php?t=57548 Magic SEE] by [[Harm Geert Muller]], [[CCC]], September 07, 2015
* [http://www.talkchess.com/forum/viewtopic.php?t=64166 Problems with SEE] by [[Matthew R. Brades]], [[CCC]], June 03, 2017
* [http://www.talkchess.com/forum/viewtopic.php?t=65836 see] by [[Folkert van Heusden]], [[CCC]], November 28, 2017
* [http://www.talkchess.com/forum/viewtopic.php?t=65982 Poor man's SEE] by [[Harm Geert Muller]], [[CCC]], December 11, 2017

=External Links=
* [http://mediocrechess.blogspot.com/2007/03/guide-static-exchange-evaluation-see.html Static exchange evaluation (SEE)] from [http://mediocrechess.varten.org/index.html Mediocre Chess] by [[Jonatan Pettersson]]
* [http://www.chessprogramming.net/computerchess/static-exchange-evaluation-in-chess/ Static Exchange Evaluation in Chess] by [[Steve Maughan]], [http://www.chessprogramming.net/ Chess Programming Blog], July 9, 2013

=References=
<references />

'''[[Move Ordering|Up one level]]'''

Navigation menu