Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
ORG
169
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.
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
170
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.
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.
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 3: example for Particle swarm down
JOURNAL OF COMPUTING, VOLUME 3, ISSUE 12, DECEMBER 2011, ISSN 2151-9617 https://sites.google.com/site/journalofcomputing WWW.JOURNALOFCOMPUTING.ORG
171
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 243250,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.