Difference between revisions of "Swap rule"

From HexWiki
Jump to: navigation, search
m (game sites -> online playing)
(Size 14: change i12 to losing)
 
(41 intermediate revisions by 9 users not shown)
Line 1: Line 1:
Because the [[First player|first player]] has a considerable advantage if he is allowed to make his first move without restrictions, the '''swap rule''' was devised. It states that one player first makes a move, and then the [[Second player|other player]] decides who plays with which colour. The swap rule can be implemented in two ways, as follows. (Assume that the colours are red and blue, with red moving first.)
+
The '''swap rule''' states that after Red plays the first move, Blue decides whether to swap colours or not. If Blue swaps colours, Blue becomes Red and Red becomes Blue. Whichever player ends up being Blue makes the second move and then the game continues as usual.
  
# The first player places a red [[Piece|piece]] in any [[hexagon (Board element)|hex]] on the [[Board|board]]. Then the other player can either make a move with the blue pieces, in which case he becomes blue, or he can state that he wants to be red. After this the game continues without any more swapping.
+
== Reason for the swap rule ==
# The first player makes a move with the red pieces. The other player either makes a move with the blue pieces, or makes a [[Piece swap|piece swap]]. This means to remove the red piece from the board, and place a blue piece at the hexagon which is the mirror image of the hexagon in which the red piece was placed, with respect to the board's long diagonal.
+
  
In [[IRL play|face-to-face play]] the first option is most practical, since it is easier to change colours of the players that removing and adding pieces on the board. It is also less error-prone. On [[Online playing|game sites]] on the Internet the second version is more common, presumably because the colours are determined at the start of the game, and it is easier to change the board position than the colour designation.
+
When playing Hex without the swap rule, the [[first player]] has a considerable advantage. The swap rule was devised to make the game more even. Namely, if the first player plays a move that is too strong, the second player will swap and be in a strong position. And if the first player plays a move that is too weak, the second player will not swap (and therefore also be in a strong position). Therefore, the swap rule creates an incentive for the first player to play a move that is as fair as possible.
  
The swap rule is also called the "Pie rule", since it resembles the ''You cut, I choose'' rule when sharing a pie between two children.
+
The swap rule is sometimes also called the "pie rule", since it resembles the well-known "you cut, I choose" method for fairly dividing a pie between two people. Namely, one person cuts the pie in two, and the other person chooses which piece to eat. Here, the incentive for the first person is to make the two pieces as equal as possible.
  
When playing with the swap rule, the second player has a winning strategy. However, the second player's [[Advantage|advantage]] is much smaller than the advantage of the first player is when playing without swap.  
+
Since each opening move is theoretically either winning or losing, there exists no opening move that is exactly fair. For this reason, the second player theoretically has a forced win when playing with the swap rule. However, the second player's advantage is very small, and certainly much smaller than the first player's advantage would be when playing without the swap rule.
  
== The generalized swap rule ==
+
== Implementations of the swap rule ==
Instead of placing just one piece, the first player can place any number of red and blue pieces, and state which colour has the next move. The second player then decides who has which colour. This version has the drawback that the first player can prepare in advance a position which he has studied extensively, which the second player doesn't see until the game starts, thereby giving the first player an advantage.
+
 
 +
Swapping can be implemented in two ways, as follows. As usual, we assume that the players are Red and Blue, with Red going first.
 +
 
 +
# '''"Swap sides":''' The players perform the swap by switching colours: Red becomes Blue and Blue becomes Red. After the swap, it is Blue's turn.
 +
# '''"Swap pieces":''' The players perform the swap by switching pieces. This means the initial red piece is replaced by a blue piece in the mirror image position, where the mirroring takes place with respect to the board's long diagonal. For example, a red piece at a3 becomes a blue piece at c1. The players do not switch colours: Red stays Red and Blue stays Blue. After the swap, it is Red's turn.
 +
 
 +
