Abstract
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.
Similar content being viewed by others
References
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
McPhail BP (2005) Light up is NP-complete. Feb 2005. http://www.reed.edu/~mcphailb/lightup.pdf
Batenburg KJ (2003) An evolutionary algorithm for discrete tomography. Master thesis in computer science, University of Leiden, The Netherlands
Batenburg KJ, Kosters WA (2004) A discrete tomography approach to Japanese puzzles. Proceedings of BNAIC, pp 243–250
Tsang EPK (1993) Foundations of constraint satisfaction. Academic Press, London
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
http://www.pro.or.jp/~fuji/java/puzzle/nonogram/knowhow.html
Database of Japanese puzzles. http://hattori.m78.com/puzzle/picture/java/stage_01/index.html and http://www.books.com.tw/exep/prod/booksfile.php?item=0010317755
Author information
Authors and Affiliations
Corresponding author
Rights and permissions
About this article
Cite this article
Yu, CH., Lee, HL. & Chen, LH. An efficient algorithm for solving nonograms. Appl Intell 35, 18–31 (2011). https://doi.org/10.1007/s10489-009-0200-0
Published:
Issue Date:
DOI: https://doi.org/10.1007/s10489-009-0200-0