GPU上的高性能N皇后问题求解器:无存储体冲突的迭代深度优先搜索
High-Performance N-Queens Solver on GPU: Iterative DFS with Zero Bank Conflicts
AI总结:
针对N皇后问题解计数验证的高成本挑战,提出基于NVIDIA GPU的迭代DFS算法,通过共享内存映射、无存储体冲突优化,用8块RTX 5090仅28.4天验证27皇后解,较同类GPU方法提速超10倍,为28皇后问题求解提供可行路径。
摘要:
N皇后问题的解计数是一个经典的NP完全问题,计算复杂度极高。截至目前,学术界仅严格验证了N≤26时的解数量。2016年,PreuBer领导的研究团队使用FPGA硬件解决了27皇后问题,耗时约一年,但结果尚未得到独立验证。近期关于GPU并行计算的研究表明,验证27皇后解仍需约17个月,时间与计算资源成本过高。为应对这一挑战,我们在NVIDIA GPU平台提出创新并行计算方法,核心贡献包括:(1)用于求解N皇后问题的迭代深度优先搜索(DFS)算法;(2)将所需栈结构完全映射到GPU共享内存;(3)通过精心设计的内存访问模式有效避免存储体冲突;(4)采用多种优化技术以实现最优性能。在该优化框架下,我们使用8块RTX 5090 GPU仅用28.4天成功验证了27皇后问题,确认了PreuBer计算结果的正确性。此外,我们将下一个开放问题——28皇后问题的预计求解时间缩短至约11个月,使其在计算上可行。与最先进的GPU方法相比,在相同硬件配置(8块A100)上,我们的方法实现了10倍以上的加速;使用8块RTX 5090 GPU时加速超过26倍,为这一长期停滞的问题带来了新视角。
英文摘要:
The counting of solutions to the N-Queens problem is a classic NP-complete problem with extremely high computational complexity. As of now, the academic community has rigorously verified the number of solutions only up to N <= 26. In 2016, the research team led by PreuBer solved the 27-Queens problem using FPGA hardware, which took approximately one year, though the result remains unverified independently. Recent studies on GPU parallel computing suggest that verifying the 27-Queens solution would still require about 17 months, indicating excessively high time and computational resource costs. To address this challenge, we propose an innovative parallel computing method on NVIDIA GPU platform, with the following core contributions: (1) An iterative depth-first search (DFS) algorithm for solving the N-Queens problem; (2) Complete mapping of the required stack structure to GPU shared memory; (3) Effective avoidance of bank conflicts through meticulously designed memory access patterns; (4) Various optimization techniques are employed to achieve optimal performance. Under the proposed optimization framework, we successfully verified the 27-Queens problem in just 28.4 days using eight RTX 5090 GPUs, thereby confirming the correctness of PreuBer's computational results. Moreover, we have reduced the projected solving time for the next open case-the 28-Queens problem-to approximately 11 months, making its resolution computationally feasible. Compared to the state-of-the-art GPU methods, our method achieves over 10x speedup on identical hardware configurations (8 A100), while delivering over 26x acceleration when utilizing 8 RTX 5090 GPUs, and brings fresh perspectives to this long-stagnant problem.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。