BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
MikeCarter
Calcite | Level 5

Hi There,

Am trying to solve an MILP using proc opt, which I know is infeasible. To know the source of this structural infeasibility, am calling out IIS=ON option and then print "constraint.status". However, this lists one IIS at a time. I fix it and run IIS again; it comes up with another IIS. My problem has multiple IIS and I want to list all of them at one go, so I can make changes accordingly How can I list all the IIS at once? Any idea / experience anyone?

-Thanks,

-Mike

1 ACCEPTED SOLUTION

Accepted Solutions
LeoLopes
SAS Employee

There are two things you can try:

First, if the constraints all come from the same declaration, i.e.

con DontDoIt{i in SETI}: ...

then you can try relaxing all of the DontDoIt constraints.

Second, a little bit more work, but probably closer to what you want, you could put the solve statement in a loop and keep track of the constraints removed at each step until the problem is feasible.

Combining this IIS example with the information about problem symbols:

proc optmodel presolver=none;

   /* declare variables */

   var x{1..3} >=0;

  

   /* upper bound on variable x[3] */

   x[3].ub = 3;

  

   /* objective function */

   min obj = x[1] + x[2] + x[3];

  

   /* constraints */

   con c1: x[1] + x[2] >= 10;

   con c2: x[1] + x[3] <= 4;

   con c3: 4 <= x[2] + x[3] <= 5;

  

   num iteration init 1;

   set IIS{1 .. iteration} init {};

   do while (1);

     solve with lp / iis = on;

     IIS[iteration] = {ci in 1 .. _NCON_: _CON_[ci].status ~= ''};

     if card(IIS[iteration]) = 0 then leave;

     for {ci in IIS[iteration]: _CON_[ci].status = 'I_L'}

        _CON_[ci].lb = -constant('big');

     for {ci in IIS[iteration]: _CON_[ci].status = 'I_U'}

        _CON_[ci].ub = constant('big');

     iteration = iteration + 1;

   end;

   iteration = iteration - 1;

   for {ii in 1 .. iteration}

     put IIS[ii]=;

quit;

View solution in original post

3 REPLIES 3
LeoLopes
SAS Employee

There are two things you can try:

First, if the constraints all come from the same declaration, i.e.

con DontDoIt{i in SETI}: ...

then you can try relaxing all of the DontDoIt constraints.

Second, a little bit more work, but probably closer to what you want, you could put the solve statement in a loop and keep track of the constraints removed at each step until the problem is feasible.

Combining this IIS example with the information about problem symbols:

proc optmodel presolver=none;

   /* declare variables */

   var x{1..3} >=0;

  

   /* upper bound on variable x[3] */

   x[3].ub = 3;

  

   /* objective function */

   min obj = x[1] + x[2] + x[3];

  

   /* constraints */

   con c1: x[1] + x[2] >= 10;

   con c2: x[1] + x[3] <= 4;

   con c3: 4 <= x[2] + x[3] <= 5;

  

   num iteration init 1;

   set IIS{1 .. iteration} init {};

   do while (1);

     solve with lp / iis = on;

     IIS[iteration] = {ci in 1 .. _NCON_: _CON_[ci].status ~= ''};

     if card(IIS[iteration]) = 0 then leave;

     for {ci in IIS[iteration]: _CON_[ci].status = 'I_L'}

        _CON_[ci].lb = -constant('big');

     for {ci in IIS[iteration]: _CON_[ci].status = 'I_U'}

        _CON_[ci].ub = constant('big');

     iteration = iteration + 1;

   end;

   iteration = iteration - 1;

   for {ii in 1 .. iteration}

     put IIS[ii]=;

quit;

MikeCarter
Calcite | Level 5

Thanks Leo. This gives me some direction to think.

Thank you very much. Shall try the second approach.

LeoLopes
SAS Employee

You're welcome!

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


Register now!

Multiple Linear Regression in SAS

Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 2154 views
  • 0 likes
  • 2 in conversation