Skip to main content
Log in

Metaheuristics can solve sudoku puzzles

  • Published:
Journal of Heuristics Aims and scope Submit manuscript

Abstract

In this paper we present, to our knowledge, the first application of a metaheuristic technique to the very popular and NP-complete puzzle known as ‘sudoku’. We see that this stochastic search-based algorithm, which uses simulated annealing, is able to complete logic-solvable puzzle-instances that feature daily in many of the UK’s national newspapers. We also introduce a new method for producing sudoku problem instances (that are not necessarily logic-solvable) and use this together with the proposed SA algorithm to try and discover for what types of instances this algorithm is best suited. Consequently we notice the presence of an ‘easy-hard-easy’ style phase-transition similar to other problems encountered in operational research.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Similar content being viewed by others

References

  • Abramson, D., Krishnamoorthy, H., Dang, H.: Simulated annealing cooling schedules for the school timetabling problem. Asia-Pac. J. Oper. Res. 16, 1–22 (1996)

    Google Scholar 

  • Armstrong, S.: X-wing and Swordfish. Online resource. http://www.simes.clara.co.uk/programs/sudokutechnique6.htm (accessed July 2005)

  • Cheeseman, P., Kanefsky, B., Taylor, W.: Where the really hard problems are. In: Mylopoulos, J., Reiter, R. (eds.) Proceedings of IJCAI-91, pp. 331–337. Morgan Kaufmann, San Mateo (1991)

    Google Scholar 

  • Colbourn, C.J., Colbourn, M.J., Stinson, D.R.: The computational complexity of recognising critical sets. In: Graph Theory. Lecture Notes in Mathematics, vol. 1073, pp. 248–253. Springer, New York (1984)

    Google Scholar 

  • Eiben, A.E., van der Hauw, J., van Hemert, J.: Graph coloring with adaptive evolutionary algorithms. J. Heuristics 4(1), 25–46 (1998)

    Article  MATH  Google Scholar 

  • Garey, M.R., Johnson, D.S.: Computers and Intractability. Freeman, San Francisco (1979)

    MATH  Google Scholar 

  • Glover, F., Laguna, M.: Tabu search. In: Pardalos, P.M., Resende, M.G.C. (eds.) Handbook of Applied Optimization, pp. 194–208. Oxford University Press, Oxford (2002)

    Google Scholar 

  • Huckvale, M.: Mark huckvale—sudoku puzzles. Online resource. http://www.phon.ucl.ac.uk/home/mark/sudoku/ (accessed July 2005)

  • Kirkpatrick, S., Gelatt, C., Vecchi, M.: Optimization by simulated annealing. Science 4598, 671–680 (1983)

    Article  Google Scholar 

  • Lourenco, H.R., Martin, O., Stützle, T.: Iterated local search. In: Glover, F., Kochenberger, G. (eds.) Handbook of Metaheuristics, pp. 321–353. Kluwer Academic, Norwel (2002)

    Google Scholar 

  • Lynce, I., Ouaknine, J.: Sudoku as a SAT problem. In: Proceedings of the 9th Symposium on Artificial Intelligence and Mathematics (2006)

  • Pendlebury, P.: Can you sudoku. In: The Mail on Sunday, London, 8th May 2005. An online version is also available at http://www.mailonsunday.co.uk/pages/live/articles/news/news.html?in_article_=348348&in_page_id=1770&in_a_source= (accessed July 2005)

  • Ross, P., Corne, D., Fang, H.-L.: Improving evolutionary timetabling with delta evaluation and directed mutation. In: Davidor, Y., Schwefel, H., Reinhard, M. (eds.) Parallel Problem Solving from Nature III (PPSN). Lecture Notes in Computer Science, vol. 866, pp. 556–565. Springer, Berlin (1994)

    Google Scholar 

  • Ross, P., Corne, D., Terashima-Marin, H.: The phase-transition niche for evolutionary algorithms in timetabling. In: Burke, E., Ross, P. (eds.) The Practice and Theory of Automated Timetabling (PATAT). Lecture Notes in Computer Science, vol. 1153, pp. 309–325. Springer, Berlin (1996)

    Google Scholar 

  • Simonis, H.: Sudoku as a constraint problem. In: Hnich, B., Prosser, P., Smith, B. (eds.) Proceedings of the 4th International Workshop on Modelling and Reformulating Constraint Satisfaction Problems. pp. 13–27 (2005)

  • Smith, B.: Phase transitions and the mushy region in constraint satisfaction problems. In: Cohn, A. (ed.) Proceedings of the 11th European Conference on Artificial Intelligence, pp. 100–104. Wiley, New York (1994)

    Google Scholar 

  • Turner, J.S.: Almost all k-colorable graphs are easy to color. J. Algorithms 9, 63–82 (1988)

    Article  MATH  Google Scholar 

  • van Laarhoven, P., Aarts, E.: Simulated Annealing: Theory and Applications. Reidel, Dordrecht (1987)

    MATH  Google Scholar 

  • Yato, T., Seta, T.: Complexity and completeness of finding another solution and its application to puzzles. IEICE Trans. Fundam. E 86-A(5), 1052–1060 (2003)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Rhyd Lewis.

Rights and permissions

Reprints and permissions

About this article

Cite this article

Lewis, R. Metaheuristics can solve sudoku puzzles. J Heuristics 13, 387–401 (2007). https://doi.org/10.1007/s10732-007-9012-8

Download citation

  • Received:

  • Revised:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s10732-007-9012-8

Keywords

Navigation