Answers.Body: <p>Considerations such as yours for a definition of "space" have long been a part of computer chess, and I suggest looking to <a href="https://chessprogramming.wikispaces.com/Space" rel="nofollow noreferrer">that literature</a> for ways to approach a precise, quantitative definition. The ideas you already outline in your list touch on things like <a href="https://chessprogramming.wikispaces.com/Mobility" rel="nofollow noreferrer">piece mobility</a> and <a href="https://chessprogramming.wikispaces.com/Square%20Control" rel="nofollow noreferrer">control of squares</a> (and in particular, <a href="https://chessprogramming.wikispaces.com/Center%20Control" rel="nofollow noreferrer">the center</a>) that generally go into the evaluation by engines of who has, in some sense, more space.</p>
  
  <p>You write, of your distinct starting points, "I could easily rationalize any of the above items ... we could expect a correlation between some of these things, but eventually I have to settle." I would stress that <strong>you don't actually have to choose</strong> from among these as though they are distinct, opposing alternatives. Rather, just as engine evaluations take myriad considerations about material, space, king safety, etc. for a given position and boil it all down to a single numerical value, the same can of course be done for just the "space" component of things, making a composite score that simultaneously reflects e.g. the relative mobility and the relative square control of the two sides. Again, I would recommend looking at how these things are actually implemented in engines, and to go from there.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-03-06T03:33:58.463Z
Answers.Text: ♦ That's a great point, perhaps I can form a composite equation of sorts to encompass the different aspects of space. But part of the reason I'm trying to settle on one specific formula is that I want to avoid the "black box" phenomenon. I'm afraid if things get too complex, I won't be able to de-abstract the results of my regression model. Is there any one formula that an engine uses for space that you prefer? Or the name of the engine would work too, I could research it.
Answers.UserDisplayName: Arash Howaida
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-12-10T21:52:55.673Z
Answers.Text: How would it be a "black box phenomenom" though if you're the one setting the formulas for each of the elements that go into the composite value?
Answers.UserDisplayName: Wins94
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-11-22T20:49:15.833Z
Answers.Text: I think some sets of phenomena can't all or always be compressed into a one word concept.  So I agree with the rational response to augment the dimensionality of the feature question behind the word question.  It is clear that the further we experience chess the more we recognize our pre-chess spatial intuition being a cognitive player in our minds.  And there are many objects of the chessboard static and or dynamic that could have visuo-spatial objectification. I think having first word compositions might help clear the language barrier toward chess theory of all space notions. Feature space?
Answers.UserDisplayName: dbdb
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-03-05T17:16:28.920Z
Answers.LastActivityDate: 2018-03-05T17:16:28.920Z
Answers.UserDisplayName: ETD
Answers.Body: <p>I define space as a mixture of mobility and squares controlled.</p>
  
  <pre><code>
  [fen "rbk3br/2p2p2/1pP2Pp1/pP4Pp/P6P/8/4R2K/4R3 w - - 0 0"]
  </code></pre>
  
  <p>Black is completely lost due to his lack of space.</p>
  
  <pre><code>
  [fen "8/2p2p2/1pP1kPp1/pP1rr1Pp/P6P/2K5/4R3/4R3 w - - 0 0"]
  </code></pre>
  
  <p>Black is just as cramped, but his greater mobility and more active king gives him a much better game.</p>
  
  <p>EDIT:  From "Elements of Positional Evaluation" by Dan Heisman.  Section 3.3 Space</p>
  
  <p>So to better understand space, we must once more return to mobility.  What is important to realize is that space depends on mobility; that is, mobility "defines" space.  This means that no matter how the pieces are situated, the player with more space is really the one with more actual and actual global mobility, despite what the pawn structure may seem to indicate.  For example, in a closed position where White's pawns seem more advanced, if Black's pieces, through open files or diagonals, can "point" through and around the pawn mass in some way that gives Black the superior actual mobility, then it is he who may seem to obtain the space advantage.  This is additionally made posible because pieces are not legally bound to stay behind either side's pawns.  Indeed, an over ambitious early push of a pawn mass somethimes leaves one's pieces scattered to the defensive at some later time because the opposition was not effectively reduced in total actual mobility and god behind the advanced pawns.  So, whereas space is an existing and useful term, it does not qualify as a basic element.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-03-10T13:04:49.287Z
