Meerkat Clan Algorithm for Solving N-Queen Problems

The swarm intelligence and evolutionary methods are commonly utilized by researchers in solving the difficult combinatorial and Non-Deterministic Polynomial (NP) problems. The N-Queen problem can be defined as a combinatorial problem that became intractable for the large ‘n’ values and, thereby, it is placed in the NP class of problems. In the present study, a solution is suggested for the N-Queen problem, on the basis of the Meerkat Clan Algorithm (MCA). The problem of n-Queen can be mainly defined as one of the generalized 8-Queen problem forms, for which the aim is placing 8 queens in a way that none of the queens has the ability of killing the others with the use of the standard moves of the chess queen. The Meerkat Clan environment is a directed graph, called the search space, produced for the efficient search of valid n-queens’ placement, in a way that they do not cause harm to one another. This paper also presents the development of an intelligent heuristic function which is helpful to find the solution with high speed and effectiveness. This study includes a detailed discussion of the problem background, problem complexity, Meerkat Clan Algorithm, and comparisons of the problem solution with the Practical Swarm Optimization (PSO) and Genetic Algorithm (GA. It is an entirely review-based work which implemented the suggested designs and architectures of the methods and a fair amount of experimental results


Introduction
A swarm can be defined as a large amount of simple and homogenous factors that locally interact amongst one another, and with their environment, without any central regulation for allowing the emergence of a general interesting behavior.The swarm-based methods have lately emerged as a set of the population-based, nature-inspired methods which can produce fast, low cost, and robust solutions to a number of complicated tasks [1][2][3].The MCA is efficiently dependent upon the behavior and parameters of Meerkats, which are social mammals, living in groups of 5 to 30 individuals.Due to the fact that they are amiable animals, they share latrine as well as the parental care duties.Each crowd has one commanding alpha male and an overwhelming alpha female, as well as a specified domain where they change in the case where the nourishment is rare or they are constrained out by a more grounded crowd.This algorithm begins by fixed steps, which are utilized to initialize the parameter values, and flows with the number of the iterated steps for discovering the optimal solution to the problem [4].The N-Queen problem is represented by placing 'n' queens on a chessboard in a way that none of the queens has the ability of killing the rest with the use of the standard moves of the chess queen.There can be named 3 such cases where the queen has the ability of killing another one [5]; a. in the case where 2 queens are in one row, b. in the case where 2 queens are in one column, c. the case where one of the queens is in the diagonal of another one.

N-Queen Problem
The 8 queens problem is the famous NP-complete problem which was firstly introduced in 1850 by C. F. Gaus [6].This Problem has been researched by a number of mathematicians in the 19th century.The main challenge of the problem is the fact that it needs numerous calculations.The general problem of the N-Queen was discussed by Yaglom and Yaglom in the 1950s [6].The general problem of the N-Queen has been characterized by the following constraints into an NxN grid with following conditions [6]: 1.Only 1 queen may be put in row.2.Only 1 queen may be put in column.3.Only 1 queen may be put on diagonal.4.Precisely N queens have to be put on that grid.There has been a number of methods that has been introduced to address this problem, such as the program development, algorithmic design, AI, and parallel and distributed computing.Such widespread interest in the N-Queen problem is partly a result of the characteristics which identifies complex problems, viz.which satisfies a group of global constraints.In the section below, the proposal of the molecular algorithm to solve that problem will be introduced [6].Also, the N-Queens is considered as one of the NP-complete problems.There are several metaheuristic (swarm intelligence and nature-inspired) algorithms that have been used to solve the NP-complete problems, such as the bees algorithm, camel herd algorithm, ant colony algorithm, harmony search, scatter search, and so on [8][9][10][11].

Related Work
As of late, the region of Evolutionary Computation has made its mark.Two of the common advanced approaches are the GAs and PSO, both of which being utilized in optimal problems.While the two methodologies are upheld to discover an answer for a given target work, they utilize various systems and computational endeavours.Consequently, it is worthy to evaluate their usage.Martinjak et al. [2007] showed that the mathematical problem of the n-queens may be successfully solved with the use of heuristic methods, even in the cases of very large problem dimensions.The heuristic algorithm was carried out for the simulation of the Tabu search, simulated annealing, and GA algorithms by comparing their levels of efficiency.The results showed that a conceptually quite simple heuristic function (like a case in which the neighborhood includes n-tuples differed from current solution in the positions of the two queens) might address this difficult non-deterministic polynomial problem [12].Khan et al. [2009] suggested an effective solution by operating an 8-queen problem that can easy extends to large 'n' values due to the simplistic model of search space.They found that their solution can be effective for the 8-queen in the case where the parameters have been set as swarm size = 15, alpha = 1.50, and beta = 1, or alpha = 1, beta = 1.50.It was concluded that the ACO has the ability of providing a sufficient solution in a reasonable duration for the problems of combining optimizations.As a future work, they proposed exploring its applicability to a number of other equivalent problems [5].Sadiq et al. [2010], considered the N-Queens problem as a very difficult one, which several researchers were interested in solving with a variety of intelligent approaches.Their study presented a new hybrid technique to solve the N-Queen problem.The proposed method depended on DNAcomputing and Tabu search algorithm.Tabu search is used as a tool for increasing the efficiency of the system by reducing the run time and memory capacity as well as the number of the random generated states.The experimental results demonstrated that the use of the hybrid approach provided the best results when compared with the classical DNA-computing approach.The proposed method produced results when all solutions with size 11-by-11, and multiple solutions with size 20-by-20 as maximum.The run time of the proposed system was lower than that of the classical DNA-computing by 50% and the reduction in memory capacity was 75% [13].Sadiq et al. [2013] solved the N-queen's problem using three swarm intelligence algorithms, namely the Bees algorithm, particle swarm optimization (POS), and Cuckoo search.The study showed that these algorithms provided relatively better results.By comparison, the Bees algorithm was more efficient than the PSO, which performed better than the Cuckoo search to handle n-queens problem [14].Al-Obaidi et al. [2018] presented the Meerkat Clan Algorithm and displayed its ability for solving the problem of the Traveling Salesman.The MCA results were obtained through the division of the set of the solutions 2 groups (care and foraging).The majority of the operation was carried out on the foraging group and the poorest solutions were substituted by the optimal ones in the care set.The poorest solution in the care set was dropped and another randomly created solution was added.Their results demonstrated the exceptional performance of the capacity of the algorithms in obtaining the optimum or near-optimum solutions at quite fast rates [4].Nowadays, the computer science community is aware of the importance of the development of solutions for the complicated problems.As discussed above, learning about the collective behaviors of the living creatures can be considered as a motivation to study and provide a valuable swarm-based meta-heuristics analysis tools.The efforts until now have shown the possibility of those new approaches to find successful solutions to a wide range of applied optimization problem types.Actually, there is no single 'best' approach.A variety of applications have been more satisfactory for solving various problems, which either results in more adequate solutions, or improves the speed.In addition to that, the specific approach's suitability does not only rely on the issue; various processes are more appropriate for various individuals, according to their capabilities and knowledge [4].

MCA to Solve N-Queen Problem Meerkats Metaheuristic
Meerkats can be described as dwelling mammals which live in massive open networks with a variety of entrances, where they are only capable of leaving during the day [4].Meerkats are very friendly animals which occupy abandoned domains in the form of clusters, usually of about 10 to 30 individuals, even though considerably larger groups are normally seen in zones of a sufficient supply of food.The group usually includes 3-4 female and male match families, as well as their offspring.After being a wake early in the morning, they rise out of the tunnels for sunbathing.The majority of the group will head out for rummaging for sustenance whereas the rest will either play the roles of gate-keepers or keep an eye on the young.By standing straight on the tails and the rear legs on the highest hill point and in the shrubs, the monitor Meerkats may be having a good advantage to call attention for keeping an eye out for the moving towards the predators, particularly from the sky.A progression of a variety of the caution calls are going to be sounded afterwards for alarming the rest of the gathering about the approaching risk, often making the whole group plunge in the underground tunnel for stowing away [4].

The Artificial Model of the Meerkat Clan
This section will present the Meerkat Clan Algorithm which is dependent upon the behaviour and the parameters of the Meerkats, along with the impacts of those parameters on the efficiency of the algorithm.The significant parameters were obtained from the behaviours of the Meerkats and employed in the MCA, which include the size of the clan n, care group size c, foraging group size m, number of neighbours K, and worst foraging and care ratio, Fr and Cr, respectively.This algorithm begins by specific steps which are utilized to initialize the parameter values and flow with the amount of the iterated steps for the discovery of the optimum solution to the problem.The specified steps which have been utilized in this algorithm for any problem are: 1. Initialization of the values of the parameters.2. Generation of the random clan.3. Computation of the clan fitness.4. Selection of the optimal solution as the Sentry. 5. Dividing the clan to 2 groups, i.e. care and foraging (c and m, respectively).The iterated processes which can differ based on the type of the problem are: 1.Generation of the random neighbours for every one of the foraging solutions.2. Swapping the optimal neighbour with the foraging solution in the case where it is better.3. The poorest solutions for the foraging group will be swapped with the optimal solutions in the care group.For 10 times running and for 10-100 as a population size, the mean value of the optimal results for 8queens have been presented.Table (4) shows that the MCA provides better solutions for solving the 8-Queens problem as compared to the GA and the PSO, in terms of time and number of generations.4 and 5 show that the MCA obtained the best results in a very good time and best iteration numbers.Also, GA has a good result, whereas the worst algorithm is PSO in terms of both consumed time and iteration numbers.MCA required less iteration, as shown in Table 5.Also, the frequency was better than that obtained by GA and PSO, because of the higher divergence of Meerkat.The strategic neighborhood adopted by the Meerkat is one of the reasons for this diversification.The average number of iterations required by the MCA to find the solution is less those required by GA (about 66%) and PSO (about 92%).

Conclusions
N-Queens problem was selected for comparing the performance of MCA against both GA and PSO.MCA showed simple behavior and operators, its performance under different cases is well in small and large search space size.The experimental results showed that MCA was clearly superior compared with GA and PSO.This result was achieved because of the good diversity and exploration features of this algorithm which depend on the neighbours-generation strategy.As a future work, the order crossover operation can be used as a type of neighbourhood generation.Specifically, this can be performed for those operators with several crossover methods; for example, the Very Greedy Crossover, Cycle Crossover, and Crowding Crossover.

Table 2 -
GA's operators and parameters to solve the N-Queens Problem

Table 3 -
Description of the PSO parameters to solve the N-Queens Problem

Table 4 -
Best generation and consumed time to find 8-queens problem solution in MCA, GA, and PSO.

16] PSO [16] Best Gen. Time (Sec.) Best Gen. Time (Sec.) Best Gen. Time (Sec.)
Table (5)illustrates the results of best generations and consumed time for MCA, GA, and PSO.The best algorithm is the MCA, which was superior to the other ones by a large margin.

Table 5 -
Best iteration and consumed time to find 16-Queens Problem Solution in MCA, GA and PSO,