#### Abstract

In the field of computing, combinatorics, and related areas, researchers have formulated several techniques for the Minimum Dominating Set of Queens Problem (MDSQP) pertaining to the typical chessboard based puzzles. However, literature shows that limited research has been carried out to solve the MDSQP using bioinspired algorithms. To fill this gap, this paper proposes a simple and effective solution based on genetic algorithms to solve this classical problem. We report results which demonstrate that near optimal solutions have been determined by the GA for different board sizes ranging from 8 × 8 to 11 × 11.

#### 1. Introduction

The MDSQP which is otherwise known as the chess covering problem is one of the well-known chessboard problems which has been receiving continued interests by researchers including the computational intelligence domain. In the field of graph theory, specifically the study of dominating sets had addressed this problem even in the early 1970s. In chessboard, cells are organized as rows and columns. In chess layman terms, a queen (say ) placed on a square will dominate all squares associated with the row, column, and two diagonals with reference to . The idea behind this problem is to find the minimum number of queens required to dominate the whole chessboard. Domination here refers to the coverage of all the possible squares being attacked by those queens including the square dominated by the respective queens. Previous researches have been trying to find the domination number for the -queens problem using mathematical and combinatorial approaches [18]. Many formulations have been derived and presented in these approaches. It has been observed that limited efforts have been carried out to employ evolutionary algorithms to address the MDSQP. In fact, most of the studies in the literature were devoted to address the original -queens problem which is called a nonattacking problem. The results of such studies have demonstrated that evolutionary algorithms are capable of outperforming other principled approaches such as backtracking to solve such problems. However, these studies have focused only on the nonattacking -queens problem, whereas, to the best of our knowledge, the MDSQP has been least considered using bioinspired evolutionary algorithms.

Evolutionary algorithms have been proved to be successful for solving and optimizing a wide range of complex problems including combinatorial ones, such as the one studied here, within reasonable computing time [9]. Generally speaking, evolutionary algorithms can be classified into two main categories which are swarm intelligence based approaches and classical evolutionary approaches. Swarm intelligence (SI) approaches are inspired from the social natural behavior such as animals group behavior when searching for food or avoiding certain threat [10]. Several SI approaches with reference to the literature include Particle Swarm Optimization (PSO) and Ant Colony Optimization (ACO). ACO have been proved to efficiently solve several optimization problems [11]. PSO has also demonstrated good results in optimizing various complex problems such as the supply chain management (e.g., [12]) and shortest path problems [13, 14].

The classical evolutionary algorithms, on the other hand, including genetic algorithms, were successfully adopted in a wide range of optimization problems. Genetic algorithm is one of the most commonly used evolutionary algorithms in the literature which was first proposed in the 1970s [15]. GA was inspired from the natural process of searching and selection process which leads to the survival of the fittest individuals [15]. Researchers in the literature have demonstrated the efficiency of adopting GA in solving various optimization problems such as data mining [16] and network traffic control [17]. In fact, GA have been adopted in the literature solely to solve some problems such as [17, 18] and were hybridized with other approaches for more enhanced results. Commonly, GA is hybridized with local and heuristic search approaches such as Cuckoo search [19] and Tabu search [20]. Furthermore, various researchers hybridized it with other evolutionary approaches like dynamic programming as in [21].

Therefore, this paper intends to fill these gaps and present a bioinspired genetic algorithm (GA) to solve the MDSQP problem by considering board sizes gradually from the typical chessboard up to a board. The proposed approach gradually increments the number of queens placed on the board from just below the lower bounds suggested in the literature until an optimal solution has been determined (i.e., all the squares of the chessboard get dominated). The remaining paper is organized as follows: Section 2 discusses related work; Section 3 formulates the problem; Section 4 presents the evolutionary mechanism of the proposed technique; results are discussed in Section 5 and the paper is finally concluded with insights for future work in Section 6.