Answers.Text: Thanks for the input, this helps! When you said "mixture of mobility and squares controlled," I totally get the first example. As for the 2nd example, were you going for an illustration of squares controlled? Like you said, black is more mobile. After thinking about it, would it be fair to say that black's rook on e5 gives him more "space" if all else is equal? I was thinking, maybe he doesn't control the e file, but he is at least contesting it. Of course he has claimed the d file on top of that.
Answers.UserDisplayName: Arash Howaida
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-03-10T22:13:58.297Z
Answers.Text: In the second example, I was considering mostly the black king having greater access to the white pawns, although the d5 rook restricting the white king does limit its global mobility.
Answers.UserDisplayName: Fred Knight
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-03-05T05:33:37.670Z
Answers.LastActivityDate: 2018-03-11T00:06:08.683Z
Answers.LastEditDate: 2018-03-11T00:06:08.683Z
Answers.UserDisplayName: Fred Knight
Answers.Body: <p>One definition that I've seen, I believe it was in Larry Evans' book, <em>New Ideas in Chess</em>, but it may have been another book, is that the amount of space one controls can be determined counting the number of squares you directly attack on your opponents side of the board.</p>
  
  <p>In the position shown, white's space count is 8, and black's is 2. White is directly attacking b5, c5, d5, e5, f5, g5, c6, and e6, while black is only attacking d4 and f4.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-03-05T16:40:41.853Z
Answers.LastActivityDate: 2018-03-05T16:40:41.853Z
Answers.UserDisplayName: Herb
Answers.Body: <p>I believe that we can &quot;visualize&quot; the space, as the area of the board that is available to each player to safely maneuver their pieces because it is the area they control.</p>
  <p>In my opinion, an easy way to count how much space corresponds to each player is to add the squares behind the pawn lines in which the pieces of their color can move, plus the squares controlled by the pawns in which the opponent can not recapture immediately with a pawn.</p>
  <p>Thus, the player with black pieces has, for example, eight squares behind the pawn line, plus four squares that attack his pawns without the opponent having pawns that they can immediately recapture. A total of twelve squares (12 = 8 + 4).</p>
  <p>Instead, the player with the white pieces has twelve squares behind his pawn line and his pawns control seven squares. A total of nineteen squares (19 = 12 + 7).</p>
  <p>A difference of seven more squares in favor of the player with white pieces.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-11-25T07:12:59.503Z
Answers.LastActivityDate: 2020-11-25T07:12:59.503Z
Answers.UserDisplayName: djnavas
Answers.Body: <p>From a human, chess player perspective, <em>space</em> is something you talk about in opening/middlegame (rarely in endgames), when there are many pieces on the board. In most normal openings it is typically determined by how far up the board you moved your pawns, particularly the central pawns. Think about something like the <a href="https://www.365chess.com/eco/C02_French_advance_variation" rel="nofollow noreferrer">advance French variation</a>, where white has more space, because he has got a pawn on the 5th rank, while black did not move any pawn beyond the center of the board.</p>
  
  <p>By moving the pawns further than your opponent, you gain more "space" for operating your pieces, i.e., the number of possible moves should increase. Conversely your pawns might very well limit your opponent's options, not necessarily the number of legal moves, but the number of moves that don't lose material. </p>
  
  <p>As you want to do this automatically, I believe that checking how far the pawns moved is not a good measure for space, because you would have to distinguish between central pawns and others, and also some pawn structures might be more effective in creating space than others.</p>
  
  <p>Number of legal moves, could be a measure, but I would suspect that this might not be very sensitive, because even in your example the difference might be small.</p>
  
  <p>If you don't mind the calculation overhead, I would suggest <strong>number of legal moves that do not lose material immediately</strong> as a measure. This would take care of the fact that the player with less space is limited in developing options, because attractive developing squares like (for black) f6, c6, d6, e6, might be under attack by pawns.</p>
  
  <p>I'd also experiment with ignoring moves on the 1st/8th rows.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-03-04T16:12:14.653Z