In face-to-face play, the "swap sides" method is most practical, since it is easier for the players to switch colours than to remove and add pieces on the board. This is especially true when playing with pencil and paper. It is also less error-prone. On [[Online playing|online game sites]], the "swap pieces" method is more common, presumably because the colours are determined at the start of the game, and it is easier to change the board position than the colour designation. This also makes the game record more readable, since it is always clear which player was "Red" and which was "Blue".
 +
 
 +
== When to swap ==
 +
 
 +
The decision whether to swap is an important one. Accidentally swapping a weak move, or accidentally failing to swap a strong move, is bad for the second player.
 +
 
 +
Different players have different preferences for which moves to swap. It is generally agreed that moves near the center of the board are far too strong and should be swapped, whereas moves on the first player's own edge (except in the obtuse corner) are too weak and should not be swapped. a1 and b1 are provably losing and should never be swapped. a3–a8, a10, a11, c2, and c10 (on an 11 × 11 board) are relatively balanced, and whether or not to swap them depends on the player's preferences. a9 is fairly weak and should probably not be swapped. Of course, the same applies to the corresponding cells on the opposite side of the board.
 +
 
 +
To get an idea of which opening moves are winning, it is useful to study the situation for [[small boards]]. For boards up to size 9 × 9, the winning opening moves are known. While the winning opening moves have not been solved for boards of size 10 × 10 or greater, it is reasonable to extrapolate from the smaller board sizes. On the [[small boards]], the red hexes should be swapped, and the blue hexes should not be swapped. Fair opening moves are probably the ones that are near the boundary of red and blue.
 +
 
 +
Some strong players have suggested that when a position is roughly balanced, having an extra stone on the board usually makes the game easier to play. This means that whenever there is doubt about a move, it might be a good idea to swap it. However, the first player can take advantage of this behaviour by playing a first move that is probably losing under perfect play. This idea has been popularized by "lazyplayer" at littlegolem/igg.
 +
 
 +
Another consideration is not to use the same opening move all the time. Some players may be very familiar with particular openings. Playing an unfamiliar opening can confuse the opponent.
 +
 
 +
In the following diagrams, it is suggested that an opening move played in a red cell is probably winning and should be swapped; those in a blue cell are probably losing and should not be swapped; and those marked "*", which are near the boundary of red and blue, are probably relatively fair opening moves. It must be kept in mind, however, that these diagrams reflect somebody's subjective guess. The opening on 11 × 11 boards has not been solved, so nobody really knows for sure which moves are winning or losing. Many players have different opinions on when to swap.
 +
 
 +
=== Size 11 ===
 +
 
 +
<hexboard size="11x11"
 +
  coords="show"
 +
  contents="S red:all blue:(a1--j1 a2--i2 a3 k3)
 +
              blue:(a9 k9 c10--k10 b11--k11)
 +
            E *:(a3 a4 a6--a9 a11 c2 c10 f3)
 +
            E *:(f9 i2 i10 k1 k3--k6 k8 k9)"
 +
  />
 +
 
 +
=== Size 13 ===
 +
 
 +
