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

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

1 ACCEPTED SOLUTION

Accepted Solutions
RobPratt
SAS Super FREQ

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

2 REPLIES 2
RobPratt
SAS Super FREQ

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;

user24feb
Barite | Level 11

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}:Sum{w in Plants}X[q,w]<=Supply;
  Con Cns2{w in Plants}:Sum{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;

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 2 replies
  • 1038 views
  • 0 likes
  • 2 in conversation