Artificial Intelligence and Quantum Computing: Early Innovations. Volume 1. Studies in Computational Intelligence - Montiel, Oscar; Orozco Rosas, Ulises; López, Daniel; Sánchez, Moises (Springer, Cham, 2025)
The N-Queens problem, a classic challenge in combinatorial optimization, requires placing N queens on an chessboard such that no two queens threaten each other. This problem is NP-complete and P-complete, indicating that classical solutions have exponential time complexity as N increases. This chapter explores the application of Grover’s Algorithm, a quantum search algorithm known to provide quadratic speedup in unstructured search scenarios, to efficiently address the N-Queens problem. We present a comprehensive methodology for designing the quantum oracle necessary to enforce non-attacking constraints and detail the mathematical formulations for row, column, and diagonal checks. The implementation of this oracle and the associated quantum circuit is demonstrated using IBM Quantum Experience’s simulator, showing a practical approach to leveraging quantum computational advantages. We analyze the simulation results for smaller board sizes and discuss the scalability challenges and hardware limitations of current quantum technology. The chapter highlights the potential of quantum algorithms to significantly outperform classical approaches, although practical implementations for larger N remain constrained by existing quantum hardware capabilities. Insights into optimizing quantum circuits and the integration of quantum-classical hybrid approaches are discussed as promising avenues for future research in quantum computing applications to complex combinatorial problems.
From Classical Challenges to Quantum Solutions: Grover’s Algorithm for the N-Queens Problem
Keywords: Algorithm for the N-Queens; Grover’s; Campus Tijuana