Based on [http://www.mseymour.ca/hex_book/hexstrat.html Hex: A Strategy Guide] by Matthew Seymour.
 +
 
 +
<hexboard size="13x13"
 +
  coords="show"
 +
  contents="S red:all
 +
              blue:(a1--l1 a2--k2 a3 f3--i3 m3)
 +
              blue:(a11 e11--h11 m11 c12--m12 b13--m13)
 +
            E *:(a3--a10 a13 c2 c12)
 +
            E *:(m1 m4--m11 k2 k12)"
 +
  />
 +
 
 +
 
 +
Based on the [https://littlegolem.net/jsp/forum/topic2.jsp?forum=50&topic=739 swap map] of leela_bot, a very strong computer player on LG. Moves have been marked as "close" when the odds of winning are within 10% of even (40-60%).
 +
 
 +
<hexboard size="13x13"
 +
  coords="show"
 +
  contents="S red:all
 +
              blue:(a1--l1 a2--k2 a3 m3)
 +
              blue:(a11 m11 c12--m12 b13--m13)
 +
            E *:(m1 a2 b2 c2 d2 k2 a3 f3 g3 h3 j3 m3 m4)
 +
            E *:(a10 a11 d11 f11 g11 h11 m11 c12 j12 k12 l12 m12 a13)"
 +
  />
 +
 
 +
=== Size 14 ===
 +
Based on [https://www.hexwiki.net/index.php/User:Mason Mason Mackaman's] explorations with [https://github.com/hzyhhzy/KataGo/releases/tag/Hex_20240812 KataHex 20240812]. "'''&minus;'''" represents a win rate between 1/6 and 1/4, "'''+'''" represents a win rate between 1/4 and 1/3, and "'''*'''" represents a win rate between 1/3 and 1/2.
 +
 
 +
<hexboard size="14x14"
 +
  coords="show"
 +
  contents="S red:all blue:(a1--m1 a2--l2 a3 g3 n3 f3)
 +
                      blue:(b14--n14 c13--n13 n12 h12 a12 i12)
 +
            E -:(a3 a4 a6 a9 a10 a12 b12 c13 e12 l13)
 +
              +:(a11 a14 b4 d12 j12)
 +
              *:(f12 g12 h12 i12)
 +
              -:(c2 j3 l2 m3 n3 n5 n6 n9 n11 n12)
 +
              +:(e3 k3 m11 n1 n4)
 +
              *:(f3 g3 h3 i3)"
 +
/>
 +
 
 +
=== Size 15 ===
 +
 
 +
Based on the swap map of [[KataHex]]. The strongest move without the swap rule, d12, has a 99.4% win percentage, corresponding to an advantage of 888 Elo points. Moves have been marked as "close" when the Elo advantage is less than 1/5 that of the best move &mdash; 178 Elo points, or within 26.5&ndash;73.5% win percentage. In some sense, these Red opening moves confer Blue (who has the swap option) an advantage of less than 1/10th of a stone.
 +
 
 +
<hexboard size="15x15"
 +
  coords="show"
 +
  contents="S red:all blue:(a1--n1 a2--m2 a3 f3--i3 o3)
 +
              blue:(a13 g13--j13 o13 c14--o14 b15--o15)
 +
            E *:(c2 e3--j3 b4 a10 a11 a15 m2)
 +
            E *:(m14 f13--k13 n12 o6 o5 o1 c14)"
 +
  />
 +
 
 +
=== Size 19 ===
 +
 
 +
Based on the swap map of [[KataHex]]. The strongest move without the swap rule has a 95.7% win percentage, corresponding to an advantage of 539 Elo points. Moves have been marked as "close" (*) when the Elo advantage is less than 1/5 that of the best move &mdash; 108 Elo points, or within 35&ndash;65% win percentage. In some sense, these Red opening moves confer Blue (who has the swap option) an advantage of less than 1/10th of a stone.
 +
 
 +
It is worth noting that a significant number of opening moves are just outside the "close" threshold. These moves are marked with (+) and have win percentages of 32.5&ndash;35% or 65&ndash;67.5%. They are moderately balanced moves and can be interesting options if you are looking to vary your opening repertoire.
 +
 
 +
<hexboard size="19x19"
 +
  coords="show"
 +
  contents="S red:all blue:(a1--r1 a2--q2 a3 e3--n3 s3)
 +
              blue:(a17 f17--o17 s17 c18--s18 b19--s19)
 +
            E *:(c2 d3--e3 m3--p3 i4--l4 a10 a14--a16 a19)
 +
            E *:(q18 o17--p17 d17--g17 h16--k16 s10 s4--s6 s1)
 +
            E +:(a2--b2 a4 b4 f3--h3 j5 q2 a13 b17)
 +
            E +:(r18--s18 s16 r16 l17--n17 j15 c18 s7 r3)"
 +
  />
 +
 
 +
== A more general swap rule ==
 +
 
 +
It has been suggested that one could use a more general swap rule. Under this proposal, instead of placing just one piece, the first player places any number of red and blue pieces, and state which color has the next move. Let's assume that the first player has placed N stones in the board. The second player then can start playing Hex with one color of his choice or, if he fears that the other player has an excessive advantage due to home preparation, he can swap roles with the first player, remove all stones from the board and place at most N-1 stones as he wants. This rule has been first proposed by "lazyplayer" at littlegolem/igg. However, it is not widely used, nor implemented by any [[online playing|game sites]].
 +
 
 +
==See also==
 +
 
 +
[[Basic (strategy guide)#10_.C3.97_10_swap_rules|Guideline for 10x10 board size]], in the basic strategy guide.
 +
 
 +
==External links==
 +
 
 +
[http://www.cs.cmu.edu/People/hde/hex/hexfaq/ A FAQ about Hex]
 +
 
 +
[http://www.cs.ualberta.ca/~queenbee/openings.html A more complete site] with solutions to size 7. Beware, the colours are inverted, vertical is blue there.
 +
 
 +
[[category: Opening]]
 +
[[category: Basic Strategy]]
 +
[[Category: Rules and Conventions]]

Latest revision as of 14:26, 7 October 2024

The swap rule states that after Red plays the first move, Blue decides whether to swap colours or not. If Blue swaps colours, Blue becomes Red and Red becomes Blue. Whichever player ends up being Blue makes the second move and then the game continues as usual.

Reason for the swap rule

When playing Hex without the swap rule, the first player has a considerable advantage. The swap rule was devised to make the game more even. Namely, if the first player plays a move that is too strong, the second player will swap and be in a strong position. And if the first player plays a move that is too weak, the second player will not swap (and therefore also be in a strong position). Therefore, the swap rule creates an incentive for the first player to play a move that is as fair as possible.

The swap rule is sometimes also called the "pie rule", since it resembles the well-known "you cut, I choose" method for fairly dividing a pie between two people. Namely, one person cuts the pie in two, and the other person chooses which piece to eat. Here, the incentive for the first person is to make the two pieces as equal as possible.

Since each opening move is theoretically either winning or losing, there exists no opening move that is exactly fair. For this reason, the second player theoretically has a forced win when playing with the swap rule. However, the second player's advantage is very small, and certainly much smaller than the first player's advantage would be when playing without the swap rule.

Implementations of the swap rule

Swapping can be implemented in two ways, as follows. As usual, we assume that the players are Red and Blue, with Red going first.

  1. "Swap sides": The players perform the swap by switching colours: Red becomes Blue and Blue becomes Red. After the swap, it is Blue's turn.
  2. "Swap pieces": The players perform the swap by switching pieces. This means the initial red piece is replaced by a blue piece in the mirror image position, where the mirroring takes place with respect to the board's long diagonal. For example, a red piece at a3 becomes a blue piece at c1. The players do not switch colours: Red stays Red and Blue stays Blue. After the swap, it is Red's turn.

In face-to-face play, the "swap sides" method is most practical, since it is easier for the players to switch colours than to remove and add pieces on the board. This is especially true when playing with pencil and paper. It is also less error-prone. On online game sites, the "swap pieces" method is more common, presumably because the colours are determined at the start of the game, and it is easier to change the board position than the colour designation. This also makes the game record more readable, since it is always clear which player was "Red" and which was "Blue".

When to swap

The decision whether to swap is an important one. Accidentally swapping a weak move, or accidentally failing to swap a strong move, is bad for the second player.

Different players have different preferences for which moves to swap. It is generally agreed that moves near the center of the board are far too strong and should be swapped, whereas moves on the first player's own edge (except in the obtuse corner) are too weak and should not be swapped. a1 and b1 are provably losing and should never be swapped. a3–a8, a10, a11, c2, and c10 (on an 11 × 11 board) are relatively balanced, and whether or not to swap them depends on the player's preferences. a9 is fairly weak and should probably not be swapped. Of course, the same applies to the corresponding cells on the opposite side of the board.

To get an idea of which opening moves are winning, it is useful to study the situation for small boards. For boards up to size 9 × 9, the winning opening moves are known. While the winning opening moves have not been solved for boards of size 10 × 10 or greater, it is reasonable to extrapolate from the smaller board sizes. On the small boards, the red hexes should be swapped, and the blue hexes should not be swapped. Fair opening moves are probably the ones that are near the boundary of red and blue.

Some strong players have suggested that when a position is roughly balanced, having an extra stone on the board usually makes the game easier to play. This means that whenever there is doubt about a move, it might be a good idea to swap it. However, the first player can take advantage of this behaviour by playing a first move that is probably losing under perfect play. This idea has been popularized by "lazyplayer" at littlegolem/igg.

Another consideration is not to use the same opening move all the time. Some players may be very familiar with particular openings. Playing an unfamiliar opening can confuse the opponent.

In the following diagrams, it is suggested that an opening move played in a red cell is probably winning and should be swapped; those in a blue cell are probably losing and should not be swapped; and those marked "*", which are near the boundary of red and blue, are probably relatively fair opening moves. It must be kept in mind, however, that these diagrams reflect somebody's subjective guess. The opening on 11 × 11 boards has not been solved, so nobody really knows for sure which moves are winning or losing. Many players have different opinions on when to swap.

Size 11

abcdefghijk1234567891011

Size 13

Based on Hex: A Strategy Guide by Matthew Seymour.

abcdefghijklm12345678910111213


Based on the swap map of leela_bot, a very strong computer player on LG. Moves have been marked as "close" when the odds of winning are within 10% of even (40-60%).

abcdefghijklm12345678910111213

Size 14

Based on Mason Mackaman's explorations with KataHex 20240812. "" represents a win rate between 1/6 and 1/4, "+" represents a win rate between 1/4 and 1/3, and "*" represents a win rate between 1/3 and 1/2.

abcdefghijklmn1234567891011121314

Size 15

Based on the swap map of KataHex. The strongest move without the swap rule, d12, has a 99.4% win percentage, corresponding to an advantage of 888 Elo points. Moves have been marked as "close" when the Elo advantage is less than 1/5 that of the best move — 178 Elo points, or within 26.5–73.5% win percentage. In some sense, these Red opening moves confer Blue (who has the swap option) an advantage of less than 1/10th of a stone.

abcdefghijklmno123456789101112131415

Size 19

Based on the swap map of KataHex. The strongest move without the swap rule has a 95.7% win percentage, corresponding to an advantage of 539 Elo points. Moves have been marked as "close" (*) when the Elo advantage is less than 1/5 that of the best move — 108 Elo points, or within 35–65% win percentage. In some sense, these Red opening moves confer Blue (who has the swap option) an advantage of less than 1/10th of a stone.

It is worth noting that a significant number of opening moves are just outside the "close" threshold. These moves are marked with (+) and have win percentages of 32.5–35% or 65–67.5%. They are moderately balanced moves and can be interesting options if you are looking to vary your opening repertoire.

abcdefghijklmnopqrs12345678910111213141516171819

A more general swap rule

It has been suggested that one could use a more general swap rule. Under this proposal, instead of placing just one piece, the first player places any number of red and blue pieces, and state which color has the next move. Let's assume that the first player has placed N stones in the board. The second player then can start playing Hex with one color of his choice or, if he fears that the other player has an excessive advantage due to home preparation, he can swap roles with the first player, remove all stones from the board and place at most N-1 stones as he wants. This rule has been first proposed by "lazyplayer" at littlegolem/igg. However, it is not widely used, nor implemented by any game sites.

See also

Guideline for 10x10 board size, in the basic strategy guide.

External links

A FAQ about Hex

A more complete site with solutions to size 7. Beware, the colours are inverted, vertical is blue there.