Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,36 @@
|
|||
/*Special ordered set of type N
|
||||
|
||||
Nigel_Galloway
|
||||
January 26th, 2012
|
||||
*/
|
||||
|
||||
param Lmax;
|
||||
param Lmin;
|
||||
set SOS;
|
||||
param Sx{SOS};
|
||||
var db{Lmin..Lmax,SOS}, binary;
|
||||
|
||||
maximize s : sum{q in (Lmin..Lmax),t in (0..q-1), z in SOS: z > (q-1)} Sx[z-t]*db[q,z];
|
||||
sos1 : sum{t in (Lmin..Lmax),z in SOS: z > (t-1)} db[t,z] = 1;
|
||||
solve;
|
||||
|
||||
for{t in (Lmin..Lmax),z in SOS: db[t,z] == 1} {
|
||||
printf "\nA sub-sequence of length %d sums to %f:\n", t,s;
|
||||
printf{q in (z-t+1)..z} " %f", Sx[q];
|
||||
}
|
||||
printf "\n\n";
|
||||
|
||||
data;
|
||||
param Lmin := 1;
|
||||
param Lmax := 6;
|
||||
param:
|
||||
SOS: Sx :=
|
||||
1 7
|
||||
2 4
|
||||
3 -11
|
||||
4 6
|
||||
5 3
|
||||
6 1
|
||||
;
|
||||
|
||||
end;
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
GLPSOL: GLPK LP/MIP Solver, v4.47
|
||||
Parameter(s) specified in the command line:
|
||||
--math GSS.mod
|
||||
Reading model section from GSS.mod...
|
||||
Reading data section from GSS.mod...
|
||||
38 lines were read
|
||||
Generating s...
|
||||
Generating sos1...
|
||||
Model has been successfully generated
|
||||
GLPK Integer Optimizer, v4.47
|
||||
2 rows, 21 columns, 41 non-zeros
|
||||
21 integer variables, all of which are binary
|
||||
Preprocessing...
|
||||
1 row, 21 columns, 21 non-zeros
|
||||
21 integer variables, all of which are binary
|
||||
Scaling...
|
||||
A: min|aij| = 1.000e+000 max|aij| = 1.000e+000 ratio = 1.000e+000
|
||||
Problem data seem to be well scaled
|
||||
Constructing initial basis...
|
||||
Size of triangular part = 1
|
||||
Solving LP relaxation...
|
||||
GLPK Simplex Optimizer, v4.47
|
||||
1 row, 21 columns, 21 non-zeros
|
||||
* 0: obj = 1.000000000e+001 infeas = 0.000e+000 (0)
|
||||
* 1: obj = 1.100000000e+001 infeas = 0.000e+000 (0)
|
||||
OPTIMAL SOLUTION FOUND
|
||||
Integer optimization begins...
|
||||
+ 1: mip = not found yet <= +inf (1; 0)
|
||||
+ 1: >>>>> 1.100000000e+001 <= 1.100000000e+001 0.0% (1; 0)
|
||||
+ 1: mip = 1.100000000e+001 <= tree is empty 0.0% (0; 1)
|
||||
INTEGER OPTIMAL SOLUTION FOUND
|
||||
Time used: 0.0 secs
|
||||
Memory used: 0.1 Mb (135491 bytes)
|
||||
|
||||
A sub-sequence of length 2 sums to 11.000000:
|
||||
7.000000 4.000000
|
||||
|
||||
Model has been successfully processed
|
||||
Loading…
Add table
Add a link
Reference in a new issue