I looked at the problem of Magic Square I am sure with some cycle, and if the condition can solve this problem, but I am interested to know if there is any known algorithm / data structure to solve this problem. I'm not interested in the exact solution, but any hint on the / datastructure algorithm will help.
This is a description of sudoku generalized to squares of different sizes. There are several famous sudoku solvers; you will have to adapt them.
There is a good algorithm from Donald Knuth: Algorithm X , Dancing Links
As I know, this is one of the fastest algorithms for solving sudoku.
And here it is quite readable and with the help of paper with good images: http://arxiv.org/abs/cs/0011047