Hex is a two player
abstract strategy
Abstract strategy games admit a number of definitions which distinguish these from strategy games in general, mostly involving no or minimal narrative theme, outcomes determined only by player choice (with no randomness), and perfect information ...
board game
Board games are tabletop games that typically use . These pieces are moved or placed on a pre-marked board (playing surface) and often include elements of table, card, role-playing, and miniatures games as well.
Many board games feature a ...
in which players attempt to connect opposite sides of a rhombus-shaped
board made of hexagonal cells. Hex was invented by mathematician and poet
Piet Hein in 1942 and later rediscovered and popularized by
John Nash.
It is traditionally played on an 11×11
rhombus
In plane Euclidean geometry, a rhombus (plural rhombi or rhombuses) is a quadrilateral whose four sides all have the same length. Another name is equilateral quadrilateral, since equilateral means that all of its sides are equal in length. Th ...
board, although 13×13 and 19×19 boards are also popular. The board is composed of hexagons called ''cells'' or ''hexes''. Each player is assigned a pair of opposite sides of the board, which they must try to connect by alternately placing a stone of their color onto any empty hex. Once placed, the stones are never moved or removed. A player wins when they successfully connect their sides together through a chain of adjacent stones. Draws are impossible in Hex due to the
topology
In mathematics, topology (from the Greek words , and ) is concerned with the properties of a geometric object that are preserved under continuous deformations, such as stretching, twisting, crumpling, and bending; that is, without closing ho ...
of the game board.
Despite the simplicity of its rules, the game has deep strategy and sharp tactics. It also has profound mathematical underpinnings. The game was first published under the name Polygon in the Danish newspaper ''Politiken'' on December 26, 1942. It was later marketed as a board game in
Denmark
)
, song = ( en, "King Christian stood by the lofty mast")
, song_type = National and royal anthem
, image_map = EU-Denmark.svg
, map_caption =
, subdivision_type = Sovereign state
, subdivision_name = Kingdom of Denmark
, establishe ...
under the name Con-tac-tix, and
Parker Brothers marketed a version of it in 1952 called Hex; they are no longer in production. Hex can also be played with paper and pencil on hexagonally ruled graph paper.
Game type
Hex is a finite, 2-player
perfect information game, and an
abstract strategy game that belongs to the general category of ''
connection games''.
It can be classified as a
Maker-Breaker game,
a particular type of
positional game. Since the game can never end in a
draw,
Hex is also a
determined game
Determinacy is a subfield of set theory, a branch of mathematics, that examines the conditions under which one or the other player of a game has a winning strategy, and the consequences of the existence of such strategies. Alternatively and simi ...
.
Hex is a special case of the "node" version of the
Shannon switching game.
Hex can be played as a
board game
Board games are tabletop games that typically use . These pieces are moved or placed on a pre-marked board (playing surface) and often include elements of table, card, role-playing, and miniatures games as well.
Many board games feature a ...
or as a
paper-and-pencil game.
Rules

