A Heuristic Hillclimbing Algorithm for Mastermind Alexandre Temporel and Tim Kovacs.

Slides:



Advertisements
Similar presentations
An Introduction to Game Theory Part V: Extensive Games with Perfect Information Bernhard Nebel.
Advertisements

Heuristic Search techniques
1 Constraint Satisfaction Problems A Quick Overview (based on AIMA book slides)
Huffman code and ID3 Prof. Sin-Min Lee Department of Computer Science.
CPSC 422, Lecture 21Slide 1 Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 21 Mar, 4, 2015 Slide credit: some slides adapted from Stuart.
On the Genetic Evolution of a Perfect Tic-Tac-Toe Strategy
Lecture 13 Last time: Games, minimax, alpha-beta Today: Finish off games, summary.
Rules: Click on the correct colour to fill in your colouring in book. Then click on the arrow to move unto the next page. Can you finish the whole book?
© red ©
Kavita Math231 Recursion and Iteration. Kavita Math231 We use Recursion when we have to perform a complex task that can be broken into the several subtasks.
November 10, 2009Introduction to Cognitive Science Lecture 17: Game-Playing Algorithms 1 Decision Trees Many classes of problems can be formalized as search.
Artificial Intelligence Genetic Algorithms and Applications of Genetic Algorithms in Compilers Prasad A. Kulkarni.
Othello Sean Farrell June 29, Othello Two-player game played on 8x8 board All pieces have one white side and one black side Initial board setup.
THE RENJU GAME BY ABHISHEK JAIN, PRANSHU GUPTA & RHYTHM DAS PCLUB SUMMER PROJECT PRESENTATION JUNE, L7 IIT KANPUR MENTOR – SANIL JAIN.
Genetic Algorithm.
CSM6120 Introduction to Intelligent Systems Other evolutionary algorithms.
Brian Duddy.  Two players, X and Y, are playing a card game- goal is to find optimal strategy for X  X has red ace (A), black ace (A), and red two (2)
Artificial Intelligence in Game Design Problems and Goals.
林偉楷 Taiwan Evolutionary Intelligence Laboratory.
Graph Coloring with Ants
Development of a Machine-Learning-Based AI For Go By Justin Park.
 Summary  How to Play Go  Project Details  Demo  Results  Conclusions.
Search CSE When you can’t use A* Hill-climbing Simulated Annealing Other strategies 2 person- games.
Mark Dunlop, Computer and Information Sciences, Strathclyde University 1 Algorithms & Complexity 5 Games Mark D Dunlop.
Instructor: Vincent Conitzer
1 CSE 4705 Artificial Intelligence Jinbo Bi Department of Computer Science & Engineering
Artificial Intelligence CS482, CS682, MW 1 – 2:15, SEM 201, MS 227 Prerequisites: 302, 365 Instructor: Sushil Louis,
Algorithms and their Applications CS2004 ( ) 13.1 Further Evolutionary Computation.
Backtracking and Games Eric Roberts CS 106B January 28, 2013.
Reactive and Output-Only HKOI Training Team 2006 Liu Chi Man (cx) 11 Feb 2006.
1 CSE 4705 Artificial Intelligence Jinbo Bi Department of Computer Science & Engineering
CPSC 422, Lecture 21Slide 1 Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 21 Oct, 30, 2015 Slide credit: some slides adapted from Stuart.
ARTIFICIAL INTELLIGENCE (CS 461D) Princess Nora University Faculty of Computer & Information Systems.
Othello Artificial Intelligence With Machine Learning Computer Systems TJHSST Nick Sidawy.
Debugging, The Scientific Method, and Mastermind.
HANGMAN OPTIMIZATION Kyle Anderson, Sean Barton and Brandyn Deffinbaugh.
Checkers A Matlab Project by Spenser Davison, Edward Dyakiw, Justin Pezzi, and Scott Wu.
Design of a real time strategy game with a genetic AI By Bharat Ponnaluri.
Organic Evolution and Problem Solving Je-Gun Joung.
CAP6938 Neuroevolution and Artificial Embryogeny Evolutionary Computation Theory Dr. Kenneth Stanley January 25, 2006.
Explorations in Artificial Intelligence Prof. Carla P. Gomes Module 5 Adversarial Search (Thanks Meinolf Sellman!)
Week 6 MondayTuesdayWednesdayThursdayFriday Testing III Reading due Group meetings Testing IVSection ZFR due ZFR demos Progress report due Readings out.
Artificial Intelligence By Mr. Ejaz CIIT Sahiwal Evolutionary Computation.
1 Comparative Study of two Genetic Algorithms Based Task Allocation Models in Distributed Computing System Oğuzhan TAŞ 2005.
Genetic Algorithms An Evolutionary Approach to Problem Solving.
GENETIC ALGORITHM By Siti Rohajawati. Definition Genetic algorithms are sets of computational procedures that conceptually follow steps inspired by the.
 Negnevitsky, Pearson Education, Lecture 12 Hybrid intelligent systems: Evolutionary neural networks and fuzzy evolutionary systems n Introduction.