Vast amount of efforts have been devoted to investigate chessboard problems. Problems related to chessboard can mainly be classified to the original -queen problem and the dominating set (i.e., the covering problem). The original -queen problem can be defined as placing queens on chessboard in an optimal way such as none of the queens should attack each other [22, 23]. It was first introduced in 1850 [24]. Numerous researches have been performed to solve this problem using different approaches; most of them adopted mathematical approaches and graph theory such as [2527]. The study of such a problem may benefit in the understanding of various applications such as traffic control, deadlock prevention, and parallel memory storage [28]. The complexity of the -queen problem is known as exponential where it gets more complex with large values. Various approaches were adopted to solve this problem such as backtracking [29], neural networks [3032], and evolutionary and optimization algorithms [3342].

The domination set problem on the other hand has received less attention by computer science researchers. In fact, various researches have been devoted to investigate such a problem but were mainly adopting mathematical models. Burger and Mynhardt pointed out that the queens dominating problem is one of the most difficult chessboard problems [43]. It is commonly defined as finding the minimum numbers of queens required to cover all the squares of chessboard. This number is termed as the domination number and referred by the notation . Researchers have arrived at upper and lower bounds since early 1970s [3]. Many formulations and values were derived and found especially for small values of [3, 4345]. Table 1 shows some of these values. Figure 1 shows a brief taxonomy of typical chessboard problems. For instance, several studies were conducted to find the domination number of the normal domination [8]. In these studies, it is required to find the minimum queens to be optimally placed on chessboard that will cover all squares in the board. However, many researchers considered the domination set problems under several variations. For instance, many studies were conducted to investigate the independent domination number which can be defined as the number of queens which do not attack each other and cover the entire chessboard [3]. Various values and formulations were derived and proved in a mathematical context. Furthermore, the “diagonal queens domination problem” was frequently stated in the literature. In such a problem, it is required to find the number of minimum queens placed in the main diagonal and cover the entire chessboard [3, 4]. Cockayne has also tried to find the domination number of the queens placed on a single column [3]. Furthermore, many researchers carried out studies to solve the problem of the domination set on a toroidal chessboard [1]. In such studies, it is required to find out the minimum number of queens that would cover the entire squares in the torus. Bozóki et al., on the other hand, shed the light on a different problem called “domination of the rectangular queens graph” where it is required to find the domination number of queens in a rectangular chessboard () in which the number of squares in column and rows are different [46]. They derived lower bounds for small values of and particularly .

As seen above, the queens domination set problem has been enormously studied especially using mathematical methods. However, literature still lacks the adoption of computational models particularly optimization approaches to solve this problem. Limited articles were found technically considering the problem. For instance, Fernau tried to analyze the complexity of this problem using backtracking, dynamic programming on subsets, and dynamic programming on path decomposition [47]. He indicated that the complexity of the dominating queen problem is a challenging problem. On the other hand, Mohabbati-Kalejahi et al. (2012) presented a hybrid Imperialist Competitive Algorithm (ICA) with a local search algorithm in order to solve the nonattacking queens based domination problems [48]. The proposed hybrid algorithm was compared with the basic ICA in the two problems and the results indicated an improved performance in terms of average runtime and average fitness value. The solution was formulated for the nonattacking queens problem. However, for the domination problem less details and information have been provided pertaining to the implementation details of the proposed algorithm. For example, crucial components of an evolutionary algorithm such as the formulation of a fitness function have not been presented in detail. Therefore, this work is intended to fill this gap in the literature by adopting a typical bioinspired genetic algorithm (GA) to solve the Minimum Dominating Set of Queens Problem (MDSQP). The proposed algorithm is described in the following sections.

#### 3. Problem Formulation