Hex is played on a
rhombic
Rhombic may refer to:
* Rhombus, a quadrilateral whose four sides all have the same length (often called a diamond)
*Rhombic antenna, a broadband directional antenna most commonly used on shortwave frequencies
* polyhedra formed from rhombuses, suc ...
grid of hexagons, typically of size 11x11, although other sizes are also possible. Each player has an allocated color, conventionally Red and Blue or Black and White.
Each player is also assigned two opposite board edges. The hexagons on each of the four corners belong to both adjacent board edges.
The players take turns placing a stone of their color on a single cell on the board. The most common convention is for Red or Black to go first. Once placed, stones are not moved, replaced, or removed from the board. Each player's goal is to form a connected path of their own stones linking their two board edges. The player who complete such a connection wins the game.
To compensate for the first player's advantage, the
swap rule
The pie rule, sometimes referred to as the swap rule, is a rule used to balance abstract strategy games where a first-move advantage has been demonstrated. After the first move is made in a game that uses the pie rule, the second player must sel ...
is normally used. This rule allows the second player to choose whether to switch positions with the first player after the first player makes the first move.
When it is clear to both players who will win the game, it is customary, but not required, for the losing player to resign. In practice, most games of Hex end with one of the players resigning.
History
Invention
The game was invented by the
Danish mathematician
Piet Hein, who introduced it in 1942 at the
Niels Bohr Institute. Although Hein later renamed it to Con-tac-tix,
it became known in Denmark under the name ''Polygon'' due to an article by Hein in the 26 December 1942 edition of the Danish newspaper ''Politiken'', the first published description of the game, in which he used that name.
Nash's claim
The game was rediscovered in 1948 or 1949 by the mathematician
John Nash at
Princeton University
Princeton University is a private research university in Princeton, New Jersey. Founded in 1746 in Elizabeth as the College of New Jersey, Princeton is the fourth-oldest institution of higher education in the United States and one of the n ...
.
According to
Martin Gardner
Martin Gardner (October 21, 1914May 22, 2010) was an American popular mathematics and popular science writer with interests also encompassing scientific skepticism, micromagic, philosophy, religion, and literatureespecially the writings of L ...
, who featured Hex in his July 1957
Mathematical Games column, Nash's fellow players called the game either Nash or John, with the latter name referring to the fact that the game could be played on hexagonal bathroom tiles.
Nash insisted that he discovered the game independently of Hein, but there is some doubt about this, as it is known that there were Danish people, including
Aage Bohr, who played Hex at Princeton in the 1940s, so that Nash may have subconsciously picked up the idea. Hein wrote to Gardner in 1957 expressing doubt that Nash discovered Hex independently. Gardner was unable to independently verify or refute Nash's claim. Gardner privately wrote to Hein: "I discussed it with the editor, and we decided that the charitable thing to do was to give Nash the benefit of the doubt. ... The fact that you invented the game before anyone else is undisputed. Any number of people can come along later and say that they thought of the same thing at some later date, but this means little and nobody really cares."
In a later letter to Hein, Gardner added: "Just between you and me, and off the record, I think you hit the nail on the head when you referred to a 'flash of a suggestion' which came to Mr. Nash from a Danish source, and which he later forgot about. It seems the most likely explanation."
Published games

