计算机工程与应用 ›› 2008, Vol. 44 ›› Issue (31): 64-66.DOI: 10.3778/j.issn.1002-8331.2008.31.018

• 理论研究 • 上一篇    下一篇

基于辅助矩阵的“魔方阵”求解算法

耿 宏,姚佳佳,李 艳   

  1. 中国民航大学 航空自动化学院,天津 300300
  • 收稿日期:2007-11-30 修回日期:2008-02-27 出版日期:2008-11-01 发布日期:2008-11-01
  • 通讯作者: 耿 宏

Magic-square’s resolving arithmetic based on assistant matrix

GENG Hong,YAO Jia-jia,LI Yan   

  1. College of Aeronautical Automation,Civil Aviation University of China,Tianjin 300300,China
  • Received:2007-11-30 Revised:2008-02-27 Online:2008-11-01 Published:2008-11-01
  • Contact: GENG Hong

摘要: 求解魔方阵对矩阵在工程计算、经济数据分析(如列昂节夫投入——产出矩阵)等数据处理方面有重要理论和应用价值。在给出魔方阵的概念及分类的基础上,提出一种通用n阶魔方阵的求解算法,并用C++程序语言实现,解决了传统偶数阶魔方阵求解的一个难题。实验结果表明,利用辅助矩阵,该算法和劳伯利算法、哈利算法相比,解决了偶数阶魔方阵无法求解的问题,和利用希腊拉丁方阵算法相比,可实现全部偶数阶魔方阵的求解;另一方面,该算法在奇数阶魔方阵求解时具有相同时间复杂度和满意性能。

关键词: 魔方阵, 偶数阶, 奇数阶, 循环, 辅助矩阵

Abstract: The resolving of magic square has important value of theoretics and applications on the digital handling of matrix in engineering calculation and economic data analysis(such as Rianjev input and output matrix).Based on concept and sort of magic square,a sort of current resolution arithmetic of magic square is put forward,and implemented using C++ program language.It resolves the problem that traditional method can not figure out even magic square.Experiments indicate that,the arithmetic utilizing assistant matrix resolves the problem that even magic square can not figure out compared with Lauber arithmetic and De la Hire arithmetic,and can realize all even magic squares’ resolution compared with using Greece Latina phalanx arithmetic.On the other hand,the arithmetic has sameness time complex degree and approving capability in figuring out odd magic square.

Key words: magic-square, even rank, odd rank, circulation, matrix