In order to solve the problem and present it programmatically we firstly labelled all squares in the chessboard by sequencing numbers starting gradually from 1 to starting from the top most left square to the bottom right most square. Figure 2 shows an example of the proposed labelling schema with reference to the commonly used chessboard. In addition, all squares in the board have a location (analogous to the norms of the analytical geometry) in the coordinate form, where denotes the row number and denotes the column number. For example, the location of the square 28 in Figure 2 is (4, 4). This location can be used to determine the dominated squares for a queen placed in a particular square. Let be a set of chessboard squares and let be the set of dominated squares by queen for the case of number of queens. Then it follows that Defining a fitness function for this problem firstly requires defining a method to identify dominated squares for all queens on the board. For a queen placed on the location , a square will be if at least one of the following conditions holds:Equations (2) and (3) represent the dominated squares in terms of rows and columns, respectively. The rest of the equations from (4) to (7) represent the squares dominated by a queen placed in for the diagonal directions. Specifically the dominated squares of the two diagonals pertaining to the four sides (upper left, lower left, upper right, and lower right). For example, squares 19, 10, and 1 in Figure 2 are instances of dominated squares by the queen placed on the square 28 and this case has been modeled using a logical algebraic expression using (4). The main objective is to maximize the number of dominated squares in a chessboard by queens and finding optimal locations of these queens is quite challenging owing to the complexity of permutations and combinations involved. Therefore, this is measured by the following fitness function: whereThe value of this function approaches 1 when all the squares of the chessboard get dominated at least once. In other words, a fitness value <1 could cohesively indicate that there are some squares or at least 1 square which has not been dominated by any th queen ().

#### 4. Formulation of the Problem Using Genetic Algorithms

The proposed GA formulation has been modeled to solve the chessboard. The overall structure of the proposed GA can be described in Figure 3.

##### 4.1. Coding

Individuals have been coded in a matrix of order . Intuitively , the product of the columns and rows, represents the population size (number of possible candidate solutions). The elements of the matrix represent bit binary encodings of the labels (each square has been labelled as discussed before) of the queens being placed on the chessboard. The following matrices show typical examples for the case of few possible candidate solutionsFurthermore, the dominated square set has also been coded in a matrix as shown below; the total number of unique dominated squares is represented by the number of rows. The above matrix shows an example instance of a dominated set containing two squares in the chessboard. Furthermore, let us assume that we would like to encode only one candidate solution in a chessboard. Figure 3 shows that two queens are placed in the squares labelled 6 and 16. By converting the decimal values of these squares into 8-digit binary code and taking into consideration having two queens, therefore, we get a matrix which is shown below:Furthermore, to identify the dominated squares by the two queens placed in the chessboard, (2) to (7) must be applied. Accordingly, Figure 3 shows that all squares in the chessboard except label 3 are dominated by the two queens. Therefore, the dominated set is as follows:By converting the elements of into 8-digit binary code we will get the following dominated set matrix :

Illustration of typical crossover operations is as follows:

##### 4.2. Initial Population and Fitness Evaluation

A random population consisting of 100 individuals (possible candidate solutions) is generated at the initialization stage of the GA making sure that queens are placed in different squares in the board. The domination rate of the queens is computed using the fitness function as modeled in Section 2. The selection criteria of our proposed techniques are as follows. Individuals are sorted based on their fitness value and the top 50% of the population (candidates with the potential fitness capability) will be allowed to survive and will be considered into the next generation. Candidates whose fitness capability is below 50% will be discarded (they will not be allowed to survive). Subsequent to this selection process, the classical roulette-wheel selection method has been adopted for selecting individuals that will be mated for reproduction.

##### 4.3. Crossover and Offspring Generation

The new generation is produced by implementing the one-point crossover between two parents. The steps involved in the proposed crossover operator can be described as follows:(i)Two individuals are selected according to the selection operator.(ii)Generate a random crossover point in the two parents.(iii)Exchange genetic materials after the crossover point.(iv)Validate new individuals so that the individuals are retained within the boundaries of the chessboard.(v)If an offspring’s location happens to be to zero owing to stochastics, generate a random adjustment point.(vi)Change the value of the adjustment position to 1.(vii)If an offspring’s location is larger than , based on the chessboard size change the value of the digits of the chromosome causing this issue to 0.Equation shows an example of a crossover operation between two parents to produce two children (offspring); shows an example of a crossover operation to illustrate the validation and adjustment process.

