Applied Intelligence

, Volume 35, Issue 1, pp 18–31 | Cite as

An efficient algorithm for solving nonograms

  • Chiung-Hsueh Yu
  • Hui-Lung Lee
  • Ling-Hwei ChenEmail author


Nonogram is one of logical games popular in Japan and Netherlands. Solving nonogram is a NP-complete problem. There are some related papers proposed. Some use genetic algorithm (GA), but the solution may get stuck in local optima. Some use depth first search (DFS) algorithm, the execution speed is very slow. In this paper, we propose a puzzle solving algorithm to treat these problems. Based on the fact that most of nonograms are compact and contiguous, some logical rules are deduced to paint some cells. Then, we use the chronological backtracking algorithm to solve those undetermined cells and logical rules to improve the search efficiently. Experimental results show that our algorithm can solve nonograms successfully, and the processing speed is significantly faster than that of DFS. Moreover, our method can determine that a nonogram has no solution.

Japanese puzzle Nonogram Depth first search Chronological backtracking 


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Ueda N, Nagao T (1996) NP-completeness results for NONOGRAM via parsimonious reductions. Technical report TR96-0008, Department of Computer Science, Tokyo Institute of Technology, May 1996 Google Scholar
  2. 2.
    McPhail BP (2005) Light up is NP-complete. Feb 2005.
  3. 3.
    Batenburg KJ (2003) An evolutionary algorithm for discrete tomography. Master thesis in computer science, University of Leiden, The Netherlands Google Scholar
  4. 4.
    Batenburg KJ, Kosters WA (2004) A discrete tomography approach to Japanese puzzles. Proceedings of BNAIC, pp 243–250 Google Scholar
  5. 5.
    Tsang EPK (1993) Foundations of constraint satisfaction. Academic Press, London Google Scholar
  6. 6.
    Wiggers WA (2004) A comparison of a genetic algorithm and a depth first search algorithm applied to Japanese nonograms. Twente student conference on IT, Jun 2004 Google Scholar
  7. 7.
  8. 8.

Copyright information

© Springer Science+Business Media, LLC 2009

Authors and Affiliations

  1. 1.Department of Computer ScienceNational Chiao Tung UniversityHsinchuROC

Personalised recommendations