Research Article

A Linear Time Pattern Based Algorithm for N-Queens Problem

Volume: 25 Number: 2 June 1, 2022
TR EN

A Linear Time Pattern Based Algorithm for N-Queens Problem

Abstract

The n-queens problem is the placing of n number of queens on an nxn chessboard so that no two queens attack each other. This problem is important due to various usage fields such as VLSI testing, traffic control job scheduling, data routing, dead-lock or blockage prevention, digital image processing and parallel memory storage schemes mentioned in the literature. Besides, this problem has been used as a benchmark for developing new Artificial Intelligence search techniques. However, it is known that backtracking algorithms, one of the most frequently used algorithms to solve this problem, cannot produce all solutions in large n values due to the exponentially growing time complexity. Therefore, various methods have been proposed for producing one or more solutions, not all solutions for each n value. In this study, a pattern based approach that produces at least one unique solution for all n values (n>3) was detected. By using this pattern, a new algorithm that produces at least one unique solution for even very large n values in linear time was developed. The developed algorithm with О(n) time complexity produces quite faster solution to n-queens problem and even in some values, this algorithm produces (n-1)/2 unique solutions in linear time.

Keywords

References

  1. [1] Abramson B., and Yung M.M., “Construction through decomposition: A linear time algorithm for the n-queens problem”, Colombia University Computer Science Technical Reports, CUCS-129-84, (1984).
  2. [2] Sosic R., and Gu J., “A polynomial time algorithm for the n-queens problem”, ACM SIGART Bulletin, 1(3): 7-11, (1990).
  3. [3] Waqas M., and Bhatti A.A., “Optimization of N+ 1 Queens Problem Using Discrete Neural Network”, Neural Network World, 27(3): 295, (2017).
  4. [4] Wang C.N., Yang S.W., Liu C.M., and Chiang, T., “A hierarchical decimation lattice based on N-queen with an application for motion estimation”, IEEE signal processing letters, 10(8): 228-231, (2003).
  5. [5] Bell J., and Stevens B., “A survey of known results and research areas for n-queens”, Discrete Mathematics, 309(1): 1-31, (2009).
  6. [6] Murali G., Naureen S., Reddy Y.A., Reddy M.S., JNTUA-Pulivendula J.P., and JNTUA-Pulivendula J.P. “Graphical Simulation of N Queens Problem”, International Journal of Computer Technology and Applications, 2(6), (2011).
  7. [7] Güldal S., Baugh V., and Allehaibi S., “N-Queens solving algorithm by sets and backtracking”, In SoutheastCon, IEEE, 1-8 (2016).
  8. [8] Lijo V.P. and Jose J.T., “Solving N-Queen Problem by Prediction”, IJCSIT International Journal of Computer Science and Information Technologies, 6(4): 3844-3848, (2015).

Details

Primary Language

English

Subjects

Engineering

Journal Section

Research Article

Publication Date

June 1, 2022

Submission Date

July 6, 2020

Acceptance Date

December 17, 2020

Published in Issue

Year 2022 Volume: 25 Number: 2

APA
Karabulut, B., Ergüzen, A., & Ünver, H. M. (2022). A Linear Time Pattern Based Algorithm for N-Queens Problem. Politeknik Dergisi, 25(2), 615-622. https://doi.org/10.2339/politeknik.762967
AMA
1.Karabulut B, Ergüzen A, Ünver HM. A Linear Time Pattern Based Algorithm for N-Queens Problem. Politeknik Dergisi. 2022;25(2):615-622. doi:10.2339/politeknik.762967
Chicago
Karabulut, Bergen, Atilla Ergüzen, and Halil Murat Ünver. 2022. “A Linear Time Pattern Based Algorithm for N-Queens Problem”. Politeknik Dergisi 25 (2): 615-22. https://doi.org/10.2339/politeknik.762967.
EndNote
Karabulut B, Ergüzen A, Ünver HM (June 1, 2022) A Linear Time Pattern Based Algorithm for N-Queens Problem. Politeknik Dergisi 25 2 615–622.
IEEE
[1]B. Karabulut, A. Ergüzen, and H. M. Ünver, “A Linear Time Pattern Based Algorithm for N-Queens Problem”, Politeknik Dergisi, vol. 25, no. 2, pp. 615–622, June 2022, doi: 10.2339/politeknik.762967.
ISNAD
Karabulut, Bergen - Ergüzen, Atilla - Ünver, Halil Murat. “A Linear Time Pattern Based Algorithm for N-Queens Problem”. Politeknik Dergisi 25/2 (June 1, 2022): 615-622. https://doi.org/10.2339/politeknik.762967.
JAMA
1.Karabulut B, Ergüzen A, Ünver HM. A Linear Time Pattern Based Algorithm for N-Queens Problem. Politeknik Dergisi. 2022;25:615–622.
MLA
Karabulut, Bergen, et al. “A Linear Time Pattern Based Algorithm for N-Queens Problem”. Politeknik Dergisi, vol. 25, no. 2, June 2022, pp. 615-22, doi:10.2339/politeknik.762967.
Vancouver
1.Bergen Karabulut, Atilla Ergüzen, Halil Murat Ünver. A Linear Time Pattern Based Algorithm for N-Queens Problem. Politeknik Dergisi. 2022 Jun. 1;25(2):615-22. doi:10.2339/politeknik.762967