Difference between revisions of "User:Hexanna"

From HexWiki
Jump to: navigation, search
(rough draft of more katahex strategy)
m (typo)
 
(42 intermediate revisions by the same user not shown)
Line 5: Line 5:
 
I started learning Hex mid-July of 2021, about 2 weeks before I created my LittleGolem account.
 
I started learning Hex mid-July of 2021, about 2 weeks before I created my LittleGolem account.
  
==katahex/general strategy part 2 (rough draft)==
+
[[PlayHex]] > Settings > Shading pattern > Custom > <code>t = (2*row + 3*col) % 7; (t==0 ? 0 : (3^t % 7))/6</code>
* When playing near the opponent's 5th row:
+
** Bridging is efficient
+
*** If the opponent has played 4-4, bridge towards the center (like e10->f11)
+
** Stones 3 apart are efficient
+
* Hammock template is inefficient
+
** If you have three stones like this: https://hexworld.org/board/#19,i9:ph11:pk9, usually don't try to make a hammock.
+
** If there are no opponent stones nearby, you should probably tenuki and not make a template at all.
+
** If there are nearby opponent stones, you might make the box, trapezoid, shopping cart, scooter, or bicycle.
+
*** Be mindful of the potential intrusion points when thinking about which template to make; there are tradeoffs. The bicycle is bigger than the trapezoid, but it's also weaker and allows intrusion.
+
* Don't worry about switchbacks, climbing, 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.
+
* Most people spend too much time calculating various lines, especially in the opening
+
* 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.
+
  
* 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.
+
==draft of more strategy stuff==
** 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:
+
There's a fair amount of stuff for [[Strategic advice from KataHex]] that I've either been too lazy to write up / polish, or haven't thought of a good way to explain. I also haven't properly conveyed which things are important; some things come up rarely and should either be mentioned briefly or cut for the article. There's also a tradeoff in generality/specificity and concreteness/abstractness.
** 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
+
I need a lot more concrete examples, but it's hard to come by truly instructive examples (or know what people find useful)
** 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 (but by no means always), the concession you make here isn't worth the extra strength.
+
  
