Efficient solutions for Mastermind using genetic algorithms

  • Authors:
  • Lotte Berghman;Dries Goossens;Roel Leus

  • Affiliations:
  • ORSTAT, K.U.Leuven, Naamsestraat 69, 3000 Leuven, Belgium;ORSTAT, K.U.Leuven, Naamsestraat 69, 3000 Leuven, Belgium;ORSTAT, K.U.Leuven, Naamsestraat 69, 3000 Leuven, Belgium

  • Venue:
  • Computers and Operations Research
  • Year:
  • 2009

Quantified Score

Hi-index 0.01

Visualization

Abstract

We present a new genetic algorithm for playing the game of Mastermind. The algorithm requires low run-times and results in a low expected number of guesses. Its performance is comparable to that of other meta-heuristics for the standard setting with four positions and six colors, while it outperforms the existing algorithms when more colors and positions are examined. The central idea underlying the algorithm is the creation of a large set of eligible guesses collected throughout the different generations of the genetic algorithm, the quality of each of which is subsequently determined based on a comparison with a selection of elements of the set.