Guess the colour Mix the colours Evaluation Group with work.
T. P. Runarsson, J. J. Merelo, U. Iceland & U. Granada (Spain) NICSO 2010 Adapting Heuristic Mastermind Strategies to Evolutionary Algorithms.
ECF Arbiter Seminar - Materials by CAA
Instructor: Vincent Conitzer
What colour?.
Othello Artificial Intelligence With Machine Learning
South African Flag The South African flag contains the most colours of any national flag. Can you colour it in here? RED WHITE YELLOW WHITE BLACK GREEN.
Artificial Intelligence and Lisp Lecture 13 Additional Topics in Artificial Intelligence LiU Course TDDC65 Autumn Semester,
Pairings FIDE Arbiter Seminar.
David Kauchak CS52 – Spring 2016
C ODEBREAKER Class discussion.
Teaching Plan Problem Solving
Colour Theories.
Colour Phrase Random Slide Show Menu
Colours.
Pairings FIDE Arbiter Seminar.
Instructor: Vincent Conitzer
Introduction to Artificial Intelligence Lecture 9: Two-Player Games I
What Color is it?.
What colour is it / are they?
CS 8520: Artificial Intelligence
Teaching Plan Problem Solving
Probability – Single Event – Higher – GCSE Questions
Presentation transcript:

A Heuristic Hillclimbing Algorithm for Mastermind Alexandre Temporel and Tim Kovacs

Mastermind A constraint optimisation problem Studied from perspectives of: combinatorics information theory game theory artificial intelligence evolutionary computation

Rules of Mastermind A 2-player game: code maker selects a secret code and score’s opponents guesses against it code breaker attempts to find secret code with as few guesses as possible Secret code is a sequence of 4 colours from the set {red, yellow, blue, green, black, white}

Feedback on Guesses For each guess, code maker returns: a black peg for each correct colour in correct position a white peg for each correct colour in incorrect position NB: each colour only scores 1 peg Example: (using integers instead of colours) Secret code: 2413 Guess: 1233 Score: 1 black peg, 2 white pegs

Objectives 1. Traditional objective is to minimise number of guesses needed to find secret code 2. For computer players also of interest to minimise number of codes considered as potential guesses Our algorithm is similar to existing Genetic Algorithm players on (1) but better on (2)

General Strategies Number of possible codes is finite Each new guess rules out some possibilities Strategically optimal strategies make guesses we know are incorrect but which maximise number of possibilities ruled out Stepwise optimal make only guesses that could be correct

A Useful Property of Mastermind Each guess is scored as 1 of 14 possible combinations of black and white pegs So all guesses belong to 1 of 14 sets of guesses If we score a potential guess against the last guess, the secret code will be in the set which scores the same as the last guess against the secret code This lets us evaluate potential guesses against our last guess before making our next guess

Example Secret Code: 2413 Guess 1: 1233 Score: 1 black, 2 white For guess 2, we should use a combination which scores 1 back, 2 white against guess 1 Any combination which does not cannot be the secret code

Selecting Potential Guesses How to select potential guesses to score against our last guess? at random (Rosu) using a Genetic Algorithm (Bento, Merelo) our new method

Our Method 1. Submit a random guess and call it CFG 2. Induce a New Potential Guess (NPG) from CFG as described on next slide 3. If NPG does not score the same as previous guesses go to (2), otherwise submit it as new guess 4. If new guess scores 0 black 0 white then prevent its colours being used again and go to (1) 5. If new guess scores as good or better than CFG then adopt it as CFG 6. If new guess is secret code stop, otherwise (2)

Induction of New Potential Guesses 1. Select as many characters from CFG as it has black pegs (correct colours in correct position) and add to NPG 2. Select as many characters from CFG as it has white pegs and assign them to random empty positions in NPG 3. Fill any remaining positions with random colours (but give higher probability to colours not already used in steps 1 and 2).

Number of guesses to find secret code Size of Game (colours x positions) 4x65x86x8 Random GA (Bento) GA (Merelo) SHC Code Tracker SHC without CT

Number of Potential Guesses Evaluated Size of Game 4x65x86x8 Random GA (Bento) GA (Merelo) SHC Code Tracker SHC without CT

Number of Potential Guesses Evaluated

Conclusions Our method makes a similar number of guesses but considers far fewer potential guesses Our method is less complex than GA methods Further optimisation may be possible A case where domain knowledge allows randomised hillclimbing to outperform GAs Application to related constraint optimisation problems may be possible