Hello Gams,
Can someone please help me learn how to use the ‘specify initial integer
solution’ for the MIP solver in Mosek via GAMS?
There is a parameter MSK_IPAR_MIO_CONSTRUCT_SOL by which one can
(supposedly) set an initial integer solution. I can’t seem to make it work.
Here is a toy example problem:
$title Steve Dirkse is Cool
set N /1*3/;
binary variables
x1
x2
x3
;
free variable z;
equations
obj
c1
c2
;
obj…
z =E= 2x1 + x2 + 3x3;
c1…
x1 + x2 + x3 =G= 1;
c2…
x1 + 2*x3 =G= 2;
x1.l = 1;
x2.l = 1;
x3.l = 1;
model jtl /all/;
option mip=mosek;
jtl.optfile = 1;
solve jtl using mip minimizing z;
With the mosek.opt file:
MSK_IPAR_LOG_MIO_FREQ 1
MSK_IPAR_MIO_CUT_LEVEL_ROOT 0
MSK_IPAR_MIO_CUT_LEVEL_TREE 0
MSK_IPAR_MIO_CONSTRUCT_SOL 1
Gives the output:
\
linderot@meisterbrau:~/svn-mods/pcuts/data/mv$ gams testme.gms
— Job testme.gms Start 05/05/08 13:02:13
GAMS Rev 227 Copyright (C) 1987-2008 GAMS Development. All rights reserved
Licensee: Computer Sciences Dept. G080221/0001AS-LNX
University of Wisconsin-Madison DC2621
License for teaching and research at degree granting institutions
— Starting compilation
— testme.gms(38) 3 Mb
— Starting execution: elapsed 0:00:00.006
— testme.gms(34) 4 Mb
— Generating MIP model jtl
— testme.gms(35) 4 Mb
— 3 rows 4 columns 9 non-zeroes
— 3 discrete-columns
— Executing MOSEK: elapsed 0:00:00.028
MOSEK Link May 1, 2008 22.7.1 LNX 3927.4685 LX3 x86/Linux
M O S E K version 5.0.0.79 (Build date: Jan 29 2008 13:55:37)
Copyright (C) MOSEK ApS, Fruebjergvej 3, Box 16
DK-2100 Copenhagen, Denmark
http://www.mosek.com
Reading parameter(s) from
“/afs/cs.wisc.edu/u/l/i/linderot/svn-mods/pcuts/data/mv/mosek.opt”
MSK_IPAR_LOG_MIO_FREQ 1
MSK_IPAR_MIO_CUT_LEVEL_ROOT 0
MSK_IPAR_MIO_CUT_LEVEL_TREE 0
MSK_IPAR_MIO_CONSTRUCT_SOL 1
Finished reading from
“/afs/cs.wisc.edu/u/l/i/linderot/svn-mods/pcuts/data/mv/mosek.opt”
No initial feasible MIO solution found.
Mixed integer optimizer started.
BRANCHES RELAXS ACT_NDS BEST_INT_OBJ BEST_RELAX_OBJ
REL_GAP(%) TIME
0 0 0 3.0000000000e+00 NA NA
0.1
0 0 0 3.0000000000e+00 NA NA
0.1
Objective of best integer solution : 3.00000000e+00
Construct solution objective : Not employed
User objective cut value : Not employed
Number of branches : 0
Number of cuts generated : 0
Number of relaxations solved : 0
Number of interior point iterations: 0
Number of simplex iterations : 0
Mixed integer optimizer terminated. Time: 0.07
Interior-point optimizer started.
Presolve started.
Linear dependency checker started.
Linear dependency checker terminated.
Presolve - time : 0.00
Presolve - Stk. size (kb) : 0
Eliminator - tries : 0 time
: 0.00
Eliminator - elim’s : 0
Lin. dep. - tries : 1 time
: 0.00
Lin. dep. - number : 0
Presolve terminated.
Interior-point optimizer terminated. CPU time: 0.00. Real time: 0.00.
Interior-point solution
Problem status : PRIMAL_FEASIBLE
Solution status : PRIMAL_FEASIBLE
Primal - objective: 3.0000000000e+00 eq. infeas.: 0.00e+00 max bound
infeas.: 0.00e+00 cone infeas.: 0.00e+00
Dual - objective: 0.0000000000e+00 eq. infeas.: 0.00e+00 max bound
infeas.: 0.00e+00 cone infeas.: 0.00e+00
Basic solution
Problem status : PRIMAL_FEASIBLE
Solution status : PRIMAL_FEASIBLE
Primal - objective: 3.0000000000e+00 eq. infeas.: 0.00e+00 max bound
infeas.: 0.00e+00
Dual - objective: 0.0000000000e+00 eq. infeas.: 0.00e+00 max bound
infeas.: 0.00e+00
Integer solution
Problem status : PRIMAL_FEASIBLE
Solution status : INTEGER_OPTIMAL
Primal - objective: 3.0000000000e+00 eq. infeas.: 0.00e+00 max bound
infeas.: 0.00e+00 integer infeas.: 0.00e+00
Optimizer - real time : 0.08 cpu time: 0.08
Interior-point - iterations : 0 cpu time: 0.00
Basis identification - cpu time: 0.00
Primal - iterations : 0 cpu time: 0.00
Dual - iterations : 0 cpu time: 0.00
Clean - iterations : 0 cpu time: 0.00
Simplex - cpu time: 0.00
Primal simplex - iterations : 0 cpu time: 0.00
Dual simplex - iterations : 0 cpu time: 0.00
Mixed integer - relaxations: 0 cpu time: 0.07
Return code - 0 [MSK_RES_OK]
— Restarting execution
— testme.gms(35) 0 Mb
— Reading solution for model jtl
*** Status: Normal completion
— Job testme.gms Stop 05/05/08 13:02:13 elapsed 0:00:00.163