构造魔方阵:一个整数约束满足问题及一种快速方法
Constructing Magic Squares: an integer constraint satisfaction problem and a fast approach
AI总结:
本文提出了一种快速方法,用于构造大阶数的魔方阵,通过整数约束满足问题和针对性算法,实现了高效且可扩展的魔方阵生成。
摘要:
魔方阵是一个引人入胜的数学难题,已引起了数学家数世纪的 fascination。给定一个正整数 n(可能很大),其中一个主要挑战仍然是在计算时间内找到一个阶数为 n 的魔方阵,即一个阶数为 n 的矩阵,其中包含从 a_min 到 a_max 的唯一整数,使得每一行、每一列和每一斜线的和都等于常数 C(A)。在本文中,我们首先提出一个整数约束满足问题来构造阶数为 n 的魔方阵。然而,该问题的求解时间随着阶数的增加而呈指数增长。为克服这一限制,我们还提出了一种方法,根据 n 是奇数、单数偶数还是双数偶数来构造魔方阵。此外,我们提供了该新方法正确性的证明。我们的数值结果表明,我们的方法可以在不到 140 秒的时间内构造出阶数高达 70000 的魔方阵,展示了其效率和可扩展性。
英文摘要:
Magic squares are a fascinating mathematical challenge that has intrigued mathematicians for centuries. Given a positive (and possibly large) integer \( n \), one of the main challenges that still remains is to find, within a computational time, a magic square of order \( n \), that is, a square matrix of order \( n \) with unique integers from \( a_{\min} \) to \( a_{\max} \), such that the sum of each row, column, and diagonal equals a constant \( \mathcal{C}(A) \). In this work, we first present an integer constraint satisfaction problem for constructing a magic square of order \( n \). Nonetheless, the solution time of this problem grows exponentially as the order increases. To overcome this limitation, we also propose a that constructs magic squares depending on whether \( n \) is odd, singly even, or doubly even. Moreover, we provide a proof of the correctness of this novel approach. Our numerical results show that our method can construct magic squares of order up to \num{70000} in less than \num{140} seconds, demonstrating its efficiency and scalability.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。