copt01.gms : COPT test suite - iis

Description

Tests the COPT link option 'iis'  for infeasible models.

Contributor: Stefan Vigerske, March 2021, by modifying CPLEX08


Small Model of Type : LP


Category : GAMS Test library


Main file : copt01.gms

$TITLE 'COPT test suite - IIS'
$if not '%GAMS.lp%' == '' $set solver %GAMS.lp%
$if not set solver        $set solver copt
$onText
Tests the COPT link option 'iis'  for infeasible models.

Contributor: Stefan Vigerske, March 2021, by modifying CPLEX08
$offText

$echo "iis yes" > %solver%.opt
$echo "iis yes" > %solver%.op2
$echo "indic e1$b 0" >> %solver%.op2
$echo "indic e2$b 1" >> %solver%.op2

$onEcho > iis1.gms
Variables
    x, y, z;

Positive Variables
    x, y;

Equations
    e0, e1;

e0.. z =e= x + y;
e1.. x + y =l= -1;

Model m / all /;
Solve m using LP minimizing z;
$offEcho

$call.checkErrorLevel gams iis1 solver=%solver% lo=2 optfile=1
$call.checkErrorLevel grep -q "Irreducible Inconsistent Subsystem (IIS) found" iis1.lst
$call.checkErrorLevel grep -q "Number of equations in IIS: 1" iis1.lst
$call.checkErrorLevel grep -q "Upper: e1 <= -1" iis1.lst
$call.checkErrorLevel grep -q "Number of variables in IIS: 2" iis1.lst
$call.checkErrorLevel grep -q "Lower: x >= 0" iis1.lst
$call.checkErrorLevel grep -q "Lower: y >= 0" iis1.lst

$onEcho > iis2.gms
Sets
    i / 1,2,3 /;

Variables
    z;

SOS1 Variables
    x(i);

Equations
    e0, e1, e2;

e0.. z =e= sum(i, x(i));
e1.. x('1') =g= x('2') + 0.1;
e2.. x('2') =g= x('3') + 0.1;

Model m / all /;
Solve m using MIP minimizing z;
$offEcho

$call.checkErrorLevel gams iis2 solver=%solver% lo=2 optfile=1
$call.checkErrorLevel grep -q "Irreducible Inconsistent Subsystem (IIS) found" iis2.lst
$call.checkErrorLevel grep -q "Number of equations in IIS: 2" iis2.lst
$call.checkErrorLevel grep -q "Lower: e1 >= 0.1" iis2.lst
$call.checkErrorLevel grep -q "Lower: e2 >= 0.1" iis2.lst
$call.checkErrorLevel grep -q "Number of SOS in IIS: 1" iis2.lst
$call.checkErrorLevel grep -q "SOS: x(1)" iis2.lst
$call.checkErrorLevel grep -q "SOS: x(2)" iis2.lst
$call.checkErrorLevel grep -q "SOS: x(3)" iis2.lst

$onEcho > iis3.gms
Variables
    z;

Positive Variables
    x, y;

Binary Variables
    b;

Equations
    e0, e1, e2, e3;

e0.. z =e= x + y;
e1.. x + y =l= -1;
e2.. x + y =l= -2;
e3.. b =l= 1;

Model m / all /;
Solve m using MIP minimizing z;
$offEcho

$call.checkErrorLevel gams iis3 solver=%solver% lo=2 optfile=2
$call.checkErrorLevel grep -q "Irreducible Inconsistent Subsystem (IIS) found" iis3.lst
$call.checkErrorLevel grep -q "Number of indicators in IIS: 2" iis3.lst
$call.checkErrorLevel grep -q "indic e1\$b 0" iis3.lst
$call.checkErrorLevel grep -q "indic e2\$b 1" iis3.lst
$call.checkErrorLevel grep -q "Number of variables in IIS: 2" iis3.lst
$call.checkErrorLevel grep -q "Lower: x >= 0" iis3.lst
$call.checkErrorLevel grep -q "Lower: y >= 0" iis3.lst