← Nine Men's Morris against the computer

Nine Men's Morris Strategy: Forks, Blocks and How to Beat the Computer

The numbers on this page come from running the game's own code — its rules, its evaluation and its search. Easy has no randomness, so the winning line was replayed move by move and each figure against it rests on 2,000 games. Hard and Expert think against a clock, so they were simulated at a fixed depth of six plies over 15 to 30 games per figure. The endgames with three men are exact: every position was solved.
The short answer

The game here is the classic Nine Men's Morris with flying, and its Easy level can be beaten the same way every time: place b2, d2, b4, f6, d5, a1, g1, g4, e4, then slide b2–b4, and none of its nine men can move — a win in ten moves, the fastest the rules allow. In ordinary play the habit that pays most is the threat that cannot be parried: adding it to careful play lifts the win rate over Easy from 19% to 90% of 2,000 simulated games. Hard lost 5 games of 30 to our best simple rule, all of them by being blocked; Expert, searching six plies, lost none of 110.

Which game this is

Nine Men's Morris has many house rules, so it is worth saying exactly what is played here. Each side has nine men; you play blue and move first. There are three phases: placing the men one at a time, moving them along the lines to a neighbouring empty point, and flying — a side left with exactly three men may move a man to any empty point.

  • A mill is three of your men on one line. Closing one, in any phase, removes one enemy man. A man in a mill cannot be taken while its owner has men outside mills.
  • Closing two mills with a single move still removes only one man.
  • You lose with two men left, or when it is your turn and none of your men can move.
  • The game is drawn when the same position comes up three times, or after 50 moves without a mill — counted for both sides together, so 25 moves each.

The board has 24 points and no labels, so this page uses the usual notation: letters a–g from left to right, numbers 1–7 from the bottom. The table shows the board as a map: each number stands on a point and says how many neighbours that point has.

abcdefg
7232
6242
5232
4343343
3232
2242
1232

Every point lies on exactly two lines, so every point can take part in two mills. What differs is the number of neighbours: four points have four (d6, b4, f4, d2), eight have three, and the twelve corners have two.

Placing: which points are strongest

The usual advice is to take the busy points, and the map shows which those are: only d6, b4, f4 and d2 have four neighbours. A man there has the most ways out later and stands in the way of the most enemy moves.

We measured it with two copies of the same rule-based player (the best rule from the table below), forcing the first man onto each kind of point, 2,000 games each:

First man onFirst player winsDrawLosesWins minus losses
A four-neighbour point (d6, b4, f4, d2)49.0%12.2%38.9%+10
A corner of the outer or inner ring49.9%5.1%45.0%+5
A corner of the middle ring (b6, f6, b2, f2)44.4%9.6%46.0%−2
A three-neighbour midpoint43.6%9.4%47.0%−3

So the four-neighbour points are the only start that leaves the first player clearly ahead; the margin of error on the last column is about two points either way. The computer agrees. Easy takes d6 whenever it is free and b4 when it is not. Hard and Expert, searching six plies, answered a first man on d7 or b6 with d6, and a first man on d6 with b4; only against the corner a7 did they prefer the point next to it, d7.

The other half of placing is the moment it ends. With all eighteen men down, only six points are empty, and you are the one who has to move first. A side with no legal move loses at once. A player who looked only for mills and threats lost 61 games of 2,000 to Easy on that very first slide, boxed in before the movement phase had begun. Before your last two or three men go down, check that at least one of your men will have an empty neighbour — and count how many the computer's men will have.

Forks and the running mill

