dqq.gms : Warm-starting quad-precision MINOS

Description

Illustrate the DQQ procedure.  This procedure is used for multiscale
LP models (i.e. models with coefficients and/or variables that vary
over an extreme range).  It takes advantage of the quad-precision
solver QUADMINOS to handle the extreme range of values encountered.

In the reference above, several instances are solved by DQQ: the data
for some of these instances can be processed here by specifying the
GDX input when running, e.g.

  > gams dqq --GDXNAME=pilot

We include data for the following instances (in order of increasing difficulty):
  pilot4, pilot, pilot87, tma_me, glcaerwt, glcalift
These instances were obtained from MPS files via the mps2gms utility.


Reference

  • Ma, D, Yang, L, Fleming, R M T, Thiele, I, Palsson, B O, and Saunders, M A, Reliable and efficient solution of genome-scale models of Metabolism and macromolecular Expression. Scientific Reports 7, 40863 (2017).

Large Model of Type : GAMS


Category : GAMS Model library


Main file : dqq.gms   includes :  pilot4.gdx  pilot.gdx  pilot87.gdx  tma_me.gdx  glcaerwt.gdx  glcalift.gdx

$Title Warm-starting quad-precision MINOS (DQQ,SEQ=414)
$ontext
Illustrate the DQQ procedure.  This procedure is used for multiscale
LP models (i.e. models with coefficients and/or variables that vary
over an extreme range).  It takes advantage of the quad-precision
solver QUADMINOS to handle the extreme range of values encountered.

In the reference above, several instances are solved by DQQ: the data
for some of these instances can be processed here by specifying the
GDX input when running, e.g.

  > gams dqq --GDXNAME=pilot

We include data for the following instances (in order of increasing difficulty):
  pilot4, pilot, pilot87, tma_me, glcaerwt, glcalift
These instances were obtained from MPS files via the mps2gms utility.


Ma, D., Yang, L., Fleming, R.M.T., Thiele, I., Palsson, B.O.,
Saunders, M.A.  Reliable and efficient solution of genome-scale models
of Metabolism and macromolecular Expression, Scientific Reports 7,
Article number 40863 (2017).
doi:10.1038/srep40863. http://rdcu.be/oCpn
$offtext


$if not set GDXNAME $set GDXNAME pilot4

$ifthen not set LPNAME
$  set LPNAME MINOS
$  set OPTNUM 11
$else
$  set OPTNUM 0
$endif

sets i      all rows in MPS order
     ig(i)  greater-than-or equal rows
     il(i)  less-than-or equal rows
     ie(i)  equality rows
     ir(i)  ranged rows
  ;

sets j        all columns in MPS order
     jc (j)   continuous columns
  ;

parameters  c(j)        objective coefs
            cobj        objective constant
            b(i)        right hand sides
            ac (i,jc)   matrix coefs: continuous variables
  ;

set mps2gms; parameter mps2gmsstats(mps2gms);

equations eobj   objective function
          eg(i)  greater-than-or equal equs
          el(i)  less-than-or equal equs
          ee(i)  equality equs
          er(i)  ranged equs
  ;

         variables obj        objective variable
positive variables xc (j)     continuous variables
                   r  (i)     ranged row variables
  ;

$gdxin %GDXNAME%
$load i j mps2gms mps2gmsstats
$load ig il ie ir
$load jc
$load cobj c b
$load ac
$load xc r

$gdxin

eobj.. obj =e= sum(jc,       c(jc  )*xc (jc ))
             + cobj;

eg(ig)..       sum(jc,  ac (ig,jc )*xc (jc ))
               =g= b(ig);

el(il)..       sum(jc,  ac (il,jc )*xc (jc ))
               =l= b(il);

ee(ie)..       sum(jc,  ac (ie,jc )*xc (jc ))
               =e= b(ie);

er(ir)..       sum(jc,  ac (ir,jc )*xc (jc ))
               =e= r(ir);

model m / all /;

option limcol=0,limrow=0,solprint=off;

$ontext
Implement DQQ procedure:
 1. Solve with Double-precision MINOS, scaling on, optfile=11
 2. Solve with Quad-precision MINOS, scaling on,   optfile=12
 3. Solve with Quad-precision MINOS, scaling off,  optfile=13
$offtext

$onecho > minos.o11
* step 1 (D) of DQQ
scale option             2
feasibility tolerance    1e-7
optimality tolerance     1e-7
expand frequency         100000
LU factor tolerance      1.9
LU update tolerance      1.9
$offecho

$onecho > quadminos.o12
* step 2 (Q1) of DQQ
scale option             2
feasibility tolerance    1e-15
optimality tolerance     1e-15
expand frequency         100000
LU factor tolerance      10.0
LU update tolerance      10.0
$offecho

$onecho > quadminos.o13
* step 3 (Q2) of DQQ
scale option             0
feasibility tolerance    1e-15
optimality tolerance     1e-15
expand frequency         100000
LU factor tolerance      5.0
LU update tolerance      5.0
$offecho

parameters
  xbar1(jc)
  xbar2(jc)
  xbar3(jc)
  ;
scalars
  obj1
  itr1
  obj2
  itr2
  dx2 / NA /
  obj3
  itr3
  dx3 / NA /
  ;

* step 1: solve with normal (Double-precision) MINOS
m.optfile = %OPTNUM%;
option lp = %LPNAME%;
solve m using lp minimizing obj;
obj1 = m.objval;
itr1 = m.iterusd;
xbar1(jc) = xc.L(jc);

* step 2: solve with quad-precision MINOS
m.optfile = 12;
option lp = quadminos;
solve m using lp minimizing obj;
obj2 = m.objval;
itr2 = m.iterusd;
xbar2(jc) = xc.L(jc);

* step 3: solve with quad-precision MINOS, no scaling
m.optfile = 13;
option lp = quadminos;
solve m using lp minimizing obj;
obj3 = m.objval;
itr3 = m.iterusd;
xbar3(jc) = xc.L(jc);

dx2 = smax{jc, abs(xbar1(jc)-xbar2(jc))};
dx3 = smax{jc, abs(xbar2(jc)-xbar3(jc))};

file log /''/;
putclose log ' '
  / 'Instance name: %GDXNAME%'
  / 'Step 1:  itr =' itr1:10:0  '   obj =' obj1:18:8
  / 'Step 2:  itr =' itr2:10:0  '   obj =' obj2:18:8 '   dx =' dx2:14:8
  / 'Step 3:  itr =' itr3:10:0  '   obj =' obj3:18:8 '   dx =' dx3:14:8
  /;