Hex: Connection Game & Mathematical Theory
- Hex is a two-player, perfect-information connection game played on an n×n board where each player aims to connect opposite board sides.
- The game is underpinned by the Hex Theorem, which ensures a unique winner by leveraging principles from graph theory, planar topology, and fixed-point theory.
- Hex presents significant computational challenges due to its high branching factor, driving advancements in AI, combinatorial game theory, and machine learning strategies.
Hex is a two-player, perfect-information connection game played on a rhombus tiled by hexagonal cells. On an board, the players alternately color empty cells; one player aims to connect the top and bottom sides, while the other aims to connect the left and right sides. A fully colored Hex position has exactly one winner, so draws are impossible, and the game has become a standard meeting point for graph theory, planar topology, fixed-point theory, combinatorial game theory, and computational game playing (Yang, 18 Jul 2025).
1. Rules, board structure, and formal model
A standard Hex board is an rhombus of hexagonal cells. The literature commonly names the players Red and Blue, or Black and White. Red aims to connect the top and bottom sides by a continuous chain of Red cells; Blue aims to connect the left and right sides by a continuous chain of Blue cells. An board is widely used and is described as “ultra-weakly solved” in the sense that the first player has a winning strategy by a strategy-stealing argument (Yang, 18 Jul 2025).
A graph-theoretic formulation encodes the board as a cell adjacency graph , where is the set of cells and two distinct cells are adjacent when they share a side. If denotes the set of cells touching Red’s two designated boundary sides and the analogous set for Blue, then a Red win is the existence of a path in whose vertices are Red-colored cells and whose endpoints lie in the two components of ; Blue is defined analogously with respect to 0 (Yang, 18 Jul 2025).
This formulation makes Hex a connection game rather than a capture game. The relevant invariant is global connectivity, not local material balance. In computational terms, this matters because solving arbitrary Hex positions is PSPACE-complete, and the large branching factor on standard boards makes exhaustive search difficult (Young et al., 2016).
2. The Hex Theorem and the impossibility of draws
The central structural fact is the Hex Theorem: on any completely filled 1 Hex board, exactly one player has a continuous path connecting their two opposite sides. In the notation of one standard statement, if every tile is marked either with 2 or 3, then either there exists an 4-path connecting sides 5 and 6 or an 7-path connecting sides 8 and 9. An equivalent restatement on the integer-grid model 0 says that if 1 is divided into two sets 2 and 3, then either 4 contains a connected path joining the 5 and 6 edges, or 7 contains a connected path joining the 8 and 9 edges (Yang, 18 Jul 2025).
The geometric intuition uses the interface between opposite colors. Whenever adjacent cells have different colors, one draws a boundary segment between them. These segments form paths that cannot terminate in the interior and must end at the board’s corners. Because the two target connections are “orthogonal,” simultaneous completion would require a crossing, but Hex forbids crossing because a cell cannot be colored by both players. The interface therefore separates the board into regions in a way that forces exactly one winning chain (Yang, 18 Jul 2025).
A concise graph-theoretic proof uses a decomposition lemma for graphs of maximum degree two: every finite graph with all degrees at most two is a disjoint union of isolated vertices, simple cycles, and simple paths. Applied to Hex, one constructs a subgraph 0 consisting of edges lying on interfaces between oppositely colored adjacent tiles, then adds four auxiliary degree-1 vertices 2 at the corners. Since each 3 has degree 4, these vertices must be endpoints of simple paths in 5, and the resulting boundary paths certify that one color connects its designated sides. This proves the no-draw property and excludes simultaneous wins (Yang, 18 Jul 2025).
3. Topological formulations, shape independence, and fixed-point equivalence
Hex admits a more general topological formulation on any finite triangulation of a disk whose boundary is partitioned into four arcs in cyclic order. In that setting, either there is a red chain meeting the two red arcs or a blue chain meeting the two blue arcs, and the two events cannot occur simultaneously. The proof can be organized through a no-retraction argument for the disk and a nonplanarity argument based on 6, so the conclusion depends only on planarity, connectivity, and the disk topology, not on the literal geometry of a rhombus of hexagons (Prytuła, 2021).
The same topological framework yields an equivalence between Hex and the game of Y. A doubled-and-folded copy of a Y-board produces a Hex-board, and a standard extension trick converts Hex to Y. In this sense, the Hex Theorem and the Y Theorem are equivalent in the generalized triangulated-disk setting (Prytuła, 2021).
A deeper equivalence links Hex to Brouwer’s Fixed Point Theorem. One direction discretizes a continuous map 7 on a sufficiently fine 8 grid and partitions the grid into sets
9
according to whether the first or second coordinate of 0 exceeds a chosen 1 in the positive or negative direction. Boundary constraints show that 2 cannot reach 3, 4 cannot reach 5, 6 cannot reach 7, and 8 cannot reach 9. By the Hex Theorem, 0 cannot cover the whole board, so there is an uncovered grid point 1 satisfying 2; taking 3 yields a fixed point. The converse direction assumes a filled Hex partition with neither an 4-connection nor a 5-connection, defines a discrete map by unit displacements 6 or 7, extends it piecewise-linearly to a continuous map 8 on a triangulation of 9, and derives a contradiction to Brouwer by showing that 0 has no fixed point (Yang, 18 Jul 2025).
The paper reviewing these arguments also recalls Sperner’s Lemma in the standard simplex formulation and uses it to derive Brouwer’s theorem on 1 through a labeling
2
This discrete-to-continuous bridge places Hex in the same formal lineage as Sperner labeling and fixed-point existence (Yang, 18 Jul 2025).
4. Winning strategies, computational complexity, and machine play
John Nash’s classical strategy-stealing argument shows that the first player has a winning strategy. The argument assumes, for contradiction, that the second player has a winning strategy; the first player makes an arbitrary opening move and then “pretends to be the second player.” If the supposed strategy ever prescribes the already occupied opening cell, the first player simply uses another move, relying on the fact that the “extra piece cannot hurt.” Combined with the no-draw property, this proves existence of a first-player winning strategy, but it is non-constructive and does not produce an explicit move-by-move solution (Yang, 18 Jul 2025).
From the viewpoint of complexity theory and computer game playing, Hex is difficult because rewards are terminal, action spaces are large, and global connectivity is hard to evaluate locally. On a standard 3 board, the average number of legal moves is reported as about 4, compared to 5 for chess, and Reisch proved PSPACE-completeness for 6 Hex (Banerjee, 2020).
Classical top-performing Hex programs relied heavily on search. MoHex, described as the current ICGA Olympiad champion in the NeuroHex study, combines Monte Carlo tree search with theorem-based pruning and early win detection (Young et al., 2016). A contrasting line of work trains neural policies or value estimators directly. “NeuroHex: A Deep Q-learning Hex Agent” used an 7-layer CNN on the 8 board with supervised initialization followed by self-play Deep Q-learning, no search at inference time, and reported win-rates of 9 as first player and 0 as second player against a 1-second-per-move version of MoHex after roughly two weeks of training (Young et al., 2016). A later “neurodynamic programming” study on 2 Hex compared CNN and RNN value architectures and found the CNN-PBE agent strongest in head-to-head tournaments, with 3 total wins across two seasons (Banerjee, 2020).
5. Combinatorial game theory and 3-terminal regions
Modern mathematical analysis of Hex treats local subpositions as combinatorial games over structured outcome posets. For monotone set-coloring games such as Hex, a central distinction is between monotone games, in which all moves available to both players are good, and passable games, in which permitting pass moves would not help either player. The framework developed for Hex shows that every passable short game is equivalent to a monotone game, and Hex positions fit naturally into this setting (Selinger, 2021).
A particularly important local object is the 3-terminal region: a region completely surrounded by black and white stones such that the black boundary stones form 4 connected components. The associated outcome poset is
5
where 6 means no black terminals are connected, 7 mean exactly one pair is connected, and 8 means all three black terminals are connected (Demer et al., 11 Jul 2025).
The structural theorem underpinning this analysis states that Hex is the universal planar Shannon game of degree 9. Every 0-planar Shannon game is isomorphic to a Hex position, and conversely every Hex position is isomorphic to a 1-planar Shannon game. This yields a decomposition principle: every Hex position can be analyzed in terms of 3-terminal regions (Demer et al., 11 Jul 2025).
The same work proves that there are infinitely many distinct Hex-realizable values for 3-terminal regions. The basic infinite family is the sequence of superswitches defined by
2
These values are pairwise inequivalent, passable, and Hex-realizable. The paper also develops related simpleswitch and tripleswitch constructions, proves cofinality properties, and introduces a database of over 3 million Hex-realizable 3-terminal values, together with 4 “primary” positions used as compact generators (Demer et al., 11 Jul 2025).
These local-value tools are applied to automated verification of connects-both templates and pivoting templates, to a new handicap strategy for 5 Hex, and to the construction of witnesses showing that certain probes are uniquely winning. In particular, they are used to disprove a conjecture of Henderson and Hayward about the ziggurat template by showing that every probe into that template is non-inferior (Demer et al., 11 Jul 2025).
6. Infinite Hex and generalized winning conditions
An infinite version of Hex was introduced by Hamkins and Leonessi on a fixed regular hexagonal tiling of the plane. A position is a coloring 6, where black tiles are the relevant occupied cells and white tiles are treated as vacant for the purpose of Black’s objective. The winning condition is no longer a finite side-to-side connection; instead, Black must build a two-way infinite black path whose two tails eventually remain in opposite quarter-planes 7 and 8 for every 9 (Törmä, 2023).
The corresponding winning set
0
has been shown to be arithmetic. More precisely, it lies in lightface 1 and is 2-hard. Since arithmetic sets are Borel, this settles the question of whether the infinite winning condition is Borel (Törmä, 2023).
This has immediate determinacy consequences. By Borel determinacy, every initial position of Infinite Hex is determined in the sense that either one player has a winning strategy or both players have drawing strategies. This differs sharply from finite Hex, where there are no draws on a full board. Hamkins and Leonessi had already shown that perfect play from the empty position in Infinite Hex yields a draw, so the infinite game changes the strategic landscape even though it preserves the connection-game character of finite Hex (Törmä, 2023).
Across these finite, local, topological, and infinite formulations, Hex functions as a mathematically dense model of planar connectivity. Its no-draw theorem is simultaneously a graph theorem, a separation theorem, and a fixed-point analogue; its local regions support a nontrivial combinatorial game theory; and its infinite variant reaches into descriptive set theory (Yang, 18 Jul 2025).