* Cuts: https://hexworld.org/board/#19c1,e3f3f4e4i3:pk3j3n3p2q3o4e8:pg10f9m8:pn10o8
+
It's a good idea to first study patterns in a '''vacuum''', meaning in the absence of nearby stones. This provides a useful baseline when evaluating a move. Local patterns can occur in "open" areas (areas far away from corners/edges, whether in a vacuum or not) as well as near corners/edges. Let's start with open patterns.
** 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:po4n7f10f13m10k14
+
<hexboard size="3x3"
** "In a vacuum" means "with no nearby stones"
+
  float="inline"
** 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.
+
  edges="none"
** 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.
+
  coords="none"
** 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.
+
  contents="R b1 c1 B -:b2 a3 E *:c2"
** P4 (bottom-left): The main intuition to learn is that Red e12 (a bridge away) is ? on the chess notation scale.
+
/>
** P5 (bottom-right): Blue plays two bridge moves away. Again, Red l12 a bridge away is ? on the scale.
+
<hexboard size="3x4"
 +
  float="inline"
 +
  edges="none"
 +
  coords="none"
 +
  contents="R a2 c1 d2 B b3 S b1 b2 c2 d1"
 +
/>
 +
<hexboard size="3x4"
 +
  float="inline"
 +
  edges="none"
 +
  coords="none"
 +
  contents="R a3 c2 B d1 S b2 b3 E *:(c1 d2)"
 +
/>
 +
<hexboard size="3x4"
 +
  float="inline"
 +
  edges="none"
 +
  coords="none"
 +
  contents="R a2 b3 B b1 S b2 a3 E *:(a1 d2)"
 +
/>
  
* 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.
+
In these patterns, the shaded cells are expected to be empty.
** Depth 1: Don't play moves that allow your opponent to cut through.
+
* Pattern 1 is strong for Red (and weak for Blue), because Red threatens to play at (*) to kill the blue stone at (-). Even if Red hasn't played (*), the pattern is still weak for Blue, because the effectiveness of (-) is hindered by the other blue stone.
** Depth 2: Don't play moves where an otherwise natural continuation for you is to play a move pruned by depth 1.
+
** This pattern frequently happens near the obtuse corner, as a result of bad minimaxing. In the first example below, Blue 3 is a common, but misguided, attempt at minimaxing. However, it's a mistake, and Red 4 (which creates the pattern) is the best reply. This position is weak for Blue ''even though Red does not plan to play (*)'' (as it is too close to his own edge) &mdash; Blue 3 hinders Blue 1, and the damage has already been done. In the second example, Blue 5 is a bad minimaxing move that creates the pattern, and Red 6 kills the blue stone.
 +
** <hexboard size="5x5"
 +
  float="inline"
 +
  edges="bottom left"
 +
  coords="none"
 +
  contents="B 1:d2 R 2:c3 B 3:e1 R 4:c2 E *:d3"
 +
/> <hexboard size="6x6"
 +
  float="inline"
 +
  edges="bottom left"
 +
  coords="none"
 +
  contents="B 1:f1 R 2:d2 B 3:d3 R 4:e2 B 5:d4 R 6:c3"
 +
/>
  
* 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.
+
===Ladders===
*# ''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.
+
*#* 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 2, 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 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 strengthing 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 particuarly 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 the katahex strategy article is another case of this concept.
+
  
* Specific situations - there are a lot that you can pick up with experience and studying with KataHex, but I worry that each individual one isn't common enough to be useful.
+
* Ladders are tricky. Here's a first-order approximation &mdash; there are many exceptions, but this is still a useful baseline:
 +
** As the defender of the ladder, you have two main options: push, or let your opponent connect in exchange for territory. Look ahead to see whether pushing seems good for you.
 +
*** Generally, yield if and only if pushing would allow your opponent to adjacent-cut through two of your stones (which happens if you have a stone above the ladder).
 +
*** If the attacker fails to push, you should either bridge or play adjacently on the attacker's row to cut in front of the ladder. [illustrate this?]
 +
** As the attacker of the ladder, your main options are to push or pivot. If you're close to an acute corner, you can either pivot, or if the corner is empty, play a cornering move.
 +
*** Most of the time, pushing is good until you reach a corner.
 +
*** If you have stones above the ladder, try to make use of them, mostly by jumping and pivoting early enough so that the stones aren't "wasted".
 +
 
 +
 
 +
===Advanced strategy: Leaving the question open===
 +
 
 +
An important skill is learning when to tenuki. One class of examples is when you have a choice between two moves (or two sets of moves A and B), and playing one prevents you from playing the other one later. Your opponent is asking a [[question]]: do you want to play set A or set B? It can be advantageous to leave both possibilities open, so that if your opponent plays a move near the region, you can respond with the more advantageous reply of A and B. (The "dual" viewpoint: It can be a mistake to answer the question immediately &mdash; that gives your opponent a better idea of what to play in that region, both practically and theoretically. Answering it relieves your opponent of the obligation to play a move that counters ''both'' A and B.)
 +
 
 +
Here's an instructive example. Consider this 6-5 acute corner joseki ([https://hexworld.org/board/#19nc1,o14o15n15m17p16n17q14q15p15p17o17p14r12 HexWorld link]):
 +
<hexboard size="8x8"
 +
  float="inline"
 +
  edges="bottom right"
 +
  coords="none"
 +
  contents="R 1:d3 B 2:d4 R 3:c4 B 4:b6 R 5:e5 B 6:c6 R 7:f3 B 8:f4 R 9:e4 B 10:e6 R 11:d6 B 12:e3 R 13:g1 S c5 d5 E A:(f2 c7) B:(g2 c8) *:a5 -:d7"
 +
/>
 +
* There is a lot to unpack. First, some general commentary before we talk about the "question".
 +
** Blue 6 captures the two shaded hexes and should be an automatic reply to Red 5 for a strong player.
 +
** Blue 10 is not the only possible reply after Red 9. (*) is another strong option. (-) looks locally tempting (it lets Red connect in exchange for a 2nd-row ladder escape) but it's a mistake, because it's redundant with Blue 8 which already provides a 2nd-row ladder escape.
 +
** Red yields the soon-to-be ladder on move 13 to prevent an adjacent allow-cut with Red 1.
 +
* After Red 13, it's now Blue to move. Blue has some reasonable-looking options in the hexes marked A or B. Which of these moves should Blue play, if any?
 +
** Blue's plan is to either play both moves marked A or both moves marked B, but ''not'' one of each. Why?
 +
** Ideally, if it worked, Blue would independently like to play A at the top (it's the more useful intrusion) and B at the bottom (it's better to defend a ladder than to let your opponent connect outright). But unfortunately for Blue, the top and bottom aren't independent. Blue can't do both, because if Blue plays A at the top (and Red defends the bridge at B, creating a capped flank), the ladder escapes at the bottom right corner are not strong enough for Blue to play B at the bottom; since Red will connect bottom-right regardless in this situation, Blue has to make the most of it by gaining some territory (at the bottom A) while letting Red connect, which Red was going to do regardless.
 +
** In essence, Red has created a question for Blue: do you want to play the A set or the B set? There are cases where each option is better, but importantly, Blue has the deciding power here &mdash; Red cannot meaningfully force Blue to "settle" the question without otherwise making a concession. This "dual threat" means Red has to plan for the ''worst'' of A and B when making moves in the region. ''[A concrete example here would be nice.]''
 +
** If Blue were to commit to one of the sets now, she would give up this dual threat for free. So, Blue should actually tenuki rather than playing either the A or B sets. (Indeed, KataHex thinks playing either set is an inaccuracy. In this particular example, Blue can also play at (*) instead of playing in a totally separate region.)
 +
** Taking a step back, Red played move 13 (the locally optimal move) knowing that Blue would get the deciding power. The lesson is ''not'' that giving your opponent the deciding power is a huge disadvantage (such that you should make lots of concessions to avoid doing so); rather, it's important to be aware when a question exists and realize that settling it prematurely could be a mistake.
 +
 
 +
There are a couple other 6-5 acute corner joseki worth discussing, as they both come up frequently in real games. They are cases where move order matters, and the correct move order allows a player to neutralize the opponent's deciding power. Here is the first example:
 +
<hexboard size="8x8"
 +
  float="inline"
 +
  edges="bottom right"
 +
  coords="none"
 +
  contents="R 1:d3 B 2:d5 R 3:e5 B 4:d6 R 5:e6 B 6:e4 E *:c5 +:f2 A:b7 B:c7"
 +
/>
 +
<hexboard size="8x8"
 +
  float="inline"
 +
  edges="bottom right"
 +
  coords="none"
 +
  contents="R 1:d3 B 2:d5 R 3:e5 B 4:d6 R 5:e6 B 6:e4 R 7:f2 B 8:c7 R 9:f4 B 10:f3 R 11:g2 B 12:g3"
 +
/>
 +
<hexboard size="8x8"
 +
  float="inline"
 +
  edges="bottom right"
 +
  coords="none"
 +
  contents="R 1:d3 B 2:d5 R 3:e5 B 4:d6 R 5:e6 B 6:e4 R 7:c5 B 8:b7 R 9:f2 B 10:f4 E a:c7 b:g3"
 +
/>
 +
* In the first diagram, Red would like to play both (*) and (+). Both moves bridge efficiently from Red 1 while blocking Blue's stones.
 +
** However, Blue has two possible ways to extend her group at the bottom, by playing either A or B. This is a question for Blue.
 +
** Moving at (+) first would be a mistake because Blue has a strong minimaxing reply at B (see the second diagram). The best Red can do now is let Blue connect in the corner in exchange for territory at Red 11.
 +
** Instead, Red should play at (*) first. Blue could reasonably respond at B, but A is slightly better (see the third diagram). However, this leaves a bridge intrusion at (a), and Red now has the ladder escape that he needs for Red 9 to threaten to connect (via (b)). Blue 10 still connects in the corner, but the position here is more favorable for Red than in the second diagram.
 +
 
 +
Here is the other joseki, where the question is more subtle (and less important):
 +
<hexboard size="7x6"
 +
  float="inline"
 +
  edges="bottom right"
 +
  coords="none"
 +
  contents="R 1:b2 B 2:b4 R 3:c4 B 4:b5 R 5:d5 B 6:c6 R 7:d6 E *:c3 +:c5"
 +
/>
 +
<hexboard size="7x6"
 +
  float="inline"
 +
  edges="bottom right"
 +
  coords="none"
 +
  contents="R 1:b2 B 2:b4 R 3:c4 B 4:b5 R 5:d5 B 6:c6 R 7:d6 B 8:c5 R 9:d4 B 10:c3 E A:d1 B:d2"
 +
/>
 +
<hexboard size="7x6"
 +
  float="inline"
 +
  edges="bottom right"
 +
  coords="none"
 +
  contents="R 1:b2 B 2:b4 R 3:c4 B 4:b5 R 5:d5 B 6:c6 R 7:d6 B 8:c3 R 9:d1 B 10:c5"
 +
/>
 +
* In the first diagram, Blue would like to play both (*) and (+).
 +
** If Blue plays (+) first (see the second diagram), after Blue 10, Red now has the deciding power to play either A or B. The tradeoff is that A lets Blue connect outright in exchange for slightly more useful territory (since it's a bridge away from Red 1), while B holds Blue to a 2-4 parallel ladder.
 +
** Blue achieves a better outcome by playing (*) first (see the third diagram). Red must play A now, since if Red were to play B, then Blue would simply cut through and connect anyways. By playing in the correct move order, Blue practically strips Red of the deciding power between A and B. In some cases, this hardly matters and Red was going to play A regardless, but in general (*) is the safer move for Blue.
 +
 
 +
Finally, [https://playhex.org/games/bc0bf856-fe69-4088-a11b-1a700089866a here] is a game where Blue used this concept to make sense of the board and prune out some bad moves.
 +
* The first relevant position is [https://hexworld.org/board/#14nc1,g12:sd11c12d5d12e11e12f11f12g11g12i11h11i9i10k9,j9k8j8k7j5j6g3e6h4b6f2e3c2f3g2g4h3e2g6d8f8i6i4:rb after Red 17]. Blue would ideally like to convert the 4-6-8-10-12 group into a third-row ladder escape by playing g13, creating a capped flank, but Red can respond with the minimaxing m8 which deprives Blue 2 (the swap stone) of its 3rd-row ladder escape. Red asks Blue the question: "Do you want the third-row escape on the left edge and the second-row escape on the right edge, or vice versa?"
 +
* As a further complication, [https://hexworld.org/board/#14nc1,g12:sd11c12d5d12e11e12f11f12g11g12i11h11i9i10k9j9k8j8k7j5j6,g3e6h4b6f2e3c2f3g2g4h3e2g6d8f8i6i4:rb after Red 23], Red asks Blue another question: "How do you eventually want to intrude in my 21-23 bridge? Do you want to play k6, which works well with Blue 22 and the swap stone to form a '6th row' ladder escape, or j7 to connect with your main group?" This question is not independent of the first one &mdash; if Blue gives up the third-row escape on the swap stone, then k6 no longer works well, and conversely, if Blue insists on keeping the third-row escape on the swap stone, then j7 makes Blue 22 a bit of a waste.
 +
* With these two questions top of mind, Blue decided to tenuki on move 24 (and later). KataHex thinks this was a good decision, and settling any of the questions prematurely would've been a blunder. Furthermore, Blue attempted to tenuki in such a way that the decision power of the two questions was preserved (with debatable success), while hoping Red would make it easy for Blue to decide how to answer the questions. (Despite the game ending in a win for Blue, that hope never really materialized.)
 +
 
 +
==bullet hex strategy?==
 +
 
 +
I have not thought about this much, but you can model bullet Hex (i.e., Hex with very fast time controls) as Hex where some fraction of your moves must be premoves. Practically speaking, what does this mean? You should occasionally play premove tricks (moves that give you a large advantage assuming your opponent premoves the "expected" move or otherwise doesn't react to your move), and you should play in a way that's resilient to premove tricks, even if the moves are suboptimal in regular Hex. The frequency of premove tricks should increase significantly as players get into time pressure.
 +
 
 +
It would be interesting to study "bullet Hex strategy". Here's a starting example. Suppose you're Red and pushing the ladder below, but it's Blue's turn. Both players are under time pressure, and you have a split second to play a premove (or hover your mouse) if you wish. You ''expect'' Blue to continue pushing the ladder by playing at P. Where do you play?
 +
 
 +
<hexboard size="5x8"
 +
  coords="hide"
 +
  edges="bottom left"
 +
  contents="R b3 c3 d3 B b4 c4 E *:e3 +:f2 -:g3 P:d4 Q:e4 Y:d5 Z:f4"
 +
  />
 +
 
 +
I think it depends:
 +
* Case 1: The rest of the board is settled, Red has a forced win (for example, a ladder escape), and he simply needs to carry out that win without running out of time.
 +
** Naively, Red just keeps pushing the ladder by premoving or hovering over (*). However, the risk here is that Blue can play a premove trick&mdash;she can yield by playing at Y instead of the expected P, and if Red premoves the push at (*) (or doesn't premove, but fails to react that Blue played an unexpected move and plays (*) nonetheless), then Blue plays at Z.
 +
** A better idea for Red is to ''premove'' at P. Then, if Blue plays "as expected" by pushing the ladder at P (instead of yielding), the premove doesn't go through and Red plays at (*). However, if Blue does yield at Y, Red's premove goes through and is a good move.
 +
* Case 2: There is play remaining elsewhere, so Red could conceivably let Blue connect in exchange for territory. Or, Red has a forced win but is behind on time, and the ladder is really long and he'll lose on time if he simply tries the strategy from Case 1.
 +
** Most of the time, Red can still play the "premove P, click (*)" strategy from Case 1. However, with a small probability, Red waits for Blue to play at P, then he plays at (+) instead, hoping Blue will premove her ''next'' move. This is a premove ''trick'', and unlike the strategy from Case 1, it's important that Red doesn't play it 100% of the time&mdash;he needs to play it as part of a mixed strategy. If Blue notices, the downside is that the ladder has just been pushed up one row. But if Blue premoves and pushes the ladder again at Q, then Red plays at (-) and immediately wins.
 +
** Blue might not like the fact that Red has this premove trick. One possible resource for her is to "premove (*), click Q" while defending the ladder; this probably works quite well in bullet.
 +
 
 +
==katahex/general strategy (draft material)==
 +
 
 +
Some miscellaneous topics &mdash; I've written rough drafts/outlines of a few but they aren't ready to be published. If you have KataHex, you might consider these "select topics" as an advanced study guide for large boards, to explore on your own.
 +
* Common mistake: playing two adjacent stones (of the same color), either in a vacuum or in certain inefficient configurations.
 +
** Closely related to "bad minimaxing". Chances are, if you want to play an adjacent stone and it's not (i) provably optimal, (ii) part of a joseki, or (iii) part of a forcing sequence, you're better off with a bridge move.
 +
* Isosceles triangle pattern - this appears in lots of different josekis. The basic pattern is Red 5/7/9 in https://hexworld.org/board/#19nc1,c2d16b17e17c15b18e14e18d12, where the base of the "isosceles triangle" is perpendicular to your opponent's edge.
 +
** As with all patterns, try to learn/intuit not only when it's efficient to play the pattern, but when it's inefficient to do so. (For instance, in a vacuum, it's inefficient to play two red stones perpendicular and close to the blue edge; you should play at a 30 degree angle instead. This pattern needs neighboring stones to be efficient.)
 +
* Tom's move is useful for connecting, but it leaves several weaknesses and intrusion points if you don't absolutely have to connect.
 +
** Useful starter position with a 2-4 parallel ladder for analysis: https://hexworld.org/board/#19nc1,e6e4d4e3c3d5c7d2f4f5e5g3f3g1f2f1e2e1d3c2b3b2g4h3g2h1
 +
** Obtuse corner opening joseki with a 2-4 parallel ladder: https://hexworld.org/board/#19c1,a19j5d15c17c14c15b17b18a18d14a16d13
 +
* Acute corner joseki continuations. Red 7 is an inaccuracy but this is a common joseki: https://hexworld.org/board/#19nc1,e6e4d4e3d3d5c7f2b7c5b10i2. Study the "continuation" moves Red 11 and Blue 12, and study similar moves in related joseki.
 +
** For example, gain intuition for why Red 13 is the best move in https://hexworld.org/board/#19nc1,d5d4c5c3b4b3e4f2c4d3g3:pb8 (a5/b5 are captured by Red; see [[Theorems_about_templates#The_shape_of_templates]]), why Red 17 is the best move in https://hexworld.org/board/#19nc1,e6e5d6d4c5c4f5g3d5e4h4i2b5b4j3:pc9, and why other moves are weak.
 +
 
 +
===a3 opening===
 +
Nowadays, strong players rarely play a3 on the first move because it's similar to c2 (which is already on the losing side on most board sizes), but a bit weaker. There are some subtle differences between a3 and c2, however, and most strategy advice on the a3 opening is outdated.
 +
 
 +
If Red plays a3, some older strategy guides recommend that Blue respond d6 or e7 if she wants to play in the acute corner. However, KataHex considers this an inaccuracy; even though d6 and e7 are attacking stones in the sense that Blue would win a [[bridge ladder]] towards the acute corner, they don't do a good job blocking Red's edge the way e4 does in an empty corner.
 +
 
 +
If you want to play the acute corner, 5-5, or 4-4 on smaller boards, is a good choice. (There are other options further away from the corner on larger boards.) KataHex and other bots consistently prefer these moves:
 +
* https://www.littlegolem.net/jsp/game/game.jsp?gid=2175191&nmove=4
 +
* https://www.littlegolem.net/jsp/game/game.jsp?gid=2033243&nmove=2
 +
* https://www.littlegolem.net/jsp/game/game.jsp?gid=2018841&nmove=8
 +
* https://www.littlegolem.net/jsp/game/game.jsp?gid=1950209&nmove=20
 +
 
 +
One reason may be the efficiency of templates [[Edge template IV2e|IV2e]] and [[Fifth_row_edge_templates#V-2-d|V2d]], both of which have a "hole"; the template can be rotated so that the hole coincides with Red's a3 stone. This is explored in more detail below.
 +
 
 +
It can be useful to realize that a3 is primarily a blocking move (blocking Blue on the left rather than helping Red connect to top), whereas c2 is half blocking and half connecting. To illustrate the point, it's a bad idea for Red to play both c2 and 4-4 obtuse corner on the top edge (in the absence of Blue's blocking stones), because that's too much strength near the top. However, Red could feasibly play both a3 and 4-4 on the top edge.
 +
 
 +
a3 can combine well with c5. Red's goal is to leave b4/c5 open as options (these are the same hexes used in the a3 escape trick, but of course, a3+c5 can also connect upwards). Blue should also keep an eye on b4 - not to play immediately because it's too close to her own edge - but as the most efficient option for connecting to the left side near the top. Blue would much prefer to connect using b4 (which is a locally efficient move that neutralizes a3's switchback and upwards connecting potential) than b5 (which only slightly weakens a3's potential, forcing Red to play d5 instead of c5), or a 2nd row ladder with b3 (which removes Red's weakness at b1).
 +
 
 +
a3 is one of my favorite openings to analyze (I only wish it were more fair as an opening move). Unlike c2 where Blue's best move is typically to tenuki, a3 gives Blue the option to fight in the same acute corner. There is essentially a separate theory of a3 corner joseki.
 +
 
 +
I find a3 lines particularly educational because a3 changes the corner just enough to make different moves more efficient. You can learn a lot about how an existing stone influences neighboring stones.
 +
 
 +
* d4: https://hexworld.org/board/#14c1,a3d4e4e3
 +
** Note that Red e4 is near his own edge, but it's adjacent to Blue's stone at d4 and does a good job at blocking it; this is analogous to the joseki https://hexworld.org/board/#14nc1,k10k9, where Blue 2 is often a strong move. Blue e3 is counterintuitive, but it forms [[Fifth_row_edge_templates#V-2-d|template V2d]], which has a hole at Red's a3. In essence, Blue makes Red's a3 stone nearly useless in this line.
 +
** Red avoids b5 which is a very weak move, because it makes Blue b4 even more efficient: https://hexworld.org/board/#14c1,a3d4b5b4c4d2. This position is practically Blue's dream; Blue makes full use of d4 and the weakness at a3 with [[Edge template IV2e|template IV2e]] (which also has a hole).
 +
*** This is similar to Red 5 being a blunder in this opening: https://hexworld.org/board/#14nc1,a10d11c12c11b12b11
 +
* e3 first: https://hexworld.org/board/#14c1,a3e3c4b4d2c3d3c5
 +
* d3 is bad: https://hexworld.org/board/#14c1,a3d3b4
 +
* Why is e4 weak? After Red c5!, the normally locally efficient b4 (even though it's globally inefficient, because it's on Blue's 2nd row) is terrible because Red d3 is a bridge cut. Note that a3 primarily is a blocking move, not a connecting one, so d3+a3 is not so much strength near the top that it renders d3 a bad move. https://hexworld.org/board/#14c1,a3e4c5b4d3
 +
* e5: In some ways, these resemble the low intrusion 5-4 joseki, shifted up one row.
 +
** https://hexworld.org/board/#14nc1,a3e5c5c6d6d5 Red 5 is optional but actually an acceptable bridge peep, because intruding on the other side of the bridge would be too much strength near the top and almost never a good idea.
 +
** Red must still avoid b5 for the same reason as before: https://hexworld.org/board/#14nc1,a3e5c5c4b5b4d4f3d3 is very favorable to Blue. Observe that Blue 8 at f3 is more efficient than at e2, because e2 is followed by Red f3 which is a bridge cut
 +
** https://hexworld.org/board/#14nc1,a3e5c5c4d4c6d6e6d5d7b8c7a7b6a6b5a5a4b4c2c3f3d2 Red peeps the bridge with 7. d6; Blue 8. e6 may be a stronger reply than connecting directly. While this variation represents strong play by both sides, and Red is doing just fine, Blue 20 and the sequence leading up to it is a good illustration of how Blue can play efficiently around Red's a3 stone.
 +
** https://hexworld.org/board/#14nc1,a3e5c5d4c4c6f5h3 There are too many variations after Blue d4 to list them all. Blue 6 at d3 leads to a fun minimaxing sequence but is perhaps a slight inaccuracy: https://hexworld.org/board/#14nc1,a3e5c5d4c4d3b6d2c3d7
 +
 
 +
==Notation for distances==
 +
When analyzing patterns, it's useful to have a way to express various distances concisely. There are terms like adjacent, bridge, "classic block," but larger distances are hard to describe. Distances like "two hexes away" are ambiguous, does it mean a distance of 2 (like a1 and c1) or two hexes in between (like a1 and d1)? Everyone has their own way of thinking about it. Here's the one I use:
 +
* Pretend that the hex grid consists of regular hexagons, and adjacent hexagons' centers have distance 1. (Equivalently, the centers of the hexes form a triangular lattice; pretend these triangles are equilateral with side length 1.)
 +
* It's not hard to show that a "bridge" (like a1 and b2) has length sqrt(3) if you connect the centers, and a "classic block" (like a1 and c2) has length sqrt(7). A fun exercise is to show that the distances between the centers of two hexes is always the square root of an integer. Which integers are possible as squared distances? Answer: [https://oeis.org/A003136 Löschian numbers.]
 +
* The fact that squared distances are integers is notationally convenient. Let Δn denote a ''squared'' distance of n (I like this because it looks nicer than a square root symbol, and a letter like "d" can be confused with a coordinate).
 +
* "Adjacent" is Δ1; "bridge" is Δ3; "classic block" is Δ7; the distance between a1 and c1 is Δ4; "two bridges away" is Δ12.
 +
* Are there collisions? [https://oeis.org/A118886 Yes,] but the first collision is Δ49 (a distance of 7), which is both the distance between a1 and h1, and between a1 and f4. This is large enough that for practical purposes, the notation is unique. (An interesting fact: the first number with a 4-way collision is, coincidentally, [https://oeis.org/A198775 1729] of [https://en.wikipedia.org/wiki/1729_(number)#As_a_Ramanujan_number Ramanujan fame.])
 +
* Here is a mapping of squared distances from the hex marked (*). Most of the time, you only need distances up to Δ16.
 +
<hexboard size="5x9"
 +
  coords="hide"
 +
  edges="hide"
 +
  visible="area(a1,e5,i1)"
 +
  contents="S a1
 +
            E *:a1 1:b1 3:b2 4:c1 7:c2 9:d1 12:c3 13:d2 16:e1 19:d3 21:e2 25:f1
 +
              27:d4 28:e3 31:f2 36:g1 37:e4 39:f3 43:g2 49:h1
 +
              48:e5 49:f4 52:g3 57:h2 64:i1"
 +
  />
 +
 
 +
==Why I like the swap rule==
 +
 
 +
# The standard reason: It makes the game much more fair.
 +
# Every Hex player knows "Hex without swap is a first-player win." Add the swap rule, and you get another elegant result for free: "Hex with swap is a second-player win."
 +
# It provides much-needed asymmetry to the opening. The Hex board has two-fold rotational symmetry, and on odd-sized boards without swap, most players will open in the center. The symmetry isn't broken until the second turn!
 +
# The opening stone is especially influential in determining the character of the game. On 19x19, games that open with c2 look quite different from those that open with a10. A lot of cool tactics, like the a3 and a4 switchbacks, only really appear when you add the swap rule. The swap rule greatly expands the variety of plausible positions, and who doesn't like more variety?
 +
# While the second player has a theoretical advantage, the first player has a practical advantage: she can choose what opening to play. Because the opening stone is much more influential than later stones, the first player can pick an opening that she's especially familiar with, or one that her opponent is weak at. It would not be surprising if the first and second player's advantages cancel out among strong humans (on 19x19), and each player wins almost exactly 50% of games.
 +
# Since the swap rule is nonconstructive, it scales up beautifully to larger boards. Even if players have no idea which opening stones are fair, it's virtually certain that fair stones exist, and there should be no qualms about fairness. Contrast this with komi in Go: a fair komi has to be empirically determined for each board size, and there could be disagreements about the komi for various board sizes. (This concern is alleviated with auction komi, but that adds another rule to the game.)
 +
# It's resistant to partial solutions. Let's say that someone miraculously comes up with a constructive proof that the obtuse corner is winning on 19x19. No problem, players will just stop playing obtuse corner and play other opening moves instead.
 +
# It's fun to try to trick players into swapping a weak move or not swapping a deceptively strong move. :)
  
 
==Insights and tidbits from KataHex (hzy's bot)==
 
==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&times;19 generated with net 20220618, 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%).
* 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%).
+
** 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.
+
  
 
<hexboard size="19x19"
 
<hexboard size="19x19"
Line 104: Line 259:
 
               47:(o3 e17)
 
               47:(o3 e17)
 
               59:(p3 d17)
 
               59:(p3 d17)
 +
              121:(h4 l16)
 
               72:(i4 k16)
 
               72:(i4 k16)
 
               67:(j4 j16)
 
               67:(j4 j16)
 
               81:(k4 i16)
 
               81:(k4 i16)
 
               94:(l4 h16)
 
               94:(l4 h16)
 +
              138:(m4 g16)
 +
              122:(i5 k15)
 +
              108:(j5 j15)
 +
              133:(k5 i15)
 
               69:(q2 c18)
 
               69:(q2 c18)
 +
              163:(p2 d18)
 
               96:(b17 r3)
 
               96:(b17 r3)
 
               201:(b18 r2)
 
               201:(b18 r2)
Line 114: Line 275:
 
               67:(b2 r18)
 
               67:(b2 r18)
 
               56:(c2 q18)
 
               56:(c2 q18)
 +
              146:(d2 p18)
 
               100:(a3 s17)
 
               100:(a3 s17)
 
               137:(b3 r17)
 
               137:(b3 r17)
Line 229: Line 391:
 
* 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.
 
* 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).
 
* 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: [https://hexworld.org/board/#30,ad1ad2ad3ad4ad5ad6ad7ad8ad9ad10ad11ad12 here]. All other hexes look fine.
 
 
On 31x31, the same clicking and url issue occurs for ad6, ad11, and ad31: [https://hexworld.org/board/#31,ad5ad6ad7ad11ad31ae1 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. [[User:Selinger|Selinger]] ([[User talk:Selinger|talk]]) 22:21, 20 April 2024 (UTC)
 
 
----
 
 
[[User:Fjan2ej57w|Fjan2ej57w]]'s question 7, "how much space of an empty board would be filled if both sides play optimally":
 
 
[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.
 
 
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 )
 

Latest revision as of 17:59, 30 November 2025

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.

PlayHex > Settings > Shading pattern > Custom > t = (2*row + 3*col) % 7; (t==0 ? 0 : (3^t % 7))/6

draft of more strategy stuff

There's a fair amount of stuff for Strategic advice from KataHex that I've either been too lazy to write up / polish, or haven't thought of a good way to explain. I also haven't properly conveyed which things are important; some things come up rarely and should either be mentioned briefly or cut for the article. There's also a tradeoff in generality/specificity and concreteness/abstractness.

I need a lot more concrete examples, but it's hard to come by truly instructive examples (or know what people find useful)

It's a good idea to first study patterns in a vacuum, meaning in the absence of nearby stones. This provides a useful baseline when evaluating a move. Local patterns can occur in "open" areas (areas far away from corners/edges, whether in a vacuum or not) as well as near corners/edges. Let's start with open patterns.

  • ...


In these patterns, the shaded cells are expected to be empty.

  • Pattern 1 is strong for Red (and weak for Blue), because Red threatens to play at (*) to kill the blue stone at (-). Even if Red hasn't played (*), the pattern is still weak for Blue, because the effectiveness of (-) is hindered by the other blue stone.
    • This pattern frequently happens near the obtuse corner, as a result of bad minimaxing. In the first example below, Blue 3 is a common, but misguided, attempt at minimaxing. However, it's a mistake, and Red 4 (which creates the pattern) is the best reply. This position is weak for Blue even though Red does not plan to play (*) (as it is too close to his own edge) — Blue 3 hinders Blue 1, and the damage has already been done. In the second example, Blue 5 is a bad minimaxing move that creates the pattern, and Red 6 kills the blue stone.
    • 3412
      124635

Ladders

  • Ladders are tricky. Here's a first-order approximation — there are many exceptions, but this is still a useful baseline:
    • As the defender of the ladder, you have two main options: push, or let your opponent connect in exchange for territory. Look ahead to see whether pushing seems good for you.
      • Generally, yield if and only if pushing would allow your opponent to adjacent-cut through two of your stones (which happens if you have a stone above the ladder).
      • If the attacker fails to push, you should either bridge or play adjacently on the attacker's row to cut in front of the ladder. [illustrate this?]
    • As the attacker of the ladder, your main options are to push or pivot. If you're close to an acute corner, you can either pivot, or if the corner is empty, play a cornering move.
      • Most of the time, pushing is good until you reach a corner.
      • If you have stones above the ladder, try to make use of them, mostly by jumping and pivoting early enough so that the stones aren't "wasted".


Advanced strategy: Leaving the question open

An important skill is learning when to tenuki. One class of examples is when you have a choice between two moves (or two sets of moves A and B), and playing one prevents you from playing the other one later. Your opponent is asking a question: do you want to play set A or set B? It can be advantageous to leave both possibilities open, so that if your opponent plays a move near the region, you can respond with the more advantageous reply of A and B. (The "dual" viewpoint: It can be a mistake to answer the question immediately — that gives your opponent a better idea of what to play in that region, both practically and theoretically. Answering it relieves your opponent of the obligation to play a move that counters both A and B.)

Here's an instructive example. Consider this 6-5 acute corner joseki (HexWorld link):

13AB112732985461110AB
  • There is a lot to unpack. First, some general commentary before we talk about the "question".
    • Blue 6 captures the two shaded hexes and should be an automatic reply to Red 5 for a strong player.
    • Blue 10 is not the only possible reply after Red 9. (*) is another strong option. (-) looks locally tempting (it lets Red connect in exchange for a 2nd-row ladder escape) but it's a mistake, because it's redundant with Blue 8 which already provides a 2nd-row ladder escape.
    • Red yields the soon-to-be ladder on move 13 to prevent an adjacent allow-cut with Red 1.
  • After Red 13, it's now Blue to move. Blue has some reasonable-looking options in the hexes marked A or B. Which of these moves should Blue play, if any?
    • Blue's plan is to either play both moves marked A or both moves marked B, but not one of each. Why?
    • Ideally, if it worked, Blue would independently like to play A at the top (it's the more useful intrusion) and B at the bottom (it's better to defend a ladder than to let your opponent connect outright). But unfortunately for Blue, the top and bottom aren't independent. Blue can't do both, because if Blue plays A at the top (and Red defends the bridge at B, creating a capped flank), the ladder escapes at the bottom right corner are not strong enough for Blue to play B at the bottom; since Red will connect bottom-right regardless in this situation, Blue has to make the most of it by gaining some territory (at the bottom A) while letting Red connect, which Red was going to do regardless.
    • In essence, Red has created a question for Blue: do you want to play the A set or the B set? There are cases where each option is better, but importantly, Blue has the deciding power here — Red cannot meaningfully force Blue to "settle" the question without otherwise making a concession. This "dual threat" means Red has to plan for the worst of A and B when making moves in the region. [A concrete example here would be nice.]
    • If Blue were to commit to one of the sets now, she would give up this dual threat for free. So, Blue should actually tenuki rather than playing either the A or B sets. (Indeed, KataHex thinks playing either set is an inaccuracy. In this particular example, Blue can also play at (*) instead of playing in a totally separate region.)
    • Taking a step back, Red played move 13 (the locally optimal move) knowing that Blue would get the deciding power. The lesson is not that giving your opponent the deciding power is a huge disadvantage (such that you should make lots of concessions to avoid doing so); rather, it's important to be aware when a question exists and realize that settling it prematurely could be a mistake.

There are a couple other 6-5 acute corner joseki worth discussing, as they both come up frequently in real games. They are cases where move order matters, and the correct move order allows a player to neutralize the opponent's deciding power. Here is the first example:

162345AB
711110126923458
91b610723458a
  • In the first diagram, Red would like to play both (*) and (+). Both moves bridge efficiently from Red 1 while blocking Blue's stones.
    • However, Blue has two possible ways to extend her group at the bottom, by playing either A or B. This is a question for Blue.
    • Moving at (+) first would be a mistake because Blue has a strong minimaxing reply at B (see the second diagram). The best Red can do now is let Blue connect in the corner in exchange for territory at Red 11.
    • Instead, Red should play at (*) first. Blue could reasonably respond at B, but A is slightly better (see the third diagram). However, this leaves a bridge intrusion at (a), and Red now has the ladder escape that he needs for Red 9 to threaten to connect (via (b)). Blue 10 still connects in the corner, but the position here is more favorable for Red than in the second diagram.

Here is the other joseki, where the question is more subtle (and less important):

1234567
A1B1023948567
91823410567
  • In the first diagram, Blue would like to play both (*) and (+).
    • If Blue plays (+) first (see the second diagram), after Blue 10, Red now has the deciding power to play either A or B. The tradeoff is that A lets Blue connect outright in exchange for slightly more useful territory (since it's a bridge away from Red 1), while B holds Blue to a 2-4 parallel ladder.
    • Blue achieves a better outcome by playing (*) first (see the third diagram). Red must play A now, since if Red were to play B, then Blue would simply cut through and connect anyways. By playing in the correct move order, Blue practically strips Red of the deciding power between A and B. In some cases, this hardly matters and Red was going to play A regardless, but in general (*) is the safer move for Blue.

Finally, here is a game where Blue used this concept to make sense of the board and prune out some bad moves.

  • The first relevant position is after Red 17. Blue would ideally like to convert the 4-6-8-10-12 group into a third-row ladder escape by playing g13, creating a capped flank, but Red can respond with the minimaxing m8 which deprives Blue 2 (the swap stone) of its 3rd-row ladder escape. Red asks Blue the question: "Do you want the third-row escape on the left edge and the second-row escape on the right edge, or vice versa?"
  • As a further complication, after Red 23, Red asks Blue another question: "How do you eventually want to intrude in my 21-23 bridge? Do you want to play k6, which works well with Blue 22 and the swap stone to form a '6th row' ladder escape, or j7 to connect with your main group?" This question is not independent of the first one — if Blue gives up the third-row escape on the swap stone, then k6 no longer works well, and conversely, if Blue insists on keeping the third-row escape on the swap stone, then j7 makes Blue 22 a bit of a waste.
  • With these two questions top of mind, Blue decided to tenuki on move 24 (and later). KataHex thinks this was a good decision, and settling any of the questions prematurely would've been a blunder. Furthermore, Blue attempted to tenuki in such a way that the decision power of the two questions was preserved (with debatable success), while hoping Red would make it easy for Blue to decide how to answer the questions. (Despite the game ending in a win for Blue, that hope never really materialized.)

bullet hex strategy?

I have not thought about this much, but you can model bullet Hex (i.e., Hex with very fast time controls) as Hex where some fraction of your moves must be premoves. Practically speaking, what does this mean? You should occasionally play premove tricks (moves that give you a large advantage assuming your opponent premoves the "expected" move or otherwise doesn't react to your move), and you should play in a way that's resilient to premove tricks, even if the moves are suboptimal in regular Hex. The frequency of premove tricks should increase significantly as players get into time pressure.

It would be interesting to study "bullet Hex strategy". Here's a starting example. Suppose you're Red and pushing the ladder below, but it's Blue's turn. Both players are under time pressure, and you have a split second to play a premove (or hover your mouse) if you wish. You expect Blue to continue pushing the ladder by playing at P. Where do you play?

PQZY

I think it depends:

  • Case 1: The rest of the board is settled, Red has a forced win (for example, a ladder escape), and he simply needs to carry out that win without running out of time.
    • Naively, Red just keeps pushing the ladder by premoving or hovering over (*). However, the risk here is that Blue can play a premove trick—she can yield by playing at Y instead of the expected P, and if Red premoves the push at (*) (or doesn't premove, but fails to react that Blue played an unexpected move and plays (*) nonetheless), then Blue plays at Z.
    • A better idea for Red is to premove at P. Then, if Blue plays "as expected" by pushing the ladder at P (instead of yielding), the premove doesn't go through and Red plays at (*). However, if Blue does yield at Y, Red's premove goes through and is a good move.
  • Case 2: There is play remaining elsewhere, so Red could conceivably let Blue connect in exchange for territory. Or, Red has a forced win but is behind on time, and the ladder is really long and he'll lose on time if he simply tries the strategy from Case 1.
    • Most of the time, Red can still play the "premove P, click (*)" strategy from Case 1. However, with a small probability, Red waits for Blue to play at P, then he plays at (+) instead, hoping Blue will premove her next move. This is a premove trick, and unlike the strategy from Case 1, it's important that Red doesn't play it 100% of the time—he needs to play it as part of a mixed strategy. If Blue notices, the downside is that the ladder has just been pushed up one row. But if Blue premoves and pushes the ladder again at Q, then Red plays at (-) and immediately wins.
    • Blue might not like the fact that Red has this premove trick. One possible resource for her is to "premove (*), click Q" while defending the ladder; this probably works quite well in bullet.

katahex/general strategy (draft material)

Some miscellaneous topics — I've written rough drafts/outlines of a few but they aren't ready to be published. If you have KataHex, you might consider these "select topics" as an advanced study guide for large boards, to explore on your own.

a3 opening

Nowadays, strong players rarely play a3 on the first move because it's similar to c2 (which is already on the losing side on most board sizes), but a bit weaker. There are some subtle differences between a3 and c2, however, and most strategy advice on the a3 opening is outdated.

If Red plays a3, some older strategy guides recommend that Blue respond d6 or e7 if she wants to play in the acute corner. However, KataHex considers this an inaccuracy; even though d6 and e7 are attacking stones in the sense that Blue would win a bridge ladder towards the acute corner, they don't do a good job blocking Red's edge the way e4 does in an empty corner.

If you want to play the acute corner, 5-5, or 4-4 on smaller boards, is a good choice. (There are other options further away from the corner on larger boards.) KataHex and other bots consistently prefer these moves:

One reason may be the efficiency of templates IV2e and V2d, both of which have a "hole"; the template can be rotated so that the hole coincides with Red's a3 stone. This is explored in more detail below.

It can be useful to realize that a3 is primarily a blocking move (blocking Blue on the left rather than helping Red connect to top), whereas c2 is half blocking and half connecting. To illustrate the point, it's a bad idea for Red to play both c2 and 4-4 obtuse corner on the top edge (in the absence of Blue's blocking stones), because that's too much strength near the top. However, Red could feasibly play both a3 and 4-4 on the top edge.

a3 can combine well with c5. Red's goal is to leave b4/c5 open as options (these are the same hexes used in the a3 escape trick, but of course, a3+c5 can also connect upwards). Blue should also keep an eye on b4 - not to play immediately because it's too close to her own edge - but as the most efficient option for connecting to the left side near the top. Blue would much prefer to connect using b4 (which is a locally efficient move that neutralizes a3's switchback and upwards connecting potential) than b5 (which only slightly weakens a3's potential, forcing Red to play d5 instead of c5), or a 2nd row ladder with b3 (which removes Red's weakness at b1).

a3 is one of my favorite openings to analyze (I only wish it were more fair as an opening move). Unlike c2 where Blue's best move is typically to tenuki, a3 gives Blue the option to fight in the same acute corner. There is essentially a separate theory of a3 corner joseki.

I find a3 lines particularly educational because a3 changes the corner just enough to make different moves more efficient. You can learn a lot about how an existing stone influences neighboring stones.

Notation for distances

When analyzing patterns, it's useful to have a way to express various distances concisely. There are terms like adjacent, bridge, "classic block," but larger distances are hard to describe. Distances like "two hexes away" are ambiguous, does it mean a distance of 2 (like a1 and c1) or two hexes in between (like a1 and d1)? Everyone has their own way of thinking about it. Here's the one I use:

  • Pretend that the hex grid consists of regular hexagons, and adjacent hexagons' centers have distance 1. (Equivalently, the centers of the hexes form a triangular lattice; pretend these triangles are equilateral with side length 1.)
  • It's not hard to show that a "bridge" (like a1 and b2) has length sqrt(3) if you connect the centers, and a "classic block" (like a1 and c2) has length sqrt(7). A fun exercise is to show that the distances between the centers of two hexes is always the square root of an integer. Which integers are possible as squared distances? Answer: Löschian numbers.
  • The fact that squared distances are integers is notationally convenient. Let Δn denote a squared distance of n (I like this because it looks nicer than a square root symbol, and a letter like "d" can be confused with a coordinate).
  • "Adjacent" is Δ1; "bridge" is Δ3; "classic block" is Δ7; the distance between a1 and c1 is Δ4; "two bridges away" is Δ12.
  • Are there collisions? Yes, but the first collision is Δ49 (a distance of 7), which is both the distance between a1 and h1, and between a1 and f4. This is large enough that for practical purposes, the notation is unique. (An interesting fact: the first number with a 4-way collision is, coincidentally, 1729 of Ramanujan fame.)
  • Here is a mapping of squared distances from the hex marked (*). Most of the time, you only need distances up to Δ16.
1491625364964371321314357121928395227374948

Why I like the swap rule

  1. The standard reason: It makes the game much more fair.
  2. Every Hex player knows "Hex without swap is a first-player win." Add the swap rule, and you get another elegant result for free: "Hex with swap is a second-player win."
  3. It provides much-needed asymmetry to the opening. The Hex board has two-fold rotational symmetry, and on odd-sized boards without swap, most players will open in the center. The symmetry isn't broken until the second turn!
  4. The opening stone is especially influential in determining the character of the game. On 19x19, games that open with c2 look quite different from those that open with a10. A lot of cool tactics, like the a3 and a4 switchbacks, only really appear when you add the swap rule. The swap rule greatly expands the variety of plausible positions, and who doesn't like more variety?
  5. While the second player has a theoretical advantage, the first player has a practical advantage: she can choose what opening to play. Because the opening stone is much more influential than later stones, the first player can pick an opening that she's especially familiar with, or one that her opponent is weak at. It would not be surprising if the first and second player's advantages cancel out among strong humans (on 19x19), and each player wins almost exactly 50% of games.
  6. Since the swap rule is nonconstructive, it scales up beautifully to larger boards. Even if players have no idea which opening stones are fair, it's virtually certain that fair stones exist, and there should be no qualms about fairness. Contrast this with komi in Go: a fair komi has to be empirically determined for each board size, and there could be disagreements about the komi for various board sizes. (This concern is alleviated with auction komi, but that adds another rule to the game.)
  7. It's resistant to partial solutions. Let's say that someone miraculously comes up with a constructive proof that the obtuse corner is winning on 19x19. No problem, players will just stop playing obtuse corner and play other opening moves instead.
  8. It's fun to try to trick players into swapping a weak move or not swapping a deceptively strong move. :)

Insights and tidbits from KataHex (hzy's bot)

  • Swap map for 19×19 generated with net 20220618, 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%).
abcdefghijklmnopqrs123456789101112131415161718195677675614616369201174100137157653737673849010310449647599611083731217267819413857136122108133179356957813111599814138238241819911513178955693171331081221365713894816772121738311096594764910410390847376733651571371001742016916314656677756

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).