Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Hex A game of connections The Beginning • Invented independently by Piet Hein in 1942 and John • • • Nash in 1948. Played on a grid of hexagons. Standard size for tournaments is 11x11 or 14x14. Object of the game is to make a continuous chain of your colour to connect your sides of the board. Simple Rules – Play anywhere: Very wide game tree – Swap Rule: Helps balance the game • Early Game Proofs – First Player Win – No Ties The Board Virtual Connections • What is a virtual connection? – Subgame: goal is to connect two board positions, not necessarily the edges. – A guarantee that for a given subgame, even if the opponent plays first, you can still win the subgame. – An edge to edge virtual connection for a player means they win! Basic Virtual Connections • Simplest Basic Virtual Connection is the “two bridge” – The two blue pieces here form a two bridge, and the lower piece forms a two bridge with the edge. • In diagrams, we represent virtual connections by colouring all the pieces required to maintain the connection. Edge Connection Templates 2 out connection • A good example of more complex • • • virtual connections are edge templates. These templates are virtual connections from the edge to a piece on the board. The farther out the piece, the more pieces that are needed to connect it to the edge. Very useful to know for learning how to play Hex better! 4 out connections 3 out connections Almost Virtual Connections • A subgame in which if we • • get one free move, we play one piece to create a new full connection. The piece that creates the full connection is called the key of the almost connection. In our diagrams, a blue key is coloured cyan and a red key is coloured magenta. Complex Virtual Connections • The advantage to virtual • • connections is the number of pieces required to win a game on any board is much smaller. Sometimes, you can win with only a handful of pieces on the board! Consider this board position. Blue responds to Red’s rather poor followup move … • And Blue wins, because he already has a full connection from edge to edge! Discovering Virtual Connections Recursive Virtual Connections • By applying three rules, we can find some virtual • • • • connections The connections found are a subset of all connections, but they are still very useful These rules were formalized in two papers written by Vadim Anshelevich As each connection is discovered, it is added to a data structure for use by later rules Every two adjacent positions have a trivial connection joining them The And Rule • Assume we have – – – – Connection from A-B Connection from B-C B is our colour A-B and B-C do not intersect • Then the union of A-B and B-C is a connection from A-C The And Rule – Empty Intersection • The two connections • must have an empty intersection If they do not, one opponent move can challenge both components The Almost Rule • Assume we have – – – – Connection from A-B Connection from B-C B is empty A-B and B-C do not intersect • Then the union of AB, B-C, and B is an almost connection from A-C The Or Rule • Assume we have – At least two Almost connections from A-B – A subset of these connections has an empty intersection • Then, the union of this subset is a connection from A-B The Or Rule - continued Recursive Virtual Connections Trivial Connections AND Connections ALMOST Connections OR Connections When no new connections are found, we are done. Applications of Virtual Connection Information • We know of three good uses for virtual connection information – Proving a win for a player – Evaluation Function – Limiting the search tree Proving a win for a player • If a player has an edge-toedge connection, they have a guaranteed win. Evaluation Function • In 1953, Claude Shannon and E.F. Moore made a Hex-playing machine, based on electrical resistances • Vadim Anshelevich describes a method of using electrical resistances in his Hex papers. Evaluation Function • Each virtual connection is a wire between two positions, with a resistance based on the size of the connection, and the state of the endpoints. • A voltage is applied to the edges. The resulting current that passes through the system is the value of the evaluation function. Limiting the search tree • On smaller boards (7x7 and less) one or both players will often have almost connections joining edge to edge within the first few moves • If the opponent does not play within this connection, then the player can play the ‘key’ of the almost connection, forming a full connection. Limiting the search tree Mustplay Regions • If a player has multiple almost edge-edge connections, then their opponent must play a move that disrupts all such connections. • The opponent must then play a move in the intersection of all of the player’s almost edge-edge connections. Mustplay Region for D5 Mustplay Regions • Since a player is forced to play in their mustplay region, we can eliminate parts of the search tree. • On smaller boards (7x7 and lower) most lines of play have mustplay regions within the first few moves • On larger boards, mustplay regions will only develop in the midgame.