Answers.LastActivityDate: 2018-03-04T16:12:14.653Z
Answers.UserDisplayName: user1583209
Body: <p><strong>Premise</strong></p>
  
  <p>I have always enjoyed playing recreational chess, so I know the basics and some general tactics / strategies. It was only recently though that I have gone more hardcore, so to speak, with my analysis. Namely, I'm taking the "big data" approach by looking at the freely available game logs (which contain hundreds of thousands of games). </p>
  
  <p>I realize there has already been expert machine-learning analysis done with this data and some of it published. However, I'm doing this just because I like chess and I like to dabble with programming. I don't expect to win any Nobel prizes, but I do expect to have fun along the way. Basically I think it's cool to test out the theories or rules of thumb for their effectiveness. Like I said, I'm trying to be humble/realistic about my model specification, and there are probably some things I cannot capture from the data. Some variables/features are easier to formulate than others; which brings me to my question.</p>
  
  <p>I'm trying to figure out if I can create a variable (aka feature) for which player has more "space." Let's say we have this position:</p>
  
  <p><a href="https://i.sstatic.net/ME1kk.jpg" rel="noreferrer"><img src="https://i.sstatic.net/ME1kk.jpg" alt="enter image description here"></a></p>
  
  <p>White is said to have a space advantage here. Maybe it's my lack of expertise, and I'm not sure exactly what "space" is being referred to here; I see a few different things going on. The following are my three attempts to explain "space." (bear in mind I am aiming to reduce "space" to something quantitative, hence the nerdy-sounding explanations)</p>
  
  <ul>
  <li><p>White's pieces have a shorter average distance to the end of the board than black's. White's pawn is all the way on the 5th rank, while black's pieces are closer to his starting position</p></li>
  <li><p>White has more available moves. Black is looking rather cramped, some of his pieces are getting in the way of each other.</p></li>
  <li><p>White controls more squares. White's light square bishop controls a longer diagonal than black's, and so forth.</p></li>
  </ul>
  
  <p>This is the confusing part for me, because I could easily rationalize any of the above items as being "space." Citeris paribus, we could expect a correlation between some of these things, but eventually I have to settle on a precise definition of "space" if I'm to transform chess logs to a quantitative variable. </p>
  
  <p><strong>Question:</strong> Is there a precise definition ( be it in the literature or an unspoken but widely understood axiom) of the concept of "space?" Perhaps none of my attempts to explain space are close, and there is a 4th better definition. Either way, please feel free to weigh in.</p>
  
  <p><strong>Note:</strong> All I'm asking is a precise definition. You do not have to reduce your definition to the quantitative (unless you want to!)</p>
  
  <p><a href="https://chess.stackexchange.com/questions/19645/what-is-space-on-a-chessboard?rq=1">What is &#39;space&#39; on a chessboard?</a> the accepted answer to this post hints at my 2nd definition: "space in terms of the number of possible legal moves you have." Is that the overall consensus though?</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2018-03-04T14:20:32.827Z
