Answers.Body: <p>Ultimately, what is considered 'similar' depends on what one is trying to achieve by measuring similarity. I suspect, a common chess engine use-case would be to try predicting if the two positions are going to return same evaluation result.</p>
  <p>Here are a few brainstorm-style ideas:</p>
  <ul>
  <li>Compare lists of legal moves and measure the degree to which they
  overlap.</li>
  <li>Base the measure on the number of pieces whose positions are mismatched</li>
  <li>Base the measure on the minimum number of moves needed to get from
  position A to position B.</li>
  </ul>
  <p>Some food for thought: <a href="https://en.wikipedia.org/wiki/Edit_distance" rel="nofollow noreferrer">https://en.wikipedia.org/wiki/Edit_distance</a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-09-07T23:37:52.310Z
Answers.LastActivityDate: 2021-09-07T23:37:52.310Z
Answers.UserDisplayName: QuarterlyQuotaOfQuotes
Body: <p>I'm looking for metrics that quantify how similar/different two positions are.</p>
  <p>I have found a paper that used pawn structures to search for similar games in a database. <a href="http://doras.dcu.ie/20378/1/ganguly-sigir2014.pdf" rel="nofollow noreferrer">This one</a> tries to use reachable squares, as well as attack and defense structures do achieve this.</p>
  <p>Metrics can be arbitrary, but I wonder if other approaches exist.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-01-21T19:58:06.450Z
Comments.Text: Similar positions will have similar game trees from that position, with similar branches in fact explored by chess engines. If a somewhat crude similarity measure can be found, perhaps it could be refined by using that similarity measure on a large number of positions reachable from the given position, in much the same way that chess engines can take a static evaluation function and apply it to a tree of reachable positions. I have no idea how to flesh this out, but there are various metrics which have been used in discrete math to measure tree similarity.
Comments.UserDisplayName: John Coleman
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-01-24T22:21:33.813Z
Comments.Text: A tricky task - optical similarity can be highly misleading, the slightest tactical nuance might make the difference.
Comments.UserDisplayName: Hauke Reddmann
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-09-11T00:54:56.907Z
Comments.Text: @2080 it would be best to define what you mean by similarity - optical similarity (i.e. humans at a glance with no understanding of chess rules would find the positions similar-looking) or gametree similarity (i.e. the positions are similar from the perspective of considerations pertaining to what should be played in each).
Comments.UserDisplayName: Mobeus Zoom
Tags: <software><programming>
Title: Position Similarity Metrics
ThreadText: # Position Similarity Metrics
  
  (Asked by: username_0 on 2021-01-21)
  
  I'm looking for metrics that quantify how similar/different two positions are.
  
  I have found a paper that used pawn structures to search for similar games in a database. [This one](http://doras.dcu.ie/20378/1/ganguly-sigir2014.pdf) tries to use reachable squares, as well as attack and defense structures do achieve this.
  
  Metrics can be arbitrary, but I wonder if other approaches exist.
  
  **Tags:** software, programming
  
  > **Comments:**
  > **username_1**: Similar positions will have similar game trees from that position, with similar branches in fact explored by chess engines. If a somewhat crude similarity measure can be found, perhaps it could be refined by using that similarity measure on a large number of positions reachable from the given position, in much the same way that chess engines can take a static evaluation function and apply it to a tree of reachable positions. I have no idea how to flesh this out, but there are various metrics which have been used in discrete math to measure tree similarity.  
  > **username_2**: A tricky task - optical similarity can be highly misleading, the slightest tactical nuance might make the difference.  
  > **username_3**: @username_0 it would be best to define what you mean by similarity - optical similarity (i.e. humans at a glance with no understanding of chess rules would find the positions similar-looking) or gametree similarity (i.e. the positions are similar from the perspective of considerations pertaining to what should be played in each).  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_4 on 2021-09-07. Score: 2
  
  Ultimately, what is considered 'similar' depends on what one is trying to achieve by measuring similarity. I suspect, a common chess engine use-case would be to try predicting if the two positions are going to return same evaluation result.
  
  Here are a few brainstorm-style ideas:
  
  * Compare lists of legal moves and measure the degree to which they
    overlap.
  * Base the measure on the number of pieces whose positions are mismatched
  * Base the measure on the minimum number of moves needed to get from
    position A to position B.
  
  Some food for thought: <https://en.wikipedia.org/wiki/Edit_distance>
  
  
  ---
  
  