摘要
本文在分析N皇后问题解的结构的基础上,优化了利用回溯法求解N皇后问题的算法的循环结束条件,借助于矩阵改进了互不攻击的条件检测方法,避免了求解复杂的逻辑表达式,大大地减少了比较次数,使得算法的运行效率更高。
Based on the analysis about the solution structure of n - Queen problem, we improve the backtracking algorithm for the n - Queen problem, the loop termination condition and the method which checks the n - Queen not to attack each other by the matrix. So we can avoid calculating complicated logic expressions and can reduce the times of comparison, and can raise the executive efficiency of the algorithm.
出处
《宜宾学院学报》
2006年第6期64-66,共3页
Journal of Yibin University
关键词
N元皇后问题
互不攻击的布局
回溯算法
n- Queen Problem
Not Attacking Distribution
Backtracking Algorithm