• Save
Connect (4|n)
Upcoming SlideShare
Loading in...5

Connect (4|n)



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

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



Total Views
Views on SlideShare
Embed Views



3 Embeds 13

http://www.n0on3.net 7
https://www.n0on3.net 4
http://www.linkedin.com 2



Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
Post Comment
Edit your comment

Connect (4|n) Connect (4|n) Presentation Transcript

  • Term paper presentation, Artificial Intelligence class, 2009 Development of an Artificial Player for Connect-(4|n) game Alessandro Manfredi 256479
  • 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)
  • 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 (?)
  • 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
  • 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
  • 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
  • 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
  • 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 ?)