Hex (board game)
Hex is a two player abstract strategy board game in which players attempt to connect opposite sides of a hexagonal board. Hex was invented by mathematician and poet Piet Hein in 1942 and independently by John Nash in 1948.
11×11 Hex gameboard showing a winning configuration for Blue | |
Years active | 1942–present |
---|---|
Genre(s) | Board game Abstract strategy game Connection game |
Players | 2 |
Setup time | None |
Playing time | 30 minutes – 2 hours (11×11 board) |
Random chance | None |
Skill(s) required | Strategy, tactics |
It is traditionally played on an 11×11 rhombus board, although 13×13 and 19×19 boards are also popular. Each player is assigned a pair of opposite sides of the board which they must try to connect by taking turns placing a stone of their color onto any empty space. Once placed, the stones are unable to be 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 of the game board.
The game has deep strategy, sharp tactics and a profound mathematical underpinning related to the Brouwer fixed-point theorem. The game was first marketed as a board game in Denmark 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.
Hex-related research is current in the areas of topology, graph and matroid theory, combinatorics, game theory and artificial intelligence.
Game type
Hex is a connection game,[1] and can be classified as a Maker-Breaker game,[1]:122 a particular type of positional game. The game can never end in a draw (tie),[1]:99 in other words, Hex is also a "determined game".
Hex is a finite, perfect information game, and an abstract strategy game that belongs to the general category of connection games. Hex is a special case of the "node" version of the Shannon switching game.[1]:122
As a product, Hex is a board game; it may also be played with paper and pencil.
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,[2][3] 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. The game was independently re-invented in 1948 by the mathematician John Nash at Princeton University.[4][5] According to Martin Gardner, 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.[4] Hein wrote to Gardner in 1957 expressing doubt that Nash discovered Hex independently, but Nash insists that he reinvented the game before being exposed to Hein's work. Gardner was unable to independently verify or refute Nash's claim.[6]
Published games
In 1952, Parker Brothers marketed a version. They called their version "Hex" and the name stuck.[4] Parker Brothers also sold a version under the "Con-tac-tix" name in 1968.[2] Hex was also issued as one of the games in the 1974 3M Paper Games Series; the game contained a 5½ × 8½ inch 50-sheet pad of ruled Hex grids. Hex is currently published by Nestorgames in a 11x11 size and a 14x14 size.[7]
Shannon's Hex machine
About 1950, American mathematician and electrical engineer Claude Shannon and E. F. Moore constructed an analog Hex playing machine, which was essentially a resistance network with resistors for edges and lightbulbs for vertices.[8] 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 make strong automatons.[9]
Research timeline
In 1952 John Nash expounded an existence proof that on symmetrical boards, the first player has a winning strategy.
In 1964, mathematician Alfred Lehman 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. The game was later shown to be 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 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 available here). This program was based on Polygames[10] (an open-source project, initially developed by Facebook Artificial Intelligence Research and several universities[11]) using a mix of:[12]
- zero-learning as in AlphaZero
- boardsize invariance thanks to fully convolutional neural networks (as in U-Net) 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[13] about earlier artificial intelligence methods such as the original AlphaGo).
Automatons
In the early 1980s Dolphin Microware published Hexmaster, an implementation for Atari 8-bit computers.[14] Various paradigms resulting from research into the game have been used to create digital computer Hex playing automatons 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.).
Game play
Each player has an allocated color, conventionally Red and Blue or White and Black.[4] Players take turns placing a stone of their color on a single cell within the overall playing board. Once placed, stones are not moved, captured or removed from the board. The goal for each player is to form a connected path of their own stones linking the opposing sides of the board marked by their colors, before their opponent connects his or her sides in a similar fashion. The first player to complete his or her connection wins the game. The hexagons on each of the four corners belong to both adjacent sides.
It is not necessary to construct a complete chain between sides or fill up the whole board before the game is decided (but if it does by construction, the player placing the last stone will win); usually only 1/3 to 40% of the board is filled before it becomes obvious that one player or the other can force a win. This is somewhat analogous to chess games ending long before checkmate - the game usually ends with one player or the other resigning.
Since the first player to move in Hex has a distinct advantage, the pie rule is generally implemented for fairness. This rule allows the second player to choose whether to switch positions with the first player after the first player makes the first move.
Strategy
From the proof of a winning strategy for the first player, it is known that the Hex board must have a complex type of connectivity which has never been solved. Play consists of creating small patterns which have a simpler type of connectivity called "safely connected", and joining them into sequences that form a "path". Eventually, one of the players will succeed in forming a safely connected path of stones and spaces between his sides of the board and win. The final stage of the game, if necessary, consists of filling in the empty spaces in the path.[15]
A "safely connected" pattern is composed of stones of the player's color and open spaces which can be joined into a chain, an unbroken sequence of edge-wise adjacent stones, no matter how the opponent plays.[16] One of the simplest such patterns is the bridge (see diagram 1), which consists of two stones of the same color (A and C), and a pair of open spaces (B and D).[17] If the opponent plays in either space, the player plays in the other, creating a contiguous chain. There are also safely connected patterns which connect stones to edges.[18] There are many more safely connected patterns, some quite complex, built up of simpler ones like those shown. Patterns and paths can be disrupted by the opponent before they are complete, so the configuration of the board during an actual game often looks like a patchwork rather than something planned or designed.[15]
There are weaker types of connectivity than "safely connected" which exist between stones or between safely connected patterns which have multiple spaces between them.[19] The middle part of the game consists of creating a network of such weakly connected stones and patterns[19] which hopefully will allow the player, by filling in the weak links, to construct just one safely connected path between sides as the game progresses.[19]
Success at Hex requires a particular ability to visualize synthesis of complex patterns in a heuristic way, and estimating whether such patterns are 'strongly enough' connected to enable an eventual win.[15] The skill is somewhat similar to the visualization of patterns, sequencing of moves, and evaluating of positions in chess.[20]
Mathematical theory
Determinacy
John Nash was the first to prove (c. 1949)[21] that Hex cannot end in a draw, a non-trivial result colloquially called the "Hex theorem", which we now know is equivalent to the Brouwer fixed-point theorem. Apparently, he didn't publish the proof. The first exposition of it appears in an in-house technical report in 1952,[22] in which he states that "connection and blocking the opponent are equivalent acts." The first rigorous proof was published by John R. Pierce in his 1961 book Symbols, Signals, and Noise.[23] 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.[24] A brief sketch of the no-draw ending requirement of Hex from that paper is presented below:
- Begin with a Hex board completely filled with hexagons marked with either X or O (indicating which player played on that hexagon).
- Starting at a hexagon vertex at the corner of the board where the X side and O sides meet, draw a path along the edges between hexagons with different X/O markings.
- Since every vertex of the path is surrounded by three hexagons, the path cannot self-intersect or loop, since the intersecting portion of the path would have to approach between two hexagons of the same marking. So, the path must terminate.
- The path cannot terminate in the middle of the board since every edge of the path ends in a node surrounded by three hexagons—two of which have to be differently marked by construction. The third hexagon must be differently marked from the two adjacent to the path, so the path can continue to one side or the other of the third hexagon.
- Similarly, if the sides of the board are considered to be a solid wall of X or O hexagons, depending on which player is trying to connect there, then the path cannot terminate on the sides.
- Thus the path can only terminate on another corner.
- The hexagons on either side of the line form an unbroken chain of X hexagons on one side and O hexagons on the other by construction.
- The path cannot terminate on the opposite corner because the X and O markings would be reversed at that corner, violating the construction rule of the path.
- Since the path connects adjacent corners, the side of the board between the two corners (say, an X side) is cut off from the rest of the board by an unbroken chain of the opposite markings (O in this case). That unbroken chain necessarily connects the other two sides adjacent to the corners.
- Thus, the completely filled Hex board must have a winner.
There is a reductio ad absurdum existence proof attributed to John Nash c. 1949 that the first player in Hex on a board of any size has a winning strategy. Such a proof gives no indication of a correct strategy for play. The proof is common to a number of games including Hex, and has come to be called the "strategy-stealing" argument. Here is a highly condensed informal statement of the proof:[4]
- It is impossible for the game to end in a draw (see above), therefore 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 defense. He makes an arbitrary move. Thereafter he plays the winning second player strategy assumed above. If in playing this strategy, he is required to play on the cell where an arbitrary move was made, he makes another arbitrary move. In this way he plays 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 are forced to drop this assumption.
- Consequently, there must be a winning strategy for the first player.
Computational complexity of generalizations
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.[25] A strengthening of this result was proved by Reisch by reducing quantified Boolean formula in conjunctive normal form to Hex played on arbitrary planar graphs.[26] In computational complexity theory, 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×1056 possible legal positions;[27] this compares to 4.6×1046 legal positions in chess.[28]
A rough estimate of the number of nodes in the game tree can be obtained as an exponential function of the average branching factor and the average number of plies in a game thus: bd where d is the ply depth and b is the branching factor. In Hex, the average branching factor is a function of the ply depth. It has been stated that the average branching factor is about 100; that implies an average ply depth of 43 (there will be 121 open spaces on the board when the first player is to make his first move, and 79 when he is to make his 22nd move, the 43rd ply - the average number of open spaces, i.e. branching factor, during the game is (121+120+...+79)/43=100). Therefore, the game tree size has an upper bound of approximately 10043 = 1086.[29] The bound includes some number of illegal positions due to playing on when there is a complete chain for one player or the other, as well as excludes legal positions for games longer than 43 ply. Another researcher obtained a state space estimate of 1057 and a game tree size of 1098 using an upper limit of 50 plies for the game. This compares to 10123 node game tree size of chess.
Interesting game tree reductions are available by noting that the board has dual bilateral symmetry as well as 180° rotational symmetry: for each position, a topologically identical position is obtained by flipping the board left-right, top-bottom, or rotating it 180°.
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.[30] 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.[31] 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.[32] 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.[33] 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 variant of Hex. Each player tries to force his 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.[34] On boards with unequal dimensions, the player whose sides are further apart can win regardless of who plays first.[35] 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.[36][37] On boards with an even number, one of the first player's winning moves is always to place a stone in the accute corner.[38]
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.[39] 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 noncontractible loop.[40] 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 over-the-board tournaments reported from Brazil, Czech Republic, Denmark, France, Germany, Italy, Netherlands, Norway, Poland, Portugal, Spain, UK and the US.
One of the largest Hex tourneys 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
- Game of Y
References
- Hayward; Toft (2019). Hex, Inside and Out: The Full Story. CRC Press.
- Con-tac-tix manual (PDF). Parker Brothers. 1968.
- Hayward, Ryan B.; Toft, Bjarne (2019). Hex, inside and out : the full story. Boca Raton, Florida: CRC Press. p. 156. ISBN 978-0367144258.
- Gardner, M. (1959). The Scientific American Book of Mathematical Puzzles & Diversions. N.Y., N.Y.: Simon and Schuster. pp. 73–83. ISBN 0-226-28254-6.
- Nasar, Sylvia (13 November 1994). "The Lost Years of a Nobel Laureate". The New York Times. Retrieved 23 August 2017.
- Hayward, Ryan B.; Toft, Bjarne (2019). Hex, inside and out : the full story. Boca Raton, Florida: CRC Press. p. 127-138. ISBN 978-0367144258.
- "nestorgames - fun to take away". www.nestorgames.com. Retrieved 3 September 2020.
- Shannon, C. (1953). "Computers and Automata". Proceedings of the Institute of Radio Engineers. 41 (10): 1234–41. doi:10.1109/jrproc.1953.274273. S2CID 51666906.
- Anshelevich, V. (2002). A Hierarchical Approach to Computer Hex.
- facebookincubator/Polygames, Facebook Incubator, 28 May 2020, retrieved 29 May 2020
- "Open-sourcing Polygames, a new framework for training AI bots through self-play". ai.facebook.com. Retrieved 29 May 2020.
- Cazenave, Tristan; Chen, Yen-Chi; Chen, Guan-Wei; Chen, Shi-Yu; Chiu, Xian-Dong; Dehos, Julien; Elsa, Maria; Gong, Qucheng; Hu, Hengyuan; Khalidov, Vasil; Li, Cheng-Ling (27 January 2020). "Polygames: Improved Zero Learning". arXiv:2001.09832 [cs.LG].
- Marcus, Gary (17 January 2018). "Innateness, AlphaZero, and Artificial Intelligence". arXiv:1801.05667 [cs.AI].
- Kucherawy, Murray (January 1984). "Hexmaster". Antic. p. 112. Retrieved 18 January 2019.
- Browne p.
- Browne, p.28
- Browne, pp. 29–30
- Browne, pp. 71–77
- Browne, p.
- Lasker, p.
- Hayward, Ryan B.; Rijswijck, van, Jack (6 October 2006). "Hex and combinatorics". Discrete Mathematics. 306 (19–20): 2515–2528. doi:10.1016/j.disc.2006.01.029. Retrieved 21 October 2020.
- Nash, John (Feb. 1952). Rand Corp. technical report D-1164: Some Games and Machines for Playing Them. https://www.rand.org/content/dam/rand/pubs/documents/2015/D1164.pdf
- Hayward, Ryan B.; Toft, Bjarne (2019). Hex, inside and out : the full story. Boca Raton, Florida: CRC Press. p. 99. ISBN 978-0367144258.
- David Gale (1979). "The Game of Hex and Brouwer Fixed-Point Theorem". The American Mathematical Monthly. Mathematical Association of America. 86 (10): 818–827. doi:10.2307/2320146. JSTOR 2320146.
- Even, S.; Tarjan, R. E. (1976). "A Combinatorial Problem Which is Complete in Polynomial Space". Journal of the ACM. 23 (4): 710–719. doi:10.1145/321978.321989. S2CID 8845949.
- Stefan Reisch (1981). "Hex ist PSPACE-vollständig (Hex is PSPACE-complete)". Acta Informatica (15): 167–191. doi:10.1007/bf00288964. S2CID 9125259.
- Browne, C (2000). Hex Strategy. Natick, MA: A.K. Peters, Ltd. pp. 5–6. ISBN 1-56881-117-9.
- Tromp, J. "Number of chess diagrams and positions". John's Chess Playground. Archived from the original on 29 June 2011.CS1 maint: bot: original URL status unknown (link)
- The exact number of nodes is actually 121*120*...*79=121!/78!=7.4*1085.
- On a decomposition method for finding winning strategy in Hex game Archived 2 April 2012 at the Wayback Machine, Jing Yang, Simon Liao and Mirek Pawlak, 2002
- Unpublished white papers, formerly @ www.ee.umanitoba.com/~jingyang/
- Solving 8x8 Hex, P. Henderson, B. Arneson, and R. Hayward, Proc. IJCAI-09 505-510 (2009)
- Pawlewicz, Jakub; Hayward, Ryan (2013). "Scalable Parallel DFPN Search" (PDF). Proc. Computers and Games. Retrieved 21 May 2014.
- Hayward, Ryan B.; Toft, Bjarne (2019). Hex, inside and out : the full story. Boca Raton, Florida: CRC Press. p. 175. ISBN 978-0367144258.
- Hayward, Ryan B.; Toft, Bjarne (2019). Hex, inside and out : the full story. Boca Raton, Florida: CRC Press. p. 154. ISBN 978-0367144258.
- Gardner (1959) p.78
- Browne (2000) p.310
- Hayward, Ryan B.; Toft, Bjarne (2019). Hex, inside and out : the full story. Boca Raton, Florida: CRC Press. p. 175. ISBN 978-0367144258.
- Freeling, Christian. "How I invented games and why not". MindSports. Retrieved 19 October 2020.
- "Projex". BoardGameGeek. Retrieved 28 February 2018.
Further reading
External links
- Hex: A Strategy Guide free Net book by Matthew Seymour
- Thesis on Hex history, classification and complexity
- HexWiki, a wiki dedicated to Hex
- University of Alberta Computer Hex Research Group
- Theory page gathering theoretical work on Hex (moved - top level pages at Hex archive; downloadable material no longer available)
- Hex at BoardGameGeek
- Game of Hex at MathWorld with links to related mathematical papers
- Printable Hex boards on A4 or A3 paper, for use with standard Go stones