Hi, I was doing a undergraduate project about the magic square and find a interesting fact. Changing the name of two set I can find a magic in less than 60 seconds or not find it in a resonably amount of time. Any one have an idea that can explain that fact?
Thanks, Raniere Silva
17c17
< set N := 1..n;
---
> set N2 := 1..n;
19c19
< set N2 := 1..n*n;
---
> set N := 1..n*n;
25c25
< var x{i in N, j in N, k in N2} binary;
---
> var x{i in N2, j in N2, k in N}, binary;
28c28
< s.t. a{i in N, j in N}: sum {k in N2} x[i,j,k] = 1;
---
> s.t. a{i in N2, j in N2}: sum{k in N} x[i,j,k] = 1;
31c31
< s.t. b{k in N2}: sum {i in N, j in N} x[i,j,k] = 1;
---
> s.t. b{k in N}: sum{i in N2, j in N2} x[i,j,k] = 1;
34c34
< s.t. r{i in N}: sum{j in N} (sum {k in N2} k*x[i,j,k]) = s;
---
> s.t. r{i in N2}: sum{j in N2, k in N} k * x[i,j,k] = s;
37c37
< s.t. c{i in N}: sum{j in N} (sum {k in N2} k*x[i,j,k]) = s;
---
> s.t. c{j in N2}: sum{i in N2, k in N} k * x[i,j,k] = s;
40c40
< s.t. d: sum{i in N} (sum {k in N2} k*x[i,i,k]) = s;
---
> s.t. d: sum{i in N2, k in N} k * x[i,i,k] = s;
43c43
< s.t. e: sum{i in N} (sum {k in N2} k*x[n+1-i,i,k]) = s;
---
> s.t. e: sum{i in N2, k in N} k * x[i,n-i+1,k] = s;
52c52
< { printf{j in 1..n} "%3d", sum{k in N2} k * x[i,j,k];
---
> { printf{j in 1..n} "%3d", sum{k in N} k * x[i,j,k];
msAssigF.mod
Description: audio/mod
msAssigL.mod
Description: audio/mod
GLPSOL: GLPK LP/MIP Solver, v4.43
Parameter(s) specified in the command line:
--math -m msAssigF.mod --log msAssigF.log --tmlim 60
Reading model section from msAssigF.mod...
msAssigF.mod:57: warning: final NL missing before end of file
57 lines were read
Generating a...
Generating b...
Generating r...
Generating c...
Generating d...
Generating e...
Model has been successfully generated
GLPK Integer Optimizer, v4.43
86 rows, 1296 columns, 5616 non-zeros
1296 integer variables, all of which are binary
Preprocessing...
86 rows, 1296 columns, 5616 non-zeros
1296 integer variables, all of which are binary
Scaling...
A: min|aij| = 1.000e+00 max|aij| = 3.600e+01 ratio = 3.600e+01
GM: min|aij| = 4.082e-01 max|aij| = 2.449e+00 ratio = 6.000e+00
EQ: min|aij| = 1.667e-01 max|aij| = 1.000e+00 ratio = 6.000e+00
2N: min|aij| = 1.250e-01 max|aij| = 1.000e+00 ratio = 8.000e+00
Constructing initial basis...
Size of triangular part = 71
Solving LP relaxation...
GLPK Simplex Optimizer, v4.43
86 rows, 1296 columns, 5616 non-zeros
0: obj = 0.000000000e+00 infeas = 5.608e+02 (15)
* 114: obj = 0.000000000e+00 infeas = 2.158e-14 (8)
OPTIMAL SOLUTION FOUND
Integer optimization begins...
+ 114: mip = not found yet >= -inf (1; 0)
+ 19731: mip = not found yet >= 0.000000000e+00 (281; 1385)
+ 37373: mip = not found yet >= 0.000000000e+00 (392; 3155)
+ 46363: >>>>> 0.000000000e+00 >= 0.000000000e+00 0.0% (501; 3904)
+ 46363: mip = 0.000000000e+00 >= tree is empty 0.0% (0; 5699)
INTEGER OPTIMAL SOLUTION FOUND
Time used: 12.6 secs
Memory used: 3.0 Mb (3153446 bytes)
Magic sum is 111
28 8 18 10 11 36
7 19 23 13 33 16
35 31 27 3 14 1
12 22 4 30 17 26
21 20 9 24 5 32
15 6 29 34 25 2
Model has been successfully processed
GLPSOL: GLPK LP/MIP Solver, v4.43
Parameter(s) specified in the command line:
--math -m msAssigL.mod --log msAssigL.log --tmlim 60
Reading model section from msAssigL.mod...
msAssigL.mod:57: warning: final NL missing before end of file
57 lines were read
Generating a...
Generating b...
Generating r...
Generating c...
Generating d...
Generating e...
Model has been successfully generated
GLPK Integer Optimizer, v4.43
86 rows, 1296 columns, 5616 non-zeros
1296 integer variables, all of which are binary
Preprocessing...
86 rows, 1296 columns, 5616 non-zeros
1296 integer variables, all of which are binary
Scaling...
A: min|aij| = 1.000e+00 max|aij| = 3.600e+01 ratio = 3.600e+01
GM: min|aij| = 4.082e-01 max|aij| = 2.449e+00 ratio = 6.000e+00
EQ: min|aij| = 1.667e-01 max|aij| = 1.000e+00 ratio = 6.000e+00
2N: min|aij| = 1.250e-01 max|aij| = 1.000e+00 ratio = 8.000e+00
Constructing initial basis...
Size of triangular part = 71
Solving LP relaxation...
GLPK Simplex Optimizer, v4.43
86 rows, 1296 columns, 5616 non-zeros
0: obj = 0.000000000e+00 infeas = 5.608e+02 (15)
* 141: obj = 0.000000000e+00 infeas = 2.620e-14 (3)
OPTIMAL SOLUTION FOUND
Integer optimization begins...
+ 141: mip = not found yet >= -inf (1; 0)
+ 29170: mip = not found yet >= 0.000000000e+00 (174; 725)
+ 58219: mip = not found yet >= 0.000000000e+00 (277; 1642)
+ 89362: mip = not found yet >= 0.000000000e+00 (295; 2880)
+120041: mip = not found yet >= 0.000000000e+00 (347; 4008)
+149833: mip = not found yet >= 0.000000000e+00 (339; 5317)
+180232: mip = not found yet >= 0.000000000e+00 (351; 6495)
+209696: mip = not found yet >= 0.000000000e+00 (366; 7695)
+240191: mip = not found yet >= 0.000000000e+00 (408; 8825)
+271673: mip = not found yet >= 0.000000000e+00 (526; 9677)
+302055: mip = not found yet >= 0.000000000e+00 (558; 10728)
+331787: mip = not found yet >= 0.000000000e+00 (585; 11863)
+358157: mip = not found yet >= 0.000000000e+00 (615; 12890)
TIME LIMIT EXCEEDED; SEARCH TERMINATED
Time used: 60.0 secs
Memory used: 4.0 Mb (4172198 bytes)
Magic sum is 111
0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0
Model has been successfully processed
_______________________________________________ Bug-glpk mailing list [email protected] https://lists.gnu.org/mailman/listinfo/bug-glpk
