nine men's morris martin boyd christopher hirunthanakorn

22
Nine Men's Morris Martin Boyd Christopher Hirunthanakorn

Upload: robyn-mcmillan

Post on 14-Dec-2015

215 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Nine Men's Morris Martin Boyd Christopher Hirunthanakorn

Nine Men's MorrisMartin Boyd

Christopher Hirunthanakorn

Page 2: Nine Men's Morris Martin Boyd Christopher Hirunthanakorn

Game Overview

• Two player game

• RULESo Players alternate turns placing pieces on

the boardo If a mill is formed, player may remove an

opponent's piece mill - three pieces formed along a line

o After both players place nine pieces, players move their pieces to any free adjacent spot

o The game is over when a player has less than 3 pieces or no legal moves remain

Page 3: Nine Men's Morris Martin Boyd Christopher Hirunthanakorn

Example

Page 4: Nine Men's Morris Martin Boyd Christopher Hirunthanakorn

Example (continued)

Page 5: Nine Men's Morris Martin Boyd Christopher Hirunthanakorn

Game Classification

• Determinate

• Zero-sum

• Symmetric

• Perfect Information

• Sequential

• Normal

Page 6: Nine Men's Morris Martin Boyd Christopher Hirunthanakorn

Background

• One of the oldest games played to dateo Game board carving from 1400 BCE found

in Egypt

• Also known as Mill, Merelles, or Cowboy Checkers

• Popular variants of the game include Three Men's, Six Men's, and Twelve Men's Morris

Page 7: Nine Men's Morris Martin Boyd Christopher Hirunthanakorn

Research Goals/Questions

• Look for an optimal strategy for piece placement

• Find an optimal strategy for gameplay

• Is there a winning strategy for either player?

• Is the game fair?

Page 8: Nine Men's Morris Martin Boyd Christopher Hirunthanakorn

Analyzing the Game

• Searched for previous work on the game

• Game States and Combinatorics

• Created program with a GUI

• Analyzed Five Men's Morris

• Created an Adaptive Program

• Created an AI

• Used python as the programming language

Page 9: Nine Men's Morris Martin Boyd Christopher Hirunthanakorn

Previous Publications

• Ralph Gasser (Swiss computer scientist)o Proved that perfect play in Nine Men's Morris

results in a draw and is impossible for humans to achieve

o Analyzed the midgame and endgame by going through all possible game states and labeling them a win or lose position

o Did not provide any advice on the optimal strategy or fairness of the game

Page 10: Nine Men's Morris Martin Boyd Christopher Hirunthanakorn

Five Men's Morris

• Players have 5 pieces instead of 9

• 16 spots instead of 24

Page 11: Nine Men's Morris Martin Boyd Christopher Hirunthanakorn

Game States and Combinatorics

• A game state is defined as the game board and all relevant information defining it such as Last player to move and position of last move

• Board to the right is the game state where player 1 just went but could have placed it on either side

• Used combinatorics to estimate the number of game states possible o About 1.74 * 10^11 states based on possible

combinations of placement (16*15*14*13*12*11*10*9*8*7*6)

o Can be reduced using symmetry of game states to about 7.26 * 10^8 (31+14*13*12*11*10*9*8*7*6)

Page 12: Nine Men's Morris Martin Boyd Christopher Hirunthanakorn

Basic Program Structure

A1

B C D E

2

3

4

5

B2

E5

Page 13: Nine Men's Morris Martin Boyd Christopher Hirunthanakorn

Basic Program Structure

• Data of the Game Board is stored in 3 arrayso Basic Array

[A1,A3,A5,B2,B3,B4,C1,C2,C4,C5,D2,D3,D4,E1,E3,E5]o Mill Array

[[0,A1,A3,A5],[0,B2,B3,B4],...,[0,E1,E3,E5]] o Connection Array

[[A1,A3,C1,0],[A3,A1,A5,B3],...,[E5,C5,E3,0]]

Page 14: Nine Men's Morris Martin Boyd Christopher Hirunthanakorn

Adaptive Program

• Runs the Game MANY times

• Contains Matchboxes that punish a player if that player loses thus not repeating the same mistake twice.

Page 15: Nine Men's Morris Martin Boyd Christopher Hirunthanakorn

Matchboxes

A EC DB1

2

3

4

5

A5

C2

B4

C5D2

C4

D3D4E5

MOVES

Page 16: Nine Men's Morris Martin Boyd Christopher Hirunthanakorn

Adaptive Program

• 2 different Adaptive Programs written for Five Men's Morris

• Opening Stage Adaptiveo Contains a Matchbox for each player to select

spots

• Second Stage Adaptiveo Contains two Matchboxes for each player to

move pieces and the other for removing pieces

Page 17: Nine Men's Morris Martin Boyd Christopher Hirunthanakorn

Adaptive Results

• Opening Stage Adaptiveo After 60 million runs (On the last 10 million)

72544 won by Player 1 44059 won by Player 2 9883397 end in a draw Player 1 has 20% advantage on win/loss However most opening stages end in draw

• Second Stage Adaptiveo After 10 million runs still dead eveno The program requires more runs to draw a

conclusion.

Page 18: Nine Men's Morris Martin Boyd Christopher Hirunthanakorn

AI Logic (Minimax and Negamax)

• AI is based on the game theory decision rule of Minimax and Negamax

• Both determine the worth of a game state using a set of conditions

• Efficiently searches through possible states and presents the best one.o Negamax differs in how it eliminates certain

states that can not be achieved to increase search speeds Current State

2 0

2

5

91 6

Next State

Next Next State

Page 19: Nine Men's Morris Martin Boyd Christopher Hirunthanakorn

AI Logic (Scoring)

• Plays the game more intelligently by choosing the best move from all possible moves for that game board

• Moves are scored based on the resultant game board o next to open connection or own piece =

+1o next to opponent's piece = -1o sets up 2/3 parts of a mill = +2o blocks opponent's mill = +2o makes a mill = +3

Page 20: Nine Men's Morris Martin Boyd Christopher Hirunthanakorn

AI Results

• Player 1 using AI, Player 2 playing randomlyo After 1000 runs multiple times, Player 1 wins

roughly about 70% of the time

• Both players using AIo After 1000 runs multiple times, neither player

has an advantage over the other (around 50% each)

• AI will require more improvements and test runs to get solid results

Page 21: Nine Men's Morris Martin Boyd Christopher Hirunthanakorn

General Strategy

• Take spots on both rings

• Take spots with the most connections

• Block your opponent's move in a way that you don't trap yourself

• Try to force your opponent to allow you to make a millo Ex) player 1 takes outside corners and

player 2 tries to block

• If possible, set up two potential mills next to each other so that a mill can be made by moving back and forth

Page 22: Nine Men's Morris Martin Boyd Christopher Hirunthanakorn

Future Work

• Improve AI and adaptive learning programs to be more efficiento Currently the Adaptive takes too long to

run through the required number of games

• Confirm the patterns found apply to Nine Men's Morris by running the programs on it

• Come up with a more detailed strategy that will handle every situation