Answers.Body: <p>You're asking a pretty complex question, but it's good to go back to basics.  There are a couple of concepts to consider:</p>
  
  <h2>Evaluation</h2>
  
  <p>If a (real) player is shown a position and asked "who is winning this game?", how do they go about deciding?  Most likely, they will check a few basic things, such as: material differences, the degree to which pieces have been developed or are positioned "well", doubled / isolated / connected / passed pawns, (controlled) open files, how far up the board the pawns are.</p>
  
  <p>Now, if you had to, you could come up with a systematic way to calculate a position score based on the above.  You could decide, for example, that a pawn is worth 1 point, and that a passed pawn is worth 0.3 points more.  Isolated or doubled pawns might be worth a bit less, etc.  If you add up everything, you get an estimate value for the immediate position at hand.  </p>
  
  <p>This is known as <a href="http://chessprogramming.wikispaces.com/Evaluation">evaluation</a>, and basically all chess programs have a way to evaluate positions (ignoring novelty AI chess engines which are typically very weak).</p>
  
  <blockquote>
    <p>But what about subtle, deep positional moves?</p>
  </blockquote>
  
  <p>Well, we've only barely scratched the surface of position evaluation.  The actual implementation of an evaluation function could be simplistic, to allow for more positions to be evaluated per second (albeit in a rough fashion), or more complex, leading to less positions evaluated, but with a higher degree of confidence.  It's not unusual for the evaluation function to take into account hundreds or even thousands of separate pieces of information.</p>
  
  <h2>Search</h2>
  
  <p>I've specifically left out something from the above, which most real players will immediately think about - is there any way to immediately win the game for either side?  Any mates or "hanging" pieces visible?  Although it's easy to trivialise this, it's anything but trivial.  </p>
  
  <p>What does it mean for a player to have <em>full</em> confidence in a combination?  In the end, it boils down to having calculated all options.  Real players typically won't do this (except for trivial or very forced mates), most of the time we will only consider a handful of options, and rule out others which seem to be "non-constructive" or obviously leading to a loss.  We often make mistakes during this calculation, e.g. we may realise that a change in move orders makes threats evaporate, etc.  The point is that to be completely sure of a combination, you actually need to calculate all the way to its conclusion, assuming each player will only make the best possible move available to them (this is referred to as "min/max").  </p>
  
  <p>Now, given that chess has a much larger search space (this is what "all possible moves in the future" is referred to) than what is feasible for a computer to calculate, compromises need to be made.  Just like humans, computers can decide to disregard entire lines of thought based on certain criteria.  This is known as <em>heuristics</em>.  It's worthwhile noting that while you can only be really sure of a combination if you brute force it, a complex evaluation function can often detect the presence of threats (e.g. we could count forks, skewer opportunities, etc, to guide a search in that direction).</p>
  
  <p>In the end, although computers are extremely fast, it's the heuristics which allow them to calculate so deep.  That said, you may be surprised how deep modern engines calculate fully, typically it's beyond 3 moves, even in quick games.</p>
  
  <h2>Conclusion / combining it all</h2>
  
  <p>So, to summarise - evaluation functions have a lot of intelligence built into them (i.e. they take into consideration more things than your average human player), heuristics allow the computer to cull lines of thought it decides probably aren't going to end well, and computers are extremely, extremely fast.  Add them up, and they're pretty difficult to beat.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-05-04T10:16:29.867Z
