作者投稿和查稿 主编审稿 专家审稿 编委审稿 远程编辑

计算机工程 ›› 2011, Vol. 37 ›› Issue (20): 219-222. doi: 10.3969/j.issn.1000-3428.2011.20.076

• 人工智能及识别技术 • 上一篇    下一篇

基于双向广度优先搜索的魔力方块问题求解

王桂平 1,张 帅 2   

  1. (1. 重庆大学计算机学院,重庆 400030;2. 浙江财经学院信息学院,杭州 310018)
  • 收稿日期:2011-04-20 出版日期:2011-10-20 发布日期:2011-10-20
  • 作者简介:王桂平(1979-),男,博士研究生,主研方向:计算理论,计算复杂性理论,网格计算,云计算;张 帅,副教授、博士
  • 基金资助:
    国家自然科学基金资助项目(50975250);浙江省自然科学基金资助项目(Y1110671)

Solution for Magic Square Problem Based on Bidirectional Breadth-first Search

WANG Gui-ping 1, ZHANG Shuai 2   

  1. (1. College of Computer Science, Chongqing University, Chongqing 400030, China; 2. School of Information, Zhejiang University of Financial and Economy, Hangzhou 310018, China)
  • Received:2011-04-20 Online:2011-10-20 Published:2011-10-20

摘要: 将魔力方块问题与八数码问题进行对比分析,通过讨论魔力方块问题是否有解、解的最少步数、状态表示、状态判重、状态转换关系等相关问题,提出一种基于双向广度优先搜索和状态转换表的求解算法。实验结果表明,与有界深度优先搜索、简单广度优先搜索及A*搜索算法相比,该算法效率较高,稳定性较好,可以实现魔力方块问题的实时求解及演示。

关键词: 魔力方块问题, 状态判重, 状态转换表, 双向广度优先搜索, 八数码问题

Abstract: This paper introduces magic square problem, and analyzes 8-puzzle problem comparatively. It comprehensively discusses some issues relevant to solving magic square problem, such as whether there is a solution, minimum steps, state representation, state repetition judging, transition relation between states of magic square problem. It proposes a solution based on bidirectional Breadth-first Search(BFS) and state transition table. Experimental results prove that compared with other algorithms, the algorithm proposed is efficient and stable, which meets the requirements of real-time solving and presentation of magic square problem.

Key words: magic square problem, state repetition judging, state transition table, bidirectional Breadth-first Search(BFS), 8-puzzle problem

中图分类号: