Abstract
The n-queens problem is a classical combinatorial optimization problem which has been proved to be NP-hard. The goal is to place n non-attacking queens on an n×n chessboard. In this paper, two single-solution-based (Local Search (LS) and Tuned Simulated Annealing (SA)) and two population-based metaheuristics (two versions of Scatter Search (SS)) are presented for solving the problem. Since parameters of heuristic and metaheuristic algorithms have great influence on their performance, a TOPSIS-Taguchi based parameter tuning method is proposed, which not only considers the number of fitness function evaluations, but also aims to minimize the runtime of the presented metaheuristics. The performance of the suggested approaches was investigated through computational analyses, which showed that the Local Search method outperformed the other two algorithms in terms of average runtimes and average number of fitness function evaluations. The LS was also compared to the Cooperative PSO (CPSO) and SA algorithms, which are currently the best algorithms in the literature for finding the first solution to the n-queens problem, and the results showed that the average fitness function evaluation of the LS is approximately 21 and 8 times less than that of SA and CPSO, respectively. Also, a fitness analysis of landscape for the n-queens problem was conducted which indicated that the distribution of local optima is uniformly random and scattered over the search space. The landscape is rugged and there is no significant correlation between fitness and distance of solutions, and so a local search heuristic can search a rugged plain landscape effectively and find a solution quickly. As a result, it was statistically and analytically proved that single-solution-based metaheuristics outperform population-based metaheuristics in finding the first solution of the n-queens problem.
Similar content being viewed by others
References
Aarts, E.H.L., Lenstra, J.K.: Local Search in Combinatorial Optimization. Wiley, New York (1997)
Abramson, B., Yung, M.: Divide and conquer under global constraints: a solution to the N-queens problem. J. Parallel Distrib. Comput. 6(3), 649–662 (1989)
Amooshahi, A., Joudaki, M., Imani, M., Mazhari, N.: Presenting a new method based on cooperative PSO to solve permutation problems: a case study of n-queen problem. In: 3rd International Conference on Electronics Computer Technology (2011)
Bell, J., Stevens, B.: A survey of known results and research areas for n-queens. Discrete Math. 309, 1–31 (2009)
Bezzel, M.: Proposal of 8-queens problem, Berliner Schachzeitung 3, 363 (1848)
Campos, V., Laguna, M., Mart, R.: Context-independent scatter search and tabu search for permutation problems. INFORMS J. Comput. 17, 111–122 (2005)
Dirakkhunakon, S., Suansook, Y.: Simulated annealing with iterative improvement. In: International Conference on Signal Processing Systems (2009). doi:10.1109/ICSPS.2009.61
Draa, A., Talbi, H., Batouche, M.: A quantum inspired genetic algorithm for solving the N-queens problem. In: Proceedings of the 7th International Symposium on Programming and Systems, Algiers, pp. 145–152 (2005)
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)
Erbas, C., Sarkeshik, S., Tanik, M.M.: Different perspectives of the n-queens problem. In: Proceedings of the 1992 ACM Annual Conference on Communications, pp. 99–108. ACM Press, New York (1992)
Geman, S., Geman, D.: Stochastic relaxation, Gibbs distributions, and the Bayesian restoration of images. IEEE Trans. Pattern Anal. Mach. Intell. 6, 721–741 (1984)
Glover, F.: A template for scatter search and path relinking. In: Hao, J.K., Lutton, E., Ronald, E., Schoenauer, D., Snyers, D. (eds.) Lecture Notes in Computer Science, vol. 1363, pp. 13–54 (1997)
Glover, F.: Heuristics for integer programming using surrogate constraints. Decis. Sci. 8, 156–166 (1977)
Homaifar, A., Turner, J., Ali, S.: The n-queens problem and genetic algorithms. In: Proceedings IEEE Southeast Conference, vol. 1, pp. 262–267 (1992)
Hwang, C.L., Yoon, K.: Multiple Attribute Decision Making-Method and Applications, a State-of-the-Art Survey. Springer, New York (1981)
Jagota, A.: Optimization by reduction to maximum clique. In: IEEE International Conference on Neural Networks (1993)
Jones, T., Forrest, S.: Fitness distance correlation as a measure of problem difficulty for genetic algorithms. In: Proceedings of the 6th International Conference on GeneticAlgorithms, pp. 184–192. Morgan Kaufmann, San Francisco (1995)
Jones, T.: Evolutionary algorithms, fitness landscapes and search. PhD thesis, University of New Mexico, Albuquerque, NM (1995)
Kale, L.V.: An almost perfect heuristic for the n non-attacking queens problem. Inf. Process. Lett. 34, 173–178 (1990)
Khan, S., Bilal, M., Sharif, M., Sajid, M., Baig, R.: Solution of n-queen problem using ACO. In: IEEE 13th International Multitopic Conference, Art. No. 5383157 (2009).
Kirkpatrick, S., Gelet, C.D., Vecchi, M.P.: Optimization by simulated annealing. Science 220, 621–630 (1983)
Kosters, W.: n-queens bibliography. Retrieved May 4 (2012). http://www.liacs.nl/~kosters/nqueens/
Laguna, M., Marti, R.: Scatter Search: Methodology and Implementations in C. Kluwer Academic, Boston (2003)
Lionnet, F.J.E.: Question 963. Nouv. Ann. Math., Ser. 2 8, 560 (1869)
Martí, R., Laguna, M., Campos, V.: Scatter search vs. genetic algorithms: an experimental evaluation with permutation problems. In: Rego, C., Alidaee, B. (eds.) Adaptive Memory and Evolution: Tabu Search and Scatter Search. Kluwer Academic, Dordrecht (2004)
Martinjak, I., Golub, M.: Comparison of heuristic algorithms for the N-queen problem. In: Proceedings of the ITI 2007 29th Int. Conf. on Information Technology Interfaces, Cavtat, Croatia, pp. 25–28 (2007)
Nouraniy, Y., Andresenz, B.: A comparison of simulated annealing cooling strategies. J. Phys. A, Math. Gen. 31, 8373–8385 (1998)
Pauls, E.: Das Maximalproblem der Damen auf dem Schachbrete, II, Deutsche Schachzeitung. Organ fur das Gesammte Schachleben 29(9), 257–267 (1874)
Rego, C., Leão, P.: A scatter search tutorial for graph-based permutation problems. Research Paper HCES-10-00, Hearin Center for Enterprise Science, University of Mississippi, MS 38677, USA (2009)
Rivin, I., Zabih, R.: A dynamic programming solution to the n-queens problem. Inf. Process. Lett. 41, 253–256 (1992)
Russell, S.J., Norvig, P.: Artificial Intelligence a Modern Approach Prentice-Hall, Englewood Cliffs (1995)
Segundo, P.S.: New decision rules for exact search in N-queens. J. Glob. Optim. 51, 497–514 (2011). doi:10.1007/s10898-011-9653-x
Sloane, N.J.A.: The On-Line Encyclopedia of Integer Sequences (2012). http://oeis.org/A000170
Sosic, R., Gu, J.: Efficient local search with conflict minimization. IEEE Trans. Knowl. Data Eng. 6E, 661–668 (1994)
Taguchi, G., Yokoyama, Y.: Taguchi Methods: Design of Experiments. Am. Supplier Inst. Press, Millersburg (1993)
Talbi, E.-G.: Metaheuristics from Design to Implementation. Wiley, Hoboken (2009)
Tambouratzis, T.: A simulated annealing artificial neural network implementation of the n-queens problem. Int. J. Intell. Syst. 12, 739–752 (1997)
Tong, L.I., Wang, Ch.H., Chen, H.C.: Optimization of multiple responses using principal component analysis and technique for order preference by similarity to ideal solution. Int. J. Adv. Manuf. Technol. 27, 407–414 (2005)
Wolpert, D.W., Macready, W.G.: No free lunch theorems for optimization. IEEE Trans. Evol. Comput. 1(1), 67–82 (1997)
Xinchao, Z.: Simulated annealing algorithm with adaptive neighborhood. Appl. Soft Comput. 11, 1827–1836 (2011)
Yang, X.-S.: Nature-Inspired Metaheuristic Algorithms. Luniver Press (2010)
Author information
Authors and Affiliations
Corresponding author
Rights and permissions
About this article
Cite this article
Masehian, E., Akbaripour, H. & Mohabbati-Kalejahi, N. Landscape analysis and efficient metaheuristics for solving the n-queens problem. Comput Optim Appl 56, 735–764 (2013). https://doi.org/10.1007/s10589-013-9578-z
Received:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s10589-013-9578-z