Difference between revisions of "Mustplay region"
(Fixed typos and improved a diagram.) |
m (→In a game: open-parens was before sentence, so period goes before close-parens) |
||
(3 intermediate revisions by one other user not shown) | |||
Line 10: | Line 10: | ||
/> | /> | ||
− | To determine Blue's mustplay region, Blue should consider the possible ways in which Red could make a connection if it were ''Red's'' turn. These are called Red's '' | + | To determine Blue's mustplay region, Blue should consider the possible ways in which Red could make a connection if it were ''Red's'' turn. These are called Red's ''[[threat]]s''. Red has (at least) the following threats: |
* If Red plays at e4, Red is [[virtual connection|connected]] by two templates, namely [[edge template II]] and [[edge template IV2d]]. The [[carrier]] of Red's connection is the set of all cells that are required for the connection, and is highlighted: <hexboard size="7x7" | * If Red plays at e4, Red is [[virtual connection|connected]] by two templates, namely [[edge template II]] and [[edge template IV2d]]. The [[carrier]] of Red's connection is the set of all cells that are required for the connection, and is highlighted: <hexboard size="7x7" | ||
Line 54: | Line 54: | ||
== Definition == | == Definition == | ||
− | From the point of view of a player, a ''threat'' is a [[virtual connection]] between the opponent's board edges that the opponent can create in a single move. The ''carrier'' of the threat is the set of cells (empty or not) that are required for the virtual connection to be valid. The player's mustplay region is determined as follows: | + | From the point of view of a player, a ''[[threat]]'' is a [[virtual connection]] between the opponent's board edges that the opponent can create in a single move. The ''carrier'' of the threat is the set of cells (empty or not) that are required for the virtual connection to be valid. The player's mustplay region is determined as follows: |
* Identify as many threats as possible. | * Identify as many threats as possible. | ||
Line 191: | Line 191: | ||
Of these, x, y, u, v, and w are losing: if Blue plays there, Red can respond at z, re-establishing both threats. | Of these, x, y, u, v, and w are losing: if Blue plays there, Red can respond at z, re-establishing both threats. | ||
The unique winning move for Blue is z. In fact, this is basically a [[foiling]] move. | The unique winning move for Blue is z. In fact, this is basically a [[foiling]] move. | ||
+ | |||
+ | === In a game === | ||
+ | |||
+ | Consider the following position from an actual game, with Red to move: | ||
+ | <hexboard size="13x13" | ||
+ | contents="R l1 d10 B e4 R h6 B i10 R h10 B f7 R g8 B h7 R g7 B i4 R j4 B i5 R j5 B j3 R k3 B i6 R j6 B i8 R j8 B i9 R j10 B i11 R k10 B j9 R l8 B h12 R l11 B k2 R l2 B k7 R g5 B h3 R f4 B g2 R f3 B f2 R e3 B e2 R d3 B d2 R b3 B c3 R b4 B c4 R b5 B c5 R b6 B c6 R b7 B c7 R b8 B c8 R b9 B c10 R c9 B d9 R d8 B e9" | ||
+ | /> | ||
+ | One of Blue's threats is e6, with the carrier as shown: | ||
+ | <hexboard size="13x13" | ||
+ | contents="R l1 d10 B e4 R h6 B i10 R h10 B f7 R g8 B h7 R g7 B i4 R j4 B i5 R j5 B j3 R k3 B i6 R j6 B i8 R j8 B i9 R j10 B i11 R k10 B j9 R l8 B h12 R l11 B k2 R l2 B k7 R g5 B h3 R f4 B g2 R f3 B f2 R e3 B e2 R d3 B d2 R b3 B c3 R b4 B c4 R b5 B c5 R b6 B c6 R b7 B c7 R b8 B c8 R b9 B c10 R c9 B d9 R d8 B e9 B *:e6 | ||
+ | S blue:area(a10,a13,c11,c10,d9,e9,f8,f6,c6,c3,d2,g3,h4,i4,h7,h8,i9,j9,m7,m4,i7,i3,h2,d2,c3,c7,e8,c10)" | ||
+ | /> | ||
+ | Another Blue threat is f10, with the following carrier. Note that f10 is connected to Blue's i8 group by double threat at g9 and g11, marked with "*". | ||
+ | <hexboard size="13x13" | ||
+ | contents="R l1 d10 B e4 R h6 B i10 R h10 B f7 R g8 B h7 R g7 B i4 R j4 B i5 R j5 B j3 R k3 B i6 R j6 B i8 R j8 B i9 R j10 B i11 R k10 B j9 R l8 B h12 R l11 B k2 R l2 B k7 R g5 B h3 R f4 B g2 R f3 B f2 R e3 B e2 R d3 B d2 R b3 B c3 R b4 B c4 R b5 B c5 R b6 B c6 R b7 B c7 R b8 B c8 R b9 B c10 R c9 B d9 R d8 B e9 B *:f10 | ||
+ | S blue:area(a10,a13,c11,c10,d9,e9,e10,g12,h12,i11,j9,m7,m4,h8,i8,e9,d9,c10) | ||
+ | E *:g9,g11" | ||
+ | /> | ||
+ | |||
+ | Apart from the areas near the two blue edges, the only overlap of these two threats is h8, and indeed, h8 is a winning move for Red. (Red could also start by first [[intrusion|intruding]] in the areas near Blue's edges, say at b12, but this is not necessary.) | ||
=== Verification of templates === | === Verification of templates === | ||
Line 259: | Line 279: | ||
=== Computer Hex === | === Computer Hex === | ||
− | Mustplay analysis is used in computer Hex to reduce the number of possibilities that must be considered for a player's next move. This drastically reduces the size of the search tree. | + | Mustplay analysis is used in computer Hex to reduce the [[branching factor|number of possibilities]] that must be considered for a player's next move. This drastically reduces the size of the search tree. |
== See also == | == See also == |
Latest revision as of 01:16, 4 October 2023
Informally, a mustplay region for a player is a set of cells in which the player must move to avoid losing immediately. Mustplay analysis is an important tool for analyzing Hex positions, because it can help narrow down the number of possibilities a player must consider.
Contents
Example
Consider the following position, with Blue to move:
To determine Blue's mustplay region, Blue should consider the possible ways in which Red could make a connection if it were Red's turn. These are called Red's threats. Red has (at least) the following threats:
- If Red plays at e4, Red is connected by two templates, namely edge template II and edge template IV2d. The carrier of Red's connection is the set of all cells that are required for the connection, and is highlighted:
- If Red plays at e5, then Red is connected via two copies of edge template II and two bridges, as shown:
- Alternatively, if Red plays at e5, Red is also connected via edge template II and edge template III2e, as shown: While the last two connections both use a Blue stone at e5, they have different carriers.
- If Red plays at d5, Red is connected via a 3rd row ladder, using f6 as a ladder escape. In this case, the carrier consists of the path the ladder will take and the space required for the ladder escape:
Blue's mustplay region consists of those empty cells that are in the carriers of all of Red's known threats. Therefore, Blue's mustplay region consists of the cells d1, e1, e5, e6, e7, and f7.
Note that this does not mean that all of d1, e1, e5, e6, e7, and f7 are winning moves for Blue, or even that Blue has any winning moves at all. Rather, what it means is that all other moves are losing. In other words, if Blue has any winning moves at all, they must be in Blue's mustplay region. Blue must now consider each of the six moves d1, e1, e5, e6, e7, and f7 and check if any of them are winning, or barring that, which one of them is least likely to be losing.
To help narrow down Blue's choices even further, it helps to consider captured and dominated cells. In the above example, d1, e1, e7, and f7 are captured by Red, and therefore, Blue should not play there. This leaves Blue with e5 and e6 as the only possible moves to consider. It so happens that e5 is winning and e6 is losing. Therefore, considering the mustplay region has helped Blue identify the only possible winning move. Blue will play e5 and win the game.
Definition
From the point of view of a player, a threat is a virtual connection between the opponent's board edges that the opponent can create in a single move. The carrier of the threat is the set of cells (empty or not) that are required for the virtual connection to be valid. The player's mustplay region is determined as follows:
- Identify as many threats as possible.
- Determine the intersection of the carriers of all of these threats.
- With respect to the chosen set of threats, the mustplay region is the set of empty cells in that intersection.
Properties
- All moves outside a player's mustplay region are losing. Moves within the mustplay region may be winning or losing.
- If a player's mustplay region is empty, the player is losing.
- If there are no winning moves in a player's mustplay region, the player is losing.
- The mustplay region is not unique. By considering more opponent threats, a player may arrive at a smaller mustplay region.
Example: no winning move
If there are no winning moves in a player's mustplay region, the player is losing. To illustrate this, consider the following position, with Blue to move.
Red's main threats are:
- d3, connecting via a ziggurat:
- b4, connecting via edge template II:
- c4, connecting via edge template II and a double threat:
The only empty cell in the carrier of all three threats is b5, hence Blue's mustplay region consists of b5. This means that all moves except possibly b5 are losing for Blue.
Unfortunately for Blue, b5 is also losing, because if Blue plays b5, Red can win as follows:
Therefore Blue has no winning moves at all and is losing the game.
Applications
Foiling
Consider the following situation, with Blue to move:
Red's main threats are:
- e4, connecting via bridges and a ziggurat:
- a6, connecting via a 2nd row ladder and ladder escape:
- a6, connecting via a 2nd row ladder and a slightly different ladder escape:
Therefore, Blue's mustplay region consists of the following 5 cells:
Of these, y, z, u, and v are losing: if Blue plays there, Red wins by responding at x. Blue's unique winning move is x. This move is also known as a foiling move, because it takes away Red's template and Red's ladder escape at the same time.
Solving Hex puzzles
Consider the following puzzle, due to Eric Demer. Blue to move and win.
At first, the situation seems confusing here. Blue's central stones neither seem to have a convincing connection to the left edge nor to the right one.
Mustplay analysis helps clarify the situation. First, let's note that Red's e3 and g3 are already very strongly connected to the top edge; Blue cannot gain anything by intruding into that connection. (In fact, Red has captured rows 1–3). We therefore concentrate on the bottom part of the board. Within that region, Red's main threats are:
- d4, connecting via edge template III2a:
- f5, connecting via double threat of f6 and a 2nd row ladder at d6, for which b5 and c5 are a ladder escape:
We therefore see that Blue's mustplay region consists of the following six cells:
Of these, x, y, u, v, and w are losing: if Blue plays there, Red can respond at z, re-establishing both threats. The unique winning move for Blue is z. In fact, this is basically a foiling move.
In a game
Consider the following position from an actual game, with Red to move:
One of Blue's threats is e6, with the carrier as shown:
Another Blue threat is f10, with the following carrier. Note that f10 is connected to Blue's i8 group by double threat at g9 and g11, marked with "*".
Apart from the areas near the two blue edges, the only overlap of these two threats is h8, and indeed, h8 is a winning move for Red. (Red could also start by first intruding in the areas near Blue's edges, say at b12, but this is not necessary.)
Verification of templates
Mustplay analysis is also useful in the verification of templates. In that context, it is sometimes known as template reduction. For example, consider edge template V1a:
To show that the template is valid, we must show that Blue has no way of disconnecting the template's red stone from the edge. We use mustplay analysis to reduce the number of possiblities. Red's main threats are:
- Connecting via template IVa:
- Connecting via a bridge and template IVa:
- Connecting via a bridge and template III-1-b:
- Connecting via template IVb, in two different ways:
Therefore, Blue's mustplay region consists of only three cells:
To finish verifying the template, it then remains to show that each of these three moves is losing for Blue. See the article on edge template V1a for the details.
Computer Hex
Mustplay analysis is used in computer Hex to reduce the number of possibilities that must be considered for a player's next move. This drastically reduces the size of the search tree.
See also
References
R. Hayward, Y. Björnsson, M. Johanson, M. Kan, N. Po, and J. van Rijswijck: "Solving 7x7 Hex with domination, fill-in, and virtual connections", Theoretical Computer Science 349;123–139, 2005.
R. Hayward: "A puzzling Hex primer". In Games of No Chance 3, Cambridge University Press, 56:151–162, 2009.