Initially in 1942, Hein distributed the game, which was then called Polygon, in the form of 50-sheet game pads. Each sheet contained an empty 11x11 empty board that could be played on with pencils or pens.
In 1952,
Parker Brothers marketed a version of the game under the name "Hex", and the name stuck.
Parker Brothers also sold a version under the "Con-tac-tix" name in 1968.
Hex was also issued as one of the games in the 1974 3M Paper Games Series; the game contained a 50-sheet pad of ruled Hex grids. Hex is currently published by Nestorgames in a 11x11 size and a 14x14 size.
Shannon's Hex machine
About 1950,
Claude Shannon
Claude Elwood Shannon (April 30, 1916 – February 24, 2001) was an American mathematician, electrical engineer, and cryptographer known as a "father of information theory".
As a 21-year-old master's degree student at the Massachusetts In ...
and
E. F. Moore constructed an analog Hex playing machine, which was essentially a resistance network with resistors for edges and light bulbs for vertices. The move to be made corresponded to a certain specified saddle point in the network. The machine played a reasonably good game of Hex. Later, researchers attempting to solve the game and develop Hex-playing computer algorithms emulated Shannon's network to create strong computer players.
Research timeline
It was known to Hein in 1942 that Hex cannot end in a draw; in fact, one of his design criteria for the game was that "exactly one of the two players can connect their two sides."
It was also known to Hein that the first player has a theoretical winning strategy.
In 1952 John Nash wrote up an existence proof that on symmetrical boards, the first player has a winning strategy.
In 1964, the mathematician
Alfred Lehman
Alfred may refer to:
Arts and entertainment
*''Alfred J. Kwak'', Dutch-German-Japanese anime television series
* ''Alfred'' (Arne opera), a 1740 masque by Thomas Arne
* ''Alfred'' (Dvořák), an 1870 opera by Antonín Dvořák
*"Alfred (Interlu ...
showed that Hex cannot be represented as a
binary matroid, so a determinate winning strategy like that for the Shannon switching game on a regular rectangular grid was unavailable.
In 1981, the Stefan Reisch showed that Hex is PSPACE-complete.
In 2002, the first explicit winning strategy (a reduction-type strategy) on a 7×7 board was described.
In the 2000s, by using
brute force
Brute Force or brute force may refer to:
Techniques
* Brute force method or proof by exhaustion, a method of mathematical proof
* Brute-force attack, a cryptanalytic attack
* Brute-force search, a computer problem-solving technique
People
* Brut ...
search computer algorithms, Hex boards up to size 9×9 (as of 2016) have been completely solved.
Until 2019, humans remained better than computers at least on big boards such as 19x19, but on Oct 30, 2019 the program Mootwo won against the human player with the best Elo rank on LittleGolem, also winner of various tournaments (the game is availabl
here. This program was based on Polygames (an open-source project, initially developed by
Facebook Artificial Intelligence Research and several universities) using a mix of:
* zero-learning as in
AlphaZero
* boardsize invariance thanks to fully convolutional neural networks (as in
U-Net
U-Net is a convolutional neural network that was developed for biomedical image segmentation at the Computer Science Department of the University of Freiburg. The network is based on the fully convolutional network and its architecture was modi ...
) and
pooling
* and growing architectures (the program can learn on a small board, and then extrapolate on a big board, as opposed to justified popular claims about earlier artificial intelligence methods such as the original AlphaGo).
Computer Hex
In the early 1980s Dolphin Microware published ''Hexmaster'', an implementation for
Atari 8-bit computers.
Various paradigms resulting from research into the game have been used to create digital computer Hex playing programs starting about 2000. The first implementations used evaluation functions that emulated Shannon and Moore's electrical circuit model embedded in an alpha-beta search framework with hand-crafted knowledge-based patterns. Starting about 2006, Monte Carlo tree search methods borrowed from successful computer implementations of Go were introduced and soon dominated the field. Later, hand crafted patterns were supplemented by machine learning methods for pattern discovery. These programs are now competitive against skilled human players.
Elo based ratings have been assigned to the various programs and can be used to measure technical progress as well as assess playing strength against Elo-rated humans. Current research is often published in either the quarterly ''
ICGA Journal'' or the annual ''Advances in Computer Games'' series (van den Herik et al. eds.).
Strategy
Although it is known that the first player (without the
swap rule
The pie rule, sometimes referred to as the swap rule, is a rule used to balance abstract strategy games where a first-move advantage has been demonstrated. After the first move is made in a game that uses the pie rule, the second player must sel ...
) has a theoretical winning strategy, it is not known what that strategy is, except for very small boards. However, there are a large number of useful tactical and strategic concepts available to Hex players.
Virtual connections and templates

A set of stones of one color is said to be ''virtually connected'' if the stones' owner can guarantee to connect them, no matter what the opponent does. The simplest example of a virtual connection is a ''bridge'', shown in diagram 1. Although the bridge's two red stones are not adjacent, Red can guarantee to connect them: if Blue plays in one of the bridge's empty cells, then Red can play in the other. Note that the virtual connection requires not just the two red stones, but also the two empty cells of the bridge. The cells (empty or otherwise) that are part of the virtual connection are called the ''carrier'' of the virtual connection.
A ''template'' is a pattern of stones and empty cells that is virtually connected and minimal (i.e., removing any stone or empty cell from the carrier would break the virtual connection). Templates can be characterized as ''interior templates'' (guaranteeing a connection between two or more stones) and ''edge templates'' (guaranteeing a connection between one or more stones and a board edge of the same color). Some examples of interior templates and edge templates are shown in diagrams 1 and 2, respectively.
Mathematical theory
Determinacy
It is not difficult to prove that Hex cannot end in a draw, i.e., no matter how the board is filled with stones, there will always be one and only one player who has connected their edges. This fact was known to Piet Hein in 1942, who mentioned it as one of his design criteria for Hex in the original Politiken article.
Hein also stated this fact as "a barrier for your opponent is a
connection for you".
John Nash wrote up a proof of this fact around 1949, but apparently didn't publish the proof. Its first exposition appears in an in-house technical report in 1952, in which Nash states that "connection and blocking the opponent are equivalent acts." A more rigorous proof was published by
John R. Pierce in his 1961 book ''Symbols, Signals, and Noise''. In 1979,
David Gale published a proof which also showed that it can be used to prove the two-dimensional
Brouwer fixed-point theorem, and that the determinacy of higher-dimensional variants proves the fixed-point theorem in general.
A proof of the no-draw property of Hex can be sketched as follows: consider the connected component of one of the red edges. This component either includes the opposite red edge, in which case Red has a connection, or else it doesn't, in which case the blue stones along the boundary of the connected component form a winning path for Blue. The concept of a connected component is well-defined because in a hexagonal grid, two cells can only meet in an edge or not at all; it is not possible for cells to overlap in a single point.
First-player winning strategy
In Hex without the
swap rule
The pie rule, sometimes referred to as the swap rule, is a rule used to balance abstract strategy games where a first-move advantage has been demonstrated. After the first move is made in a game that uses the pie rule, the second player must sel ...
on any board of size ''n''x''n'', the first player has a theoretical winning strategy. This fact was mentioned by Hein in his notes for a lecture he gave in 1943: "in contrast to most other games, it can be proved that the first player in theory always can win, that is, if she could see to the end of all possible lines of play.".
All known proofs of this fact are non-constructive, i.e., the proof gives no indication of what the actual winning strategy is. Here is a condensed version of a proof that is attributed to John Nash c. 1949.
The proof works for a number of games including Hex, and has come to be called the
strategy-stealing argument.
# Since it is impossible for the game to end in a draw (see above), either the first or second player must win.
# As Hex is a
perfect information game, there must be a winning strategy for either the first or second player.
# Let us assume that the second player has a winning strategy.
# The first player can now adopt the following strategy. They make an arbitrary move. Thereafter they play the winning second player strategy assumed above. If in playing this strategy, they are required to play on the cell where an arbitrary move was made, they make another arbitrary move. In this way they play the winning strategy with one extra piece always on the board.
# This extra piece cannot interfere with the first player's imitation of the winning strategy, for an extra piece is always an asset and never a handicap. Therefore, the first player can win.
# Because we have now contradicted our assumption that there is a winning strategy for the second player, we conclude that there is no winning strategy for the second player.
# Consequently, there must be a winning strategy for the first player.
Computational complexity
In 1976,
Shimon Even and
Robert Tarjan proved that determining whether a position in a game of generalized Hex played on arbitrary graphs is a winning position is
PSPACE-complete.
A strengthening of this result was proved by Reisch by reducing the
quantified Boolean formula problem In computational complexity theory, the language TQBF is a formal language consisting of the true quantified Boolean formulas. A (fully) quantified Boolean formula is a formula in quantified propositional logic where every variable is quantified ( ...
in
conjunctive normal form to Hex. In
computational complexity theory
In theoretical computer science and mathematics, computational complexity theory focuses on classifying computational problems according to their resource usage, and relating these classes to each other. A computational problem is a task solved ...
, it is widely conjectured that PSPACE-complete problems cannot be solved with efficient (polynomial time) algorithms. This result limits the efficiency of the best possible algorithms when considering arbitrary positions on boards of unbounded size, but it doesn't rule out the possibility of a simple winning strategy for the initial position (on boards of unbounded size), or a simple winning strategy for all positions on a board of a particular size.
Game tree of 11 by 11 Hex
In 11×11 Hex, there are approximately 2.4×10
56 possible legal positions; this compares to 4.6×10
46 legal positions in chess.
Computed strategies for smaller boards
In 2002, Jing Yang, Simon Liao and Mirek Pawlak found an explicit winning strategy for the first player on Hex boards of size 7×7 using a decomposition method with a set of reusable local patterns. They extended the method to weakly solve the center pair of topologically congruent openings on 8×8 boards in 2002 and the center opening on 9×9 boards in 2003. In 2009, Philip Henderson, Broderick Arneson and Ryan B. Hayward completed the analysis of the 8×8 board with a computer search, solving all the possible openings. In 2013, Jakub Pawlewicz and Ryan B. Hayward solved all openings for 9×9 boards, and one (the most-central) opening move on the 10×10 board.
For every N≤10, a winning first move in N×N Hex is the most-central one, suggesting the conjecture that this is true for every N≥1.
Variants
Other connection games with similar objectives but different structures include
Shannon switching game and
TwixT. Both of these bear some degree of similarity to the ancient Asian game of
Go.
Rectangular grids and paper and pencil
The game may be played on a rectangular grid like a chess, checker or go board, by considering that spaces (intersections in the case of go) are connected in one diagonal direction but not the other. The game may be played with paper and pencil on a rectangular array of dots or graph paper in the same way by using two different colored pencils.
Board sizes
Popular dimensions other than the standard 11x11 are 13×13 and 19×19 as a result of the game's relationship to the older game of
Go. According to the book ''
A Beautiful Mind'',
John Nash (one of the game's inventors) advocated 14×14 as the optimal size.
Rex (Reverse Hex)
The
misère Misère (French language, French for "destitution"), misere, bettel, betl, or (German language, German for "begging, beggar"; equivalent terms in other languages include , , ) is a bidding, bid in various card games, and the player who bids misè ...
variant of Hex. Each player tries to force their opponent to make a chain. Rex is slower than Hex since, on any empty board with equal dimensions, the losing play can delay a loss until the entire board is full.
On boards with unequal dimensions, the player whose sides are further apart can win regardless of who plays first. On boards with equal dimensions, the first player can win on a board with an even number of cells per side, and the second player can win on a board with an odd number. On boards with an even number, one of the first player's winning moves is always to place a stone in the acute corner.
''Blockbusters''
Hex had an incarnation as the question board from the television game show ''
Blockbusters''. In order to play a "move", contestants had to answer a question correctly. The board had 5 alternating columns of 4 hexagons; the solo player could connect top-to-bottom in 4 moves, while the team of two could connect left-to-right in 5 moves.
Y
The game of Y is Hex played on a triangular grid of hexagons; the object is for either player to connect all three sides of the triangle. Y is a generalization of Hex to the extent that any position on a Hex board can be represented as an equivalent position on a larger Y board.
Havannah
Havannah is game based on Hex. It differs from Hex in that it is played on a hexagonal grid of hexagons and a win is achieved by forming one of three patterns.
Projex
Projex is a variation of Hex played on a
real projective plane, where the players have the goal of creating a non
contractible loop.
Like in Hex, there are no ties, and there is no position in which both players have a winning connection.
Competition
As of 2016, there were tournaments reported from Brazil, Czech Republic, Denmark, France, Germany, Italy, Netherlands, Norway, Poland, Portugal, Spain, UK and the US. One of the largest Hex competitions is organized by the International Committee of Mathematical Games in Paris, France, which is annually held since 2013. Hex is also part of the
Computer Olympiad.
See also
*
Chinese Checkers, played on a hexagonal board
*
Connection games
*
Mathematical games
*
GIPF project, a set of 6 games played on hexvalent grids
*
Tak
Tak or TAK may refer to:
Places
* Dağdöşü or Tak, Azerbaijan, a village
* Taq, Iran or Tak, a village
* Tak province, Thailand
** Tak, Thailand, capital of the province
Entertainment
*'' Total Annihilation: Kingdoms'' or ''TA:K''
* Tak, ...
*
Game of Y
References
Further reading
*''Hex Strategy: Making the Right Connections '', Browne C.(2000), A.K. Peters Ltd. Natick, MA. (trade paperback, 363pgs)
*''HEX: The Full Story'', Hayward R. with Toft B.(2019), CRC Press Boca Raton, FL. (paperback)
External links
Hex: A Strategy Guidefree Net book by Matthew Seymour
Interactive tactical puzzles by Matthew Seymour
A Beginner's Guide to HexHex strategy for beginners by Matthew Seymour and Eric Silverman
Thesis on Hexhistory, classification and complexity
HexWiki a
wiki
A wiki ( ) is an online hypertext publication collaboratively edited and managed by its own audience, using a web browser. A typical wiki contains multiple pages for the subjects or scope of the project, and could be either open to the pu ...
dedicated to Hex
University of Alberta Computer Hex Research Groupgathering theoretical work on Hex (moved - top level pages a
downloadable material no longer available)
*
at
MathWorld with links to related mathematical papers
Printable Hex boardson A4 or A3 paper, for use with standard Go stones
{{Authority control
Board games introduced in 1942
Board games introduced in 1947
Abstract strategy games
Connection games
Positional games
PSPACE-complete problems
Parker Brothers games
Paper-and-pencil games
Solved games