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 n×n chessboard, cells are organized as n rows and n columns. In chess layman terms, a queen (say Q) placed on a square will dominate all squares associated with the row, column, and two diagonals with reference to Q. 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 γ(Qn) for the n-queens problem using mathematical and combinatorial approaches [1–8]. 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 n-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 n-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 8×8 chessboard up to a 11×11 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.
2. Related Work
Vast amount of efforts have been devoted to investigate chessboard problems. Problems related to chessboard can mainly be classified to the original n-queen problem and the dominating set (i.e., the covering problem). The original n-queen problem can be defined as placing n queens on n×n 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 [25–27]. 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 n-queen problem is known as exponential where it gets more complex with large n values. Various approaches were adopted to solve this problem such as backtracking [29], neural networks [30–32], and evolutionary and optimization algorithms [33–42].
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 n×n chessboard. This number is termed as the domination number and referred by the notation γQn. 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 n [3, 43–45]. 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 n×n 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 n×n 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 n×n 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 (n×m) in which the number of squares in column and rows are different [46]. They derived lower bounds for small values of n and m particularly 4≤m≤n≤18.
Domination number for some n values pertaining to the MDSQP.
n
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
γ(Qn)
1
1
1
3
3
4
4
5
5
5
5
7
7
≤8
≤9
≤9
9
9
Basic taxonomy of chessboard problems.
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 n 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 n×n 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 8×8 chessboard. In addition, all squares in the board have a location (analogous to the norms of the analytical geometry) in the (x,y) coordinate form, where x denotes the row number and y 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 G be a set of chessboard squares G={p1,p2,…,pn×n} and let Sq be the set of dominated squares by queen q for the case of i number of queens. Then it follows that (1)Sqi=p1,p2,…,pn×n.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 (x,y), a square n will be n∈Sq if at least one of the following conditions holds:(2)x=xj∀j1,2,…,n,(3)y=yj∀j1,2,…,n,(4)xj=x-j,y=y-j∀j1,2,…,x-1,(5)xj=x+j,yj=y-j∀j1,2,…,y-1,(6)xj=x-j,yj=y+j∀j1,2,…,x-1,(7)xj=x+j,yj=y+j∀j1,2,…,n-1.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 (x,y) 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 k queens and finding optimal locations of these k queens is quite challenging owing to the complexity of permutations and combinations involved. Therefore, this is measured by the following fitness function: (8)fx=SG,where(9)S=sq1∪sq2∪⋯∪sqk.The 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 ith queen (sqi).
The proposed labelling scheme of a typical 8×8 chessboard.
4. Formulation of the Problem Using Genetic Algorithms
The proposed GA formulation has been modeled to solve the n×n chessboard. The overall structure of the proposed GA can be described in Figure 3.
A typical example showing the proposed coding scheme.
4.1. Coding
Individuals have been coded in a matrix of order k×m. Intuitively k×m, the product of the columns and rows, represents the population size (number of possible candidate solutions). The elements of the matrix represent m 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 solutions(10)A=1100110001101001011001100010.Furthermore, the dominated square set has also been coded in a matrix S as shown below; the total number of unique dominated squares is represented by the number of rows. (11)S=11100100000001.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 4×4 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 1×2 matrix which is shown below:(12)A=0000011000010000.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 S is as follows:(13)S=1,2,4,5,6,7,8,9,10,11,12,13,14,15,16.By converting the elements of S into 8-digit binary code we will get the following dominated set matrix S:(14)S=000000010000001000000011⋮⋮00010000.
Illustration of typical crossover operations is as follows:15a1100100⟹11011100011110001010015b0011111⟹000100011000001111110.
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:
Two individuals are selected according to the selection operator.
Generate a random crossover point in the two parents.
Exchange genetic materials after the crossover point.
Validate new individuals so that the individuals are retained within the boundaries of the chessboard.
If an offspring’s location happens to be to zero owing to stochastics, generate a random adjustment point.
Change the value of the adjustment position to 1.
If an offspring’s location is larger than n×n, based on the chessboard size change the value of the digits of the chromosome causing this issue to 0.
Equation 15a shows an example of a crossover operation between two parents to produce two children (offspring); 15b 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 8×8 to 11×11. 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 n=8 to n=11 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.
Progression of fitness values: n is the board size and k is number of queens placed on the board.
n
k
Fitness value
8
3
0.88
4
0.95
5
1
9
5
0.99
6
1
10
5
0.95
6
0.97
7
1
11
6
0.97
7
1
It can be noticed that the GA could cover 88% and 95% of the 8×8 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 8×8 chessboard is five (i.e., γ(Qn)). 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 9×9 chessboard when five queens have been placed in the board, although five is derived as the domination number for a 9×9 chessboard (γQn=5). However, an optimal solution was reached by increasing number of queens placed on the board to six (γQn=6) (see Table 3). Similarly, five was reported as the domination number for the case of 10×10 and 11×11 chessboard; however, the GA was not able to cover the whole board. In fact, only 95% of the board was covered when n=10 and five queens were placed (k=5) (see Table 2). The domination percentage has been improved slightly when adding one queen (k=6) to 10×10 board. However, an optimal solution was found when placing seven queens to the board in the case of n =10, 11 (γQn=7). 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 n=8 to 11. The red circles (dots) represent the queens and the blue circles represent the dominated squares in a typical n×n 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 10×10 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.
The obtained results by the GA and domination numbers γQn reported by the literature.
n
8
9
10
11
GA
5
6
7
7
Literature
5
5
5
5
Optimal solutions yielded by the proposed GA based technique. Red dots represent queens and blue dots represent squares dominated by the queens.
n=8
n=9
n=10
n=11
Performance of the GA for a typical case; n=10 and k=5,6 and 7.
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 n=10 and n=11.
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 (n=10 and n=11). For the case of a typical 8×8 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.
BurgerA.MynhardtC.WeakleyW. D.The domination number of the toroidal queens graph of size 3k x 3kBurgerA. P.MynhardtC. M.An improved upper bound for queens domination numbersCockayneE. J.Chessboard domination problemsCockayneE. J.HedetniemiS. T.On the diagonal queens domination problemKikunoT.YoshidaN.KakudaY.A linear algorithm for the domination number of a series-parallel graphKlobučarA.Domination numbers of cardinal products P_6 × P_nSariN.IH AgustinD.VenkatesanS. S.Venkatesan S.Tight lower bounds for connected queen domination problems on the chessboardhttps://arxiv.org/abs/1608.02531DoerrB.EremeevA.HorobaC.NeumannF.TheileM.Evolutionary algorithms and dynamic programmingProceedings of the 11th annual conference on genetic and evolutionary computation2009Québec, CanadaACM771778MavrovouniotisM.LiC.YangS.A survey of swarm intelligence for dynamic optimization: algorithms and applicationsKarabogaD.GorkemliB.OzturkC.KarabogaN.A comprehensive survey: artificial bee colony (ABC) algorithm and applicationsKadadevaramathR. S.ChenJ. C. H.ShankarB. L.RameshkumarK.Application of particle swarm intelligence algorithms in supply chain network architecture optimizationMarinakisY.MigdalasA.SifalerasA.A hybrid particle swarm optimization—variable neighborhood search algorithm for constrained shortest path problemsAkhandM.HossainS.AkterS.A comparative study of prominent particle swarm optimization based methods to solve traveling salesman problemSrinivasM.PatnaikL. M.Genetic algorithms: a surveyGoldbergD. E.HollandJ. H.Genetic algorithms and machine learningBarolliA.TakizawaM.XhafaF.BarolliL.Application of genetic algorithms for QoS routing in mobile ad-hoc networks: A surveyProceedings of the 5th International Conference on Broadband Wireless Computing, Communication and Applications (BWCCA '10)November 2010Fukuoka, Japan25025910.1109/BWCCA.2010.782-s2.0-79952096405VargheseB. M.RajR. J. S.A survey on variants of genetic algorithm for scheduling workflow of tasksProceedings of the 2nd International Conference on Science Technology Engineering and Management (ICONSTEM '16)2016Abu-SrhanA.Al DaoudE.A hybrid algorithm using a genetic algorithm and cuckoo search algorithm to solve the traveling salesman problem and its application to multiple sequence alignmentAllakanyA. M.MahmoudT. M.OkamuraK.GirgisM. R.Multiple constraints QoS multicast routing optimization algorithm based on Genetic Tabu Search AlgorithmPhamD. T.HuynhT. T. B.BuiT. L.A survey on hybridizing genetic algorithm with dynamic programming for solving the traveling salesman problemProceedings of the International Conference on Soft Computing and Pattern Recognition (SoCPaR '13)December 2013Hanoi, Vietnam667110.1109/SOCPAR.2013.70541022-s2.0-84949926173RivinI.VardiI.ZimmermannP.The n-queens problemBruenA.DixonR.The n-queens problemLetavecC.RuggieroJ.The n-queens problemSosicR.GuJ.3,000,000 Queens in less than one minuteEngelhardtM. R.A group-based search for solutions of the n-queens problemSzaniszloZ.TomovaM.WyelsC.The N-queens problem on a symmetric Toeplitz matrixBellJ.StevensB.A survey of known results and research areas for n-queensSosičR.GuJ.Efficient local search with conflict minimization: a case study of the n-queens problemKwokT.SmithK. A.Experimental analysis of chaotic neural network models for combinatorial optimization under a unifying frameworkFunabikiN.TakenakaY.NishikawaS.A maximum neural network approach for N-queens problemsMandziukJ.MacukB.A neural network designed to solve the N-queens problemWangZ.HuangD.TanJ.LiuT.ZhaoK.LiL.A parallel algorithm for solving the n-queens problem based on inspired computational modelMaroosiA.MuniyandiR. C.Accelerated execution of P systems with active membranes to solve the N-queens problemMaazallahiR.NiknafsA.ArabkhedriP.A polynomial-time dna computing solution for the n-queens problemDraaA.MeshoulS.TalbiH.BatoucheM.A quantum-inspired differential evolution algorithm for solving the N-queens problemKeswaniB.ShaikhA. A.ShahA.AliK.BukhariA. H. S.Particle swarm optimization for N-queens problemHerisJ. E. A.OskoeiM. A.Modified genetic algorithm for solving n-queens problemProceedings of the Iranian Conference on Intelligent Systems (ICIS '14)February 2014Bam, Iran10.1109/IranianCIS.2014.68025502-s2.0-84900028911KhanS.BilalM.SharifM.SajidM.BaigR.Solution of n-Queen problem using ACOProceedings of the IEEE 13th International Multitopic Conference (INMIC '09)December 2009Islamabad, PakistanIEEE1510.1109/inmic.2009.53831572-s2.0-77950397417VaughanN.Swapping algorithm and meta-heuristic solutions for combinatorial optimization n-queens problemProceedings of the Science and Information Conference (SAI '15)July 2015London, UK10210410.1109/SAI.2015.72371322-s2.0-84957805504MasehianE.AkbaripourH.Mohabbati-KalejahiN.Landscape analysis and efficient metaheuristics for solving the n-queens problemBurgerA. P.MynhardtC. M.An upper bound for the minimum number of queens covering the n×n chessboardWeakleyW. D.Upper bounds for domination numbers of the queen's graphGibbonsP.WebbJ.Some new results for the queens domination problemBozókiS.GálP.MarosiI.WeakleyW. D.Domination of the rectangular queen's graphhttps://arxiv.org/abs/1606.02060FernauH.Minimum dominating set of queens: a trivial programming exercise?Mohabbati-KalejahiN.AkbaripourH.MasehianE.MadaniK.CorreiaA. D.RosaA.FilipeJ.Basic and hybrid imperialist competitive algorithms for solving the non-attacking and non-dominating n-queens problems