Abstract

Finding magic squares of order n is a search problem in a combinatorial space of n²! different squares. The construction of a magic square is simple for all n, because there are methods that create a deterministic solution for each n. These algorithms ensure the construction of a specific magic square for each n and other squares can be created from this by rotation and other operations. However, as n grows, the number of squares that cannot be obtained from these algorithms increases. The problem of finding different magic squares, not only those particulars provided by the deterministic solutions, is a challenge for any search method. This paper presents a new method to solve the magic square problem using a heuristic algorithm. The solution is separated in two phases. For the first phase, three heuristics are presented, which are used combined to construct a semi-magic square. In the second phase, a simple heuristic is used to find a magic square using the semi-magic square constructed before.

Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call