Difference between revisions of "User:Hexanna"

From HexWiki
Jump to: navigation, search
(reorganize)
 
(26 intermediate revisions by 3 users not shown)
Line 1: Line 1:
19×19 is the most popular of the "large" board sizes. This board size offers a lot of room for strategic freedom (unlike 11×11 or 13×13), but tactics and local play remain highly important.
+
[[Openings on 19 x 19]]
  
An average well-played game lasts about 72-90 moves before one side resigns, or 20-25% of the board, though it varies considerably from game to game.
+
[[Strategic advice from KataHex]]
  
The advice in this guide is heavily influenced by hzy's KataHex bot, the strongest known (and easily superhuman) bot as of March 2023.
+
I started learning Hex mid-July of 2021, about 2 weeks before I created my LittleGolem account.
  
==Differences from smaller boards==
+
==katahex/general strategy part 2 (rough draft)==
  
* While [[corner move|corner moves]] are still good moves, playing near the middle of your opponent's 5th row is often just as good. This starts to become true for boards 18×18 and larger.
+
This is not very organized, and some bullet points won't make sense without further context. I also need to decide which ideas are worth keeping. (I have outlines and rough drafts of even more stuff, but I'm worried about making the article too long and diluting it with only rarely-applicable advice.)
  
* Ladders and ladder escapes are less important. Human games often have long ladders across a side of the board, but it's usually a mistake for the defending side to keep pushing the ladder. Often, it's best for the defender to jump, allowing their opponent to connect in exchange for territory. Here is a [https://hexworld.org/board/#19n,c2d16p15o5r4q2q3r2p3p2o3m3o2 common example].
+
* Don't worry about switchbacks, climbing, or ladder creation templates on 15x15 or larger. They can be theoretically interesting and make for good puzzles, but games are rarely close enough for these to matter. Controversially, I personally don't think about them on any board size.
 +
* Q: When should the defender of a ladder yield? A: Usually, don't yield unless your opponent can make an adjacent cut (defined below) through two of your stones, one above and one below the ladder. In that case, consider yielding.
 +
** Example: https://hexworld.org/board/#13c1,c2e9c10d8b9c11d10d12 If Blue instead plays d11, Red e10 cuts through e9 and d11
 +
* If you can't find a good move, avoid a bad one by playing "skew" relative to existing stones.
 +
** That is, play a move that interacts with existing stones as little as possible (at least distance 3 from all other stones).
 +
** The difference between a good move and a blunder is >5x the difference between a great move and a good move.
  
* There is a lot more room to ignore your opponent's threats and [[tenuki|play elsewhere]] in the early opening. Moves are less forcing, and there's a much larger variety of different strategies you can try.
+
* Stone "arithmetic": not an exact science, use your intuition; play the move that maximizes the sum of local and global efficiency. I am not actually calculating values when playing, just making mental adjustments.
 +
** The best move locally is rarely the best move globally. Hex is a game of concessions and tradeoffs. There is no "free lunch," unless you count concepts like inferiority/domination.
 +
** Conversely, if it looks like your opponent is beating you on one side of the board, there are two possibilities:
 +
*** You played suboptimal moves in that region.
 +
*** Your opponent played too strong in that area, which necessarily means they made concessions elsewhere (usually the opposite side of the board).
 +
** If the first option is true, you are probably losing anyways, so assume (or hope) the second is true. That means you should tend to tenuki and play the opposite side of the board, if you think your opponent overplayed one side. Indeed, if you continue playing on the same side, your opponent might be able to get out of their mistake by minimaxing, such that they go from being overconnected to being merely connected.
  
* On smaller boards, the game becomes quite tactical after the opening, and playing well often means playing stones that "work well" with existing stones near the corner. On 19×19, there is room to start a local fight near the middle of the board, relatively far away from existing stones.
+
* For brevity, some notation for up-weighting and down-weighting particular moves:
 +
** chess notation: ??/?/?!/!?/!
 +
** one way to think about it: you are a machine who has to assign a score (or a prior policy probability) to each move. !? means slightly upweight, ! means upweight, ?? means strongly downweight, and so on.
 +
** asymmetric scale, one blunder can take multiple "great" moves to recover from; also, brilliancies (!!) are rare and don't come from easily described rules like the ones in this article
  
==Common human mistakes==
+
* !? bridge moves, either from your own stone or your opponent's
 +
** an additional !? if it's part of a bridge ladder that you'll win (you're playing 5-4 acute corner), ?! if your opponent will win
 +
* ? moves adjacent to your own stone, unless you are minimaxing and know that it's the best move. Be careful of bad minimaxing, where you connect too weakly to one side, allowing your opponent to intrude for territory. More often than not, the concession you make here isn't worth the extra strength.
  
* Playing too close to your own edge is by far the most common mistake in the opening. There are exceptions where it can be a good idea, like when you're playing a corner move or joseki, or your opponent has intruded heavily into one of your edges, or you're responding to a local tactical situation. However, if your opponent hasn't played near one of your edges, it's almost always a bad idea to play a move closer to that edge than one of your opponent's edges.
+
* Cuts (ignore the edges of the board, pretend it's 5 separate diagrams): https://hexworld.org/board/#19c1,e3f3f4e4i3:pk3j3n3p2q3o4e8:pg10f9m8:pn10o8
 +
** Suggested names for brevity (from left to right, then top down): adjacent cut, near cut, short bridge cut (or just bridge cut), long bridge cut, skew cut
 +
** ? allowing an adjacent cut
 +
** ?? allowing a bridge cut, ! bridge cutting
 +
*** if Red allows a bridge cut, often the damage has already been done even if Blue doesn't actually cut through
 +
*** however, if Blue has to make concessions to cut through, like playing on her second or third row, that often neutralizes the ?? almost entirely - this is especially true if Blue already has an existing stone close to her edge (like a swapped c2 opening).
  
==General principles==
+
* Small patterns/motifs: https://hexworld.org/board/#19c1,f4f5e5:pk4j6i5:po4n7f12f15n11l15
 +
** "In a vacuum" means "with no nearby stones"
 +
** P1 (top-left): It's a mistake for Blue to play adjacent to the Blue stone in a vacuum. Red's best response is usually playing adjacent to both stones.
 +
** P2 (top-middle): Blue plays a bridge away from Red's stone. This is often a good move, and Red's response a bridge away from both stones is also good.
 +
** P3 (top-right): Blue plays a classic block. This is often fine for Blue, and Red doesn't have an obvious best local response. Red could tenuki here.
 +
** P4 (bottom-left): The main intuition to learn is that Red e14 (a bridge away) is ? on the chess notation scale.
 +
** P5 (bottom-right): Blue plays two bridge moves away. Again, Red m13 a bridge away is ? on the scale.
  
* Corner and edge moves: In the absence of other stones nearby, Red would do well to play in one of the following spots:
+
* If you study KataHex play, you can pick up by intuition what moves to play in 50-75% of situations. The hard part is figuring out what not to play in the other situations.
 +
** Depth 1: Don't play moves that allow your opponent to cut through. (Also, already mentioned in [[Strategic advice from KataHex]], "Don't play a move that makes your opponent's existing stones unnecessarily well-placed relative to your new stone.")
 +
** Depth 2: Don't play moves where an otherwise natural continuation for you is to play a move pruned by depth 1.
  
<hexboard size="19x19"
+
* Use the patterns and intuitions that you know, to reason and make inferences in unfamiliar positions. You might not always find the best move, but you can often prune bad moves. Here is an extended example, involving several closely related patterns that are useful to know in isolation.
  coords="show"
+
*# ''Pattern:'' If you play the 4-4 3-3 obtuse corner joseki, it is important to know that Blue 6 here is weak: https://hexworld.org/board/#19nc1,d16c17d17c18d18e14c15
  contents="R d5 e6 *:f7 g8 f9 *:e10 *:e11 *:d16 p15 o14 *:n13 m12 n11 *:o10 *:o9 *:p4"
+
*#* This is because Red 7 undermines Blue 6 and also reduces Blue 2/4 from a 3rd row ladder escape to a 2nd row escape. Also, Blue's potential intrusion at c16 doesn't gain her anything.
  />
+
*#* Instead, a good local response for Blue is as follows: https://hexworld.org/board/#19nc1,d16c17d17c18d18d15. This gives Blue a 5th row ladder escape while blocking Red 1.
 +
*#* On the other hand, if Blue only has a 2nd row escape and doesn't have the "potential energy" to get a 3rd row escape, you might guess that Blue 6 above becomes a good local move, because Red 7 loses one of its main strengths. Such a guess would be correct: https://hexworld.org/board/#19nc1,d16c17p15d17e16g16e17f18d18e14c15 Blue 10 is a strong move here. On the other hand, Blue 10 at d15 would be weak here, as it's quite wasteful, only converting a 2nd row escape into a 3rd row escape.
 +
*# ''Pattern:'' If Red tenukis on move 3, then Blue 4 is locally strong here: https://hexworld.org/board/#19nc1,d16e14:pf15. In particular, Blue 4 is much stronger than bridging directly towards Blue's own edge with g13, because the former is a strong blocking move that reduces the effectiveness of Red 1. This strength is in spite of Red's intrusion on move 5. (I first saw this move in https://www.littlegolem.net/jsp/game/game.jsp?gid=2090091&nmove=16 from https://www.littlegolem.net/jsp/forum/topic2.jsp?forum=50&topic=739.)
 +
*#* This pattern is actually applicable in many situations and is an example of pattern P2 (top-middle) above. If Red started with the 5-5 obtuse corner, then the equivalent Blue 4 is also strong.
 +
*#* Another simple example is Red 5 in https://hexworld.org/board/#19nc1,d16d15f14:pe13.
 +
*# ''Inference:'' Let us consider this position again: https://hexworld.org/board/#19nc1,d16c17d17c18d18:p. Suppose Blue tenukis on move 6. What is a good local response for Red on move 7? There is more than one right answer, but you just need to find one move that isn't a blunder.
 +
*#* ''Hint:'' Use the two patterns above to come up with an answer.
 +
*#* ''Hint:'' Consider that Blue has a 3rd row ladder escape, so Blue d15 is locally strong but Blue e14 is weak. This is the case for future blue stones in this local region, even though Blue already played elsewhere on move 6. Therefore, Red should perhaps try to play a move that makes Blue d15 less attractive, even if it comes at the concession of making Blue e14 more attractive (since the latter is ''a priori'' a weak move, such a concession gives up less than it otherwise might).
 +
*#* ''Answer:'' Red 7 here is a good local move: https://hexworld.org/board/#19nc1,d16c17d17c18d18:pe13
 +
*#** Why? Ignoring stones 2-5, the presence of Red 1 and 7 makes Blue e14 more attractive. Red's 4-4 stone, much like the obtuse corner opening, tends to shift Blue's efficient stone locations up one row. With that in mind, Red's move 7 is a bit like Red e14 on an empty board, where Blue e15 is the best response: https://hexworld.org/board/#19nc1,e14e15. However, stones 2-5 make Blue e14 a bad move, despite Red 7 making it slightly less bad (this is the concession-but-not-really-a-concession that Red intended).
 +
*#** Let's now consider Blue d15. Normally a decent local move after stones 1-5, it becomes quite weak after Red 7, because of https://hexworld.org/board/#19nc1,d16c17d17c18d18:pe13d15f14. This is a typical example of the second pattern in this extended example. (Actually, if Blue had two moves in a row in this region, Blue 8 wouldn't be so bad because she could follow up with f14, where Red wants to play move 9. This is a tactical situation where it's bad for Red to tenuki.)
 +
*#** If we wanted to be complete, Blue actually has another option for move 8, f14 first which threatens d15: https://hexworld.org/board/#19nc1,d16c17d17c18d18:pe13f14d15d14e14. This is an example of the "skew cut" from above. Red should respond with d15 himself, or else Blue can play d15. This is probably Blue's best local response.
 +
*#** Every move makes a concession, but some concessions are more effective than others. As alluded to in the hint, Red 7 weakens a strong Blue reply (d15) while strengthening a weak Blue reply (e14). Red's goal is to minimize the strength of Blue's ''best'' response (rather than the strength of Blue's average response), and Red 7 at e13 accomplishes that beautifully.
 +
** Part of getting stronger at Hex (as with other games) is being able to compress knowledge and patterns effectively. If you understand this extended example, you can infer the best move in many similar but novel situations, without memorizing each one individually. If you forget which move is exactly the best, you can recover the right move with high probability by just reasoning about related patterns that you do know are strong or weak.
 +
** On larger boards and particularly near the opening or middlegame, when you have a lot of time to think about a position, it may be worth spending a good chunk of it making inferences and scoping out moves that are either good or to be avoided by each side, rather than spending most of your time calculating tons of lines and variations.
 +
** The a3 escape trick example from [[Strategic advice from KataHex]] is another case of this concept.
  
This is far from an exhaustive list; many other moves near the middle of Blue's 4th to 6th rows are often just as good. Of course, the presence of other stones even moderately nearby can influence things. KataHex prefers the spots marked (*) especially often.
+
* One of my favorite tactics is threatening a bridge cut, where the opponent needs to play too close to their own edge to connect. Red 5 here is a strong move, because it forces Blue 6, which is normally too close to the left side when combined with Blue 2: https://hexworld.org/board/#15nc1,c2d12l11g9f11e10. Be on the lookout for this when your opponent plays the 4-4 and 7-7 obtuse corner, or 5-5 and 8-8. This tactic can work well in other situations too:
 +
** https://hexworld.org/board/#19nc1,h7:pk7i8
 +
** https://hexworld.org/board/#19nc1,i5:pi8h7
 +
** However, be careful when using this tactic! When Red isn't actually making a concession by bridging his two stones, like when the pattern occurs further from his own edge, it can be a blunder for Blue to threaten a bridge cut. Here is an example where Blue 4 is a blunder in a vacuum: https://hexworld.org/board/#19nc1,h7:pe10g9f8.
  
* If Blue plays too closely to her edge, Red usually has some good local responses. In particular, if Blue plays near the middle of her 4th row, Red can choose one of the following blocks:
+
==Insights and tidbits from KataHex (hzy's bot)==
<hexboard size="7x7"
+
  coords="hide"
+
  edges="left"
+
  contents="B d4 E A:f3 B:e4 C:e5"
+
  />
+
KataHex prefers A the most often on a relatively empty board.
+
  
* If Blue plays near the middle of her 5th row:
+
* katahex_model_20220618.bin.gz (I'll call this the "strong" net) appears significantly stronger than the "default" net.
<hexboard size="7x8"
+
* Swap map for 19&times;19 generated with the strong net, with around 15k visits for most moves. For the red hexes, the number corresponds to Blue's Elo advantage if she swaps Red's move; for the blue hexes, the number corresponds to Blue's Elo advantage if she does not swap Red's move. Smaller numbers correspond to fairer openings. Includes all fair openings as well as a few selected unfair openings, including the strongest move without swap (e10). I used more visits for the fairest moves: 1000k for e3 (49.5% win rate), 500k for n3 (49.2%), 100k for a15 (52.5%).
  coords="hide"
+
** Key takeaways: The swap map at [[Swap rule#Size 19]] uses [https://pic4.zhimg.com/v2-7287c3a2a4e948da89c3ccad38cea82f_r.jpg data] that is almost certainly from the "weak" net. Compared to the weak net, the strong net notably thinks a19, n3&mdash;p3, and k4&mdash;l4 are stronger. I personally trust the strong net's evaluations more; I think it's dubious that the weak net thought l4 was a very fair opening. The nets disagree on whether e3 is winning or losing, though it's so close to 50% that the difference isn't meaningful.
  edges="left"
+
  contents="B e4 E A:g3 B:f4 C:f5 D:d6 E:c5 F:d3 *:f2"
+
  />
+
KataHex usually prefers A or E, though B/C/D/F are also common. The move marked (*) is usually less good, because Blue can respond at A.
+
  
* If Blue plays near the middle of her 6th row:
+
<hexboard size="19x19"
<hexboard size="7x9"
+
  coords="hide"
+
  edges="left"
+
  contents="B f4 E A:h3 B:e6 C:d5 D:e3 *:(g2 g5) +:g4"
+
  />
+
Here, all of A/B/C/D are often good choices. The moves marked (*) are usually worse because Blue can respond at A. The move marked (+) is also worse, and Blue usually does well to tenuki.
+
 
+
* If Blue plays close to the center, Red would do well to block at a distance, rather than using an adjacent or near block.
+
 
+
* A well-played game between equally matched players should "use" almost the whole board. In particular, large templates like [[edge template VI1a]] rarely matter on 19&times;19. Many players are tempted to play a stone in the middle of their 6th row, because such a stone is connected. However, the opponent has good responses intruding into the template (see above).
+
 
+
* Suppose Red has played the 5-4 opening. It turns out that a [https://hexworld.org/board/#19nc1,d5g3:pd4 decent response by Blue] is playing at 3-7 (from Red's perspective), partially due to the threat of Blue 4-4 as a followup. This would imply that, had Blue ''first'' played at 3-7 before Red played in the corner, Red should not respond with 5-4, because that would make Blue's 3-7 (which was placed first) unnecessarily effective. Red should instead play a move that works well against Blue's stone. It turns out that the [https://hexworld.org/board/#19nc1,:pg3d4 4-4 corner] is such a move. This is an important concept &mdash; you don't want to play a move close to your opponent's, if that would make your opponent's stone efficiently placed relative to yours.
+
 
+
* Here's another [https://hexworld.org/board/#19nc1,e4d4d5 example]. Red accidentally played the 4-5 corner move instead of 5-4. Blue should not play 4-4, because then Red could play 5-4, and he would be in the same position that he would've been, had he played the first move correctly (via the Red 5-4, Blue 4-4, Red 4-5 joseki). Blue essentially let Red out of his mistake. A better move for Blue here is simply to tenuki.
+
 
+
==Acute corner theory==
+
 
+
Corner joseki on 19&times;19 can be quite involved. Here's a sampler for inspiration.
+
 
+
('''TODO''' elaborate, add diagrams)
+
 
+
===5-4 acute corner===
+
 
+
* High intrusion is by far the most common: [https://hexworld.org/board/#19nc1,p15p16o16p14 here]
+
 
+
Blue typically doesn't play 4 if she already occupies the obtuse corner on that side, but in other cases it's often the best move. Other bots like leela_bot also play this joseki often, so even if the benefit of Blue 4 isn't immediately obvious to humans, the move still deserves serious consideration.
+
 
+
* An extended version: [https://hexworld.org/board/#19nc1,p15p16o16p14q14o17n17 here]
+
 
+
===6-5 acute corner===
+
 
+
* Low intrusion by Blue, high intrusion by Red: [https://hexworld.org/board/#19nc1,o14o16p16p15n16n17m17 here]
+
 
+
* A much longer variation: [https://hexworld.org/board/#19nc1,o14o16p16o17q17p18q18p15q13p17n16n15o15m18l17m16m17 here]
+
 
+
Blue has a couple ways to gain territory from Red 15, either playing at j18 or k19, but it seems better to defer the [[question]] and wait until one option is clearly preferable.
+
 
+
* High intrusion by Blue: [https://hexworld.org/board/#19nc1,o14o15p14p15n15m17l16m15m16k18q13p16j17k16k17 here]
+
 
+
Red 11 is a good minimaxing move, but he can only play it after Blue 10, since otherwise Blue has a [https://hexworld.org/board/#19nc1,o14o15p14p15n15m17q13l18 strong minimaxing reply].
+
 
+
===7-6 acute corner===
+
 
+
* Here's a standard one that KataHex prefers: [https://hexworld.org/board/#19nc1,n13n15o15n16p16p17r17q18o17 here]
+
 
+
==Obtuse corner theory==
+
 
+
===4-4 obtuse corner===
+
 
+
It's highly instructive to go through the many possible Blue responses to Red 4-4 in the obtuse corner.
+
 
+
<hexboard size="7x7"
+
  coords="hide"
+
  edges="bottom left"
+
  contents="R d4 E A:c5 B:d3 C:e3 D:e2 E:f2 F:d6 G:c6 H:b6 I:e5 J:d5 K:e4"
+
  />
+
 
+
'''A:''' KataHex's favorite response on 19&times;19 by far. Blue's move 3 gives her a 3rd row ladder escape in the form of [[edge template III2a]].
+
 
+
<hexboard size="7x7"
+
  coords="hide"
+
  edges="bottom left"
+
  contents="R d4 B 1:c5 R 2:d5 B 3:c6 R 4:d6"
+
  />
+
 
+
Unless Red's acute corner is free, Red usually connects directly to the bottom with move 4. This may be counterintuitive since it goes against the principle of minimaxing, but most Red attempts to minimax allow Blue to gain territory. For instance, if Red plays at 4 below, Blue gets move 7 for free, and the result is favorable to Blue.
+
 
+
<hexboard size="7x7"
+
  coords="hide"
+
  edges="bottom left"
+
  contents="R d4 B 1:c5 R 2:d5 B 3:c6 R 4:e5 B 5:d7 R 6:f6 B 7:f5 R 8:e6"
+
  />
+
 
+
If the acute corner is free, Red can play an alternative joseki on move 4:
+
 
+
<hexboard size="7x19"
+
  coords="hide"
+
  edges="bottom left right"
+
  contents="R d4 B 1:c5 R 2:d5 B 3:c6 R 4:p3 B 5:m5 R 6:q4"
+
  />
+
 
+
This joseki is quite tactical. After Blue's move 3, Red has a third row ladder from the obtuse corner, even if he plays elsewhere, but no ladder escape. Instead of connecting outright, Red plays 4 to give himself a ladder escape at a distance. Blue can defend the ladder by pushing for a few turns, but it's a mistake to push all the way to the acute corner where Red can escape the ladder. So, Blue jumps at a distance on move 5. Note that Blue deliberately chooses the 3-7 point, which works well against Red's 4.
+
 
+
After Red responds at 6, Blue has several reasonable options. Blue can push the ladder defensively, which Red can't escape outright because of Blue 5, but eventually Red can climb or carry out a complex switchback with the help of 4 and 6 (neither of which are overly strong for Red). Alternatively, Blue can start a fight in the acute corner for territory or ladder escapes. Since this is a joseki, it represents excellent play by both sides without big mistakes, but the exact best continuation will depend on the surrounding board situation.
+
 
+
'''B:''' Interestingly, this move is relatively common on 11&times;11 but not 13&times;13. The usual purpose of this move is to block Red from playing at (+) below. It appears slightly worse than move '''A''', but it's still very playable. Red has many reasonable responses marked (*):
+
 
+
<hexboard size="7x7"
+
  coords="hide"
+
  edges="bottom left"
+
  contents="R d4 B 1:d3 E +:e2 *:(c4 e3 f2)"
+
  />
+
 
+
'''C:''' This move is often effective on smaller boards when Blue has a ladder escape at her acute corner. However, the acute corner is much farther away on 19&times;19, and Blue's 5th row ladder is much less threatening, so Blue gains less from playing this move. Red, who is defending the ladder, usually pushes the ladder by playing at (*) below, or he jumps a couple hexes forward on the 3rd or 5th row (either immediately or after pushing a few times), indicated by (+):
+
 
+
<hexboard size="8x7"
+
  coords="hide"
+
  edges="bottom left"
+
  contents="R d5 B 1:e4 E *:d4 +:(c3 e2)"
+
  />
+
 
+
'''D:''' This blocking move is common on 13&times;13 but less so on 19&times;19. Blue's idea, if Red ignores the threat, is to follow up with this move 2, which is quite strong since it neutralizes Red's 4-4 stone significantly:
+
 
+
<hexboard size="7x7"
+
  coords="hide"
+
  edges="bottom left"
+
  contents="R d4 B 1:e2 2:f3"
+
  />
+
 
+
Indeed, Red usually responds to the threat, and the following sequence is a common joseki on 13&times;13:
+
 
+
<hexboard size="8x7"
+
  coords="hide"
+
  edges="bottom left"
+
  contents="R d5 B 1:e3 R 2:c4 B 3:d2 R 4:e2 B 5:d3 E *:b3 +:b4 -:f3"
+
  />
+
 
+
Red 6 is often at one of (*), (+), or (-). The move (*) allows Red to gain territory, while (+) creates a [[Flank#Capped_flank|capped flank]] that blocks Blue 3rd row ladders under Red's 4-4 stone. It's not obvious to me why, but KataHex tends to think Red is slightly better after this sequence on 19&times;19, so Blue usually doesn't play '''D''' in the first place.
+
 
+
'''E:''' Usually not the best move for Blue. Depending on local tactics, Red should either tenuki, or play one of (*):
+
 
+
<hexboard size="7x7"
+
  coords="hide"
+
  edges="bottom left"
+
  contents="R d4 B 1:f2 E *:(e2 c2)"
+
  />
+
 
+
'''F:''' This 4-2 obtuse corner block is strong on small boards like 11&times;11, but it's rarely a good move on 19&times;19, whether as the first stone in the obtuse corner, or in response to 4-4. There are exceptions &mdash; the 4-2 move works well in combination with a "middle of third row" opening stone, for example. Red would do well to connect directly with 2:
+
 
+
<hexboard size="7x7"
+
  coords="hide"
+
  edges="bottom left"
+
  contents="R d4 B 1:d6 R 2:c6"
+
  />
+
 
+
'''G:''' This block is a "surprise weapon" of sorts &mdash; it's a weak move on an empty board, but for local tactical reasons it can be very strong. The standard example is with the q2 opening, where an unsuspecting Blue who plays 4-4 in response is faced with an unpleasant surprise (more on that later).
+
 
+
<hexboard size="5x5"
+
  coords="hide"
+
  edges="top right"
+
  contents="R c2 B 1:b4 R 2:d3"
+
  />
+
 
+
Move '''G''' is also a threat if Blue already has a stone in either of (*) below.
+
 
+
<hexboard size="7x7"
+
  coords="hide"
+
  edges="bottom left"
+
  contents="R d4 E *:(e5 f6) G:c6"
+
  />
+
 
+
If '''G''' is played, Red should consider blocking the 3rd row ladder at a, or minimaxing at b.
+
 
+
<hexboard size="7x7"
+
  coords="hide"
+
  edges="bottom left"
+
  contents="R d4 B 1:c6 E a:b6 b:c3"
+
  />
+
 
+
'''H:''' Another "surprise weapon," arguably even more so. Anecdotally, when KataHex thinks '''H''' is the best move in a position, it rarely assigns a high policy to the move, only liking the move after some search. In other words, KataHex's policy "intuition" rarely considers the move a top choice, or even top 10, until it realizes that the move works tactically in the particular situation.
+
 
+
<hexboard size="7x7"
+
  coords="hide"
+
  edges="bottom left"
+
  contents="R d4 B 1:b6 E *:d5"
+
  />
+
 
+
This 2-2 obtuse corner move typically works as an unusual minimaxing move, providing ladder escapes for Blue while simultaneously blocking Red and threatening a move like (*).
+
 
+
'''I:''' This move is sometimes played on 13&times;13, but it rarely works on 19&times;19. The standard joseki is favorable to Red, probably because Blue 1 and 5 function mainly as a ladder escape blocker, and ladders/ladder escapes are themselves less important on 19&times;19.
+
 
+
<hexboard size="7x7"
+
  coords="hide"
+
  edges="bottom left"
+
  contents="R d4 B 1:e5 R 2:c4 B 3:c5 R 4:d5 B 5:d6 R 6:b5"
+
  />
+
 
+
'''J:''' Like many other Blue responses, this is a bad move in isolation. Red's 4-4 is already connected to the bottom via [[edge template IV1d]], so Blue attempts to block are futile unless she gets useful territory in exchange (like with '''A'''), but the territory gained by '''J''' is not nearly as good. However, this move can become useful if there are other blue stones present.
+
 
+
<hexboard size="7x7"
+
  coords="hide"
+
  edges="bottom left"
+
  contents="R d4 B 1:d5 R 2:c5"
+
  />
+
 
+
'''K:''' Also a weak response. Can you see why?
+
 
+
<hexboard size="7x7"
+
  coords="hide"
+
  edges="bottom left"
+
  contents="R d4 B 1:e4 R 2:e2"
+
  />
+
 
+
Red 2 is strong, but that's not the only reason why. It turns out that had Blue played 1 first (before Red played the initial 4-4 stone), then a good Red response would be playing at 4-4. Going back to our general principles, it's a bad idea to play a move that would make your opponent's existing stone unnecessarily well-placed relative to yours, and that's exactly what '''K''' does.
+
 
+
===5-5 obtuse corner===
+
 
+
'''TODO'''
+
 
+
==The first move==
+
 
+
See [[Swap_rule#Size_19]] for a swap map.
+
 
+
We'll now go through the general strategy of specific first moves. For simplicity, everything will be from Red's point of view, assuming Blue doesn't swap. Unlike the guides for smaller board sizes, we won't think too hard about ladder escapes or switchbacks, and instead we will just mention some brief notes for some selected openings.
+
 
+
===Acute corner openings===
+
 
+
<hexboard size="5x5"
+
  coords="hide"
+
  edges="top left"
+
  contents="S red:all blue:(a1--e1 a2--e2 a3)
+
            E *:(c2 d3 e3 b4)"
+
  />
+
 
+
The stone in the acute corner affects which moves are locally efficient for Red and Blue.
+
 
+
====c2====
+
 
+
On 13&times;13, b5 or c6, marked with (*) below, are common Red moves that combine well with c2. On 19&times;19, these moves are a bit too close to the corner. Playing a bit further along the b5-c6 diagonal, such as A or B below, is often a better move:
+
 
+
<hexboard size="9x6"
+
 
   coords="show"
 
   coords="show"
  edges="top left"
+
   contents="S red:all blue:(a1--r1 a2--q2 a3 e3--n3 s3)
   contents="R c2 E *:(b5 c6) A:d7 B:e8"
+
              blue:(a17 f17--o17 s17 c18--s18 b19--s19)
 +
            E 65:(d3 p17)
 +
              3:(e3 o17)
 +
              73:(f3 n17)
 +
              76:(g3 m17)
 +
              73:(h3 l17)
 +
              84:(i3 k17)
 +
              90:(j3 j17)
 +
              103:(k3 i17)
 +
              104:(l3 h17)
 +
              49:(m3 g17)
 +
              6:(n3 f17)
 +
              47:(o3 e17)
 +
              59:(p3 d17)
 +
              72:(i4 k16)
 +
              67:(j4 j16)
 +
              81:(k4 i16)
 +
              94:(l4 h16)
 +
              69:(q2 c18)
 +
              96:(b17 r3)
 +
              201:(b18 r2)
 +
              77:(a2 s18)
 +
              67:(b2 r18)
 +
              56:(c2 q18)
 +
              100:(a3 s17)
 +
              137:(b3 r17)
 +
              157:(c3 q17)
 +
              83:(a4 s16)
 +
              73:(b4 r16)
 +
              136:(a5 s15)
 +
              93:(a6 s14)
 +
              95:(a7 s13)
 +
              131:(a8 s12)
 +
              99:(a9 s11)
 +
              41:(a10 s10)
 +
              81:(a11 s9)
 +
              115:(a12 s8)
 +
              78:(a13 s7)
 +
              56:(a14 s6)
 +
              17:(a15 s5)
 +
              57:(a16 s4)
 +
              110:(a17 s3)
 +
              174:(a18 s2)
 +
              56:(a19 s1)
 +
              382:(e10 o10)"
 
   />
 
   />
  
====b4====
+
==Random unsolved questions==
  
Under the right circumstances, Blue c2 (followed by Red tenuki) can be a good local response, though this happens less in the early opening.
+
Most of these are very difficult to answer, and I would be happy if even a few were answered in the next few years:
  
====e3====
+
* Is the obtuse corner always winning on larger board sizes? What about the b4 opening? Let P(n) be the statement that "the obtuse corner is a winning opening in n&times;n Hex without swap." There are a few possible cases; an interesting exercise is to come up with subjective probabilities of each case being true.
 +
** A. P(n) is always true. If so, can we prove this?
 +
** B. P(n) is true for infinitely many n, with finitely many counterexamples. If so, what's the smallest counterexample?
 +
** C. P(n) is true for infinitely many n, with infinitely many counterexamples. If so, does P(n) hold "almost always," "almost never," or somewhere in between?
 +
** D. P(n) is true for finitely many n. If so, what's the largest such n?
 +
* Kriegspiel Hex (Dark Hex), a variant with incomplete information
 +
** Under optimal mixed strategies, what is Red's win probability on 4&times;4?
 +
** For larger boards (say, 19&times;19), is Red's win probability close to 50%?
 +
*** If so, a swap rule might not be needed for Kriegspiel Hex, which would be neat.
 +
*** If not, imagine a variant where Red's first move is publicly announced to both players, and Blue has the option to swap it. Which initial moves are the fairest now?
  
e3 is notable because KataHex thinks it's the fairest opening with the swap rule, with KataHex assigning a 49.2% win percentage for Blue, assuming no swap, after 100k visits.
 
  
===First column openings===
+
replies by [[User:Demer|Demer]]:
  
If Red starts with a move near the middle of his first column, like a10, a good followup for Red is to play one of the hexes marked A or B, or sometimes C (or both). These moves combine very efficiently with the opening stone to split up Blue's edge. KataHex nearly always plays one of these in the early opening.
+
* https://zhuanlan.zhihu.com/p/476464087 has percentages, although it doesn't translate these into a guessed swap map and I don't know anything about the bot they came from.
 +
**​ It suggests that [on 13x13, g3 is the most balanced opening] and [on 14x14, g3 should not be swapped].
 +
** On 27x27 without swap, it likes the 4-4 obtuse corner opening slightly more than anything else nearby.
 +
* As far as I'm aware, even 3&times;4 Dark Hex has not been solved. ​ (https://content.iospress.com/articles/icga-journal/icg180057 apparently gives "some preliminary results" for that size.)
  
<hexboard size="7x5"
+
hexanna:
  coords="hide"
+
  edges="left"
+
  contents="R a4 E A:b5 B:c6 C:b2"
+
  />
+
  
If Red plays at A or C, Blue often peeps in Red's bridge, as follows. Red typically responds at one of the hexes marked (*) or elsewhere, instead of defending the bridge.
+
* Thank you, this is amazing! From the Google Translate, the bot is an adaptation of KataGo trained on 13&times;13 and smaller, using transfer learning to train larger nets on top of the 13&times;13 net for a short period of time. I may edit the [[swap rule]] article later with some insights.
 +
** The results for up to 15&times;15 look very reliable to me. This is because many of the subtle patterns suggested by other bots, like leela_bot, appear in these swap maps. For example, on [https://pic3.zhimg.com/v2-53e66f72eb7129d5ffe676ae293ad856_r.jpg 13&times;13]:
 +
*** a1&ndash;c1 are stronger than d1; a2&ndash;c2 &ge; d2 &ge; e2 in strength; and a similar relation holds for moves on the third row. See [[Openings on 11 x 11#d2]].
 +
*** b4 is weaker than all of its neighbors, because Blue can fit the ziggurat in the corner.
 +
*** j3 is surprisingly weak and i3 is surprisingly strong. Many people were surprised about this when leela_bot's swap map came out, but the result may be more than just random noise.
 +
*** a10 is the weakest of a4&ndash;a10, while a5 is the strongest.
 +
*** b10 is stronger than all of its neighbors, because Blue cannot fit the ziggurat in the obtuse corner.
 +
** That this bot picked up on all these subtleties, and assigns a win percentage close to 100% for most moves on 13&times;13, suggest to me that it is probably stronger than leela_bot and gzero_bot. I can't know for sure, though.
 +
** On the other hand, and the author seems to agree, the 37&times;37 map looks very unreliable. I see percentages as low as 37% but only as high as 54% (for a move like f1, which should almost certainly be a losing move).
 +
** The 27&times;27 map looks more reliable. I'm personally very skeptical that moves on Red's 6th row are among the most balanced moves, but there are some interesting (if somewhat noisy) insights to be had still.
  
<hexboard size="7x5"
+
==Recursive swap==
  coords="hide"
+
Not really a serious suggestion, just for fun. One advantage of "recursive swap" over multi-stone swap is that opening preparation plays a smaller role, because both players have control over the first n stones.
  edges="left"
+
  contents="R a4 1:b5 B 2:b4 E *:(b2 c6)"
+
  />
+
  
====a10&ndash;a15====
+
RECURSIVE_SWAP'[k, depth, color]:
 +
  if depth = 0:
 +
    [color] continues playing as normal.
 +
  else:
 +
    [color] plays a move. [~color] can either
 +
      swap[k], or
 +
      RECURSIVE_SWAP'[k+1, depth-1, ~color]
 +
 +
RECURSIVE_SWAP[n]:
 +
  RECURSIVE_SWAP'[1, n, Red]
  
Some of the fairer openings in this category are a10, a14, a15. Blue's best response to a10&ndash;a15 in the obtuse corner is usually 4-4, but there's no rush to play it:
+
RECURSIVE_SWAP[0]:
  
<hexboard size="7x6"
+
Red continues playing as normal.
  coords="hide"
+
  edges="bottom left"
+
  contents="R a2 B 1:d4"
+
  />
+
  
On 19&times;19, a15 is weaker than it looks, because the 4-2 obtuse corner, marked (*) below, is less potent for Red than on smaller boards:
+
RECURSIVE_SWAP[1]:
  
<hexboard size="6x5"
+
Red plays a move. Blue can either
  coords="hide"
+
* swap, or
  edges="bottom left"
+
* continue playing as normal.
  contents="R a2 E *:b3"
+
  />
+
  
====a16====
+
RECURSIVE_SWAP[2]:
  
a16 is also a relatively fair opening. Blue can play 2-2 obtuse corner like on smaller boards, but it's less clearly the best option. The 4-4 obtuse corner also works, and if Blue instead waits for Red to play 1 as follows, then Blue 2 is a strong response.
+
Red plays a move. Blue can either
 +
* swap, or
 +
* play a move, after which Red can either
 +
** swap2, or
 +
** continue playing as normal.
  
<hexboard size="7x5"
+
RECURSIVE_SWAP[3]:
  coords="hide"
+
  edges="bottom left"
+
  contents="R a4 1:b2 B 2:b5"
+
  />
+
  
===Obtuse corner openings===
+
Red plays a move. Blue can either
 +
* swap, or
 +
* play a move, after which Red can either
 +
** swap2, or
 +
** play a move, after which Blue can either
 +
*** swap3, or
 +
*** continue playing as normal.
  
There are several openings that affect play in the obtuse corner, but they are quite different from each other so we'll consider them separately.
+
===Analysis===
 +
RECURSIVE_SWAP[0] is the same as playing with no swap.
  
====a19====
+
RECURSIVE_SWAP[1] is the same as playing with the swap rule.
  
A common joseki for Red is to play at 1, which is basically the 4-4 opening shifted up one row. Blue often responds at 2, and Red has a couple good responses marked (*):
+
RECURSIVE_SWAP[2]:
 +
* Red shouldn't play a move that's too strong or it'll be swapped.
 +
* If Red plays a weak stone, Blue should try to play a move just strong enough that Red will be indifferent to swap2. (If a "fair" move is half a stone, and Red plays a weak move worth x < 0.5 stones, Blue should play a move worth x + 0.5 stones.)
 +
* Red should try to play a weak move that's also hard for Blue to equalize (so that Red gets a sizable advantage when deciding whether to swap2 or not).
  
<hexboard size="6x6"
+
RECURSIVE_SWAP[3]:
  coords="hide"
+
* If Red plays a move worth x > 0.5 stones, Blue should swap.
  edges="bottom left"
+
* If Red plays a weak stone worth x < 0.5, Blue should play a move worth less than x + 0.5 (or else Red will swap2). If Blue's move is worth y, then Red should play a move as close to (y - x) + 0.5 as possible, so that Blue's swap3 decision is difficult.
  contents="R a6 1:d2 B 2:c4 E *:(b4 c1)"
+
* Red should play a weak move that's hard for Blue to find a tricky reply to (where a "tricky" reply is one that makes it hard for Red to equalize, such that Blue has an easy time deciding whether to swap3 or not).
  />
+
  
My subjective opinion is that this is the most beginner-friendly opening:
+
Miscellaneous:
 +
* Infinite recursive swap is (under perfect play) strategically equivalent to Reverse Hex, because each player must try to play a losing move as long as possible, or else their opponent will swap and win.
 +
* On any board size, assuming the opponent has the swap option after the board is completely filled, I believe RECURSIVE_SWAP[n] is a win for Red if n is even, and a win for Blue if n is odd.
 +
** I'm bad at proving things rigorously, but I think this follows from the fact that Reverse Hex is barely a win for the winning side (in that the losing side can delay the loss until the whole board is filled).
  
* A beginner who opens with Red c2 could accidentally play b3 instead, or alternatively his opponent who wishes to swap Red c2 could implement swap-pieces incorrectly and replace it with Blue c2 instead of b3. Though a19 should technically be swapped to s1 under the swap-pieces convention, it doesn't really matter.
+
----
 +
HexWorld bugs:
  
* Aesthetically, a19 retains the "most" symmetry of any fair opening. Beginners who don't want to think about the swap rule could play Hex without swap, where Red must open in an obtuse corner, and such a ruleset would be quite elegant and still balanced, even on large boards.
+
On 30x30, ad6 and ad11 are "dead" hexes that you can't click on. They don't show up even if you specify them in the url: [https://hexworld.org/board/#30,ad1ad2ad3ad4ad5ad6ad7ad8ad9ad10ad11ad12 here]. All other hexes look fine.
  
* For beginners who don't want to learn too much opening theory, "obtuse corner" is easy to remember and a good [https://en.wikipedia.org/wiki/Focal_point_(game_theory) Schelling point]. It's relatively likely that other beginners who look at the swap map and just want to try a random opening will pick a19 or s1.
+
On 31x31, the same clicking and url issue occurs for ad6, ad11, and ad31: [https://hexworld.org/board/#31,ad5ad6ad7ad11ad31ae1 here]
  
====q2====
+
: Interesting. It turns out that this bug is caused by an ad blocker, in my case Adblock Plus, although Comonoid reproduced it with AdGuard as well. The ad blocker doesn't like column 30 because its name is "ad". It adds the following CSS rules, among thousands of others:
  
If Red opens q2, the most important advice for Blue is to refrain from playing 4-4 in the nearby obtuse corner, because of Red's strong response:
+
  ad6 {display: none !important;}
 +
  ad11 {display: none !important;}
 +
  ad31 {display: none !important;}
  
<hexboard size="7x6"
+
: That's why those 3 cells are disabled, and no others! I will fix the bug soon.
  coords="hide"
+
  edges="top right"
+
  contents="R d2 B 1:c4 R 2:e3 B 3:d5 R 4:f4 B 5:e6 R 6:d6 B 7:e5 R 8:c5 B 9:d4"
+
  />
+
  
====b17====
+
: By the way, your HexWiki user page might not be the most efficient place to report a bug. [[User:Selinger|Selinger]] ([[User talk:Selinger|talk]]) 22:21, 20 April 2024 (UTC)
  
For the adventurous, while b17 should be swapped, it is weaker than it looks and quite playable. It's not overly strong, because Blue can play b18, either immediately or later. I consider it the obtuse-corner analog of b4, which is surprisingly weak because of the threat of Blue c2.
+
----
  
<hexboard size="5x5"
+
[[User:Fjan2ej57w|Fjan2ej57w]]'s question 7, "how much space of an empty board would be filled if both sides play optimally":
  coords="hide"
+
  edges="bottom left"
+
  contents="R b3 B 1:b4"
+
  />
+
  
===Third and fourth row openings===
+
[https://mathoverflow.net/questions/302821/length-of-optimal-play-in-hex-as-a-function-of-size Stack Overflow answer] for reference. My conjecture is that Hex without swap asymptotically requires Θ(n^2) cells, and more generally, a Demer handicap of Θ(f(n)) stones requires Θ(n^2/f(n)) cells, for all f(n) between Θ(1) and Θ(n). My intuition is that on 1000000&times;1000000 Hex, the first-player advantage is minuscule, and even a handicap of n^(1/2) = 1000 stones, say spaced out evenly across the short diagonal, would require on the order of "1000 columns and 1000000 rows", n^(3/2), to convert to a final connection. Another interesting question is to find a constructive winning strategy with an o(n) (sub-linear) handicap.
 
+
According to KataHex, the fairest openings in this category are e3 (mentioned above), n3, and p3.  
+
 
+
Openings in the middle of Red's 4th row are surprisingly playable, but most people prefer not to have their opening stone swapped, and playing against a 4th row opening stone can seem daunting, so a 3rd row opening is often preferable. If you strongly prefer having the first stone, or you think your opponent is overly eager to swap, you can play a weaker opening like g3 or h3.
+
 
+
Third row openings, especially those near an obtuse corner (except p3), tend to combine well with the 4-2 obtuse corner move:
+
 
+
<hexboard size="5x7"
+
  coords="hide"
+
  edges="top right"
+
  contents="R b3 1:f4"
+
  />
+
  
[[category: Opening]]
+
reply by [[User:Demer|Demer]]: ​ ​ ​ ​ ​ ​ ​ Even one with ​ n/6 - ω(1) ​ handicap would be interesting. ​ ​ ​ (improving on ​ https://webdocs.cs.ualberta.ca/~hayward/papers/handicap.pdf )
[[category: Advanced Strategy]]
+

Latest revision as of 00:41, 8 May 2024

Openings on 19 x 19

Strategic advice from KataHex

I started learning Hex mid-July of 2021, about 2 weeks before I created my LittleGolem account.

katahex/general strategy part 2 (rough draft)

This is not very organized, and some bullet points won't make sense without further context. I also need to decide which ideas are worth keeping. (I have outlines and rough drafts of even more stuff, but I'm worried about making the article too long and diluting it with only rarely-applicable advice.)

  • Don't worry about switchbacks, climbing, or ladder creation templates on 15x15 or larger. They can be theoretically interesting and make for good puzzles, but games are rarely close enough for these to matter. Controversially, I personally don't think about them on any board size.
  • Q: When should the defender of a ladder yield? A: Usually, don't yield unless your opponent can make an adjacent cut (defined below) through two of your stones, one above and one below the ladder. In that case, consider yielding.
  • If you can't find a good move, avoid a bad one by playing "skew" relative to existing stones.
    • That is, play a move that interacts with existing stones as little as possible (at least distance 3 from all other stones).
    • The difference between a good move and a blunder is >5x the difference between a great move and a good move.
  • Stone "arithmetic": not an exact science, use your intuition; play the move that maximizes the sum of local and global efficiency. I am not actually calculating values when playing, just making mental adjustments.
    • The best move locally is rarely the best move globally. Hex is a game of concessions and tradeoffs. There is no "free lunch," unless you count concepts like inferiority/domination.
    • Conversely, if it looks like your opponent is beating you on one side of the board, there are two possibilities:
      • You played suboptimal moves in that region.
      • Your opponent played too strong in that area, which necessarily means they made concessions elsewhere (usually the opposite side of the board).
    • If the first option is true, you are probably losing anyways, so assume (or hope) the second is true. That means you should tend to tenuki and play the opposite side of the board, if you think your opponent overplayed one side. Indeed, if you continue playing on the same side, your opponent might be able to get out of their mistake by minimaxing, such that they go from being overconnected to being merely connected.
  • For brevity, some notation for up-weighting and down-weighting particular moves:
    • chess notation: ??/?/?!/!?/!
    • one way to think about it: you are a machine who has to assign a score (or a prior policy probability) to each move. !? means slightly upweight, ! means upweight, ?? means strongly downweight, and so on.
    • asymmetric scale, one blunder can take multiple "great" moves to recover from; also, brilliancies (!!) are rare and don't come from easily described rules like the ones in this article
  •  !? bridge moves, either from your own stone or your opponent's
    • an additional !? if it's part of a bridge ladder that you'll win (you're playing 5-4 acute corner), ?! if your opponent will win
  •  ? moves adjacent to your own stone, unless you are minimaxing and know that it's the best move. Be careful of bad minimaxing, where you connect too weakly to one side, allowing your opponent to intrude for territory. More often than not, the concession you make here isn't worth the extra strength.
  • Cuts (ignore the edges of the board, pretend it's 5 separate diagrams): https://hexworld.org/board/#19c1,e3f3f4e4i3:pk3j3n3p2q3o4e8:pg10f9m8:pn10o8
    • Suggested names for brevity (from left to right, then top down): adjacent cut, near cut, short bridge cut (or just bridge cut), long bridge cut, skew cut
    •  ? allowing an adjacent cut
    •  ?? allowing a bridge cut, ! bridge cutting
      • if Red allows a bridge cut, often the damage has already been done even if Blue doesn't actually cut through
      • however, if Blue has to make concessions to cut through, like playing on her second or third row, that often neutralizes the ?? almost entirely - this is especially true if Blue already has an existing stone close to her edge (like a swapped c2 opening).
  • Small patterns/motifs: https://hexworld.org/board/#19c1,f4f5e5:pk4j6i5:po4n7f12f15n11l15
    • "In a vacuum" means "with no nearby stones"
    • P1 (top-left): It's a mistake for Blue to play adjacent to the Blue stone in a vacuum. Red's best response is usually playing adjacent to both stones.
    • P2 (top-middle): Blue plays a bridge away from Red's stone. This is often a good move, and Red's response a bridge away from both stones is also good.
    • P3 (top-right): Blue plays a classic block. This is often fine for Blue, and Red doesn't have an obvious best local response. Red could tenuki here.
    • P4 (bottom-left): The main intuition to learn is that Red e14 (a bridge away) is ? on the chess notation scale.
    • P5 (bottom-right): Blue plays two bridge moves away. Again, Red m13 a bridge away is ? on the scale.
  • If you study KataHex play, you can pick up by intuition what moves to play in 50-75% of situations. The hard part is figuring out what not to play in the other situations.
    • Depth 1: Don't play moves that allow your opponent to cut through. (Also, already mentioned in Strategic advice from KataHex, "Don't play a move that makes your opponent's existing stones unnecessarily well-placed relative to your new stone.")
    • Depth 2: Don't play moves where an otherwise natural continuation for you is to play a move pruned by depth 1.
  • Use the patterns and intuitions that you know, to reason and make inferences in unfamiliar positions. You might not always find the best move, but you can often prune bad moves. Here is an extended example, involving several closely related patterns that are useful to know in isolation.
    1. Pattern: If you play the 4-4 3-3 obtuse corner joseki, it is important to know that Blue 6 here is weak: https://hexworld.org/board/#19nc1,d16c17d17c18d18e14c15
      • This is because Red 7 undermines Blue 6 and also reduces Blue 2/4 from a 3rd row ladder escape to a 2nd row escape. Also, Blue's potential intrusion at c16 doesn't gain her anything.
      • Instead, a good local response for Blue is as follows: https://hexworld.org/board/#19nc1,d16c17d17c18d18d15. This gives Blue a 5th row ladder escape while blocking Red 1.
      • On the other hand, if Blue only has a 2nd row escape and doesn't have the "potential energy" to get a 3rd row escape, you might guess that Blue 6 above becomes a good local move, because Red 7 loses one of its main strengths. Such a guess would be correct: https://hexworld.org/board/#19nc1,d16c17p15d17e16g16e17f18d18e14c15 Blue 10 is a strong move here. On the other hand, Blue 10 at d15 would be weak here, as it's quite wasteful, only converting a 2nd row escape into a 3rd row escape.
    2. Pattern: If Red tenukis on move 3, then Blue 4 is locally strong here: https://hexworld.org/board/#19nc1,d16e14:pf15. In particular, Blue 4 is much stronger than bridging directly towards Blue's own edge with g13, because the former is a strong blocking move that reduces the effectiveness of Red 1. This strength is in spite of Red's intrusion on move 5. (I first saw this move in https://www.littlegolem.net/jsp/game/game.jsp?gid=2090091&nmove=16 from https://www.littlegolem.net/jsp/forum/topic2.jsp?forum=50&topic=739.)
      • This pattern is actually applicable in many situations and is an example of pattern P2 (top-middle) above. If Red started with the 5-5 obtuse corner, then the equivalent Blue 4 is also strong.
      • Another simple example is Red 5 in https://hexworld.org/board/#19nc1,d16d15f14:pe13.
    3. Inference: Let us consider this position again: https://hexworld.org/board/#19nc1,d16c17d17c18d18:p. Suppose Blue tenukis on move 6. What is a good local response for Red on move 7? There is more than one right answer, but you just need to find one move that isn't a blunder.
      • Hint: Use the two patterns above to come up with an answer.
      • Hint: Consider that Blue has a 3rd row ladder escape, so Blue d15 is locally strong but Blue e14 is weak. This is the case for future blue stones in this local region, even though Blue already played elsewhere on move 6. Therefore, Red should perhaps try to play a move that makes Blue d15 less attractive, even if it comes at the concession of making Blue e14 more attractive (since the latter is a priori a weak move, such a concession gives up less than it otherwise might).
      • Answer: Red 7 here is a good local move: https://hexworld.org/board/#19nc1,d16c17d17c18d18:pe13
        • Why? Ignoring stones 2-5, the presence of Red 1 and 7 makes Blue e14 more attractive. Red's 4-4 stone, much like the obtuse corner opening, tends to shift Blue's efficient stone locations up one row. With that in mind, Red's move 7 is a bit like Red e14 on an empty board, where Blue e15 is the best response: https://hexworld.org/board/#19nc1,e14e15. However, stones 2-5 make Blue e14 a bad move, despite Red 7 making it slightly less bad (this is the concession-but-not-really-a-concession that Red intended).
        • Let's now consider Blue d15. Normally a decent local move after stones 1-5, it becomes quite weak after Red 7, because of https://hexworld.org/board/#19nc1,d16c17d17c18d18:pe13d15f14. This is a typical example of the second pattern in this extended example. (Actually, if Blue had two moves in a row in this region, Blue 8 wouldn't be so bad because she could follow up with f14, where Red wants to play move 9. This is a tactical situation where it's bad for Red to tenuki.)
        • If we wanted to be complete, Blue actually has another option for move 8, f14 first which threatens d15: https://hexworld.org/board/#19nc1,d16c17d17c18d18:pe13f14d15d14e14. This is an example of the "skew cut" from above. Red should respond with d15 himself, or else Blue can play d15. This is probably Blue's best local response.
        • Every move makes a concession, but some concessions are more effective than others. As alluded to in the hint, Red 7 weakens a strong Blue reply (d15) while strengthening a weak Blue reply (e14). Red's goal is to minimize the strength of Blue's best response (rather than the strength of Blue's average response), and Red 7 at e13 accomplishes that beautifully.
    • Part of getting stronger at Hex (as with other games) is being able to compress knowledge and patterns effectively. If you understand this extended example, you can infer the best move in many similar but novel situations, without memorizing each one individually. If you forget which move is exactly the best, you can recover the right move with high probability by just reasoning about related patterns that you do know are strong or weak.
    • On larger boards and particularly near the opening or middlegame, when you have a lot of time to think about a position, it may be worth spending a good chunk of it making inferences and scoping out moves that are either good or to be avoided by each side, rather than spending most of your time calculating tons of lines and variations.
    • The a3 escape trick example from Strategic advice from KataHex is another case of this concept.

Insights and tidbits from KataHex (hzy's bot)

  • katahex_model_20220618.bin.gz (I'll call this the "strong" net) appears significantly stronger than the "default" net.
  • Swap map for 19×19 generated with the strong net, with around 15k visits for most moves. For the red hexes, the number corresponds to Blue's Elo advantage if she swaps Red's move; for the blue hexes, the number corresponds to Blue's Elo advantage if she does not swap Red's move. Smaller numbers correspond to fairer openings. Includes all fair openings as well as a few selected unfair openings, including the strongest move without swap (e10). I used more visits for the fairest moves: 1000k for e3 (49.5% win rate), 500k for n3 (49.2%), 100k for a15 (52.5%).
    • Key takeaways: The swap map at Swap rule#Size 19 uses data that is almost certainly from the "weak" net. Compared to the weak net, the strong net notably thinks a19, n3—p3, and k4—l4 are stronger. I personally trust the strong net's evaluations more; I think it's dubious that the weak net thought l4 was a very fair opening. The nets disagree on whether e3 is winning or losing, though it's so close to 50% that the difference isn't meaningful.
abcdefghijklmnopqrs123456789101112131415161718195677675669201174100137157653737673849010310449647599611083737267819457136179356957813111599814138238241819911513178955693171365794816772738311096594764910410390847376733651571371001742016956677756

Random unsolved questions

Most of these are very difficult to answer, and I would be happy if even a few were answered in the next few years:

  • Is the obtuse corner always winning on larger board sizes? What about the b4 opening? Let P(n) be the statement that "the obtuse corner is a winning opening in n×n Hex without swap." There are a few possible cases; an interesting exercise is to come up with subjective probabilities of each case being true.
    • A. P(n) is always true. If so, can we prove this?
    • B. P(n) is true for infinitely many n, with finitely many counterexamples. If so, what's the smallest counterexample?
    • C. P(n) is true for infinitely many n, with infinitely many counterexamples. If so, does P(n) hold "almost always," "almost never," or somewhere in between?
    • D. P(n) is true for finitely many n. If so, what's the largest such n?
  • Kriegspiel Hex (Dark Hex), a variant with incomplete information
    • Under optimal mixed strategies, what is Red's win probability on 4×4?
    • For larger boards (say, 19×19), is Red's win probability close to 50%?
      • If so, a swap rule might not be needed for Kriegspiel Hex, which would be neat.
      • If not, imagine a variant where Red's first move is publicly announced to both players, and Blue has the option to swap it. Which initial moves are the fairest now?


replies by Demer:

  • https://zhuanlan.zhihu.com/p/476464087 has percentages, although it doesn't translate these into a guessed swap map and I don't know anything about the bot they came from.
    • ​ It suggests that [on 13x13, g3 is the most balanced opening] and [on 14x14, g3 should not be swapped].
    • On 27x27 without swap, it likes the 4-4 obtuse corner opening slightly more than anything else nearby.
  • As far as I'm aware, even 3×4 Dark Hex has not been solved. ​ (https://content.iospress.com/articles/icga-journal/icg180057 apparently gives "some preliminary results" for that size.)

hexanna:

  • Thank you, this is amazing! From the Google Translate, the bot is an adaptation of KataGo trained on 13×13 and smaller, using transfer learning to train larger nets on top of the 13×13 net for a short period of time. I may edit the swap rule article later with some insights.
    • The results for up to 15×15 look very reliable to me. This is because many of the subtle patterns suggested by other bots, like leela_bot, appear in these swap maps. For example, on 13×13:
      • a1–c1 are stronger than d1; a2–c2 ≥ d2 ≥ e2 in strength; and a similar relation holds for moves on the third row. See Openings on 11 x 11#d2.
      • b4 is weaker than all of its neighbors, because Blue can fit the ziggurat in the corner.
      • j3 is surprisingly weak and i3 is surprisingly strong. Many people were surprised about this when leela_bot's swap map came out, but the result may be more than just random noise.
      • a10 is the weakest of a4–a10, while a5 is the strongest.
      • b10 is stronger than all of its neighbors, because Blue cannot fit the ziggurat in the obtuse corner.
    • That this bot picked up on all these subtleties, and assigns a win percentage close to 100% for most moves on 13×13, suggest to me that it is probably stronger than leela_bot and gzero_bot. I can't know for sure, though.
    • On the other hand, and the author seems to agree, the 37×37 map looks very unreliable. I see percentages as low as 37% but only as high as 54% (for a move like f1, which should almost certainly be a losing move).
    • The 27×27 map looks more reliable. I'm personally very skeptical that moves on Red's 6th row are among the most balanced moves, but there are some interesting (if somewhat noisy) insights to be had still.

Recursive swap

Not really a serious suggestion, just for fun. One advantage of "recursive swap" over multi-stone swap is that opening preparation plays a smaller role, because both players have control over the first n stones.

RECURSIVE_SWAP'[k, depth, color]:
  if depth = 0:
    [color] continues playing as normal.
  else:
    [color] plays a move. [~color] can either
      swap[k], or
      RECURSIVE_SWAP'[k+1, depth-1, ~color]

RECURSIVE_SWAP[n]:
  RECURSIVE_SWAP'[1, n, Red]

RECURSIVE_SWAP[0]:

Red continues playing as normal.

RECURSIVE_SWAP[1]:

Red plays a move. Blue can either

  • swap, or
  • continue playing as normal.

RECURSIVE_SWAP[2]:

Red plays a move. Blue can either

  • swap, or
  • play a move, after which Red can either
    • swap2, or
    • continue playing as normal.

RECURSIVE_SWAP[3]:

Red plays a move. Blue can either

  • swap, or
  • play a move, after which Red can either
    • swap2, or
    • play a move, after which Blue can either
      • swap3, or
      • continue playing as normal.

Analysis

RECURSIVE_SWAP[0] is the same as playing with no swap.

RECURSIVE_SWAP[1] is the same as playing with the swap rule.

RECURSIVE_SWAP[2]:

  • Red shouldn't play a move that's too strong or it'll be swapped.
  • If Red plays a weak stone, Blue should try to play a move just strong enough that Red will be indifferent to swap2. (If a "fair" move is half a stone, and Red plays a weak move worth x < 0.5 stones, Blue should play a move worth x + 0.5 stones.)
  • Red should try to play a weak move that's also hard for Blue to equalize (so that Red gets a sizable advantage when deciding whether to swap2 or not).

RECURSIVE_SWAP[3]:

  • If Red plays a move worth x > 0.5 stones, Blue should swap.
  • If Red plays a weak stone worth x < 0.5, Blue should play a move worth less than x + 0.5 (or else Red will swap2). If Blue's move is worth y, then Red should play a move as close to (y - x) + 0.5 as possible, so that Blue's swap3 decision is difficult.
  • Red should play a weak move that's hard for Blue to find a tricky reply to (where a "tricky" reply is one that makes it hard for Red to equalize, such that Blue has an easy time deciding whether to swap3 or not).

Miscellaneous:

  • Infinite recursive swap is (under perfect play) strategically equivalent to Reverse Hex, because each player must try to play a losing move as long as possible, or else their opponent will swap and win.
  • On any board size, assuming the opponent has the swap option after the board is completely filled, I believe RECURSIVE_SWAP[n] is a win for Red if n is even, and a win for Blue if n is odd.
    • I'm bad at proving things rigorously, but I think this follows from the fact that Reverse Hex is barely a win for the winning side (in that the losing side can delay the loss until the whole board is filled).

HexWorld bugs:

On 30x30, ad6 and ad11 are "dead" hexes that you can't click on. They don't show up even if you specify them in the url: here. All other hexes look fine.

On 31x31, the same clicking and url issue occurs for ad6, ad11, and ad31: here

Interesting. It turns out that this bug is caused by an ad blocker, in my case Adblock Plus, although Comonoid reproduced it with AdGuard as well. The ad blocker doesn't like column 30 because its name is "ad". It adds the following CSS rules, among thousands of others:
 ad6 {display: none !important;}
 ad11 {display: none !important;}
 ad31 {display: none !important;}
That's why those 3 cells are disabled, and no others! I will fix the bug soon.
By the way, your HexWiki user page might not be the most efficient place to report a bug. Selinger (talk) 22:21, 20 April 2024 (UTC)

Fjan2ej57w's question 7, "how much space of an empty board would be filled if both sides play optimally":

Stack Overflow answer for reference. My conjecture is that Hex without swap asymptotically requires Θ(n^2) cells, and more generally, a Demer handicap of Θ(f(n)) stones requires Θ(n^2/f(n)) cells, for all f(n) between Θ(1) and Θ(n). My intuition is that on 1000000×1000000 Hex, the first-player advantage is minuscule, and even a handicap of n^(1/2) = 1000 stones, say spaced out evenly across the short diagonal, would require on the order of "1000 columns and 1000000 rows", n^(3/2), to convert to a final connection. Another interesting question is to find a constructive winning strategy with an o(n) (sub-linear) handicap.

reply by Demer: ​ ​ ​ ​ ​ ​ ​ Even one with ​ n/6 - ω(1) ​ handicap would be interesting. ​ ​ ​ (improving on ​ https://webdocs.cs.ualberta.ca/~hayward/papers/handicap.pdf )