Harmony search based memetic algorithms for solving sudoku

  • Assif AssadEmail author
  • Kusum Deep
Original Article


The development of hybrid procedures for optimization focuses on enhancing the strength and compensating for the weakness of two or more complementary approaches. The goal is to intelligently combine the key elements of the competing methodologies to create a superior solution procedure. The objective of this paper is to explore the hybridization between Harmony Search and Hill Climbing algorithm by utilizing the exploration power of the former and exploitation power of the latter in the context of solving Sudoku which is a well-known hard combinatorial optimization problem. We call this hybrid algorithm Harmony Search Hill Climber (HSHC). In order to extend the exploration capabilities of HSHC it is further modified to create three different algorithms namely Retrievable Harmony Search Hill Climber (RHSHC), Global Best Retrievable Harmony Search Hill Climber (GB-RHSHC) and Random Best Retrievable Harmony Search Hill Climber (RB-RHSHC). Comparing the four algorithms proposed in this paper RHSHC outperforms its three variations in terms of effectiveness. Experimental results demonstrate that RHSHC perform significantly better than standard Harmony Search algorithm and standard Hill climber algorithm. On comparing RHSHC with the genetic algorithm it has been concluded that former outperforms latter both in terms of effectiveness and efficiency particularly for Hard and Expert level puzzles. Comparing RHSHC and hybrid AC3-tabu search algorithm it has been concluded that RHSHC is very competent to hybrid AC3-tabu search algorithm.


Harmony search Hill climbing Sudoku Memetic algorithm Evolutionary algorithm 