Furthermore, we have also implemented mutation with the probability of 0.05. In mutation, we simply select two random positions for the selected individuals and substitute the values of these positions to their complements (i.e., change zero to one and vice versa). In order to avoid the production of individuals outside the boundaries of the chessboard, the same crossover validation and adjustment mechanism have been found to be efficient.

#### 5. Experiments and Results

The proposed GA has been implemented using MATLAB and experimented using a 2.6 Ghz PC enabled with Intel i5 processor installed with Microsoft Windows 8 operating system. It was independently tested using a different size of the chessboard starting from the common chessboard size to In each test instance the number of queens placed in the chessboard is gradually incremented starting from the lower bounds reported in the literature until the maximum fitness has been reached. Furthermore, the proposed GA was iterated 1000 times for each instance and the best fitness values were recorded. The results in this contribution are reported after running the GA for five times for each test instance. Table 2 shows a summary of the maximum fitness reached by the GA for the value of to as well as the queen numbers placed in the chessboard. The results obtained were promising and close to upper bounds reported in the literature for MDSQP.

It can be noticed that the GA could cover 88% and 95% of the chessboard by placing three and four queens on the board, respectively. The GA was also able to find the optimal solution for the same size board when placing five queens meaning that the domination number of chessboard is five (i.e., ). These findings compare well with the results reported in the literature. As the proposed GA is considered to be a pioneer on the literature considering the MDSQP, the obtained results will be compared with the values in the literature which have been derived mathematically. Table 3 shows the optimal domination numbers obtained by the GA compared with these. Table 2 shows also that the GA was able to dominate 99% of the chessboard when five queens have been placed in the board, although five is derived as the domination number for a chessboard ). However, an optimal solution was reached by increasing number of queens placed on the board to six ) (see Table 3). Similarly, five was reported as the domination number for the case of and chessboard; however, the GA was not able to cover the whole board. In fact, only 95% of the board was covered when and five queens were placed () (see Table 2). The domination percentage has been improved slightly when adding one queen () to board. However, an optimal solution was found when placing seven queens to the board in the case of =10, 11 ). All solutions produced were graphically simulated by the GA at the end of the execution. Figure 4 shows the simulations pertaining to the optimal solutions of the proposed GA for the case of to 11. The red circles (dots) represent the queens and the blue circles represent the dominated squares in a typical chessboard. It also shows the fitness value of the presented solution corresponding to the generation number of the solution. In addition, the performance of the proposed GA solution was measured after the execution of each test instance. The results indicated that the performance in terms of fitness value is increasing over iterations. Due to the space limitation we present the performance results of the chessboard in Figure 5. It can clearly be observed that the fitness values in all the cases have been improved when the iterations tend to approach their upper limits.

It can be seen that the solutions yielded by the proposed technique could yield a good domination performance (95% to 99%) even for larger board sizes, particularly for the cases of and .

#### 6. Conclusion

In this paper, we have proposed a genetic algorithm (GA) based technique to solve the classical Minimum Dominating Set of Queens Problem (MDSQP). Experimental results demonstrate that the proposed GA based solution was able to find optimal to near optimal solutions for even large sizes of boards ( and ). For the case of a typical chessboard, the proposed solution yielded a perfect optimal solution on a par with the solutions reported in the literature. Furthermore, experimental results also systematically demonstrate that the average fitness value approached towards the maximum over subsequent iterations. These results will be a basis for our future work where we intend to deploy other bioinspired computing techniques such as membrane computing.

#### Conflicts of Interest

The authors declare that they have no conflicts of interest.