Note: In 2002, Christian has put a reward of 1000 euros for making a program for the game of Havannah, that can beat him 1 out of 10 games within the next ten years. He lost this bet.

In turn, the players place a stone of their colour on one of the unoccupied positions. Once a stone has been placed on the board, it remains there until the end of the game. This means that stones cannot be moved or beaten. For that matter the game can also played with paper and (coloured) pencils. See this PostScript file or this PDF for a board where the positions are represented by circles. Or this PDF with six boards on one page.

The aim of the game is to make a winning figure. The first player to make a winning figure wins the game. Each winning figure consists of a chain of stones. There are three kinds of winning figures: bridges, forks, and cycles. The requirements for these are:

- Bridges: A chain which connects two corner points.
- Forks: A chain which connect three sides.
- Cycles: A closed chain, encircling at least one point. Encircled points may be occupied by stones of either colour.

Since the first player to move in Havannah 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. The pie rule is not included in the following formalisation.

In this definition we start with a cube of points and take the points that are on the intersection of a plane, that goes right through the middle of six of the ribs, creating the desired hexagonal set of points.dfpoints = { (x,y,z)in{1-size,..,size-1}^{3}| x + y + z = 0 }

The coordinates with which the points are defined have a degree of freedom of only two. This means that each of the elements can always be calculated if the other two are known.

(This definition is used directly in the definition of
`distance`,
`neigbour`,
`neighbours_of`,
`corner_points`, and
`side_points` below.)

The sum of absolute differences of the coordinates is always even, because the degree of freedom is two. The points with the same distance to a given point are on the imaginary hexagon of which the corners are on the lines through this point and on the given distance.dfdistance((x1,y1,z1)inpoints, (x2,y2,z2)inpoints) = ( |x1-x2| + |y1-y2| + |z1-z2| )/2

(This definition is used directly in the definition of
`neigbour` and
`cycles` below.)

dfneighbour = { (p,q)inpoints^{2}| distance(p,q) = 1 }

(This definition is used directly in the definition of
`neigbour` and
`cycles` below.)

dfneighbours_of(pinpoints) = { qinpoints | (p,q)inneighbour }

(This definition is used directly in the definition of
`cornerside_points` and
`side_points` below.)

With this definition we have established the board and some of its properties.dfcorner_points = { pinpoints |count(neighbours_of(p)) = 3 }dfside_points = { pinpoints |count(neighbours_of(p)) = 4 }

dfpositions =powerset(points)

In thisdfconnected_in(Qinpositions) = (neighbourintersectionQ^{2})^{*}

dfconnected_within(ainQ, Qinpositions) = { binQ | (a,b)inconnected_in(Q) }

dfgroups = { groupinpositions |Foralla,bingroup ((a,b)inconnected_in(group)) }

dfbridges = { positioninpositions |Existsgroupingroups ( groupsubsetpositionandcount( positionintersectioncorner_points ) = 2 ) }

dfforks = { positioninpositions |Existsgroupingroups ( groupsubsetpositionandcount({ connected_within(s, side_points) | sin(positionintersectionside_points) }) = 3 ) }

It is not obvious that this definition is sufficient and complete. If there exists a cycle in a group encircling at least one point, it is possible to create a cycle without sharp angles and still encircling at least one point. A sharp angle consists of three successive points in the chain that are all neighbours of each other. The middle of these points can be removed out of the chain, without disconnecting it. By repeating this process of removing sharp angles in the chain we get a chain that fits the given definition.dfcycles = { positioninpositions |Existsn>1, (p_{0},..,p_{n-1})inposition^{n}(Forall1<=i<n ( distance(p_{i},p_{(i+1) mod n}) = 1anddistance(p_{i},p_{(i+2) mod n}) >= 2 ) ) }

The other way around is that we have to prove that the cycles defined with this definition do enclose at least one point. If we show that the cycles which are defined by this definition do at least have six points, it is easy to see that these cycles do enclose at least one point. We show that the cycle must at least have six points by stating the following:

Forall(p_{0},..,p_{n-1})inpoints^{n}(Forall1<=i<n ( distance(p_{i},p_{(i+1) mod n}) = 1anddistance(p_{i},p_{(i+2) mod n}) >= 2 ) =>Forall1<=i<n ( distance(p_{i},p_{(i+3) mod n}) >= 2anddistance(p_{i},p_{(i+4) mod n}) >= 2anddistance(p_{i},p_{(i+5) mod n}) >= 1anddistance(p_{i},p_{(i+6) mod n}) >= 0 ) )

dfwinning = cyclesunionbridgesunionforks

Furthermore, we have to define intermediate board positions, which do not contain a winning position for both players:dfgame_board_positions = { (a,b)inpositions^{2}| aintersectionb = {}and(count(a) =count(b)orcount(a) =count(b) + 1)andnot(ainwinningandbinwinning) }

dfintermediate_game_board_positions = { (a,b)ingame_board_positions |not(ainwinning)andnot(binwinning) }

dfvalid_proceedings((a,b)ingame_board_positions) = { (c,d)ingame_board_positions | asubsetcandbsubsetdandcount(c) +count(d) =count(a) +count(b) + 1 }

dfHavannah_games = { (p_{0}, .., p_{n})ingame_board_positions^{n}| p_{0}= ({},{})andForall0<=i<n (p_{i}inintermediate_game_board_positions)andForall0<i<=n (p_{i}invalid_proceedings(p_{i-1})and( p_{n}in (game_board_positions - intermediate_game_board_positions)orvalid_proceedings(game, p_{n}) = {}) }

dfplayers = { player = { (p, q)ingame_board_positions^{2}| qinvalid_proceedings(p) } |Forallpin{p | (p,q)inplayer}count({q | (p,q)inplayer}) <= 1) }

dfplayed_game(player_{0}inplayers, player_{1}inplayers) = (p_{0}, .., p_{n})inHavannah_gameswhereForall0<=i<n ((p_{i}, p_{i+1})inplayer_{i mod 2})

dfoutcome((p_{0}, .., p_{n-1}, (a, b))ingames) =ifainwinningthen1elifbinwinningthen-1else0fi

How many such super Havannah players exist, is unknown. We could also define the set of players that always lose. But than we are actually defining another type of game.dfsuper_Havannah_players = { playerinplayers |Forallqinplayers - {p} ( outcome(played_game(p,q)) >= 0andoutcome(played_game(q,p)) >= 0) }

home and email