Answers.Body: <p>As a chess player who currently studies computer science, I found this question very interesting so here's my thoughts on the topic. You already know how chess books categorize open and closed positions and you may also know that a semi-closed position is one with some of the characteristics of an open but not all. As you understand this makes the line between closed and semi closed positions not easy to be seen. So my recommendation is to use a number to describe the "openness" of a position(although 50% may be a problem). Now some things I thinks you might find useful for implementing you machine learning algorithm. Firstly, I will suggest you to take a look at this article <a href="https://chess24.com/en/read/news/how-do-chess-engines-think" rel="noreferrer">https://chess24.com/en/read/news/how-do-chess-engines-think</a> in the section about position evaluation. Now, some parameters you might use:</p>
  
  <ol>
  <li><p>Number of pawns(a position with no pawns is apparently wide open).</p></li>
  <li><p>Number of pawn moves(assuming a position with three pawns each,there's a big difference if they are on f2,g2,f7 and f7,g7,h7 respectively and if they are on c4,d5,e4 and c5,d6,e5.</p></li>
  <li><p>As you see in 2 you may give an extra weight for pawn moves in the center. Generally it will be a good idea to give extra weight for anything open in the center. This will be more clear in 4.</p></li>
  <li><p>Number of open and semi-open files. The ones in the center again should have an extra weight.</p></li>
  <li><p>Open diagonals. Note that diagonals with one or more isolani should be counted almost as opens(As an example think about the Indian's bishop targeting d4 and b2 when the c pawn is not on c3). And you should of course take into consideration the length of the diagonal.</p></li>
  </ol>
  
  <p>Note that essentially you don't judge the whole position, just the pawn structure. That's why count the available moves of every piece is a mistake. This just measures the mobility of the given piece and doesn't necessarily has something to do with the pawn structure. For example, in a position with no pawns a Knight on a1 has only two moves while in a closed King's Indian the f3 Knight has seven( only one is occupied by the King). Some of them drop the piece but they are legal moves nonetheless.</p>
  
  <p>Hope that helps a bit!</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-06-11T20:28:30.837Z
Answers.LastActivityDate: 2017-06-11T20:28:30.837Z
Answers.UserDisplayName: cgss
Answers.Body: <p>In the end the distinction between open/closed position is subjective and as you noticed there will always be some overlap or positions that don't fit perfectly into either category.</p>
  
  <p>What exactly do you need this for?</p>
  
  <p>For me the typical closed position has blocked pawn chains, generally many pawns, few or no open files. Because of this, the play tends to be slow, positional.  Typical plans include undermining the pawn chains from the side or pawn storms/attacks against the enemy king.</p>
  
  <p>Conversely open position have fewer and mobile pawns, open files, more space for pieces and are generally more tactical.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-06-09T21:06:53.687Z
Answers.Text: “In the end the distinction between open/closed position is subjective...”
  
  Before I made asked my question on StackExchange, I asked one of my chess-playing family members. He said to define “semi-open,” after I disagreed with him on a selection of the positions including “position-2.” If I nail down a good definition of “open,” “closed,” etc., then I can literally solve my problem. **For example,** whether or not a position is won/lost based on material can be derived (generalized) from the principle of two weaknesses. Thus, two pawns is a good tipping point rather than being a piece up.
Answers.UserDisplayName: PartyLovingHermit
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-06-09T21:08:05.570Z
Answers.Text: {I've reached my character limit on my previous comment.} Many [computer] chess engines do something almost like this when evaluating in centipawns.
  
  “For me the typical closed position... Conversely open...”
  
  Overall, I’ve already used that.
Answers.UserDisplayName: PartyLovingHermit
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-06-09T09:04:23.310Z
Answers.LastActivityDate: 2017-06-09T09:04:23.310Z
Answers.UserDisplayName: user1583209
Answers.Body: <p>I echo user 1583209; why are you doing this?</p>
  
  <p>But just as an abstract exercise, how about this measure of open-ness?</p>
  
  <p>Look at every piece on the board, and count the number of moves that it would have if there was nothing else on the board. Add this up for all pieces on both sides and call it $N_{empty}$.</p>
  
  <p>Now count the number of moves/captures that each piece actually has and add these. Call this total $N_{actual}$. The ratio $N_{actual}/N_{empty}$ is a measure of the open-ness of the position.</p>
  
  <p>I think this is cute, and maybe as good as anything else, but why are we doing this?</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-06-09T20:19:06.033Z
Answers.Text: “Look at every piece on the board… is a measure of the open-ness of the position.”
  
  I wouldn’t be able to do that with a good estimate, although I could integrate your idea when I get to the computing step of my project.
Answers.UserDisplayName: PartyLovingHermit
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-06-09T15:57:40.043Z
Answers.LastActivityDate: 2017-06-09T15:57:40.043Z
Answers.UserDisplayName: Philip Roe
Answers.Body: <p>As in openings, positions would be regarded as closed or open depending on whether they were blocked by pawns or not.  And as in the openings, these could be semi-open as well, which as you indicate would be an in-between type of situation. These distinctions are not necessarily fixed but can change depending on whether or not pawn exchanges are made to open up the position. In an open position, the pieces would have more freedom to roam and search for tactical combinations as opposed to a closed one where the opposing pieces couldn't come in contact right away and more maneuvering would take place behind the lines.  I would think that it would be more reasonable in your classifications to stick to these more general categories than to try to use percentages to describe what will be more or less fluid situations. I would categorize both of the positions shown as semi-open since Black has more open lines of attack and freedom of movement for his pieces in both as opposed to White. In fact, if it's Black's move, he has a pretty forced mate in position number 1 with <strong>1..., Qxg2+!; 2. Kxg2, Bf3+; 3. Kf1</strong> (if 3. Kg3, Bf2#) <strong>Nh2#</strong>.    And if Black moves first in position number 2, he forces mate with <strong>1..., Rxd1+!; 2. Rxd1</strong> (if 2. Kf2, Be3#)<strong>,</strong> 
  <strong>Nc2+;  3. Kf2 Be3#.</strong></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-06-09T19:17:01.103Z
Answers.Text: In position 2, if it's black's move, then there is a checkmate with 1...Rxd1+!, but this doesn't matter because I'm only focusing on the current (static) position.
Answers.UserDisplayName: PartyLovingHermit
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-06-09T19:30:26.970Z
Answers.Text: After I found the first mate, I looked for the other one since I then suspected these were mating problems and found it just before your post.  :)  I realize that's incidental to your question, but it does demonstrate that the party with more freedom has more resources.
Answers.UserDisplayName: CConero
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-06-09T19:30:29.173Z
Answers.Text: “I would categorize both of the positions shown as semi-open since Black has more open lines of attack and freedom of movement for his pieces in both as opposed to White.”
  
  That’s nice. I will now be making an edit to my question(s) so I can get more responses like this.
  
  {I have now discovered that StackExchange has a 5 minute limit for editing comments.} For example, I wouldn't care [for my problem/issue] if could still castle on the queenside.
Answers.UserDisplayName: PartyLovingHermit
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-06-09T19:34:47.260Z
Answers.Text: I try to give thoughtful answers to these questions based on 70+ years of chess experience.  Glad you found it helpful.  I didn't realize that about the 5 min. limit.  Good to know.
Answers.UserDisplayName: CConero
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-06-09T17:55:04.040Z
Answers.LastActivityDate: 2017-06-10T02:19:40.353Z
Answers.LastEditDate: 2017-06-10T02:19:40.353Z
Answers.UserDisplayName: CConero
Answers.Body: <p>You cannot.   They all have characteristics of open/closed between the two extremes so constitute a fuzzy type of set or a statistical sort of categorization.  There is no way to declare absolute that a position is either open or closed when many (most?) are in the vague area of semiclosed/semiopen as nobody tries to define quarter or 3/4 closed/open or finer fractional/decimal categories. </p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-01-18T16:14:37.817Z
Answers.LastActivityDate: 2020-01-18T16:14:37.817Z
Answers.UserDisplayName: edwina oliver
Answers.Body: <p>As a statistician with a PhD in psychometrics and an interest in chess, I find this fascinating.</p>
  <p>I would not categorize the variable. Three levels is better than two but why have levels at all?  You can give an openness rating from 0 to 100.</p>
  <p>One way would be to have a bunch of good players (whoever you could get, or pay) to rate a bunch of positions on how open they are. Then you can look at various features (many suggested above) and do a regression.</p>
  <p>Alternatively, you could just make up a formula intuitively.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-10-20T11:41:25.163Z
Answers.LastActivityDate: 2023-10-20T11:41:25.163Z
Answers.UserDisplayName: Peter Flom
Answers.Body: <p>If i had to create a generalization it'd be something like, when you have atleast two central pawns for each side and they are in contact with each other and can't be taken (say pawns on d4 e5 and e6 d5) that is a closed position. Positions ranging from there being 4 central pawns that are not in contact (e2 d3 and e6 d5 for example), to there being 2 central pawns (1 pawn for each side, like pawns on d4 and d6, or pawns on e4 and e5) are differing degrees of being semi closed. Positions with only 1 central pawn, or no central pawns on the board, I would consider open. </p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-06-09T20:01:54.333Z
Answers.Text: I've thought about _0, 1, or 2+_ pawns on a rank, file, or diagonal is somewhat stereotypical of a position being _open, semi', or closed_, respectively. This downside is that in practically all cases there is a huge mix of those.
  
  “Positions with only 1 central pawn, or... I would consider open.”
  
  Black pawns on a5, b6, c7, c5, f6, g5, h6 with white pawns on a4, b5, c4, d5, f5, g4, h5 make something that’s far from open. There’s just one open file, and it’s hard for a white bishop to do much by itself since even the a1-h8 “big” diagonal is blocked by a black pawn.
Answers.UserDisplayName: PartyLovingHermit
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-06-09T20:10:48.960Z
Answers.Text: Indeed that position would be pretty locked up. Generally players won't throw pawns up the board like that on both sides and close off avenues of play by getting rid of potential pawn breaks. My generalization is maybe only effective when side pawns are kept near their starting squares, although if edge pawns got pushed I guess that wouldn't matter too much.
Answers.UserDisplayName: Hockeyfan19
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-06-09T18:42:05.663Z
Answers.LastActivityDate: 2017-06-09T18:42:05.663Z
Answers.UserDisplayName: Hockeyfan19
Answers.Body: <p>There are historical notions that made more sense at some point of history than now, when the whole chess community knowledge that can sit in books or other storage media, I think also online databases, has been substantially exploding as well as the number of players globally, and means to diffuse that knowledge. Some talk about holes in the chess theory.  I think some thinking in the line of extending notions and adjusting them to how big chess could be that we might not have foreseen as a community in the past, could help make more automatable or useful metrics that would have value for any legal position, and what such metric might associate to odds given some 2 player pair of average &quot;strength&quot; for the full legal chess point of view with all players quality of move possible. Simpler version would be like the endgame table assumptions, for all legal positions giving its output under the assumption of perfect continuation.</p>
  <p>But, even if now one can find many ways to dismiss such dichotomies for not being applicable to all positions, a good way to adjust that past intuition made feature, is to see it as the opposite bounds of some more, how can I say, fine grain notions of line mobility obstacle degree.  I could see many ways to test or construct automatic metric, that would compound all line pieces immediate mobilities and potential.  That last word, is to tie in to what should be kept on the open-closed dichotomy.  That opening pawn moves might set the tone, are irreversible, and their mutual, relative and across the board configuration tend to change slowly, so that having had the spectacular version of either open (that we would all agree it is), or closed, would soon steer the gamut of plans left possible and plausible as winning plans.</p>
  <p>One could call the various constructed quantitative functions of the full position information metrics measuring each properties.. it is even possible that the notions would behaver as a good feature in ML on the data analysis side, if it started very fine grain, defined for each line pieces specific placements given all the other pawn placements (why not also include other blocking material of own color, and opposite color soft occlusion.</p>
  <p>In fact, it might be equivalent to just the basic input vector for Lc0.  Which is directly and exactly encoding the mobility rules set.</p>
  <p>That would be the full multidimension version of what closed and open might mean as an average yes or no criterion over all those ultimate fine grain mobilities for the line pieces. There might also be another angle that would not be about the immediate mobility.  But that would need a better formalism to describe many possible future mobilities for fast pieces given slower evolution of the slower pawn structure. This is not a good answer. I am just pushing the notion to their limit.  Not dismissing them.  The &quot;gut feeling&quot; might actually be an internal wet implementation, of what you could simulate in such ML project.  I like to  think. Good question, good principle of question for chess theory elements, actually. But I would not reject notions that can't be automatize directly, and would rather extend the notion to the now available data from actual machine players too.  That which start by exploring legal chess, might have more dynamic range for your type of project.  I suggest also digging in its latent space entrails. If you can do that.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-10-20T04:15:46.493Z
Answers.LastActivityDate: 2023-10-20T04:22:28.933Z
Answers.LastEditDate: 2023-10-20T04:22:28.933Z
Answers.UserDisplayName: dbdb
Answers.Body: <p>The best way to classify the position would be not just &quot;closed&quot; or &quot;open&quot;, but with a continuous scale. I would propose having a &quot;completely&quot; closed position at zero on the scale; it's much easier to define the most closed possible position (a KP endgame with 16 pawns total and no pieces) than the most open position which seems basically impossible to define rigorously.</p>
  <p>Several factors should be taken into account when considering how closed a position is, the most important of those being number of pawns, pawn mobility, and then piece mobility (but weighted specially). There are also several other slightly less important things, such as how exactly to weight mobility (more on that later) and open/semi-open files.</p>
  <p>Assuming the position with zero for a maximally closed position, we can first take (8 - number of white pawns) and (8 - number of black pawns), then raise them each to the power of some constant (likely between 1 and 1.5, say 1.4 for the sake of demonstrating the next concept), then add those together. We have the exponentiation to make a position with 8p4p more open than a 6p6p position, and also to make the difference in openness between 4p4p and 6p6p be greater than the difference between a 6p6p and 8p8p position.</p>
  <p>The next thing to take into account is pawn mobility. Pawn captures, including en-passant, should be weighted to be more significant than just single pawn pushes, and double pawn pushes should be weighted to be pretty insignificant since being able to double push on top of the single push should not give that much more openness.</p>
  <p>Based on the scale from the previous part where the maximum openness score is around 36, every single pawn push should be weighted at around 1, every double pawn push should be weighted at around 0.5, and every capture should be weighted around 1.5. An additional bonus between 0.5 and 1 should probably be added to moves by pawns on the c, d, e, or f files, that way the center being locked makes the position significantly more closed.</p>
  <p>There's also the matter of mobility. In my opinion, non-pawn mobility should be weighted by piece type and the square that's being moved to. For example, the king should have no weight in terms of mobility and the queen should have little weight so the queen doesn't skew the openness of the position too much. This might be unnecessary however.</p>
  <p>The main point in mobility is weighting the moves based on the pawns on the file that they move to. If the move goes to a square in any of the spaces in front of a friendly pawn on the move's file, an openness score of around 0.3 can be added. Note that if there is no friendly pawn then no score is added. Additionally, if the move goes to a square behind an enemy pawn on the file, an additional bonus of roughly 0.3 should be added.</p>
  <p>I think this answer is already too long, so I won't talk about open files. Also note that I haven't really tested out these ideas, and I suspect that the mobility stuff should be done differently so endgames don't automatically get scored as more closed due to the decreased total pieces and hence decreased overall mobility. This can probably be done but I can't figure out how to do it easily without breaking the idea about zero on the scale.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-10-25T02:41:03.563Z
Answers.LastActivityDate: 2023-10-25T02:46:33.430Z
Answers.LastEditDate: 2023-10-25T02:46:33.430Z
Answers.UserDisplayName: Hank's back rank
Body: <p>I am creating a set of chess positions to be used [as a data set] <strong>for a project</strong>. It's based on <em>supervised machine learning</em>, but I need to have labeled data (see more <em>italicized</em> text below) before any machine learning can be done. I wish to label each position as open or closed or possibly some combination of the two.</p>
  
  <p>I started out with assigning each position to just "open" or "closed," but this wasn't clear for a lot of the positions. Then I decided to go with a third label, semi-open/semi-closed, which is like the middle and in between open and closed. I’ve labeled most of the positions, but there are many positions that I still haven’t comfortably labeled with a distinct class.</p>
  
  <p>I know that open positions are characterized as having pawnless ranks, files, and diagonals, while closed positions have them clogged up with pawns. In open positions you can usually centralize your pieces, while closed positions give you a hard time moving an arbitrary piece to a random location on the board. There are many other related patterns, features, and qualities.</p>
  
  <p>I can easily go with my <strong>gut feeling</strong> when assigning "closed" to a position that has 7 pawns on each side with each pawn blockading another, and "open" to a position that has pawns only on the flanks and in their starting squares. However, it's hard for me to classify some positions such as these two examples:</p>
  
  <pre><code>[White "Position1"]
  [Black "Open/Semi/Closed/Etc"]
  [FEN "8/5Qpk/p6p/P1b5/4pPn1/2Pp3P/1P1BbqP1/R3R2K w - - 0 1 "]
  </code></pre>
  
  <hr>
  
  <pre><code>[White "Position2"]
  [Black "Open/Semi/Closed/Etc"]
  [FEN "3r1rk1/pp2pp1p/2p3pb/2P5/4P3/4nNPb/PP2P2P/R1RNK2B w - - 0 1 "]
  </code></pre>
  
  <p>What would you assign to the examples above <strong>and why</strong>? For example: one position is more open than the other due to characteristic XYZ, or the second position should not be considered closed since there's an open file, and so on.</p>
  
  <p>Should I just ditch the whole binary-ish labeling (<em>classification</em>) and instead assign a variable number (<em>regression</em>) describing how open or closed a position is (e.g. 0% to 100% open?) Or is there still a way for positions to go into a few categories, which means that we can have <strong>"rigorous" definitions</strong> of the categories of openness? And "rigorous" as in having few contradictions and preferably can be applied by a human without too much difficulty.</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-06-09T23:42:05.900Z
Comments.Text: I didn't edit much of the body, but it's **my fault** for not having a good "title" in the original question.
  
  An example of a bad solution: just the number of unoccupied squares. There’s a lot of contradictory positions. Furthermore, it barely follows the dogmatic/natural concepts that we already know. Strategically, lots of squares are good for outposted knights, but not [quite] for bishops, which need entire/long diagonals in open positions.
Comments.UserDisplayName: PartyLovingHermit
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-06-11T20:31:43.553Z
Comments.Text: If there were a rigorous definition, then you could just implement that so it would work perfectly and not have to deal with all the supervised machine learning stuff.
Comments.UserDisplayName: RemcoGerlich
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-06-12T09:10:17.917Z
Comments.Text: I'm not aiming for perfection, but something close, which machine-learning could do. Currently, I am not focusing on whether there is a better non-machine-learning algorithm.
Comments.UserDisplayName: PartyLovingHermit
Tags: <evaluation><terminology><mathematics><closed-position>
Title: How to determine if a position is open or closed in a "rigorous" fashion?
ThreadText: # How to determine if a position is open or closed in a "rigorous" fashion?
  
  (Asked by: username_0 on 2017-06-09)
  
  I am creating a set of chess positions to be used [as a data set] for a project. It's based on supervised machine learning, but I need to have labeled data (see more italicized text below) before any machine learning can be done. I wish to label each position as open or closed or possibly some combination of the two.
  I started out with assigning each position to just "open" or "closed," but this wasn't clear for a lot of the positions. Then I decided to go with a third label, semi-open/semi-closed, which is like the middle and in between open and closed. I’ve labeled most of the positions, but there are many positions that I still haven’t comfortably labeled with a distinct class.
  I know that open positions are characterized as having pawnless ranks, files, and diagonals, while closed positions have them clogged up with pawns. In open positions you can usually centralize your pieces, while closed positions give you a hard time moving an arbitrary piece to a random location on the board. There are many other related patterns, features, and qualities.
  I can easily go with my gut feeling when assigning "closed" to a position that has 7 pawns on each side with each pawn blockading another, and "open" to a position that has pawns only on the flanks and in their starting squares. However, it's hard for me to classify some positions such as these two examples:
  [White "Position1"]
  [Black "Open/Semi/Closed/Etc"]
  [FEN "8/5Qpk/p6p/P1b5/4pPn1/2Pp3P/1P1BbqP1/R3R2K w - - 0 1 "]
  
  
  [White "Position2"]
  [Black "Open/Semi/Closed/Etc"]
  [FEN "3r1rk1/pp2pp1p/2p3pb/2P5/4P3/4nNPb/PP2P2P/R1RNK2B w - - 0 1 "]
  
  What would you assign to the examples above and why? For example: one position is more open than the other due to characteristic XYZ, or the second position should not be considered closed since there's an open file, and so on.
  Should I just ditch the whole binary-ish labeling (classification) and instead assign a variable number (regression) describing how open or closed a position is (e.g. 0% to 100% open?) Or is there still a way for positions to go into a few categories, which means that we can have "rigorous" definitions of the categories of openness? And "rigorous" as in having few contradictions and preferably can be applied by a human without too much difficulty.
  
  **Tags:** evaluation, terminology, mathematics, closed-position
  
  > **Comments:**
  > **username_0**: I didn't edit much of the body, but it's **my fault** for not having a good "title" in the original question.  An example of a bad solution: just the number of unoccupied squares. There’s a lot of contradictory positions. Furthermore, it barely follows the dogmatic/natural concepts that we already know. Strategically, lots of squares are good for outposted knights, but not [quite] for bishops, which need entire/long diagonals in open positions.  
  > **username_1**: If there were a rigorous definition, then you could just implement that so it would work perfectly and not have to deal with all the supervised machine learning stuff.  
  > **username_0**: I'm not aiming for perfection, but something close, which machine-learning could do. Currently, I am not focusing on whether there is a better non-machine-learning algorithm.  
  
  ---
  
  ## 9 answers
  
  ### Answer by username_2 on 2017-06-11. Score: 9
  
  As a chess player who currently studies computer science, I found this question very interesting so here's my thoughts on the topic. You already know how chess books categorize open and closed positions and you may also know that a semi-closed position is one with some of the characteristics of an open but not all. As you understand this makes the line between closed and semi closed positions not easy to be seen. So my recommendation is to use a number to describe the "openness" of a position(although 50% may be a problem). Now some things I thinks you might find useful for implementing you machine learning algorithm. Firstly, I will suggest you to take a look at this article <https://chess24.com/en/read/news/how-do-chess-engines-think> in the section about position evaluation. Now, some parameters you might use:
  
  1. Number of pawns(a position with no pawns is apparently wide open).
  2. Number of pawn moves(assuming a position with three pawns each,there's a big difference if they are on f2,g2,f7 and f7,g7,h7 respectively and if they are on c4,d5,e4 and c5,d6,e5.
  3. As you see in 2 you may give an extra weight for pawn moves in the center. Generally it will be a good idea to give extra weight for anything open in the center. This will be more clear in 4.
  4. Number of open and semi-open files. The ones in the center again should have an extra weight.
  5. Open diagonals. Note that diagonals with one or more isolani should be counted almost as opens(As an example think about the Indian's bishop targeting d4 and b2 when the c pawn is not on c3). And you should of course take into consideration the length of the diagonal.
  
  Note that essentially you don't judge the whole position, just the pawn structure. That's why count the available moves of every piece is a mistake. This just measures the mobility of the given piece and doesn't necessarily has something to do with the pawn structure. For example, in a position with no pawns a Knight on a1 has only two moves while in a closed King's Indian the f3 Knight has seven( only one is occupied by the King). Some of them drop the piece but they are legal moves nonetheless.
  
  Hope that helps a bit!
  
  
  ---
  
  ### Answer by username_3 on 2017-06-09. Score: 3
  
  In the end the distinction between open/closed position is subjective and as you noticed there will always be some overlap or positions that don't fit perfectly into either category.
  
  What exactly do you need this for?
  
  For me the typical closed position has blocked pawn chains, generally many pawns, few or no open files. Because of this, the play tends to be slow, positional. Typical plans include undermining the pawn chains from the side or pawn storms/attacks against the enemy king.
  
  Conversely open position have fewer and mobile pawns, open files, more space for pieces and are generally more tactical.
  
  > **Comments:**
  > **username_0**: “In the end the distinction between open/closed position is subjective...”  Before I made asked my question on StackExchange, I asked one of my chess-playing family members. He said to define “semi-open,” after I disagreed with him on a selection of the positions including “position-2.” If I nail down a good definition of “open,” “closed,” etc., then I can literally solve my problem. **For example,** whether or not a position is won/lost based on material can be derived (generalized) from the principle of two weaknesses. Thus, two pawns is a good tipping point rather than being a piece up.  
  > **username_0**: {I've reached my character limit on my previous comment.} Many [computer] chess engines do something almost like this when evaluating in centipawns.  “For me the typical closed position... Conversely open...”  Overall, I’ve already used that.  
  
  ---
  
  ### Answer by username_4 on 2017-06-09. Score: 2
  
  I echo user 1583209; why are you doing this?
  
  But just as an abstract exercise, how about this measure of open-ness?
  
  Look at every piece on the board, and count the number of moves that it would have if there was nothing else on the board. Add this up for all pieces on both sides and call it $N\_{empty}$.
  
  Now count the number of moves/captures that each piece actually has and add these. Call this total $N\_{actual}$. The ratio $N\_{actual}/N\_{empty}$ is a measure of the open-ness of the position.
  
  I think this is cute, and maybe as good as anything else, but why are we doing this?
  
  > **Comments:**
  > **username_0**: “Look at every piece on the board… is a measure of the open-ness of the position.”  I wouldn’t be able to do that with a good estimate, although I could integrate your idea when I get to the computing step of my project.  
  
  ---
  
  ### Answer by username_5 on 2017-06-09. Score: 1
  
  As in openings, positions would be regarded as closed or open depending on whether they were blocked by pawns or not. And as in the openings, these could be semi-open as well, which as you indicate would be an in-between type of situation. These distinctions are not necessarily fixed but can change depending on whether or not pawn exchanges are made to open up the position. In an open position, the pieces would have more freedom to roam and search for tactical combinations as opposed to a closed one where the opposing pieces couldn't come in contact right away and more maneuvering would take place behind the lines. I would think that it would be more reasonable in your classifications to stick to these more general categories than to try to use percentages to describe what will be more or less fluid situations. I would categorize both of the positions shown as semi-open since Black has more open lines of attack and freedom of movement for his pieces in both as opposed to White. In fact, if it's Black's move, he has a pretty forced mate in position number 1 with **1..., Qxg2+!; 2. Kxg2, Bf3+; 3. Kf1** (if 3. Kg3, Bf2#) **Nh2#**. And if Black moves first in position number 2, he forces mate with **1..., Rxd1+!; 2. Rxd1** (if 2. Kf2, Be3#)**,**
  **Nc2+; 3. Kf2 Be3#.**
  
  > **Comments:**
  > **username_0**: In position 2, if it's black's move, then there is a checkmate with 1...Rxd1+!, but this doesn't matter because I'm only focusing on the current (static) position.  
  > **username_5**: After I found the first mate, I looked for the other one since I then suspected these were mating problems and found it just before your post.  :)  I realize that's incidental to your question, but it does demonstrate that the party with more freedom has more resources.  
  > **username_0**: “I would categorize both of the positions shown as semi-open since Black has more open lines of attack and freedom of movement for his pieces in both as opposed to White.”  That’s nice. I will now be making an edit to my question(s) so I can get more responses like this.  {I have now discovered that StackExchange has a 5 minute limit for editing comments.} For example, I wouldn't care [for my problem/issue] if could still castle on the queenside.  
  > **username_5**: I try to give thoughtful answers to these questions based on 70+ years of chess experience.  Glad you found it helpful.  I didn't realize that about the 5 min. limit.  Good to know.  
  
  ---
  
  ### Answer by username_6 on 2020-01-18. Score: 1
  
  You cannot. They all have characteristics of open/closed between the two extremes so constitute a fuzzy type of set or a statistical sort of categorization. There is no way to declare absolute that a position is either open or closed when many (most?) are in the vague area of semiclosed/semiopen as nobody tries to define quarter or 3/4 closed/open or finer fractional/decimal categories.
  
  
  ---
  
  ### Answer by username_7 on 2023-10-20. Score: 0
  
  As a statistician with a PhD in psychometrics and an interest in chess, I find this fascinating.
  
  I would not categorize the variable. Three levels is better than two but why have levels at all? You can give an openness rating from 0 to 100.
  
  One way would be to have a bunch of good players (whoever you could get, or pay) to rate a bunch of positions on how open they are. Then you can look at various features (many suggested above) and do a regression.
  
  Alternatively, you could just make up a formula intuitively.
  
  
  ---
  
  ### Answer by username_8 on 2017-06-09. Score: 0
  
  If i had to create a generalization it'd be something like, when you have atleast two central pawns for each side and they are in contact with each other and can't be taken (say pawns on d4 e5 and e6 d5) that is a closed position. Positions ranging from there being 4 central pawns that are not in contact (e2 d3 and e6 d5 for example), to there being 2 central pawns (1 pawn for each side, like pawns on d4 and d6, or pawns on e4 and e5) are differing degrees of being semi closed. Positions with only 1 central pawn, or no central pawns on the board, I would consider open.
  
  > **Comments:**
  > **username_0**: I've thought about _0, 1, or 2+_ pawns on a rank, file, or diagonal is somewhat stereotypical of a position being _open, semi', or closed_, respectively. This downside is that in practically all cases there is a huge mix of those.  “Positions with only 1 central pawn, or... I would consider open.”  Black pawns on a5, b6, c7, c5, f6, g5, h6 with white pawns on a4, b5, c4, d5, f5, g4, h5 make something that’s far from open. There’s just one open file, and it’s hard for a white bishop to do much by itself since even the a1-h8 “big” diagonal is blocked by a black pawn.  
  > **username_8**: Indeed that position would be pretty locked up. Generally players won't throw pawns up the board like that on both sides and close off avenues of play by getting rid of potential pawn breaks. My generalization is maybe only effective when side pawns are kept near their starting squares, although if edge pawns got pushed I guess that wouldn't matter too much.  
  
  ---
  
  ### Answer by username_9 on 2023-10-20. Score: 0
  
  There are historical notions that made more sense at some point of history than now, when the whole chess community knowledge that can sit in books or other storage media, I think also online databases, has been substantially exploding as well as the number of players globally, and means to diffuse that knowledge. Some talk about holes in the chess theory. I think some thinking in the line of extending notions and adjusting them to how big chess could be that we might not have foreseen as a community in the past, could help make more automatable or useful metrics that would have value for any legal position, and what such metric might associate to odds given some 2 player pair of average "strength" for the full legal chess point of view with all players quality of move possible. Simpler version would be like the endgame table assumptions, for all legal positions giving its output under the assumption of perfect continuation.
  
  But, even if now one can find many ways to dismiss such dichotomies for not being applicable to all positions, a good way to adjust that past intuition made feature, is to see it as the opposite bounds of some more, how can I say, fine grain notions of line mobility obstacle degree. I could see many ways to test or construct automatic metric, that would compound all line pieces immediate mobilities and potential. That last word, is to tie in to what should be kept on the open-closed dichotomy. That opening pawn moves might set the tone, are irreversible, and their mutual, relative and across the board configuration tend to change slowly, so that having had the spectacular version of either open (that we would all agree it is), or closed, would soon steer the gamut of plans left possible and plausible as winning plans.
  
  One could call the various constructed quantitative functions of the full position information metrics measuring each properties.. it is even possible that the notions would behaver as a good feature in ML on the data analysis side, if it started very fine grain, defined for each line pieces specific placements given all the other pawn placements (why not also include other blocking material of own color, and opposite color soft occlusion.
  
  In fact, it might be equivalent to just the basic input vector for Lc0. Which is directly and exactly encoding the mobility rules set.
  
  That would be the full multidimension version of what closed and open might mean as an average yes or no criterion over all those ultimate fine grain mobilities for the line pieces. There might also be another angle that would not be about the immediate mobility. But that would need a better formalism to describe many possible future mobilities for fast pieces given slower evolution of the slower pawn structure. This is not a good answer. I am just pushing the notion to their limit. Not dismissing them. The "gut feeling" might actually be an internal wet implementation, of what you could simulate in such ML project. I like to think. Good question, good principle of question for chess theory elements, actually. But I would not reject notions that can't be automatize directly, and would rather extend the notion to the now available data from actual machine players too. That which start by exploring legal chess, might have more dynamic range for your type of project. I suggest also digging in its latent space entrails. If you can do that.
  
  
  ---
  
  ### Answer by username_10 on 2023-10-25. Score: 0
  
  The best way to classify the position would be not just "closed" or "open", but with a continuous scale. I would propose having a "completely" closed position at zero on the scale; it's much easier to define the most closed possible position (a KP endgame with 16 pawns total and no pieces) than the most open position which seems basically impossible to define rigorously.
  
  Several factors should be taken into account when considering how closed a position is, the most important of those being number of pawns, pawn mobility, and then piece mobility (but weighted specially). There are also several other slightly less important things, such as how exactly to weight mobility (more on that later) and open/semi-open files.
  
  Assuming the position with zero for a maximally closed position, we can first take (8 - number of white pawns) and (8 - number of black pawns), then raise them each to the power of some constant (likely between 1 and 1.5, say 1.4 for the sake of demonstrating the next concept), then add those together. We have the exponentiation to make a position with 8p4p more open than a 6p6p position, and also to make the difference in openness between 4p4p and 6p6p be greater than the difference between a 6p6p and 8p8p position.
  
  The next thing to take into account is pawn mobility. Pawn captures, including en-passant, should be weighted to be more significant than just single pawn pushes, and double pawn pushes should be weighted to be pretty insignificant since being able to double push on top of the single push should not give that much more openness.
  
  Based on the scale from the previous part where the maximum openness score is around 36, every single pawn push should be weighted at around 1, every double pawn push should be weighted at around 0.5, and every capture should be weighted around 1.5. An additional bonus between 0.5 and 1 should probably be added to moves by pawns on the c, d, e, or f files, that way the center being locked makes the position significantly more closed.
  
  There's also the matter of mobility. In my opinion, non-pawn mobility should be weighted by piece type and the square that's being moved to. For example, the king should have no weight in terms of mobility and the queen should have little weight so the queen doesn't skew the openness of the position too much. This might be unnecessary however.
  
  The main point in mobility is weighting the moves based on the pawns on the file that they move to. If the move goes to a square in any of the spaces in front of a friendly pawn on the move's file, an openness score of around 0.3 can be added. Note that if there is no friendly pawn then no score is added. Additionally, if the move goes to a square behind an enemy pawn on the file, an additional bonus of roughly 0.3 should be added.
  
  I think this answer is already too long, so I won't talk about open files. Also note that I haven't really tested out these ideas, and I suspect that the mobility stuff should be done differently so endgames don't automatically get scored as more closed due to the decreased total pieces and hence decreased overall mobility. This can probably be done but I can't figure out how to do it easily without breaking the idea about zero on the scale.
  
  
  ---
  
  