Comments.Text: Maybe just number of legal moves. I counted 35 for white and 33 for black. Also number of squares your pieces attack.
Comments.UserDisplayName: magd
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2018-03-04T20:57:26.397Z
Comments.Text: @magd that's often called 'mobility' and is a slightly different concept (though having more space usually implies more mobility).
Comments.UserDisplayName: Glorfindel
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-04-25T10:49:29.057Z
Comments.Text: Such a precise definition is impossible. You can make it broad and practical, or precise and useless
Comments.UserDisplayName: David
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-10-14T21:13:36.193Z
Comments.Text: It's impossible to get a computer to formulate a precise defintion and AlphaZero probably doesn't even recognise the concept of space, it likely has a number of machine learning subroutines to find a way to win. Human books such as https://www.amazon.co.uk/Point-Count-Chess-Accurate-Winning/dp/4871874699 are the basis for number of legal moves/squared attack but are outdated.
Comments.UserDisplayName: magd
Tags: <analysis><theory><programming>
Title: Formulating a Precise Definition of "Space" in Chess
ThreadText: # Formulating a Precise Definition of "Space" in Chess
  
  (Asked by: username_0 on 2018-03-04)
  
  **Premise**
  
  I have always enjoyed playing recreational chess, so I know the basics and some general tactics / strategies. It was only recently though that I have gone more hardcore, so to speak, with my analysis. Namely, I'm taking the "big data" approach by looking at the freely available game logs (which contain hundreds of thousands of games).
  
  I realize there has already been expert machine-learning analysis done with this data and some of it published. However, I'm doing this just because I like chess and I like to dabble with programming. I don't expect to win any Nobel prizes, but I do expect to have fun along the way. Basically I think it's cool to test out the theories or rules of thumb for their effectiveness. Like I said, I'm trying to be humble/realistic about my model specification, and there are probably some things I cannot capture from the data. Some variables/features are easier to formulate than others; which brings me to my question.
  
  I'm trying to figure out if I can create a variable (aka feature) for which player has more "space." Let's say we have this position:
  
  [![enter image description here](https://i.sstatic.net/ME1kk.jpg)](https://i.sstatic.net/ME1kk.jpg)
  
  White is said to have a space advantage here. Maybe it's my lack of expertise, and I'm not sure exactly what "space" is being referred to here; I see a few different things going on. The following are my three attempts to explain "space." (bear in mind I am aiming to reduce "space" to something quantitative, hence the nerdy-sounding explanations)
  
  * White's pieces have a shorter average distance to the end of the board than black's. White's pawn is all the way on the 5th rank, while black's pieces are closer to his starting position
  * White has more available moves. Black is looking rather cramped, some of his pieces are getting in the way of each other.
  * White controls more squares. White's light square bishop controls a longer diagonal than black's, and so forth.
  
  This is the confusing part for me, because I could easily rationalize any of the above items as being "space." Citeris paribus, we could expect a correlation between some of these things, but eventually I have to settle on a precise definition of "space" if I'm to transform chess logs to a quantitative variable.
  
  **Question:** Is there a precise definition ( be it in the literature or an unspoken but widely understood axiom) of the concept of "space?" Perhaps none of my attempts to explain space are close, and there is a 4th better definition. Either way, please feel free to weigh in.
  
  **Note:** All I'm asking is a precise definition. You do not have to reduce your definition to the quantitative (unless you want to!)
  
  [What is 'space' on a chessboard?](https://chess.stackexchange.com/questions/19645/what-is-space-on-a-chessboard?rq=1) the accepted answer to this post hints at my 2nd definition: "space in terms of the number of possible legal moves you have." Is that the overall consensus though?
  
  **Tags:** analysis, theory, programming
  
  > **Comments:**
  > **username_1**: Maybe just number of legal moves. I counted 35 for white and 33 for black. Also number of squares your pieces attack.  
  > **username_2**: @username_1 that's often called 'mobility' and is a slightly different concept (though having more space usually implies more mobility).  
  > **username_3**: Such a precise definition is impossible. You can make it broad and practical, or precise and useless  
  > **username_1**: It's impossible to get a computer to formulate a precise defintion and AlphaZero probably doesn't even recognise the concept of space, it likely has a number of machine learning subroutines to find a way to win. Human books such as https://www.amazon.co.uk/Point-Count-Chess-Accurate-Winning/dp/4871874699 are the basis for number of legal moves/squared attack but are outdated.  
  
  ---
  
  ## 5 answers
  
  ### Answer by username_4 on 2018-03-05. Score: 3 | Accepted answer
  
  Considerations such as yours for a definition of "space" have long been a part of computer chess, and I suggest looking to [that literature](https://chessprogramming.wikispaces.com/Space) for ways to approach a precise, quantitative definition. The ideas you already outline in your list touch on things like [piece mobility](https://chessprogramming.wikispaces.com/Mobility) and [control of squares](https://chessprogramming.wikispaces.com/Square%20Control) (and in particular, [the center](https://chessprogramming.wikispaces.com/Center%20Control)) that generally go into the evaluation by engines of who has, in some sense, more space.
  
  You write, of your distinct starting points, "I could easily rationalize any of the above items ... we could expect a correlation between some of these things, but eventually I have to settle." I would stress that **you don't actually have to choose** from among these as though they are distinct, opposing alternatives. Rather, just as engine evaluations take myriad considerations about material, space, king safety, etc. for a given position and boil it all down to a single numerical value, the same can of course be done for just the "space" component of things, making a composite score that simultaneously reflects e.g. the relative mobility and the relative square control of the two sides. Again, I would recommend looking at how these things are actually implemented in engines, and to go from there.
  
  > **Comments:**
  > **username_0**: ♦ That's a great point, perhaps I can form a composite equation of sorts to encompass the different aspects of space. But part of the reason I'm trying to settle on one specific formula is that I want to avoid the "black box" phenomenon. I'm afraid if things get too complex, I won't be able to de-abstract the results of my regression model. Is there any one formula that an engine uses for space that you prefer? Or the name of the engine would work too, I could research it.  
  > **username_5**: How would it be a "black box phenomenom" though if you're the one setting the formulas for each of the elements that go into the composite value?  
  > **username_6**: I think some sets of phenomena can't all or always be compressed into a one word concept.  So I agree with the rational response to augment the dimensionality of the feature question behind the word question.  It is clear that the further we experience chess the more we recognize our pre-chess spatial intuition being a cognitive player in our minds.  And there are many objects of the chessboard static and or dynamic that could have visuo-spatial objectification. I think having first word compositions might help clear the language barrier toward chess theory of all space notions. Feature space?  
  
  ---
  
  ### Answer by username_7 on 2018-03-05. Score: 2
  
  I define space as a mixture of mobility and squares controlled.
  
  [fen "rbk3br/2p2p2/1pP2Pp1/pP4Pp/P6P/8/4R2K/4R3 w - - 0 0"]
  
  Black is completely lost due to his lack of space.
  
  [fen "8/2p2p2/1pP1kPp1/pP1rr1Pp/P6P/2K5/4R3/4R3 w - - 0 0"]
  
  Black is just as cramped, but his greater mobility and more active king gives him a much better game.
  EDIT:  From "Elements of Positional Evaluation" by Dan Heisman.  Section 3.3 Space
  So to better understand space, we must once more return to mobility.  What is important to realize is that space depends on mobility; that is, mobility "defines" space.  This means that no matter how the pieces are situated, the player with more space is really the one with more actual and actual global mobility, despite what the pawn structure may seem to indicate.  For example, in a closed position where White's pawns seem more advanced, if Black's pieces, through open files or diagonals, can "point" through and around the pawn mass in some way that gives Black the superior actual mobility, then it is he who may seem to obtain the space advantage.  This is additionally made posible because pieces are not legally bound to stay behind either side's pawns.  Indeed, an over ambitious early push of a pawn mass somethimes leaves one's pieces scattered to the defensive at some later time because the opposition was not effectively reduced in total actual mobility and god behind the advanced pawns.  So, whereas space is an existing and useful term, it does not qualify as a basic element.
  
  > **Comments:**
  > **username_0**: Thanks for the input, this helps! When you said "mixture of mobility and squares controlled," I totally get the first example. As for the 2nd example, were you going for an illustration of squares controlled? Like you said, black is more mobile. After thinking about it, would it be fair to say that black's rook on e5 gives him more "space" if all else is equal? I was thinking, maybe he doesn't control the e file, but he is at least contesting it. Of course he has claimed the d file on top of that.  
  > **username_7**: In the second example, I was considering mostly the black king having greater access to the white pawns, although the d5 rook restricting the white king does limit its global mobility.  
  
  ---
  
  ### Answer by username_8 on 2018-03-05. Score: 1
  
  One definition that I've seen, I believe it was in Larry Evans' book, *New Ideas in Chess*, but it may have been another book, is that the amount of space one controls can be determined counting the number of squares you directly attack on your opponents side of the board.
  
  In the position shown, white's space count is 8, and black's is 2. White is directly attacking b5, c5, d5, e5, f5, g5, c6, and e6, while black is only attacking d4 and f4.
  
  
  ---
  
  ### Answer by username_9 on 2020-11-25. Score: 1
  
  I believe that we can "visualize" the space, as the area of the board that is available to each player to safely maneuver their pieces because it is the area they control.
  
  In my opinion, an easy way to count how much space corresponds to each player is to add the squares behind the pawn lines in which the pieces of their color can move, plus the squares controlled by the pawns in which the opponent can not recapture immediately with a pawn.
  
  Thus, the player with black pieces has, for example, eight squares behind the pawn line, plus four squares that attack his pawns without the opponent having pawns that they can immediately recapture. A total of twelve squares (12 = 8 + 4).
  
  Instead, the player with the white pieces has twelve squares behind his pawn line and his pawns control seven squares. A total of nineteen squares (19 = 12 + 7).
  
  A difference of seven more squares in favor of the player with white pieces.
  
  
  ---
  
  ### Answer by username_10 on 2018-03-04. Score: 1
  
  From a human, chess player perspective, *space* is something you talk about in opening/middlegame (rarely in endgames), when there are many pieces on the board. In most normal openings it is typically determined by how far up the board you moved your pawns, particularly the central pawns. Think about something like the [advance French variation](https://www.365chess.com/eco/C02_French_advance_variation), where white has more space, because he has got a pawn on the 5th rank, while black did not move any pawn beyond the center of the board.
  
  By moving the pawns further than your opponent, you gain more "space" for operating your pieces, i.e., the number of possible moves should increase. Conversely your pawns might very well limit your opponent's options, not necessarily the number of legal moves, but the number of moves that don't lose material.
  
  As you want to do this automatically, I believe that checking how far the pawns moved is not a good measure for space, because you would have to distinguish between central pawns and others, and also some pawn structures might be more effective in creating space than others.
  
  Number of legal moves, could be a measure, but I would suspect that this might not be very sensitive, because even in your example the difference might be small.
  
  If you don't mind the calculation overhead, I would suggest **number of legal moves that do not lose material immediately** as a measure. This would take care of the fact that the player with less space is limited in developing options, because attractive developing squares like (for black) f6, c6, d6, e6, might be under attack by pawns.
  
  I'd also experiment with ignoring moves on the 1st/8th rows.
  
  
  ---
  
  