Analysis
of the game of Hex
I found a new way to solve the game of Hex on tables of even side
without the pie rule. On tables of odd side it is known since the beginning of the
50s a simple winning strategy consisting in occupying the centre (that is
forbidden), described in Martin Gardner’s article on Scientific American of July 1957.
The strategy is the following:
considering a table of Hex with side of 10 boxes with the main diagonal
put in horizontal in which the superior left border is blue and the superior
right is red. The boxes which are adjacent to the superior blue border are
indicated with the numbers from one to ten from the bottom to the top and those
which are adjacent to the inferior red border with the letters from a to j
from the top to the bottom.
In Hex to defend means to attack: the game cannot finish equal,
forbidding the opponent to create a winning chain means to create one for your
own.
Red plays in one of the two central boxes placed on the minor diagonal.
Blue plays where he wants. Red answers, in order of priority, in a box:
-
marked with
the same number if Blue has just completed a chain of 2 boxes on same number
itself. Red plays in the box closest to one of the two central letters and at
equality of conditions choice is irrelevant;
-
adjacent to one in which Blue has just played and with another blue box,
when it is the only box to connect them (if there are several options Red
blocks the chain of maximum length and if there are more than one with the same
characteristics Red plays in the box nearer to one of the two central letters and
of minimum number);
-
adjacent to and connected with the red border, if Blue has played on the
border with the red border and with a red box marked with the numbers 2 or 9
already existing. In this way Red makes the connection to the red border that
is threatened;
-
in the right bottom adjacent box if Blue has played to the left of the
lower diagonal and over the box occupied by Red as first. If Blue has played to
the right of the lower diagonal and over the box occupied by Red as first this
one plays in the high left adjacent box. If Blue has played to the left of the
lower diagonal and under the box occupied by Red as first this one plays in the
high left adjacent box. If Blue has played to the right of the lower diagonal
and under the box occupied by Red as first this one plays in the high left
adjacent box. If a blue chain starts to the left of the lower diagonal and it
passes through it Red continues to embank it in the same way. Also in this case
for a symmetric thinking if a blue chain starts to the right of the lower
diagonal and it passes through it Red continues to embank it in the same way. If
Blue has played on a box marked by the same letter of that or those in which he
played before Red continues to answer in the same way;
-
if the answer chain is occupied Red lengthens his chain of maximum
length and which has more boxes nearer to the box in which he made his first
move. If two or more chains has the same characteristics Red plays in the chain
of maximum number and first in alphabetical order;
-
in the only box also adjacent to two red boxes, when the connection
between the two red boxes is threatened and it only takes a move to realize it.
It is possible to generalise
this strategy for tables on the side with a number of box bigger than 8 (the
ones to be solved).
Visit blog.massimodacasto.net
for comments on this article.
Massimo Dacasto
E-mail: angelodacasto@virgilio.it.
Analisi del gioco dell’Hex
Ho trovato un nuovo approccio
per risolvere il gioco dell’Hex su tavolieri di lato pari senza regola della
torta. Su tavolieri di lato dispari è conosciuta sin dagli anni ’50 una
semplice strategia vincente per il primo giocatore consistente nell’occupare il
centro (che è vietato), descritta nell’articolo di Martin Gardner su Scientific American del luglio 1957 e
raccolta in un libro del 1959 che fu tradotto in italiano con il titolo Enigmi e giochi matematici 1 (Sansoni).
La strategia è la seguente:
si consideri un tavoliere di
Hex con lato di 10 caselle con la diagonale maggiore disposta in orizzontale in
cui il bordo superiore sinistro è blu e quello superiore destro rosso. Le
caselle che confinano con il bordo superiore blu siano indicate con numeri
dall’uno al dieci dal basso verso l’alto e quelle che confinano con il bordo
inferiore rosso con lettere dalla a
alla j dall’alto verso il basso.
Nell’Hex difendersi
equivale ad attaccare: in un gioco che non può finire in parità impedire
all’avversario di creare una catena vincente equivale a crearne una propria.
Il Rosso gioca in una delle
due caselle centrali situate sulla diagonale minore.
Il Blu gioca dove lo ritiene
opportuno. Il Rosso risponde, in ordine di priorità, in una casella:
-
contrassegnata dallo
stesso numero se il Blu ha appena completato una catena di 2 caselle sul numero
stesso. Il Rosso gioca nella casella più vicina a una delle due lettere
centrali e a parità di condizioni la scelta è indifferente;
-
confinante con quella in
cui il Blu ha appena giocato e con un’altra casella blu, quando è unica la
casella per connetterle (se ci sono varie opzioni il Rosso blocca la catena di
lunghezza potenzialmente massima e se ne esistono più di una con gli stessi
requisiti il Rosso gioca nella casella più vicina a una delle due lettere
centrali e di numero minimo);
-
confinante e connessa
con il bordo rosso, se il Blu ha giocato a confine con il bordo rosso stesso e
con una casella rossa contrassegnata dal numero 2 o 9 già esistente. In questo
modo il Rosso attua la connessione al bordo rosso che viene minacciata;
-
confinante in basso a
destra se il Blu ha giocato a sinistra della diagonale minore e sopra alla
casella occupata alla prima mossa dal Rosso. Se il Blu ha giocato a destra
della diagonale minore e sopra alla casella occupata alla prima mossa dal Rosso
quest'ultimo risponde nella casella in basso a destra. Se il Blu ha giocato a
sinistra della diagonale minore e sotto alla casella occupata alla prima mossa
dal Rosso quest'ultimo risponde nella casella confinante in alto a sinistra. Se
il Blu ha giocato a destra della diagonale minore e sotto alla casella occupata
alla prima mossa dal Rosso quest'ultimo risponde in alto a sinistra. Se una
catena blu inizia a sinistra della diagonale minore e ci passa il Rosso
continua ad arginarla nello stesso modo. Anche in questo caso per un ragionamento
simmetrico se una catena blu inizia a destra della diagonale minore e ci passa
il Rosso continua ad arginarla nello stesso modo. Se una catena blu inizia
sopra alla casella in cui ha giocato il Rosso per primo e vi prosegue a destra
il Rosso continua ad arginarla nello stesso modo. Anche in questo caso per un
ragionamento simmetrico se una catena blu inizia sotto alla casella in cui ha
giocato il Rosso per primo e vi prosegue a sinistra il Rosso continua ad
arginarla nello stesso modo. Se il Blu ha giocato in una casella contrassegnata
dalla stessa lettera di quella o quelle in cui ha giocato prima il Rosso
continua a rispondere nello stesso modo;
-
se la casella di
risposta è occupata il Rosso allunga la sua catena di lunghezza massima e che
ha più caselle vicine alla casella in cui ha effettuato la prima mossa. Se due
o più catene hanno gli stessi requisiti il Rosso gioca nella casella di numero
massimo e prima in ordine alfabetico;
-
nell’unica casella
confinante anche con due caselle rosse, quando viene minacciata la connessione
tra le due caselle rosse stesse e manca una mossa per attuarla.
È possibile generalizzare
questa strategia per tavolieri di lato con un numero di caselle pari e maggiore
di 8 (quelli da risolvere).
Visiti blog.massimodacasto.net
per commenti su questo articolo.
Massimo Dacasto
E-mail: angelodacasto@virgilio.it.