Skip to main content

Evaluation and Comparison of Brute-Force Search and Constrained Optimization Algorithms to Solve the N-Queens Problem

  • Chapter
  • First Online:
New Perspectives on Hybrid Intelligent System Design based on Fuzzy Logic, Neural Networks and Metaheuristics

Part of the book series: Studies in Computational Intelligence ((SCI,volume 1050))

Abstract

The N-Queens problem is relevant in Artificial Intelligence (AI); the solution methodology has been used in different computational intelligent approaches. Max Bezzel proposed the problem in 1848 for eight queens in 8 \(\times\) 8 chessboard. After that, the formulation was modified to an N-Queens problem in a chessboard. There are several ways of posing the problem and algorithms to solve it. We describe two commonly used mathematical models that handle the position of queens and restrictions. The first and easiest way is to find one combination that satisfies the solution. The second model uses a more compact notation to represent the queen’s potions. This generic problem has been solved with many different algorithms. However, there is no comparison of the performance among the methods. In this work, a comparison of performance for different problem sizes is presented. We tested the Backtracking, Branch and Bound, and Linear Programming algorithms for a different number of queens, reaching 17. In addition, we present statistical comparative experimental results of the different methods.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 169.00
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 219.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info
Hardcover Book
USD 219.99
Price excludes VAT (USA)
  • Durable hardcover edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

