Operations Research topics: SAS/OR,
SAS Optimization, and SAS Simulation Studio

Find constraints which cause infeasibiltiy

Accepted Solution Solved
Reply
Super Contributor
Posts: 339
Accepted Solution

Find constraints which cause infeasibiltiy

Hello,

is there a way to find constraints for proc optmodel that cause infeasibility? (Or is there at least a possibility to redirect the "suffixes", .status etc. to "create data" or ODS?)

Thanks&kind regards


Accepted Solutions
Solution
‎02-24-2015 10:40 AM
SAS Employee
Posts: 447

Re: Find constraints which cause infeasibiltiy

You can diagnose infeasibility by using the IIS= option in the SOLVE WITH LP statement:

SAS/OR(R) 13.2 User's Guide: Mathematical Programming

You can then examine the .STATUS suffix by using PRINT:

SAS/OR(R) 13.2 User's Guide: Mathematical Programming

or EXPAND / IIS:

SAS/OR(R) 13.2 User's Guide: Mathematical Programming

or CREATE DATA:

create data var_status_data from name=_VAR_.name status=_VAR_.status;

create data con_status_data from name=_CON_.name status=_CON_.status;

View solution in original post


All Replies
Solution
‎02-24-2015 10:40 AM
SAS Employee
Posts: 447

Re: Find constraints which cause infeasibiltiy

You can diagnose infeasibility by using the IIS= option in the SOLVE WITH LP statement:

SAS/OR(R) 13.2 User's Guide: Mathematical Programming

You can then examine the .STATUS suffix by using PRINT:

SAS/OR(R) 13.2 User's Guide: Mathematical Programming

or EXPAND / IIS:

SAS/OR(R) 13.2 User's Guide: Mathematical Programming

or CREATE DATA:

create data var_status_data from name=_VAR_.name status=_VAR_.status;

create data con_status_data from name=_CON_.name status=_CON_.status;

Super Contributor
Posts: 339

Re: Find constraints which cause infeasibiltiy

Thanks! I tried it out with a little example and the create-data-for-suffix-step was exactly what I was looking for.

Data Costs;
  Do Source=1 To 10;
    Do Plant=1 To 20;
   Costs=Rannor(1)*4+19;
      Output;
    End;
  End;
Run;
Data Demand;
  Do Plant=1 To 20;
    Qty=Rannor(1)*20+200;
Output;
  End;
Run;
Data Supply;
  Do Source=1 To 10;
    Qty=Rannor(1)*15+375;
    Output;
  End;
Run;

Proc Optmodel;
  Set <Num,Num> q_w;
  Num Costs{q_w};
  Read Data Costs Into q_w=[Source Plant] Costs=Costs;
  Set Sources=Setof{<q,w> in q_w} q;
  Set Plants=Setof{<q,w> in q_w} w;
  Num Demand{Plants};
  Num Supply{Sources};
  Read Data Demand Into [Plants=Plant] Demand=Qty;
  Read Data Supply Into [Sources=Source] Supply=Qty;
  Var X{Sources,Plants}>=0;
  Con Cns1{q in Sources}Smiley Frustratedum{w in Plants}X[q,w]<=Supply;
  Con Cns2{w in Plants}Smiley Frustratedum{q in Sources}X[q,w]>=Demand;
  Min Obj=Sum{q in Sources,w in Plants}X[q,w]*Costs[q,w];
  Solve with LP/Solver=Dual /*Algorithm=Network*/ IIS=On;

  create data var_status_data from [Source Plant] name=X.name status=X.status;
  create data con_status_data from [Plant] name=Cns1.name status=Cns1.status;
  Create Data Con_Status_data_2 From [Source] name=Cns2.name status=Cns2.status;
  Run;

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 322 views
  • 0 likes
  • 2 in conversation