Answers.Text: Just an update: "AI"-based algorithms are in some of the best engines nowadays - AlphaZero, Lela, and Stockfish. With the aid of algorithms from machine learning, Stockfish was able to gain some hundreds extra in ELO when playing against other top engines. These engines also contributed interesting data to chess theory as some were trained with zero information fed in - learning from purely random moves at first, playing itself. AlphaZero was able to arrive at many openings played by super GMs. Also, the heuristics used are often alpha-beta pruning (just for a little more info).
Answers.UserDisplayName: user904963
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2013-03-26T15:24:59.120Z
Answers.LastActivityDate: 2013-03-26T15:24:59.120Z
Answers.UserDisplayName: Daniel B
Answers.Body: <p>It is just impossible for computers to look deep enough (25 ply and more) and check every possible move.</p>
  
  <p>What makes is possible is the technique called <a href="http://en.wikipedia.org/wiki/Alpha%E2%80%93beta_pruning" rel="nofollow noreferrer">Alpha-beta pruning</a> which means that computers, similar to humans (but way better) follow only the promising continuations.</p>
  
  <p>They evaluate the positions constantly (based on some precoded rules, valuing material, king safety, activity, pawn structures etc) and look into variations that seem to be leading them towards the best position.</p>
  
  <p>It is still close to magic how they manage to do it efficiently enough to evaluate millions of these positions in a second.</p>
  
  <p>So to summarise- you are correct, they can not look at all the moves if they play strategic chess, but they can very quickly look at decent moves. The problem is still with the very long term plans and horizon to which they can see, but this is being worked on (Rybka analyses much slower, but plays much more positional chess, while Houdini is romantic at it's 'mechanical heart' calculating more moves and playing more aggressively). Even computers have their own styles!</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-05-04T10:28:18.157Z
Answers.Text: It is impossible to brute force most positions, but I'll add to your answer that there are 6-piece end tables for all combinations of legal pieces (6 total pieces e.g. 3 white & 3 black or 5 white & 1 black). Engines look up the solved answer to evaluate any position with 6 or fewer pieces. I'm not sure what its criteria are when they have a losing position (maximize number of moves before checkmate? Attempt tricks? Attack, going for a checkmate or for a profitable capture?). People are working on 7-piece tables although I don't know its progress / whether it is feasible to use (too many GB).
Answers.UserDisplayName: user904963
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2013-04-25T08:57:40.140Z
Answers.LastActivityDate: 2019-09-17T16:40:24.757Z
Answers.LastEditDate: 2019-09-17T16:40:24.757Z
Answers.UserDisplayName: bjedrzejewski
Answers.Body: <p>I agree with the answers.</p>
  
  <p>I remember GM <a href="http://en.wikipedia.org/wiki/Roman_Dzindzichashvili" rel="nofollow">Roman Dzindzichashvili</a> talking about it, in one of <a href="http://www.chesscentral.com/chess_dvd_roman_s/40.htm" rel="nofollow">Roman's labs</a> videos, i don't remember what video it was (if anyone knows the details please edit my answer).</p>
  
  <p>Roman said that the developer of <a href="http://en.wikipedia.org/wiki/Fritz_%28chess%29" rel="nofollow">Fritz engine</a> is his friend. So Roman tested Fritz to see how good it was, and the developer told Roman that in order for fritz to make complex decisions (sacrificing materials in exchange for positional advantage for example) they had to change the value of the pieces, like telling the program that a bad bishop is worth 1 point, a bishop on an open diagonal is worth 7 points, knights are worth 5 points in close positions... </p>
  
  <p>I don't know the exact numbers for each piece but that's how it works, and now your engine won't have any problem sacrificing a bad bishop or whatever if you can tell him the value of each piece in each position.</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>See also <a href="http://chessprogramming.wikispaces.com/" rel="nofollow">The Chess Programming Wiki</a>.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2013-03-26T22:34:12.963Z
Answers.LastActivityDate: 2013-03-28T11:10:30.853Z
Answers.LastEditDate: 2013-03-28T11:10:30.853Z
Answers.UserDisplayName: Lynob
Answers.Body: <p>Alpha-beta pruning simply means that if you find a line that turns out badly for you, you stop looking at that candidate move, and instead try others.  It is a type of backward pruning meaning that you'll never miss a good move as a result.  Forward pruning, by contrast, is based more on guesswork.  Futility pruning, late move reductions and razoring are types of forward pruning, and all rely on the programmer's feeling for what type of moves should be considered.  A program that does a lot of forward pruning may miss out on startling sacrifices that lead to mate, but on the other hand, it eliminates a lot of really bad moves, and so can go deeper in looking at the moves it does favour.  </p>
  
  <p>Most engines search the first few moves at full depth examining all the possibilities.  If no move fails high (i.e. seems clearly worse than a move you've already considered), you extend the search just a bit more.   In general, you continue exploring each line until you reach a quiescent position (with no checks, captures, mate threats, etc.), and then do your evaluation.  Quiet moves may not be considered when they are deep in the search tree, but once you get to that actual position in the game, the engine looks at all moves, quiet and sharp alike.  You can actually see this in the engine output sometimes, when an engine suddenly favours a move that it hadn't been considering a few moves back.</p>
  
  <p>Engines calculate so quickly that it's not so important for them to consider which move to look at first, but for humans this is a key question.  Jonathan Tisdall takes a stab at answering this in his book, Improve Your Chess Now.  When you are on the attack, he suggests you look at the most violent moves first.  When you are defending, you look at the most difficult lines first.  He also cites positional rules of thumb (eg. centralization, coordination) when deciding which moves to look at first.</p>
  
  <p>Other books that may be relevant are Emmanuel Neimann's Invisible Chess Moves and Charles Hertan's Forcing Chess Moves, both of whom argue for the importance of considering unlikely or surprising moves in sharp positions.  Hertan even talks about developing 'computer eyes' for such tactics.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-09-23T11:20:31.317Z
Answers.LastActivityDate: 2015-09-23T11:33:25.847Z
Answers.LastEditDate: 2015-09-23T11:33:25.847Z
Answers.UserDisplayName: A passerby
Answers.Body: <p>In a general way chess engines use a decision tree. The root of the tree is the current position and has a child node for each position that can be made by making a legal move. Each of these nodes in turn have a child node for the positions that can be reached by making a legal move from them. The engine pushes the tree out to a depth defined by its capabilities and the time it is allowed to "think". Positions that can be reached in more than one way are simply cross referenced so that they will not have to be considered more than once. Once the tree is created the computer uses a set of weighted rules to analyze the final positions in the tree and starts to remove those that are undesirable or that the opponent can prevent it from reaching. The tree is cut down this way until only one move remains and the computer makes that move. </p>
  
  <p><a href="http://www.chess.com/blog/zaifrun">http://www.chess.com/blog/zaifrun</a> has series or articles on creating a chess engine if you want a more in depth look at how they work. </p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2013-03-26T14:50:19.427Z
Answers.Text: Nice answer, so when you see depth of 30, does that mean the engine has searched 30 nodes deep?  Also, what does it mean by Ply?
Answers.UserDisplayName: xaisoft
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2013-03-26T20:37:36.633Z
Answers.Text: I am not sure what Ply stands for without doing some more research, I have never been good with acronyms. Rather depth refers to how many nodes deep, each node   would be a half move, or to moves deep might depend on the programmer. However I think that convention would have it be the number of moves deep.
Answers.UserDisplayName: Edward Goodson
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2013-03-27T14:57:54.537Z
Answers.Text: A ply is a half of a move.   A move in chess is one complete 'set' if you will by white + black.  A ply is half of that, so just one color.
Answers.UserDisplayName: ErebusBat
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2013-03-26T05:32:35.930Z
Answers.LastActivityDate: 2013-03-26T05:32:35.930Z
Answers.UserDisplayName: Edward Goodson
Body: <p>What I want to know is how engines are programmed to find moves. I'm sure they first calculate the most forcing lines such as captures and checks. But what about subtle, deep positional moves? They seem to find them very quickly as well (Generally speaking. Of course they miss such moves now and then). As in, how are they programmed to look for quiet moves/positional ideas? They can't just brute force every move, since that'd take too long, so there should be some clever way for them to arrive at the best moves really quickly. I'm interested in knowing this because I think it'd help players to think over the board in the real world as well.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-09-29T00:21:05.890Z
Comments.Text: Basically they search ahead with a search algorithm (e.g., minimax) and evaluate the positions using pre-programmed heuristics. Although some recent engines (e.g., AlphaZero) develop their own methods of evaluation through playing themselves.
Comments.UserDisplayName: Inertial Ignorance
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-03-10T06:03:42.567Z
Comments.Text: To add to the comment of @InertialIgnorance, many machine learning (ML) based engines play against itself (or train with a game database). But, we have no idea how they actually 'think'; they are indeed blackboxes!
Comments.UserDisplayName: Cyriac Antony
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-07-06T03:23:26.550Z
Comments.Text: Well as long as we don't ask engine to share their high level concept in chess-land, they will indeed remain blackboxes.  They are so, because we are content to say that.  But the NN. weights are all there, training trajectories of them, along with all the training games.
  
  The probleme with getting the high level picture, is that it tends to slow down, or introduce bugs to make the internal model output information beyond best move at current positoin, regressions.   The bottleneck is the objective criterion being not revised.  Devs.  optimize only for that.
Comments.UserDisplayName: dbdb
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2013-03-26T11:23:03.923Z
Comments.Text: Chess engines look at several million positions per second, so they can in fact look at all them until they get a few moves deep.
Comments.UserDisplayName: RemcoGerlich
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2013-03-27T00:16:43.740Z
Comments.Text: This is an awesome question, I really enjoyed the answers.
Comments.UserDisplayName: Travis J
Tags: <engines><positional-play><calculation><chess-algorithms><brute-force>
Title: How do chess engines "think"?
ThreadText: # How do chess engines "think"?
  
  (Asked by: username_0 on 2013-03-26)
  
  What I want to know is how engines are programmed to find moves. I'm sure they first calculate the most forcing lines such as captures and checks. But what about subtle, deep positional moves? They seem to find them very quickly as well (Generally speaking. Of course they miss such moves now and then). As in, how are they programmed to look for quiet moves/positional ideas? They can't just brute force every move, since that'd take too long, so there should be some clever way for them to arrive at the best moves really quickly. I'm interested in knowing this because I think it'd help players to think over the board in the real world as well.
  
  **Tags:** engines, positional-play, calculation, chess-algorithms, brute-force
  
  > **Comments:**
  > **username_4**: Chess engines look at several million positions per second, so they can in fact look at all them until they get a few moves deep.  
  > **username_5**: This is an awesome question, I really enjoyed the answers.  
  > **username_1**: Basically they search ahead with a search algorithm (e.g., minimax) and evaluate the positions using pre-programmed heuristics. Although some recent engines (e.g., AlphaZero) develop their own methods of evaluation through playing themselves.  
  > **username_2**: To add to the comment of @InertialIgnorance, many machine learning (ML) based engines play against itself (or train with a game database). But, we have no idea how they actually 'think'; they are indeed blackboxes!  
  > **username_3**: Well as long as we don't ask engine to share their high level concept in chess-land, they will indeed remain blackboxes.  They are so, because we are content to say that.  But the NN. weights are all there, training trajectories of them, along with all the training games.  The probleme with getting the high level picture, is that it tends to slow down, or introduce bugs to make the internal model output information beyond best move at current positoin, regressions.   The bottleneck is the objective criterion being not revised.  Devs.  optimize only for that.  
  
  ---
  
  ## 5 answers
  
  ### Answer by username_11 on 2013-03-26. Score: 28 | Accepted answer
  
  In a general way chess engines use a decision tree. The root of the tree is the current position and has a child node for each position that can be made by making a legal move. Each of these nodes in turn have a child node for the positions that can be reached by making a legal move from them. The engine pushes the tree out to a depth defined by its capabilities and the time it is allowed to "think". Positions that can be reached in more than one way are simply cross referenced so that they will not have to be considered more than once. Once the tree is created the computer uses a set of weighted rules to analyze the final positions in the tree and starts to remove those that are undesirable or that the opponent can prevent it from reaching. The tree is cut down this way until only one move remains and the computer makes that move.
  
  <http://www.chess.com/blog/zaifrun> has series or articles on creating a chess engine if you want a more in depth look at how they work.
  
  > **Comments:**
  > **username_12**: Nice answer, so when you see depth of 30, does that mean the engine has searched 30 nodes deep?  Also, what does it mean by Ply?  
  > **username_11**: I am not sure what Ply stands for without doing some more research, I have never been good with acronyms. Rather depth refers to how many nodes deep, each node   would be a half move, or to moves deep might depend on the programmer. However I think that convention would have it be the number of moves deep.  
  > **username_13**: A ply is a half of a move.   A move in chess is one complete 'set' if you will by white + black.  A ply is half of that, so just one color.  
  
  ---
  
  ### Answer by username_6 on 2013-03-26. Score: 24
  
  You're asking a pretty complex question, but it's good to go back to basics. There are a couple of concepts to consider:
  
  ## Evaluation
  
  If a (real) player is shown a position and asked "who is winning this game?", how do they go about deciding? Most likely, they will check a few basic things, such as: material differences, the degree to which pieces have been developed or are positioned "well", doubled / isolated / connected / passed pawns, (controlled) open files, how far up the board the pawns are.
  
  Now, if you had to, you could come up with a systematic way to calculate a position score based on the above. You could decide, for example, that a pawn is worth 1 point, and that a passed pawn is worth 0.3 points more. Isolated or doubled pawns might be worth a bit less, etc. If you add up everything, you get an estimate value for the immediate position at hand.
  
  This is known as [evaluation](http://chessprogramming.wikispaces.com/Evaluation), and basically all chess programs have a way to evaluate positions (ignoring novelty AI chess engines which are typically very weak).
  
  > But what about subtle, deep positional moves?
  
  Well, we've only barely scratched the surface of position evaluation. The actual implementation of an evaluation function could be simplistic, to allow for more positions to be evaluated per second (albeit in a rough fashion), or more complex, leading to less positions evaluated, but with a higher degree of confidence. It's not unusual for the evaluation function to take into account hundreds or even thousands of separate pieces of information.
  
  ## Search
  
  I've specifically left out something from the above, which most real players will immediately think about - is there any way to immediately win the game for either side? Any mates or "hanging" pieces visible? Although it's easy to trivialise this, it's anything but trivial.
  
  What does it mean for a player to have *full* confidence in a combination? In the end, it boils down to having calculated all options. Real players typically won't do this (except for trivial or very forced mates), most of the time we will only consider a handful of options, and rule out others which seem to be "non-constructive" or obviously leading to a loss. We often make mistakes during this calculation, e.g. we may realise that a change in move orders makes threats evaporate, etc. The point is that to be completely sure of a combination, you actually need to calculate all the way to its conclusion, assuming each player will only make the best possible move available to them (this is referred to as "min/max").
  
  Now, given that chess has a much larger search space (this is what "all possible moves in the future" is referred to) than what is feasible for a computer to calculate, compromises need to be made. Just like humans, computers can decide to disregard entire lines of thought based on certain criteria. This is known as *heuristics*. It's worthwhile noting that while you can only be really sure of a combination if you brute force it, a complex evaluation function can often detect the presence of threats (e.g. we could count forks, skewer opportunities, etc, to guide a search in that direction).
  
  In the end, although computers are extremely fast, it's the heuristics which allow them to calculate so deep. That said, you may be surprised how deep modern engines calculate fully, typically it's beyond 3 moves, even in quick games.
  
  ## Conclusion / combining it all
  
  So, to summarise - evaluation functions have a lot of intelligence built into them (i.e. they take into consideration more things than your average human player), heuristics allow the computer to cull lines of thought it decides probably aren't going to end well, and computers are extremely, extremely fast. Add them up, and they're pretty difficult to beat.
  
  > **Comments:**
  > **username_7**: Just an update: "AI"-based algorithms are in some of the best engines nowadays - AlphaZero, Lela, and Stockfish. With the aid of algorithms from machine learning, Stockfish was able to gain some hundreds extra in ELO when playing against other top engines. These engines also contributed interesting data to chess theory as some were trained with zero information fed in - learning from purely random moves at first, playing itself. AlphaZero was able to arrive at many openings played by super GMs. Also, the heuristics used are often alpha-beta pruning (just for a little more info).  
  
  ---
  
  ### Answer by username_8 on 2013-04-25. Score: 7
  
  It is just impossible for computers to look deep enough (25 ply and more) and check every possible move.
  
  What makes is possible is the technique called [Alpha-beta pruning](http://en.wikipedia.org/wiki/Alpha%E2%80%93beta_pruning) which means that computers, similar to humans (but way better) follow only the promising continuations.
  
  They evaluate the positions constantly (based on some precoded rules, valuing material, king safety, activity, pawn structures etc) and look into variations that seem to be leading them towards the best position.
  
  It is still close to magic how they manage to do it efficiently enough to evaluate millions of these positions in a second.
  
  So to summarise- you are correct, they can not look at all the moves if they play strategic chess, but they can very quickly look at decent moves. The problem is still with the very long term plans and horizon to which they can see, but this is being worked on (Rybka analyses much slower, but plays much more positional chess, while Houdini is romantic at it's 'mechanical heart' calculating more moves and playing more aggressively). Even computers have their own styles!
  
  > **Comments:**
  > **username_7**: It is impossible to brute force most positions, but I'll add to your answer that there are 6-piece end tables for all combinations of legal pieces (6 total pieces e.g. 3 white & 3 black or 5 white & 1 black). Engines look up the solved answer to evaluate any position with 6 or fewer pieces. I'm not sure what its criteria are when they have a losing position (maximize number of moves before checkmate? Attempt tricks? Attack, going for a checkmate or for a profitable capture?). People are working on 7-piece tables although I don't know its progress / whether it is feasible to use (too many GB).  
  
  ---
  
  ### Answer by username_9 on 2013-03-26. Score: 6
  
  I agree with the answers.
  
  I remember GM [Roman Dzindzichashvili](http://en.wikipedia.org/wiki/Roman_Dzindzichashvili) talking about it, in one of [Roman's labs](http://www.chesscentral.com/chess_dvd_roman_s/40.htm) videos, i don't remember what video it was (if anyone knows the details please edit my answer).
  
  Roman said that the developer of [Fritz engine](http://en.wikipedia.org/wiki/Fritz_%28chess%29) is his friend. So Roman tested Fritz to see how good it was, and the developer told Roman that in order for fritz to make complex decisions (sacrificing materials in exchange for positional advantage for example) they had to change the value of the pieces, like telling the program that a bad bishop is worth 1 point, a bishop on an open diagonal is worth 7 points, knights are worth 5 points in close positions...
  
  I don't know the exact numbers for each piece but that's how it works, and now your engine won't have any problem sacrificing a bad bishop or whatever if you can tell him the value of each piece in each position.
  
  **EDIT**
  
  See also [The Chess Programming Wiki](http://chessprogramming.wikispaces.com/).
  
  
  ---
  
  ### Answer by username_10 on 2015-09-23. Score: 3
  
  Alpha-beta pruning simply means that if you find a line that turns out badly for you, you stop looking at that candidate move, and instead try others. It is a type of backward pruning meaning that you'll never miss a good move as a result. Forward pruning, by contrast, is based more on guesswork. Futility pruning, late move reductions and razoring are types of forward pruning, and all rely on the programmer's feeling for what type of moves should be considered. A program that does a lot of forward pruning may miss out on startling sacrifices that lead to mate, but on the other hand, it eliminates a lot of really bad moves, and so can go deeper in looking at the moves it does favour.
  
  Most engines search the first few moves at full depth examining all the possibilities. If no move fails high (i.e. seems clearly worse than a move you've already considered), you extend the search just a bit more. In general, you continue exploring each line until you reach a quiescent position (with no checks, captures, mate threats, etc.), and then do your evaluation. Quiet moves may not be considered when they are deep in the search tree, but once you get to that actual position in the game, the engine looks at all moves, quiet and sharp alike. You can actually see this in the engine output sometimes, when an engine suddenly favours a move that it hadn't been considering a few moves back.
  
  Engines calculate so quickly that it's not so important for them to consider which move to look at first, but for humans this is a key question. Jonathan Tisdall takes a stab at answering this in his book, Improve Your Chess Now. When you are on the attack, he suggests you look at the most violent moves first. When you are defending, you look at the most difficult lines first. He also cites positional rules of thumb (eg. centralization, coordination) when deciding which moves to look at first.
  
  Other books that may be relevant are Emmanuel Neimann's Invisible Chess Moves and Charles Hertan's Forcing Chess Moves, both of whom argue for the importance of considering unlikely or surprising moves in sharp positions. Hertan even talks about developing 'computer eyes' for such tactics.
  
  
  ---
  
  