in reply to Not A Magic Square But Similar
The 3² square is actually a finite affine plane of order 3
Your "selections" are nothing else then the parallels of the diagonals¹. That means resorting the rows and columns of any magical square is also a solution for your problem.
As a proof of concept:
magical square 4 3 8 9 5 1 2 7 6
mapping rows and columns to diagonals
derived solution 4 1 7 6 3 9 5 2 8
I.a.W.: You can reuse any known algorithm for magic squares.
Nota Bene: your problem class is not equivalent but even more general (i.e. simpler) b/c the "diagonal"-requirement is missing (i.e. 2-5-8 and 4-6-5 summing up to 15 isn't needed)
HTH
Cheers Rolf
( addicted to the Perl Programming Language)
¹) in the case 3x3
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Not A Magic Square But Similar (Finite Geometry)
by kennethk (Abbot) on Sep 06, 2013 at 20:59 UTC | |
by LanX (Saint) on Sep 06, 2013 at 21:37 UTC |