Optimizing search via diversity enhancement in evolutionary MasterMind Juan J. Merelo*, Antonio M. Mora, Thomas P. Runarsson and Carlos Cotta Abstract—A MasterMind player must discover a secret combination by making guesses using the hints obtained as a response to the previous ones. Finding a general strategy that scales well with problem size is still an open issue, despite having been approached from different angles, including evolu- tionary algorithms. In previous papers we have tested different approaches to the evolutionary MasterMind and having found out that diversity is essential in this kind of combinatorial optimization problems, in this paper we try to tune the search methods to keep a high diversity level and thus obtain solutions to the puzzle in less average evaluations, and, if possible, in less number of combinations played. This will allow us to get improvements in the time that will be used to explore problems of bigger size. I. I NTRODUCTION MasterMind [1] is a two-player code-breaking game, or in some sense a single-player puzzle, where one of the players –the codemaker (CM)– has no other role in the game than setting a hidden combination, and automatically providing hints on how close the other player –the codebreaker (CB)– has come to correctly guess this combination. More precisely, the flow of the game is as follows: • The CM sets and hides a length ‘ combination of κ sym- bols. Therefore, the CB is faced with κ ‘ candidates for the hidden combination, which is typically represented by an array of pegs of different colors (but can also be represented using any digits or letter strings) and hidden from the CB. • The CB tries to guess this secret code by producing a combination with the same length, and using the same set of symbols. As a response to that move, the CM acting as an oracle (which explains the inclusion of this game in the category called oracle games) provides information on the number of symbols guessed in the right position (black pegs in the physical board game), and the number of symbols with the correct color, but in an incorrect position (white pegs); this is illustrated in Table I. • The CB uses (or not, depending on the strategy he is following) this information to produce a new combina- tion, that is assessed in the same way. If he correctly guesses the hidden combination in at most N attempts, the CB wins. Otherwise, the CM takes the game. N usually corresponds to the physical number of rows in JJM and AMM are with the Dept. of Architecture and Computer Technol- ogy, ETSIIT, University of Granada, email: jmerelo,amorag@geneura.ugr.es TPR is with the School of Engineering and Natural Sciences, U. of Iceland, email: tpr@hi.is CC is with the Dept. of Languages and Computer Sciences at the U. of M´ alaga, email: ccottap@lcc.uma.es the game board, which is equal to fifteen in the first commercial version. • CM and CB are then interchanged, and several rounds of the game are played. The player that is able to obtain the minimal amount of attempts wins. This is a part of the game we do not consider. This puzzle is, in fact, a quite interesting combinatorial problem, as it relates to other oracle problems such as the hacking of the PIN codes used in bank ATMs [2] or uniquely identifying a person from queries to a genetic database [3]. Several issues remain open, such as what is the lowest average number of guesses needed to solve the problem for any given κ and ‘. Associated to this, there arises the issue of coming up with an efficient mechanism for finding the hidden combination independently of the problem size, or at least, a method that scales gracefully when the problem size increases. This paper is mainly concerned with tuning some search parameters and methods in the evolutionary algorithm to find the set that produces the best solutions in the least number of combinations examined. In our previous paper in this line of research [4] we introduced several mechanisms that decreased the number of combinations that were needed to find the solution mainly through endgames, i.e. heuristics that abandoned the evolutionary algorithm or reduced the search space when certain conditions were met. In this paper we will mainly look at the evolutionary algorithm itself, introducing operators that boost diversity so that search is enhanced and, at the same time, better solutions can be found. Our main intention is, once again, to find rules that are as general as possible and that can be applied to a wide range of problem sizes, eventually creating a solving method that can be used to find the solution in real time for that range. The rest of the paper is organized as follows: next section presents the state of the resolution of the MasterMind puzzle and its evolution, having special emphasis in evolutionary solutions; we will explain then (in Section III) the general characteristics of the evolutionary algorithm used to solve MasterMind in this work. Results obtained with this setup will be presented in Section IV, and we will finish the paper with the conclusions that derive from them (commented in Section V). II. BACKGROUND As mentioned in Section I, a MasterMind problem instance is characterized by two parameters: the number of colors κ and the number of pegs ‘. Let N κ = {1, 2, ··· κ} be the set of symbols used to denote the colors. Subsequently, any