Content uploaded by Sathya priya Ss
Author content
All content in this area was uploaded by Sathya priya Ss on Jun 08, 2019
Content may be subject to copyright.
© 2018, IJCSE All Rights Reserved 54
International Journal of Computer Sciences and Engineering Open Access
Survey Paper Volume-6, Special Issue-2, March 2018 E-ISSN: 2347-2693
Survey on N-Queen Problem with Genetic Algorithm
S.Sathyapriya1*, R.Stephen2, V.S.Joe Irudayaraj3
1*Dept.ComputerScience,St. Joseph’s College, Bharathidasanuniversity,Trichy,India.
2Dept.ComputerScience,St. Joseph’s College, Bharathidasanuniversity,Trichy,India.
3Dept.ComputerScience,St. Joseph’s College, Bharathidasanuniversity,Trichy,India.
*Corresponding Author: sathyapriya2822@gmail.com, ph.: 7373631298
Available online at: www.ijcseonline.org
Abstract— The combinatorial optimization problem is a collection of problems which need a sample amount of time and effort
to be solved. Vast difficulties have been occurring to solving these types of problem that there is no exact formula to solve the
problem. Each feasible solution works on some order and the size of the probability increases algorithmically as the number of
the problem also increases dynamically. This paper discusses about N–Queen problem, it is also a type of NP – hard problem.
Many researchers have proposed various methods and algorithms for this problem. Henceforth, Genetic Algorithm is one kind
of famous algorithm for solving NP hard problems. This paper mainly focuses on the review work of genetic algorithm to solve
the N -Queen Problems (NPQ).
Keywords—N–Queen Problem, NP-hard problem, Genetic algorithm, Heuristic algorithm.
I. INTRODUCTION
Most of the researchers and scientists, proposed different
types of heuristic algorithm for the best optimistic solution to
solve a problem by using a certain model from particular
problem, that process may be physically or biological in
nature which is frequently performed. Heuristic algorithm
differs from the classic algorithms. It performs in various
way and pursuit onward with the capacity. Further classic
algorithms are difficult for optimization problem it also
increases in finite number of times with respect to its scale of
the problem. Heuristic algorithms [1] used to find the exact
solution in a proper time. Heuristic algorithm finds quickly
the solution for a problem than the classic algorithm.NP-hard
problem (non-deterministic Polynomial time problem) [2],
that is the problem have non-deterministic solutions, these
solutions run at a polynomial time. Since due to its large
complexity (Eg: O(N!)).They cannot be able to solve within
a particular amount of times using deterministic approach.
The above-mentioned problem, works with an acceptable
number of times, which uses heuristic approach necessarily
queen is one of the non-deterministic time polynomial
problems.
A. N-Queen Problem
The N queen problem [3] is one of the challenging concepts
in computer science, the principle of the n-queen problem as
follows: N is the number of queens that is placed on the n*n
chessboard. The queens cannot be interacting with each
other. Each queen has a unique path to travel. All possible
solutions can be found for each level. Most of these solutions
are based on a particular prescription to allocate queens on a
chessboard, the factual conclusion of petite-size problems
displayed. The amount of solutions incremented
algorithmically number of queens also increases. As a matter
of choice search-based algorithm (SBA) [4] evolved. For
example, BT search (Backtracking)[5] systematically provide
all feasible solution set to a disposed in n*n chessboard. In
BT approach generates a limited class in the huge size
chessboard. Because it is crucial as BT search for asset
solutions, these solutions are significantly differed in the
results spaces. Many journalists have developed alternative
powerful search technique to run over this problem. These
techniques consisting searched heuristic method and
divisional search and collision method are identical.
Conclusively, the problem has been told in the process of
integer programming corresponding to the assignment
program. The below figure [6] explains about one of the
example for 8*8 queen problem.
International Journal of Computer Sciences and Engineering Vol.6(2), Mar 2018, E-ISSN: 2347-2693
© 2018, IJCSE All Rights Reserved 55
Figure1: solution of 8*8 queen problem
The solutions for n queen value in N*N chessboard are fixed.
The solutions for queen value from 1 to 10 are tabulated in
table 1 [7].
Table 1: Correct solutions for number of queens
B. Genetic Algorithm
Genetic Algorithm [8] is one of the best optimization
algorithms. It is based on the approach of natural selection
and genetics. It is one of the search-based algorithms,
established under the concept of evaluation. In GA, each
solution is representing as chromosomes in an individual.
Each chromosome is estimated using a function that is called
a fitness function that denotes the correctness of each
chromosome in the individual. The Genetic algorithm is not
like classical methods and it suitable for a lot of real life
problems. The main objective of genetic algorithm gives
high quality solution for hard problem. It is a program which
works based on genetic code. It is distinguished from
traditional search algorithms. This algorithm searches
between a set of points and work along with its coding of
parameter within them. The features of genetic algorithm are
used as a common optimization procedure. It uses a
probability method, whereas the classic algorithm uses
deterministic methods. The advantage of GA is very faster
and more powerful compared with traditional methods. It
gives the better solutions that close to the global optima. It
doesn’t give any guarantee for all optimal solutions that the
reason randomness, but give the nearest optimal values.
Basic terminologies of genetic algorithms are followed
1) Population: Population means a set of all solution of
a problem.
2) Chromosomes: Chromosomes is referred a single
solution from a set of solutions.
3) Gene: Gene is defined a single element of the single
solution.
4) Fitness function: Fitness function is like a function
that takes set of solution as a input and produce
solution as a output.
5) Genetic operators: There are three operators are
used in Genetic algorithm.
Genetic operators are followed,
1) Selection: Selection [9] is one important stage in genetic
algorithm. Selection work based on solution and its
population using crossover methods.
Selection procedures are,
a) Fitness function can be evaluated for each
individual that providing fitness value, then
these are normalized depend on its fitness
value.
b) Populations have been sorted by descending
order of fitness values.
c) Normalized fitness values are calculated.
d) Random number R has been chosen.
e) The selected normalized value is smaller than
R.
2) Crossover: Crossover [10] is one type of genetic
operator. It used to change the programming of
chromosomes from one to the next. The process of
crossover is taking more than one from a parent
solution and returns one child solution.
3) Mutation: Mutation [11] is another genetic operator. It
used to manage genetic, diversity from one generation
of chromosomes from one to the next.
Section I contains the introduction of N-queen Problem &
Genetic Algorithm, section II contain the related work of
Genetic Algorithm, section III contain the Summary of
Genetic Algorithm used to solve N-Queen problem, section
IV concludes research work with future directions.
II. LITERATURE SURVEY
Vijayanellappan et al compared two algorithms in [12] for
solving n – queen problems, such as genetic algorithm and
backtracking algorithm both uses different methods in an
entire work solving n queen problem. Time taken for these
methods based on a given value of n. The time increases
when n value is increased. This algorithm is explained in an
efficient way. Since the backtracking algorithm is difficult
when n value reached up to 35. The genetic algorithm is
Number of Queens
Solutions
1
1
2
0
3
0
4
2
5
10
6
4
7
40
8
92
9
352
10
724
International Journal of Computer Sciences and Engineering Vol.6(2), Mar 2018, E-ISSN: 2347-2693
© 2018, IJCSE All Rights Reserved 56
faster than the backtracking algorithm. Backtracking
algorithm is very critical to implement in higher values, but it
also efficient and simple in lowest value.
Jalal eddinAghazadeh heris et al. [13] proposed a
modified genetic algorithm for solving n queen problem.
Their paper covered weakness of this algorithm with the help
of local search algorithms. A Minimal conflicts algorithm
like a local search algorithm contributed the partial view of
genetic algorithm. Modified algorithm is the solution of the
combinations among GA and minimal conflicts algorithm.
The standard GA algorithm and modified GA algorithm are
compared to solving n queen problem. The normal GA
algorithm is not efficient to solve 8 queen problems with
large scale, but their paper solves the problem of GA
algorithm by applying minimal conflicts algorithm.
Saadakarbic et al. [14] proposed genetic algorithm for
solving the minimum dominating set of queen’s problems
connected with standardized chessboard positioned puzzles.
The paper produced simple, effective and good solutions by
using genetic algorithm to solve this problem. Since the
optimal solution is also determined by the GA algorithm for
different size board form 8*8 to 11*11. This proposed
algorithm has been resolved by using MATLAB and 2.6G
Hz PC with Intel processor. The proposed GA has found the
optimal solution on a chess board.
Ahmed S. Farhan et al. [15] proposed GA for finding 92
solutions of n queen problem. The GA algorithm solved the
problem by using genetic code for a good solution to the
problem. The probabilities of 92 solutions for 8 queen
problems are to be found each genetic represent through one-
dimensional array with the same size 8. This representation
diminishes the empty cell which wants more time for
comparison with representation one array used to store 8
queens for one solution based on GA algorithm and also
fitness calculated.
Vishal Jain et al. [16] proposed genetic algorithm for solving
various problems from different domains such a word sense
disambiguation, tuning the parameters of fuzzy logic 8 queen
and image compression. The paper explained the concept GA
algorithm and how it’s applied in the various problems and
finding solutions for vast search space, the paper mainly
focused on ample amount of space and optimization
problems from different domain large search space 8 queen
problems solved by GA algorithm.
Vishal khanna et al. [17] compared various Memetic
algorithms for solving NP –hard problem, which has a non-
polynomial time problem optimizing the n queen problem
using genetic algorithm, SALAMA and HCLSMA
algorithms. Memetic algorithm solved n queen problem
following two stages. In a first stage generate solutions
randomly that are evolved till they become feasible solution
and the second stage from these solutions are one more time
evolved so violation of soft constraints to be minimized. In a
final stage, it produces the best solution in which hard
constraints are satisfied. HCLSMA algorithm gives the better
solutions compared with GA for optimal solution. Time and
coverage rate also better in HCLSMA than GA.
Soham Mukherjee et al. [18] compared various algorithms
to solving n queen problems which provide brief explanation
about different algorithms such as Genetic Algorithm,
Simulated annealing Algorithm, Brute Force Algorithm,
Backtracking and found the best solution to n queen problem
and constructs a comparison of these four algorithms. The
proposed GA performed very well compared with SA
algorithm. BF algorithm and BT algorithm provides the best
fitness value than the simulated using by GA. GA gives the
best solution that helps to give an optimal solution to the
global optima. BF and BT algorithms are only used when the
problem size is limited and these are not efficient and
effective to solve n queen problem when the n value is high,
whereas GA and SA algorithms are given the efficient
solution when the n value is high. The proposed GA has the
better fitness of the solution than the SA algorithm by GA
but execution time of SA by GA is better than proposed GA.
Vikasthada et al. [19] proposed the comparative analysis of n
queen problem using Genetic Algorithm and Backtracking
algorithm. Both algorithms are used for different methods
when solving the n queen problem. The n value of these
problems is compared whereas the n value increases. BT
algorithm is not good for large size value, it is difficult to
solve that problem. The paper consists of whole work carried
out in MATLAB using Pentium core 2 and 2.2 GHz
processors on windows 8 with 4 GB RAM. The N value
taken from 4 to 50 under the population of 1000 and
generation is 100 further using these methods execution time
is calculated. BT technique using small size n value so less
execution time compares to GA technique, but the fact GA
are not possible to its random search, that gives only an
approximate solution GA is performing much better than the
BT algorithm.
Belae Al-khateeb et al. [20] compared two metaheuristic
algorithms such as GA and SA for solving 8 queen problems
further finding all the 92 feasible solutions for 8*8 chess
board. Both algorithms provided a better solution rather than
the randomization method and also SA is better than the GA
whose are taking less time for finding solutions.
Er.VishalKhanna et al. [21] compared various techniques for
solving N-Queen problems used techniques are Genetic
Algorithm, Backtracking Algorithm and Tuned Hybrid
Technique. This NP problem solved by following its
principle that is each queen is not contradict with each other
queen vertically, diagonally and horizontally. Performance
analysis of n queen problem is increased by removing the
threatening cell. These three algorithms are used for solving
this NP-Hard problem based on its parameter namely time
and space. Time taken by BT and Tuned hybrid techniques to
solve the problem is more than the genetic algorithm. The
paper explains the complexity analysis is improved using
various algorithms. Better solutions are found, but
International Journal of Computer Sciences and Engineering Vol.6(2), Mar 2018, E-ISSN: 2347-2693
© 2018, IJCSE All Rights Reserved 57
complexity analysis can be based in the conflict
minimization and convergence rate.
S.Pothumani [22] compared various algorithms for solving
N-Queen problem. In this paper N queen problem is
described and solved using various methods, whereas
proposed algorithms are Ant Colony Optimization, Genetic
algorithm, DNA Striker algorithm and Particle Swarm
Optimization. These all algorithms provide the better result
than the traditional algorithms, but the performance differ
depending upon the size of the space and number of queens.
Some parameters are very useful to make a comparison study
for better understand.
Amardeep sing et al. [23] proposed Memetic Algorithm for
solving well known NP-hard problem such as N-Queen
problem. The paper Memetic Algorithm is used to optimize
N-Queen problem, whereas make the complexity of the
parameters with respect to the number of iterations. Memetic
Algorithm solved N-queen problem consists of being a
combination of GA and Local Search. GA steps are followed
entire problem. The combination of GA and Local Search to
solved the NQP within two phases, in a first stage randomly
generated solution are evolved till it become feasible (hard
constraints are satisfied) and second stage evolved solutions
are minimized the violation of soft constraints.
Ayed M. Turky [24] proposed genetic algorithm and solved
Constraint satisfaction problem that taken the N queen
problem. It consumed large N values with time guarantee
optimize solved N Queen problem and the results are
tabulated. GA produced good results when compared against
the other approach. Crossover fraction, mutation fraction,
selection mechanism, crossover type, mutation type
parameters is used under the principle of GA. The results of
this problem successfully solved using GA with repair
function. This function is found different solution in different
times for a given number of queens, but it is given by best
time.
Ivicamartinjak [25] proposed the way in which heuristic
algorithm can be used to solve n queen problem. Genetic
algorithm, simulated annealing algorithm and Tabu search
algorithm are used where test results of these algorithms are
calculated and the complexity also determined. These
algorithms are successfully compared and their achievements
are measured. The reduction of the fitness function
complexity O(1) problem occurrences with large magnitude
is solved. SA calculated the fitness function equal to its
iteration, whereas other algorithms are more complicated and
the fitness function is calculated more than once in every step
of its procedure. Since fitness calculation time is taken
large.GA and SA are contrasted with Tabu search algorithm,
but from this algorithm SA is better for solving large
dimension N queen problem which also achieved fitness
function.
Marco Bozikovic et al. [26] proposed the way, which the
genetic algorithm used to solve the NQP. Chromosome
representations, genetic operators and evaluation functions
are produced. Furthermore, Global Parallel GA is proved like
a possible way of GA. GPGA works simultaneously in the
process of selection and crossover, but it is not suitable for
large processing at the same time increase the performance
for a small number of related processing units.
Milena lazarova [27] produced the efficiency of parallel GA
for solving N-queen problem with a multi computer
platform. This proposed model of GA is based on al parallel
algorithm technique of simultaneous iterations.
Chromosomes parameters are used that selected randomly in
a bidirectional circular model. This algorithm implemented
for both programming models such as flat and hybrid.
Performance and scalability made with respect to the board
size and parallel system size, but the performance of hybrid
parallel programming mode are better than the hardware
resource of the destination multicomputer.
III. Summary of Genetic Algorithm used to solve N-
Queen problem
Table 2: Summary of Genetic Algorithm used to solve N-
Queen problem
Author Name
Merits
Demerits
Vijayanellappan[12]
GA best for large
number of values.
Time taken based
on given values.
JalaleddinAghazadehh
eris[13]
Resolve the
weakness of GA
using Minimal
conflicts algorithm
Standard
algorithm is not
efficient without
applying MC
algorithm
Saadakarbic[14]
GA produce
optimal solution
for different size
boards
Other computing
technique can be
improved
Ahmed S. Farhan[15]
Empty cell
removed.
One array holds 8
queens for one
solution.
Vishal Jain et al [16]
Different domains
large space
problem solved by
GA
Parameters may
be used.
Vishal khanna [17]
Constraints are
satisfied within 2
stages.
Time and
converge rate can
be improved.
Soham Mukherjee[18]
GA is efficient and
effective than SA
by using GA.
Execution time
can be improved.
That is slow than
SA.
Vikasthada [19]
GA better than BT
and gives
approximation
solution.
Random search is
not possible.
Belae Al-khateeb [20]
Provide the better
solution than
randomized
method.
Execution time
can be improved.
Er.VishalKhanna [21]
Problem solved
based on its time
and space.
Complexity
analysis may be
improved.
S.Pothumani [22]
Better than
traditional
algorithm for
finding solution.
Better parameter
can be used.
International Journal of Computer Sciences and Engineering Vol.6(2), Mar 2018, E-ISSN: 2347-2693
© 2018, IJCSE All Rights Reserved 58
Amardeep sing [23]
Constraints are
satisfied.
Long steps may
be avoided.
Ayed M. Turky [24]
Repair function
used with GA.
Best time can be
need
Ivicamartinjak [25]
Fitness function
complexity O (1)
is solved.
Fitness function
takes large time
that can be
avoided.
IV. CONCLUSION
This survey aimed to provide a clear understanding,
regarding Genetic Algorithm with the influence of N-queen
problem. Moreover, the recently proposed various
mechanisms were concluded to solve N-queen problem. So,
furthermore each mechanism was analyzed and studied and
their advantages and improvements were included. Finally,
the brief comparison was provided in the preceding which
shows merits and demerits of existing works.
REFERENCES
[1] Kaveh, A.Ghazaan, M Ilchi. ―A new meta-heuristic algorithm:
Vibrating particles system, ScientiaIranica. Transaction A, Civil
Engineering; Tehran ,Vol. 24, Iss. 2, (2017),pp 551-566.
[2] Cusack, C., Largent, J., Alfuth, R., &Klask, K. 2010. ―Online
Games as Social-Computational Systems for Solving NP-
complete Problems‖.In Proc. of Meaningful Play’10. 5.
[3] Er. Vishal Khanna, Er. Sarvesh Chopra, Review on N-Queen
Optimization Using Tuned Hybrid Technique, International
Journal of Engineering Sciences & Research Technology
(Thomson Reuters),Vol.6, Issue.2,2017,pp.62-68.
[4] https://en.wikipedia.org/wiki/Search-
based_software_engineering
[5] Ji-PyngChiou, Chung-Fu Chang and Chin-Ju Li,‖ A backtracking
evolutionary algorithm for power systems‖, MATEC Web of
Conferences Volume,vol. 119, 2017.
[6] Doug Chatham,‖ The maximum queens problem with pawn‖,
Recreational Mathematics
Magazine,vol.3,Issue.6,2018,DOI: https://doi.org/10.1515/rm
m-2016-0010.
[7] B Documentaries, ―Full Solution of N-Queens Problem O
Reilly‖, http://oreillynQueensproblem.blogspot.in, 3-Sept-
2016.
[8] Song Yan, Yang Guoxing, ―A Genetic Algorithm for test
paper‖, International conference, 2013.
[9] ShokouhiM.Chubak P. RaeesyZ―Enhancing focused crawling
with genetic algorithms‖Vol: 4-6,2005, pp.503- 508.
[10] B.Klabbankoh, O.Pinngern. ―applied genetic algorithms in
information retrieval” Proceeding of IEEE ,pp.702- 711,Nov
2004.
[11] V.Thada, V.Jaglan, ―Use of Genetic Algorithm in Web
Information Retrieval‖, International Journal of Emerging
Technologies in Computational and Applied Sciences,
vol.7,no.3,pp.278-281, Feb,2014.
[12] Anuneet Kumar Dubey, VijayanEllappan, Rakesh Paul,
Vishal Chopra, ―Comparative Analysis of Backtracking And
Genetic Algorithm In N Queens’s Problem‖, International
Journal of Pharmacy &Technology, Vol.8, Issue.4,2016,
pp.25618-25623.
[13] JalaleddinAghazadehheris Faculty of Mathematics and
MohammadrezaAsgariOskoei, Modified Genetic Algorithm
for Solving n-Queens Problem ―,Iranian Conference on
Intelligent Systems (ICIS), 2014.
[14] SaadAlharbi and Ibrahim Venkat, ―A Genetic Algorithm
Based Approach for Solving the Minimum Dominating Set of
Queens Problem‖, Journal of Optimization, 2017.
[15] Ahmed S. Farhan ,Wadhan Z. Tareq and Fouad H. Awad,
―Solving N-Queens Problem using Genetic Algorithm ‖,
International Journal of Computer Applications, Vol.122,
Issue.12, 2015,pp.11-14.
[16] Vishal Jain, DevendraSaini and K.N Dinesh Babu,‖ A
Genetic Approach To Solve Problems From Diverse
Domains‖, International Journal of Advanced Scientific and
Technical Research, vol.6, Issue -6,2016.
[17] Er. Vishal Khanna, Er. Sarvesh Chopra and
Er.AbhishekBhardwaj,‖ N-Queens Problem Optimization
Using Various Memetic Algorithms‖, International Journal
of Modern Computer Science, Vol.5, Issue.2, 2017.
[18] Soham Mukherjee, SantanuDatta, PramitBrataChanda and
Pratik Pathak, ―Comparative Study of Different Algorithms
To Solve N-Queens Problem‖, International Journal of
Foundations of Computer Science and Technology, Vol.5,
Issue.2, 2015,pp.15-27.
[19] VikasThada and Shivali Dhaka, ―Performance Analysis of N-
Queens Problem using Backtracking Algorithm Techniques
‖, International Journal of Computer Applications, Vol.102,
Issue.7,2014, pp. 26-29.
[20] Belal Al-Khateeb, Wadhah Z. Tareq, ‖ Solving 8-Queens
Problem by Using Genetic Algorithms, Simulated Annealing
and Randomization Method‖, 2013 Sixth International
Conference on Developments in systems engineering, 2013,
pp.187.
[21] Er. Vishal Khanna, Er. Sarvesh Chopra and
Er.AbhishekBhardwaj, ―Comparative Analysis Of
Backtracking, Tuned Hybrid technique And Genetic
Algorithm For Optimization Of N-Queens Problem‖,
International Journal Of Engineering Sciences & Research
Technology, Vol.6, Issue.3, 2017.
[22] S.Pothumani, ―Solving N-Queens Problem using Various
Algorithms-A Survey‖, InternationalJournal of Advance
Research in Computer Science and Software Engineering,
Vol. 3, Issue. 2, 2013, pp. 247-250.
[23] Amarbir Singh and Sandeep Singh Dhillon, ―A Comparative
Study of Algorithms for N-Queens Problem‖, International
Journal of Advance Foundation and Research in Science and
Engineering, Vol.1, Special Issue, 2015, pp.1-4.
[24] Ayad M. Turkyand, MohdSharifuddinAhmad , ‖ Using
Genetic Algorithm for Solving N –Queens Problem‖,
International Symposium on Information Technology, vol.2,
2010.
[25] IvicaMartinjak and M. Golub, "comparison of heuristic
algorithms for the n-Queen Problem,‖ Iinternational
conference on information technology Interfaces, 2007.
[26] Marko Bozikovic, Marin Golub and Leo Budin, ―Solving N-
Queens Problem Using Global Parallel Genetic Algorithm‖,
European Conference Ljubljana Slovenia, 2003, pp.11-17.
[27] Milena Lazarova,‖ Efficiency Of Parallel Genetic Algorithm
For Solving N-Queens ProblemOn Multicomputer Platform‖,
9th WSEAS International Conference On Evolutionary
Computing (EC’08), Sofia, Bulgaria, May 2-4, 2008.