cplex08.gms : CPLEX test suite - conflict analysis

Description

Tests the CPLEX link option 'iis' (conflict analysis) for infeasible models.

Contributor: Renke Kuhlmann, December 2020


Small Model of Type : GAMS


Category : GAMS Test library


Main file : cplex08.gms

$title 'CPLEX test suite - conflict analysis' (CPLEX08,SEQ=841)
$if not '%GAMS.lp%' == '' $set solver %GAMS.lp%
$if not set solver        $set solver cplex
$onText
Tests the CPLEX link option 'iis' (conflict analysis) for infeasible models.

Contributor: Renke Kuhlmann, December 2020
$offText

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

$onEcho > cplexiis1.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 cplexiis1 solver=%solver% lo=2 optfile=1
$call.checkErrorLevel grep -q "Conflict Refiner status" cplexiis1.lst
$call.checkErrorLevel grep -q "Number of equations in conflict: 1" cplexiis1.lst
$call.checkErrorLevel grep -q "upper: e1 < -1" cplexiis1.lst
$call.checkErrorLevel grep -q "Number of variables in conflict: 2" cplexiis1.lst
$call.checkErrorLevel grep -q "lower: x > 0" cplexiis1.lst
$call.checkErrorLevel grep -q "lower: y > 0" cplexiis1.lst


$onEcho > cplexiis2.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 cplexiis2 solver=%solver% lo=2 optfile=1
$call.checkErrorLevel grep -q "Conflict Refiner status" cplexiis2.lst
$call.checkErrorLevel grep -q "Number of equations in conflict: 2" cplexiis2.lst
$call.checkErrorLevel grep -q "lower: e1 > 0.1" cplexiis2.lst
$call.checkErrorLevel grep -q "lower: e2 > 0.1" cplexiis2.lst
$call.checkErrorLevel grep -q "Number of SOS sets in conflict: 1" cplexiis2.lst
$call.checkErrorLevel grep -q "sos: x(1)" cplexiis2.lst
$call.checkErrorLevel grep -q "sos: x(2)" cplexiis2.lst
$call.checkErrorLevel grep -q "sos: x(3)" cplexiis2.lst

$onEcho > cplexiis3.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 cplexiis3 solver=%solver% lo=2 optfile=2
$call.checkErrorLevel grep -q "Conflict Refiner status" cplexiis3.lst
$call.checkErrorLevel grep -q "Number of indicator constraints in conflict: 2" cplexiis3.lst
$call.checkErrorLevel grep -q "indic e1\$b 0" cplexiis3.lst
$call.checkErrorLevel grep -q "indic e2\$b 1" cplexiis3.lst
$call.checkErrorLevel grep -q "Number of variables in conflict: 2" cplexiis3.lst
$call.checkErrorLevel grep -q "lower: x > 0" cplexiis3.lst
$call.checkErrorLevel grep -q "lower: y > 0" cplexiis3.lst