计算机工程与应用 ›› 2009, Vol. 45 ›› Issue (32): 61-62.DOI: 10.3778/j.issn.1002-8331.2009.32.019

• 研发、设计、测试 • 上一篇    下一篇

位运算在N皇后问题中的应用

潘大志1,2,杜 勇3,谭代伦1,刘志斌2   

  1. 1.西华师范大学 数学与信息学院,四川 南充 637000
    2.西南石油大学 理学院,成都 610000
    3.四川建筑职业技术学院,成都 610000
  • 收稿日期:2008-09-09 修回日期:2008-11-28 出版日期:2009-11-11 发布日期:2009-11-11
  • 通讯作者: 潘大志

Application of bits operation in N-queen question

PAN Da-zhi1,2,DU Yong3,TAN Dai-lun1,LIU Zhi-bin2   

  1. 1.College of Mathematics and Information,China West Normal University,Nanchong,Sichuan 637000,China
    2.School of Sciences,Southwest Petroleum University,Chengdu 610000,China
    3.Sichuan College of Architectural Technology,Chengdu 610000,China
  • Received:2008-09-09 Revised:2008-11-28 Online:2009-11-11 Published:2009-11-11
  • Contact: PAN Da-zhi

摘要: 利用位操作运算的快速性,将位运算应用到N皇后问题的解决中,并给出了位运算求解N皇后问题的算法。该算法较好地提高了问题求解的速度。通过VC++环境实现,该算法比普通的递归回溯算法的速度平均提高了40倍左右。

关键词: N皇后问题, 位运算, 算法, 回溯算法

Abstract: Bits operation is applied in solving of N-queen question and new algorithm is dropped with rapidity of bits operation.This algorithm raises the speed which well N-queen question is solved.Bits operation algorithm,realized by the VC++ environment,enhances equally about 40 times compared to the ordinary recursion and backtracking algorithm’s speed.

Key words: N-queen question, bits operation, algorithm, backtracking algorithm

中图分类号: