Computer Engineering and Applications ›› 2012, Vol. 48 ›› Issue (10): 64-67.

Previous Articles     Next Articles

Improved N-Queens problem algorithm based on Erlang

XIANG Hong, SUN Liming, SANG Jun   

  1. School of Software Engineering, Chongqing University, Chongqing 400044, China
  • Online:2012-04-01 Published:2012-04-11

改进的基于Erlang的N皇后问题算法

向  宏,孙黎明,桑  军   

  1. 重庆大学 软件学院,重庆 400044

Abstract: Via analyzing of the original algorithm, a new improved N-Queens problem algorithm based on Erlang is introduced in this paper. The new improved algorithm uses bitwise operations and in each row only search the valid location of the Queen where can be placed. Through theoretical analysis and experimental verification, the algorithm can significantly improve the efficiency of solving N-Queens problem.

Key words: Erlang, N-Queens problem, bitwise operation

摘要: 基于Erlang语言平台解决N皇后问题,通过对原有基于Erlang的N皇后问题算法进行分析,提出了一种改进算法。该算法利用位运算操作,并且在每一行只搜索可以放置皇后的位置。理论分析与实验证明了该算法能明显提升N皇后问题算法效率。

关键词: Erlang, N皇后问题, 位运算