References

  1. Rivin, I., Vardi, I., Zimmermann, P.: The n-queens problem. Am. Math. Mon. 101(629–639), 08 (1994)

    MathSciNet  MATH  Google Scholar 

  2. Letavec, C., Ruggiero, J.: The queens problem - delta. INFORMS Trans. Educ. 2(101–103), 05 (2002)

    Google Scholar 

  3. Mu, S.C.: Calculating a backtracking algorithm: an exercise in monadic program derivation (2021)

    Google Scholar 

  4. Osaghae, E.: Solution to n-queens problem: heuristic approach. Trans. Mach. Learn. Artif. Intell. 9, 26–35 (2021)

    Article  Google Scholar 

  5. Sharma, S., Jain, V.: Solving n-queen problem by genetic algorithm using novel mutation operator. IOP Conference Series: Materials Science and Engineering 1116, 012195 (2021)

    Article  Google Scholar 

  6. Andov, L.: Local search analysis n-queens problem. In: Griffith University, School of Information and Communication Technology, Intelligent Systems – 2802ICT (2018)

    Google Scholar 

  7. Stojkoska, B., Davcev, D., Vladimir, T.: N-queens-based algorithm for moving object detection in distributed wireless sensor networks. In: ITI2008 - 30th International Conference on Information Technology Interfaces, pp. 899–904 (2008)

    Google Scholar 

  8. Wang, C.-N., Yang, S.-W., Liu, C.-M., Chiang, T.: A hierarchical decimation lattice based on n-queen with an application for motion estimation. IEEE Signal Process. Lett. 10(8), 228–231 (2003)

    Article  Google Scholar 

  9. Sosic, R., Gu, J.: A polynomial time algorithm for the n-queens problem. ACM SIGART Bull 1 (1996)

    Google Scholar 

  10. Erbas, C., Tanik, M., Aliyazicioglu, Z.: Linear congruence equations for the solutions of the n-queens problem. Inf. Process. Lett. 41, 301–306 (1992)

    Article  MathSciNet  Google Scholar 

  11. Al-Gburi, A., Naim, S., Boraik, A.: Hybridization of bat and genetic algorithm to solve N-queens problem. Bull. Electr. Eng. Inform. 7, 626–632 (2018)

    Article  Google Scholar 

  12. Jain, V., Prasad, J.S.: Solving N-queen problem using genetic algorithm by advance mutation operator. Int. J. Electr. Comput. Eng.. 8, 4519–4523 (2018)

    Google Scholar 

  13. Ahmed, A., Shah, S., Kamran, A., Sani, A., Bukhari, H.S.: Particle swarm optimization for N-queens problem. J. Adv. Comput. Sci. Technol. 1 (2012)

    Google Scholar 

  14. Cao, J., Chen, Z., Wang, Y., Guo, H.: Parallel implementations of candidate solution evaluation algorithm for N-queens problem. Complexity 2021, 1–15 (2021)

    Google Scholar 

  15. Jianli, C., Zhikui, C., Yuxin, W., He., G.: Parallel genetic algorithm for N‐Queens problem based on message passing interface‐compute unified device architecture. Comput. Intell. (2020)

    Google Scholar 

  16. Janssen, D.M., Liew, A.W.: Acceleration of genetic algorithm on GPU CUDA Platform. In: 20th International Conference on Parallel and Distributed Computing, Applications and Technologies (PDCAT), 2019, pp. 208–213 (2019)

    Google Scholar 

  17. Nunes, I., Ulson, J., Nunes, A.: Development of neurofuzzy architecture for solving the N-Queens problem. Int. J. Gen Syst 34(6), 717–734 (2005)

    Article  Google Scholar 

  18. Waqas, M., Bhatti, A.: Optimization of N+1 queens problem using discrete neural network. Neural Netw. World. 27, 295–308 (2017)

    Article  Google Scholar 

  19. Funabiki, N., Takenaka, Y., Nishikawa, S.: A maximum neural network approach for N-queens problems. Biol. Cybern. 76, 251–255 (1997)

    Article  Google Scholar 

  20. Lakshmi, A.J., Muthuswamy, V.: A predictive context aware collaborative offloading framework for compute-intensive applications. J. Intell. Fuzzy Syst.. 40, 1–12 (2020)

    Google Scholar 

  21. de Souza, F., de Mello, F.: N-queens problem resolution using the quantum computing model. IEEE Lat. Am. Trans. 15(3), 534–540 (2017)

    Google Scholar 

  22. Draa, A., Meshoul, S., Talbi, H., Batouche, M.: A quantum-inspired differential evolution algorithm for solving the N-queens problem. Int. Arab. J. Inf. Technol. 7, 21–27 (2010)

    Google Scholar 

  23. Nadel, B.: Representation selection for constraint satisfaction: a case study using n-queens. IEEE Expert. 5, 16–23 (1990)

    Article  Google Scholar 

  24. Bell, J., Stevens, B.: A survey of known results and research areas for N-queens. Discret. Math. 309, 1–31 (2009)

    Article  MathSciNet  Google Scholar 

  25. Kondrak, G., van Beek, P.: A theoretical evaluation of selected backtracking algorithms. Artif. Intell. 89, 365–387 (1995)

    Article  MathSciNet  Google Scholar 

  26. Güldal, S., Baugh, V., Allehaibi, S.: N-queens solving algorithm by sets and backtracking (2016)

    Google Scholar 

  27. Hazama, K., Ebara, H.: Branch and bound algorithm for parallel many-core architecture. 272–277 (2018)

    Google Scholar 

  28. Koontz, W., Narendra, P., Fukunaga, K.: A branch and bound clustering algorithm. IEEE Trans. Comput. C-24, 908–915 (1975)

    Google Scholar 

  29. Stone, H., Stone, J.: Efficient search techniques—an empirical study of the n-queens problem. IBM J. Res. Dev. 31, 464–474 (1987)

    Article  Google Scholar 

  30. Nasira, G., Kumar, S.: A backpropagation neural network implementation for hybrid algorithm in solving integer linear programming problems. In: Computing Communication and Networking Technologies (ICCCNT), pp. 1–6 (2010)

    Google Scholar 

  31. Al-Rudaini, M.: N-queens problem solving using linear programming in gnu linear programming kit (GLPK) (2016)

    Google Scholar 

  32. Olivas, F., Valdez, F., Castillo, O., Gonzalez, C.I., Martinez, G., Melin, P.: Ant colony optimization with dynamic parameter adaptation based on interval type-2 fuzzy logic systems. Appl. Soft Comput. 53, 74–87 (2017)

    Google Scholar 

  33. Olivas, F., Valdez, F., Castillo, O., Melin, P.: Dynamic parameter adaptation in particle swarm optimization using interval type-2 fuzzy logic. Soft Comput. 20(3), 1057–1070 (2016)

    Google Scholar 

  34. Olivas, F., Valdez, F., Melin, P., Sombra, A., Castillo, O.: Interval type-2 fuzzy logic for dynamic parameter adaptation in a modified gravitational search algorithm. Inf. Sci. 476, 159–175 (2019)

    Article  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Oscar Montiel .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2022 The Author(s), under exclusive license to Springer Nature Switzerland AG

About this chapter

Check for updates. Verify currency and authenticity via CrossMark

Cite this chapter

Arteaga, A., Orozco-Rosas, U., Montiel, O., Castillo, O. (2022). Evaluation and Comparison of Brute-Force Search and Constrained Optimization Algorithms to Solve the N-Queens Problem. In: Castillo, O., Melin, P. (eds) New Perspectives on Hybrid Intelligent System Design based on Fuzzy Logic, Neural Networks and Metaheuristics. Studies in Computational Intelligence, vol 1050. Springer, Cham. https://doi.org/10.1007/978-3-031-08266-5_9

Download citation

Publish with us

Policies and ethics