A two-phase optimization algorithm for mastermind

Shan Tai Chen, Shun Shii Lin*, Li Te Huang

*Corresponding author for this work

Research output: Contribution to journalArticlepeer-review

14 Citations (Scopus)


This paper presents a systematic model, two-phase optimization algorithms (TPOA), for Mastermind. TPOA is not only able to efficiently obtain approximate results but also effectively discover results that are getting closer to the optima. This systematic approach could be regarded as a general improver for heuristics. That is, given a constructive heuristic, TPOA has a higher chance to obtain results better than those obtained by the heuristic. Moreover, it sometimes can achieve optimal results that are difficult to find by the given heuristic. Experimental results show that (i) TPOA with parameter setting (k, d) = (1, 1) is able to obtain the optimal result for the game in the worst case, where k is the branching factor and d is the exploration depth of the search space. (ii) Using a simple heuristic, TPOA achieves the optimal result for the game in the expected case with (k, d) = (180, 2). This is the first approximate approach to achieve the optimal result in the expected case.

Original languageEnglish
Pages (from-to)435-443
Number of pages9
JournalComputer Journal
Issue number4
Publication statusPublished - 2007 Jul


  • Algorithm
  • Deductive game
  • Mastermind
  • Search strategies

ASJC Scopus subject areas

  • General Computer Science


Dive into the research topics of 'A two-phase optimization algorithm for mastermind'. Together they form a unique fingerprint.

Cite this