Parallel Implementations of Candidate Solution Evaluation Algorithm for N-Queens Problem

The N-Queens problem plays an important role in academic research and practical application. Heuristic algorithm is often used to solve variant 2 of the N-Queens problem. In the process of solving, evaluation of the candidate solution, namely, fitness function, often occupies the vast majority of running time and becomes the key to improve speed. In this paper, three parallel schemes based on CPU and four parallel schemes based on GPU are proposed, and a serial scheme is implemented at the baseline. The experimental results show that, for a large-scale N-Queens problem, the coarse-grained GPU scheme achieved a maximum 307-fold speedup over a single-threaded CPU counterpart in evaluating a candidate solution. When the coarse-grained GPU scheme is applied to simulated annealing in solving N-Queens problem variant 2 with a problem size no more than 3000, the speedup is up to 9.3.

[1]  Russell C. Eberhart,et al.  Swarm intelligence for permutation optimization: a case study of n-queens problem , 2003, Proceedings of the 2003 IEEE Swarm Intelligence Symposium. SIS'03 (Cat. No.03EX706).

[2]  Ji Zhenzhou,et al.  A Parallel Genetic Algorithm Based on MPI for N-Queen , 2017 .

[3]  Mohd Sharifuddin Ahmad,et al.  Using genetic algorithm for solving N-Queens problem , 2010, 2010 International Symposium on Information Technology.

[4]  Denis Caromel,et al.  Peer-to-peer for computational grids: mixing clusters and desktop machines , 2007, Parallel Comput..

[5]  S. R. Sathe,et al.  Solving N-Queens problem on GPU architecture using OpenCL with special reference to synchronization issues , 2012, 2012 2nd IEEE International Conference on Parallel, Distributed and Grid Computing.

[6]  Tao Zhang,et al.  Optimization of N-Queens Solvers on Graphics Processors , 2011, APPT.

[7]  Wang Yu-xin,et al.  Parallel genetic algorithm for N‐Queens problem based on message passing interface‐compute unified device architecture , 2020, Comput. Intell..

[8]  Pourya Jafarzadeh,et al.  A Hybrid Approach Using Particle Swarm Optimization and Parallel Simulated Annealing: A Case Study of n-Queens Problem , 2014 .

[9]  E. J. Hoffman,et al.  Constructions for the Solution of the m Queens Problem , 1969 .

[10]  Andreas Polze,et al.  Using Dynamic Parallelism for Fine-Grained, Irregular Workloads: A Case Study of the N-Queens Problem , 2015, 2015 Third International Symposium on Computing and Networking (CANDAR).

[11]  Hong Liu,et al.  A Parallel Algorithm for Game Tree Search Using GPGPU , 2015, IEEE Transactions on Parallel and Distributed Systems.

[12]  Andreas Polze,et al.  NQueens on CUDA: Optimization Issues , 2010, 2010 Ninth International Symposium on Parallel and Distributed Computing.

[13]  Gustavo Augusto Lima de Campos,et al.  A New Parallel Schema for Branch-and-Bound Algorithms Using GPGPU , 2011, 2011 23rd International Symposium on Computer Architecture and High Performance Computing.

[14]  Brett Stevens,et al.  A survey of known results and research areas for n-queens , 2009, Discret. Math..

[15]  Nouredine Melab,et al.  Dynamic Configuration of CUDA Runtime Variables for CDP-Based Divide-and-Conquer Algorithms , 2018, VECPAR.

[16]  Nouredine Melab,et al.  GPU‐accelerated backtracking using CUDA Dynamic Parallelism , 2018, Concurr. Comput. Pract. Exp..

[17]  Takahiro Katagiri,et al.  Solving the 24-queens Problem using MPI on a PC Cluster , 2004 .

[18]  C. D. Gelatt,et al.  Optimization by Simulated Annealing , 1983, Science.