ArticlePDF Available

New Technique To Solve Nonogram Puzzle Problem With Quake Algorithm

Authors:
  • Al-Balqa Applied University

Abstract and Figures

Nonograms are logic puzzles in which squares in a grid are colored or left blank according to numbers given at the side of the grid where the cell is filled (black) or empty (white) which in that case called space. Once completed, the puzzle reveals a hidden picture. Nonograms may be black and white or colored, in which case the number clues are also colored to show the color of the squares. Nonograms can be of any size or shape ,also there is a different kind of nongram-called triddlers-in which cells are triangles. in this kind of puzzles we have three sets of clues instead only of two. and it vary in difficulty of the levels. The general Nonogram problem is NP-hard. This paper will enhance a new algorithm for solving nonogram puzzle problem depend on genetic algorithm and particles swarm algorithms to solve square nanogram puzzle.
Content may be subject to copyright.
New Technique To Solve Nonogram Puzzle Problem With
Quake Algorithm
Khalaf Khatatneh1
Information Technology Department Al-Balqa Applied University Al-Salt, Jordan
Key-Words: N-Puzzle, shortest path problem
,Dijkstra algorithm, Automata with
Multiplicities.
Abstract
Nonograms are logic puzzles in which squares in
a grid are colored or left blank according to
numbers given at the side of the grid where the
cell is filled (black) or empty (white) which in
that case called space. Once completed, the
puzzle reveals a hidden picture. Nonograms may
be black and white or colored, in which case the
number clues are also colored to show the color
of the squares. Nonograms can be of any size or
shape ,also there is a different kind of nongram-
called triddlers- in which cells are triangles. in
this kind of puzzles we have three sets of clues
instead only of two. and it vary in difficulty of
the levels. The general Nonogram problem is
NP-hard.
This paper will enhance a new algorithm for
solving nonogram puzzle problem depend on
genetic algorithm and particles swarm algorithms
to solve square nanogram puzzle.
Introduction
Nonogram is a Japanese puzzle which takes the
form of a N ×M matrix, with numbers located on
the left that represent the number of filled cells in
each row and the numbers on the top represent
the filled cells in the columns.
In this puzzle the numbers represent how many
cells which are filled or empty in a certain row,
for example the numbers 1,3,4 means that there
is 1 ,3,4 consecutive groups of black cell but
separated with at least one space between the
groups .the problem in this puzzle is to know
how these consecutive groups are ordered.
These puzzles originated in Japan, and have a
variety of names such as picture puzzles,
painting by numbers and Japanese crosswords .
The puzzler gradually makes a drawing on a
grid, by means of logical reasoning. This task
can be imitated by using techniques from
Artificial Intelligence. it can be represented in a
tow dimensional array with a specified number
of columns and rows. In Figure.1(a) a simple
example of nonogram puzzle and figure.1(b) the
correct solution for the puzzle.
Figure 1: a) nonogram Puzzle
b) the solution of (a)
For solving nongram puzzle at first we should
find the sum of 1's in each row and column in
this array and take the absolute value for the
deference between this row or column with
Nanogram , secondly add this differences to each
other if the result equal zero (0) then this
solution is optimal for
problem.
Particle swarm (birds when search food)
Like a bird swarm went to search food, all
particles work to each other to find food , this
technique solving Nanogram problem by
continuous search in 2-D array and shift all rows
to the right to satisfy the condition that the
deference between Nanogram is zero .
JOURNAL OF COMPUTING, VOLUME 3, ISSUE 12, DECEMBER 2011, ISSN 2151-9617
https://sites.google.com/site/journalofcomputing
WWW.JOURNALOFCOMPUTING.ORG
169
In this paper will chose the random 2-D arrays
throw (applying) the condition that any 2-D array
and nonogram will have deference between rows
is equal zero.
Figure 2: solving Nanogram using Particle swarm
Figure 3: example for Particle swarm down
Population problem, when 2-D array
have invalid column(s):
2-D array will chosen randomly depend on
deference between rows will be zero ,the
traditional particle swarm will can't solve this
Nanogram problem.
Here we need to make leap to build new
generation using genetic algorithm (GA),and
particle swarm algorithm.
Choose row that try to make same sequence for
nonogram and 2-D array column using genetic
Mutation then applying particle swarm
algorithm.
Minimal number of probability for
genetic algorithm to make mutation
Figure 4: Minimal number probability for
genetic mutation
As the Figure 4 shown the black arrows have
deferent value for column that have maximum
Priority to make leap using cross over.
Testing
This algorithm run over 90 square Nanogram
puzzle (3*3,4*4,5*5), succeed to solve it all with
complexity equal O (n3).
Figure 5: genetic
i
JOURNAL OF COMPUTING, VOLUME 3, ISSUE 12, DECEMBER 2011, ISSN 2151-9617
https://sites.google.com/site/journalofcomputing
WWW.JOURNALOFCOMPUTING.ORG
170
Conclusion
This algorithm depends on two co-factors the
first one is population size that will give us more
probability to find optimal solution when
maximized it ,and second factor is Nanogram
size ,if Nanogram size is big the algorithm will
take more time to find optimal solution there for
should algorithm after number of generation if
we don't find optimal solution.
References:
Batenburg KJ, KostersWA ,”A discrete
tomography approach to Japanese puzzles.” ,In
Proceedings of BNAIC, pp 243–250,Oct 2004.
K.J. Batenburg and W.A. Kosters ,”Solving
Nonograms by combining relaxations.”,
Pattern Recognition 42, 2009.
K.J. Batenburg, S. Henstra, W.A. Kosters and
W.J. Palenstijn, “Constructing Simple
Nonograms of Varying Difficulty”, Pure
Mathematics and Applications, 2009.
Young-Sun Sohn, Kabsuk Oh and Bo-Sung
Kim ,”A Recognition Method of the Printed
Alphabet By using Nonogram Puzzle”,2007.
Wiggers WA , “A comparison of a genetic
algorithm and a depth first search algorithm
applied to Japanese nonograms”. Twente
student conference on IT, Jun 2004.
JOURNAL OF COMPUTING, VOLUME 3, ISSUE 12, DECEMBER 2011, ISSN 2151-9617
https://sites.google.com/site/journalofcomputing
WWW.JOURNALOFCOMPUTING.ORG
171
ResearchGate has not been able to resolve any citations for this publication.
Article
Full-text available
Japanese puzzles, also known as Nonograms, are image reconstruc-tion problems that can be solved by logic reasoning. Nonograms can have widely varying difficulty levels. Although the general Nonogram problem is NP-hard, the instances that occur in puzzle collections can usually be solved by hand. This paper focuses on a subclass of Nonograms that can be solved by a sequence of local reasoning steps. A difficulty measure is defined for this class, which corresponds to the number of steps required to reconstruct the image. In the first part of this paper, we investigate the difficulty distribution among this class, analyze the structure of Nonograms that have lowest difficulty, and give a construction for the asymptotically most difficult problems. The second part of the paper deals with the task of constructing Nonograms, based on a given gray level image. We propose an algorithm that generates a set of Nonograms of varying difficulty that all resemble the gray level input image. The effectiveness of the algorithm is demonstrated for several input images.
Article
In this paper, we realize a system that converts the character images of the printed alphabet of two types into editable text documents by using a black and white CCD camera. We binarize the image of the printed English sentences, and divide a line of printed characters by the horizontal projection of the histogram method and abstract a character by the vertical projection of the method. We normalize the character by converting the height of it to 48 pixels. We cover a normalized character with a quadrangle, which is composed of a series of pixels. From this state, we get the numerical information of the character by applying the principle of the Nonogram puzzle reversely to the normalized characters and, recognize an abstracted character by comparing the standard patterns of alphabet. We get the recognition rate of 100 percent by testing 2609 characters of Batang type and 1475 characters of Dodum type.
Article
In this paper the performance of a genetic algorithm and a depth first algorithm are compared by implementing both algorithms and solving the Japanese Nonogram. Both algo-rithms are popular because of their generic structure, which makes them easy to apply to a wide range of problems. Problems such as how to make a correct representation of the Japanese Nonogram so it can be used by the genetic algorithm will be addressed. In the last section the results of the experiments show that the genetic algorithm can out-perform the depth first search algorithm.
Article
Nonograms, also known as Japanese puzzles, are a specific type of logic drawing puzzles. The challenge is to fill a grid with black and white pixels in such a way that a given description for each row and column, indicating the lengths of consecutive segments of black pixels, is adhered to. Although the Nonograms in puzzle books can usually be solved by hand, the general problem of solving Nonograms is NP-hard. In this paper, we propose a reasoning framework that can be used to determine the value of certain pixels in the puzzle, given a partial filling. Constraints obtained from relaxations of the Nonogram problem are combined into a 2-Satisfiability (2-SAT) problem, which is used to deduce pixel values in the Nonogram solution. By iterating this procedure, starting from an empty grid, it is often possible to solve the puzzle completely. All the computations involved in the solution process can be performed in polynomial time. Our experimental results demonstrate that the approach is capable of solving a variety of Nonograms that cannot be solved by simple logic reasoning within individual rows and columns, without resorting to branching operations. In addition, we present statistical results on the solvability of Nonograms, obtained by applying our method to a large number of Nonograms.
A discrete tomography approach to Japanese puzzles
  • K J Batenburg
  • Kosterswa
Batenburg KJ, KostersWA,"A discrete tomography approach to Japanese puzzles.",In Proceedings of BNAIC, pp 243-250,Oct 2004.
A Recognition Method of the Printed Alphabet By using Nonogram Puzzle
  • K J Batenburg
  • S Henstra
  • W A Kosters
  • W J Palenstijn
K.J. Batenburg, S. Henstra, W.A. Kosters and W.J. Palenstijn, "Constructing Simple Nonograms of Varying Difficulty", Pure Mathematics and Applications, 2009. Young-Sun Sohn, Kabsuk Oh and Bo-Sung Kim,"A Recognition Method of the Printed Alphabet By using Nonogram Puzzle",2007.