Procedure GMP::SolverSession::GetIIS(solverSession, rowSet, colSet)


The procedure GMP::SolverSession::GetIIS returns an irreducible infeasible set (IIS) for an infeasible math program, by returning the numbers of the rows and columns that are part of the IIS.

     solverSession,    ! (input) a solver session
     rowSet,           ! (output) a subset of Integers
     colSet            ! (output) a subset of Integers



An element in the set AllSolverSessions.


A subset of the set Integers, representing a set of row numbers.


A subset of the set Integers, representing a set of column numbers.

Return Value

The procedure returns 1 on success, or 0 otherwise.


  • This procedure is only supported by BARON, CPLEX and Gurobi. In case of BARON, the BARON option Compute IIS should be set to a non-default value.

  • Calculating the IIS procedure can be time consuming, especially if the model contains binary or integer variables.


To use GMP::SolverSession::GetIIS we declare the following identifiers (in ams format):

ElementParameter myGMP {
    Range: AllGeneratedMathematicalPrograms;
ElementParameter session {
    Range: AllSolverSessions;
ElementParameter ProgramStatus {
    Range: AllSolutionStates;
Set RowSet {
    SubsetOf: Integers;
    Index: rr;
Set ColSet {
    SubsetOf: Integers;
    Index: cc;
StringParameter name;

To retrieve the IIS, and print the rows and columns that are part of the IIS, we can use:

myGMP := GMP::Instance::Generate( MP );
session := GMP::Instance::CreateSolverSession( myGMP );

GMP::SolverSession::Execute( session );

ProgramStatus := GMP::SolverSession::GetProgramStatus( session );

if ( ProgramStatus = 'Infeasible' or ProgramStatus = 'InfeasibleOrUnbounded' ) then
    GMP::SolverSession::GetIIS( session, RowSet, ColSet );

    for ( rr ) do
        name := GMP::Row::GetName( myGMP, rr );
        display name;

    for ( cc ) do
        name := GMP::Column::GetName( myGMP, cc );
        display name;
    GMP::Solution::RetrieveFromSolverSession( session, 1 );
    GMP::Solution::SendToModel( myGMP, 1 );

GMP::Instance::Delete( myGMP );