A single threat — two men on a line with the third point empty — wins nothing against any level here: even Easy puts a man on the third point every time. What wins a man is a threat that cannot be parried. There are two kinds.

  • The fork. One move creates two threats at once, on two different lines. The opponent can block one; you close the other.
  • The running mill (in German, Zwickmühle; the game's own article calls it a double mill). Five men arranged so that one of them slides between two lines: stepping out of one mill closes the other. Every move closes a mill and removes a man, and no reply stops it unless the opponent can take or block the sliding man.

The value of this is easy to measure. A careful player — one who closes a mill when it is there and never makes a move that lets the computer close one — beats Easy in only 19% of games and draws 70%: nothing ever happens. Add one habit, “if some safe move makes a threat that no reply can parry, play it”, and the same player wins 90%.

Blocking is the other way to win, and it is stronger than it looks. The same careful player, choosing each time the safe move that leaves the computer's men the fewest empty neighbouring points, beats Easy in 54% of games without planning a single mill; one win in six of those came from leaving it no move at all. The stronger levels do the same to you: Expert won 16 of 20 games against that player by blocking it, not by taking its men.

Do not open a mill just to close it again unless the point you leave is safe. If an enemy man can step onto it, or the opponent can answer with a mill of his own, the swing costs you the mill.

Which man to remove

When you close a mill, the choice of the man to take matters about as much as an extra habit in the list above. We compared a random removal with a simple order of preference:

  1. A man whose removal leaves the opponent unable to close a mill on the next move.
  2. A man standing in a pair with the third point empty — a mill in waiting.
  3. Otherwise the man with the most neighbours: it is the most mobile, and it blocks you the most.

Against Easy, our best rule wins 91.4% of games with this order and 85.0% with a random removal; the careful player without forcing moves goes from 19% to 25%. A removal can also be the last move of the game: if it leaves the opponent's remaining men without an empty neighbour, he has lost, however many men he has.

Flying: what three men can do

The endgames with three men are small enough to solve completely, and the results are not what the board suggests.

Three against three, both sides flying: of the 2,691,920 possible positions, the side to move wins 82.9%, loses 16.9%, and only 0.15% are drawn. In 39% it simply closes a mill at once; in the rest it wins by making threats faster than they can be blocked. The longest forced win takes 13 moves. With three men each, whose turn it is matters more than where the men stand.

Four against three, the four still sliding: the side with four wins only if it can close a mill on this very move (9.9% of positions). Otherwise it cannot force anything — four sliding men can never threaten two different mills at once, and a flying man always reaches the one point that matters. When the three are to move, they win 13.5% of positions and lose none; the rest are draws.

PositionSide to move winsDrawSide to move loses
3 v 3, either side to move82.9%0.15%16.9%
4 v 3, the four to move9.9%89.7%0.4%
4 v 3, the three to move13.5%86.5%0%

So do not grind an opponent down to three while you have only four men yourself: that ending is a draw nine times in ten. Keep five or more and a running mill, and the last capture comes on the move after the one that left him with three. In simulation, a player with forcing moves who brought Easy down to three men won 1,764 of 1,845 such games; a careful player without them won 352 of 897 and drew 509.

How to beat each level here

Here is how simple ways of choosing a move do against each level. Each rule includes the ones above it; ties are broken at random; you move first. The cells read wins / draws / losses for you.

Your rulevs Easy, %vs Hard*vs Expert*
A random legal move0.2 / 35.3 / 64.50 / 0 / 150 / 0 / 15
Close a mill when you can, block the computer's when it threatens one13.1 / 39.1 / 47.8––
Careful: never make a move that lets the computer close a mill next turn19.1 / 69.5 / 11.50 / 1 / 190 / 0 / 20
Careful, and leave the computer's men the fewest empty neighbours54.5 / 40.4 / 5.20 / 1 / 190 / 0 / 20
Careful, and play any threat that cannot be parried90.3 / 4.5 / 5.30 / 0 / 250 / 0 / 25
All of it: unparryable threats first, then more room for you and less for the computer91.4 / 8.5 / 0.15 / 7 / 180 / 0 / 30

* The Easy column is in percent of 2,000 games per row. Hard and Expert are limited by time, so they were simulated at a fixed depth of six plies, and their columns are counts of games, not percentages. Six plies is as far as Hard ever looks; Expert can go deeper on a fast device, so the real Expert is at least this strong. A dash means not simulated.

Easy looks two plies ahead and counts only men and closed mills. It has no randomness and no clock, so the same moves always get the same answers. With nothing to react to, it takes the busiest free point in a fixed order — d6, b4, f4, d2 — and it does block a pair with an empty third point. What it cannot see is a second threat, or that its men are running out of moves. Hence the shortest win there is:

  1. b2 — Easy answers d6
  2. d2 — f2 (it blocks your line)
  3. b4 — b6
  4. f6 — f4
  5. d5 — d7
  6. a1 — a4
  7. g1 — d1
  8. g4 — g7
  9. e4 — a7, which closes the mill a7–d7–g7; Easy takes your man on b4
  10. Slide b2–b4. Red's men on a7, d7, g7, b6, d6, a4, f4, f2 and d1 have no empty neighbour: you win.

No shorter win exists against any opponent: a side can only lose once all its men are placed, and the computer's first turn after that comes right after your tenth move. Easy is also poor at finishing: against a player moving at random it won 64.5% of 2,000 games and drew 35.3%.

Hard searches six plies and counts pairs with an empty third point and room to move, so it sets up forks during placing. Against our best rule it closed the first mill in 25 games of 30, and the rule-based player was a man or more down when placing ended in 22. All five of that player's wins came the same way — by leaving Hard without a move on the thirteenth move. The lesson is practical: against Hard, play for the block, and during placing look two moves ahead for its forks, not one.

Expert values blocking during placing, room to move in the middle game and men in the endgame. At six plies it closed the first mill in 28 games of 30 against our best rule and lost none of 110 games to any rule in the table, without a single draw. No fixed recipe exists for Hard or Expert, because how deep they search depends on your device. Nine Men's Morris was solved in 1993 by Ralph Gasser: with perfect play by both sides it is a draw. That is a known result, not something measured here, and it sets the realistic goal against Expert: a draw by repetition is a good result.

The rules of thumb, in order of value

  1. Before every move, check that it does not let the opponent close a mill next turn.
  2. Look for a threat that cannot be parried: a fork while placing, a running mill while moving.
  3. Count empty neighbours: keep yours, take away his. A blocked side loses with all nine men on the board.
  4. Before your last placements, make sure you will have a move when placing ends.
  5. When you take a man, take the one that stops his next mill, then one from a pair, then the most mobile.
  6. Start on d6, b4, f4 or d2 when you can.
  7. Do not go into three flying men against your four: that is a draw nine times in ten.

Against Easy, rule 1 alone wins 19% of games; rules 1 and 3 win 54%; rules 1 and 2 win 90%; all together, 91% with two losses in 2,000 games.

Questions and answers

How do you win at Nine Men's Morris?

By making a threat that cannot be parried: a fork, where one move threatens two mills, or a running mill, where one man slides between two lines and closes a mill every move. Against the Easy computer here, adding such threats to careful play raises the win rate from 19% to 90% of 2,000 simulated games. The other way is to block: a side with no legal move loses at once.

Can you beat the computer at Nine Men's Morris?

Easy, yes, every time: place b2, d2, b4, f6, d5, a1, g1, g4, e4, then slide b2–b4, and none of its nine men can move. It has no randomness, so the line always works. Hard lost 5 of 30 simulated games to our best simple rule, each time by being blocked. Expert, searching six plies, lost none of 110 games; against it a draw is a good result.

Where should you place your first piece?

On one of the four points with four neighbours: d6, b4, f4 or d2, the midpoints of the middle square. Between two equal rule-based players the first player won 49% and lost 39% of 2,000 games after starting there; from a three-neighbour midpoint it won 44% and lost 47%. The Easy level takes such a point on its first move every time.

What is a running mill (double mill)?

Five men placed so that one of them moves back and forth between two lines: leaving one mill closes the other. Each move closes a mill and removes an enemy man, and the opponent can stop it only by taking or blocking the moving man. In German it is called a Zwickmühle.

Which piece should you remove after a mill?

First a man whose removal stops the opponent closing a mill on the next move, then a man from a pair with an empty third point, otherwise the man with the most neighbours. Against Easy, this order wins 91.4% of games where a random removal wins 85.0%.

Is having only three pieces a lost game?

Not by itself. With three men you fly, and four sliding men cannot force a win against three flying ones: solved exactly, that ending is a draw in about nine positions out of ten. With three men each, the side to move wins 82.9% of all positions. What beats a flying side is a running mill and at least five men.

Who wins Nine Men's Morris with perfect play?

Nobody: the game was solved by Ralph Gasser in 1993, and perfect play by both sides ends in a draw. That is a published result, not something computed on this page. Between people, and against the levels here, games are decided long before perfect play matters.

Play Nine Men's Morris against the computer →
Where to go from here
To cite this page: “Nine Men's Morris Strategy: Forks, Blocks and How to Beat the Computer”, You vs Computer, https://youvscomputer.com/games/morris-strategy.html