The first author would like to acknowledge QIP Centre Indian Institute of Technology Roorkee, India and All India Council for Technical Education (AICTE) for sponsoring his research.


  1. Takayuki Y, Takahiro S (2003) Complexity and completeness of finding another solution and its application to puzzles. IEICE Trans Fundam Electron Commun Comput Sci 86(5):1052–1060Google Scholar
  2. Mantere T, Koljonen J (2006) Solving and rating sudoku puzzles with geneticalgorithms. In: New developments in artificial intelligence and the semantic web, proceedings of the 12th finnish artificial intelligence conference STeP. Citeseer, 2006, pp 86–92Google Scholar
  3. Jones SK, Roach PA, Perkins S (2008) Construction of heuristics for a search-based approach to olving sudoku. In: Research and development in intelligent systems XXIV. Springer, 2008, pp. 37–49Google Scholar
  4. Geem ZW, Kim JH, Loganathan G (2001) A new heuristic optimization algorithm: harmony search. Simulation 76(2):60–68CrossRefGoogle Scholar
  5. Gholizadeh S, Barzegar A (2013) Shape optimization of structures for frequency constraints by sequential harmony search algorithm. Eng Optim 45(6):627–646MathSciNetCrossRefGoogle Scholar
  6. Wang L, Li L-P (2013) An effective differential harmony search algorithm for the solving non-convex economic load dispatch problems. Int J Electr Power Energy Syst 44(1):832–843CrossRefGoogle Scholar
  7. Nekooei K, Farsangi MM, Nezamabadi-Pour H, Lee KY (2013) An improved multi-objective harmony search for optimal placement of dgs in distribution systems. Smart Grid IEEE Trans 4(1):557–567CrossRefGoogle Scholar
  8. Hadwan M, Ayob M, Sabar NR, Qu R (2013) A harmony search algorithm for nurse rostering problems. Inf Sci 233:126–140MathSciNetCrossRefGoogle Scholar
  9. Diao R, Shen Q (2012) Feature selection with harmony search. Syst Man Cybern Part B Cybern IEEE Trans 42(6):1509–1523CrossRefGoogle Scholar
  10. Fattahi H, Gholami A, Amiribakhtiar MS, Moradi S (2015) Estimation of asphaltene precipitation from titration data: a hybrid support vector regression with harmony search. Neural Comput Appl 26(4):789–798CrossRefGoogle Scholar
  11. Al-Betar MA, Khader AT, Zaman M (2012) University course timetabling using a hybrid harmony search metaheuristic algorithm. Syst Man Cybern Part C Appl Rev IEEE Trans 42(5):664–681CrossRefGoogle Scholar
  12. Geem ZW (2005) Harmony search in water pump switching problem. In: Proceedings of international conference on natural computation. Springer, pp. 751–760Google Scholar
  13. Ong Y-S, Lim M-H, Zhu N, Wong K-W (2006) Classification of adaptive memetic algorithms: a comparative study. Syst Man Cybern Part B Cybern IEEE Trans 36(1):141–152CrossRefGoogle Scholar
  14. Dawkins R (2006) The selfish gene. Oxford university press, no. 199Google Scholar
  15. Ong Y-S, Nguyen Q-H, Lim M-H, Jing T (2006) A development platform for memetic algorithm design. In: SCIS and ISIS 2006. Japan society for fuzzy theory and intelligent informatics, pp 1027–1032Google Scholar
  16. Ishibuchi H, Yoshida T, Murata T (2003) Balance between genetic search and local search in memetic algorithms for multiobjective permutation flowshop scheduling. Evolut Comput IEEE Trans 7(2):204–223CrossRefGoogle Scholar
  17. Chan T-M, Leung K-S, Lee K-H (2012) Memetic algorithms for de novo motif discovery. Evolut Comput IEEE Trans 16(5):730–748CrossRefGoogle Scholar
  18. Sharma H, Bansal JC, Arya KV, Yang X-S (2016) Lévy flight artificial bee colony algorithm. Int J Syst Sci 47(11):2652–2670CrossRefzbMATHGoogle Scholar
  19. Jadon SS, Bansal JC, Tiwari R, Sharma H (2015) Accelerating artificial bee colony algorithm with adaptive local search. Memet Comput 7(3):215–230CrossRefGoogle Scholar
  20. Sharma H, Bansal JC, Arya K (2013) Power law-based local search in differential evolution. Int J Comput Intell Stud 2(2):90–112CrossRefGoogle Scholar
  21. Hart WE, Krasnogor N, Smith JE (2005) Recent advances in memetic algorithms, vol 166. Springer Science & Business Media, New YorkCrossRefzbMATHGoogle Scholar
  22. Moon TK, Gunther JH (2006) Multiple constraint satisfaction by belief ropagation: an example using sudoku. In: IEEE mountain workshop on 2006. Adaptive and learning systems, IEEE, 2006, pp. 122–126Google Scholar
  23. Lynce I, Ouaknine J (2006) Sudoku as a sat problem. In: Proceedings of the 9th Symposium on Artificial Intelligence and Mathematics (AIMATH), 6 jan 2006 Google Scholar
  24. Lewis R (2007) Metaheuristics can solve sudoku puzzles. J Heuristics 13(4):387–401CrossRefGoogle Scholar
  25. Mullaney D (2006) Using ant systems to solve sudoku problems. University College Dublin, DublinGoogle Scholar
  26. Boryczka U, Juszczuk P (2012) Solving the sudoku with the differential evolution. Zeszyty Naukowe Politechniki Białostockiej. Informatyka, pp 5–16Google Scholar
  27. Moon TK, Gunther JH, Kupin JJ (2009) Sinkhorn solves sudoku. Inf Theory IEEE Trans 55(4):1741–1746MathSciNetCrossRefzbMATHGoogle Scholar
  28. Gunther J, Moon T (2012) Entropy minimization for solving sudoku. Signal Process IEEE Trans 60(1):508–513MathSciNetCrossRefzbMATHGoogle Scholar
  29. Garey M, Johnson D (1979) Computers and intractability WH freeman and company New YorkGoogle Scholar
  30. Das KN, Bhatia S, Puri S, Deep K (2012) A retrievable ga for solving sudoku puzzles. Tech. Rep, CiteseerGoogle Scholar
  31. Nicolau M, Ryan C (2006) Solving sudoku with the gauge system. In: Genetic programming. Springer, pp 213–224Google Scholar
  32. Li Y, Deng X (2011) Solving sudoku puzzles based on improved genetic algorithm. Jisuanji Yingyong Yu Ruanjian 28(3):68–70Google Scholar
  33. Sato Y, Inoue H (2010) Solving sudoku with genetic operations that preserve building blocks. In: IEEE Symposium on Computational intelligence and games (CIG), 2010. IEEE, pp 23–29Google Scholar
  34. Deng XQ, Da Li Y (2013) A novel hybrid genetic algorithm for solving sudoku puzzles. Optim Lett 7(2):241–257MathSciNetCrossRefzbMATHGoogle Scholar
  35. Sato Y, Hasegawa N, Sato M (2013) Acceleration of genetic algorithms for sudoku solution on many-core rocessors. In: Massively parallel evolutionary computation on GPGPUs. Springer, pp 421–444Google Scholar
  36. Moraglio A, Togelius J, Lucas S (2006) Product geometric crossover for the sudoku puzzle. In: IEEE congress on evolutionary computation, 2006. CEC 2006. IEEE, pp 470–476Google Scholar
  37. Soto R, Crawford B, Galleguillos C, Paredes F, Norero E, (2015) A hybrid alldifferent-tabu search algorithm for solving sudoku puzzles. Comput Intell Neurosci 2015Google Scholar
  38. Wang Z, Yasuda T, Ohkura K, (2015) An evolutionary approach to sudoku puzzles with filtered mutations. In: IEEE congress on evolutionary computation (CEC), 2015. IEEE, pp 1732–1737Google Scholar
  39. Soto R, Crawford B, Galleguillos C, Monfroy E, Paredes F (2013) A hybrid ac3-tabu search algorithm for solving sudoku puzzles. Exp Syst Appl 40(15):5817–5821CrossRefGoogle Scholar
  40. Simonis H (2005) Sudoku as a constraint problem. In: CP workshop on modeling and reformulating constraint satisfaction problems. Citeseer, vol 12, pp 13–27Google Scholar
  41. Rossi F, Van Beek P, Walsh T (2006) Handbook of constraint programming. Elsevier, AmsterdamzbMATHGoogle Scholar
  42. Manter T, Koljonen J (2007) Solving, rating and generating sudoku puzzles with ga. In: IEEE Congress on evolutionary computation, CEC 2007. IEEE 2007, pp 1382–1389Google Scholar
  43. Soto R, Crawford B, Galleguillos C, Monfroy E, Paredes F (2014) A prefiltered cuckoo search algorithm with geometric operators for solving sudoku problems, vol 2014. The Scientific World JournalGoogle Scholar
  44. Geem ZW (2007) Harmony search algorithm for solving sudoku. In: Knowledge-based intelligent information and engineering systems. Springer, pp 371–378Google Scholar
  45. Weyland D (2015) A critical analysis of the harmony search algorithm how not to solve sudoku. Op Res Perspect 2:97–105MathSciNetGoogle Scholar
  46. Durstenfeld R (1964) Algorithm 235: random permutation. Commun ACM 7(7):420CrossRefGoogle Scholar
  47. Jin X, Li Z (1997) Genetic-catastrophic algorithms and its application in nonlinear control system. J Syst Simul 9(2):111–115Google Scholar

Copyright information

© The Society for Reliability Engineering, Quality and Operations Management (SREQOM), India and The Division of Operation and Maintenance, Lulea University of Technology, Sweden 2017

Authors and Affiliations

  1. 1.Department of MathematicsIndian Institute of Technology RoorkeeRoorkeeIndia

Personalised recommendations