Term paper presentation, Artificial Intelligence class, 2009  Development of an Artificial Player       for Connect-(4|n) ga...
The Connect-(4|n) game• Implementation of game dynamics with  dynamic board size and required connections  for the game to...
Mini-Max Algorithm• Implementations in PHP and Java• Game dynamics are implemented as a PHP script• An external Java jar i...
connectMinimax usage$ java -jar connectMinimax.jar    <rows> <columns> <connections> <depth-limit>           <heuristic-ex...
Mini-Max for non-perfect decisions • Need an heuristic • Evaluation of game state or evaluation of possible   further move...
Moves’ Heuristic• Consider the 4 dimensions  separately• For each, consider any  window including the move• For each windo...
Improvements• Raise tree depth    • Better results, longer time to wait for each       non-precomputed move :(• Max depth ...
Results and future dev.• AI beats Human in 60-65% of cases. • NB: Initial player is pseudo-random• Time-to-wait is still t...
Upcoming SlideShare
Loading in …5
×

Connect (4|n)

1,639 views
1,521 views

Published on

Short presentation to explain my work as term paper for the AI class (2009)

Published in: Technology, Education
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,639
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Connect (4|n)

  1. 1. Term paper presentation, Artificial Intelligence class, 2009 Development of an Artificial Player for Connect-(4|n) game Alessandro Manfredi 256479
  2. 2. The Connect-(4|n) game• Implementation of game dynamics with dynamic board size and required connections for the game to be won.• Different playing modes • Human vs Human • Human vs AI • Simulations: AI vs AI (Useful to obtain wide range of moves computed by the algorithm as possible input for an automatic learning tool, or just to cache precomputed moves)
  3. 3. Mini-Max Algorithm• Implementations in PHP and Java• Game dynamics are implemented as a PHP script• An external Java jar is used to compute moves • Chance to train or precompute moves outside the actual game simulations (?)
  4. 4. connectMinimax usage$ java -jar connectMinimax.jar <rows> <columns> <connections> <depth-limit> <heuristic-exp> <board-dump> <player> <rows> # Board rows <columns> # Board columns <connections> # Required connections to win <depth-limit> tree depth limit <heuristic-exp> Heuristic exponent <board-dump> Game state representation <player> Player for which compute the move
  5. 5. Mini-Max for non-perfect decisions • Need an heuristic • Evaluation of game state or evaluation of possible further moves? • Incremental evaluation: estimate value of chances opened by a move • NB: a winning move has an infinite (positive) evaluation • NB: moves which bring to (even slightly) better game states must have a relevant surplus of evaluation
  6. 6. Moves’ Heuristic• Consider the 4 dimensions separately• For each, consider any window including the move• For each window available to be completed, sum player’s pieces raised to the parametric heuristic exponent• The evaluation of a move is the sum of all these components
  7. 7. Improvements• Raise tree depth • Better results, longer time to wait for each non-precomputed move :(• Max depth can be increased as the game moves on (less possibilities to compute) • Time to wait almost not affected• Alfa-Beta Pruning
  8. 8. Results and future dev.• AI beats Human in 60-65% of cases. • NB: Initial player is pseudo-random• Time-to-wait is still too long: 17-19 sec.• How about a machine learning tool trained with the move computation component? • A classifier ( Decision-Tree ?) • Neural network ( Multilayer perceptron with backpropagation ?)

×