BookmarkSubscribeRSS Feed
Mina-sh
Fluorite | Level 6

Hello All,

I'm working on an optimization problem and here is my issue:

I define the model in a sparse format and it is solved successfully. But when I check the details I see some constraints are ignored!

So the solution is wrong... It is a simple LP problem for flow management. I'm attaching the solution and data to this message. To see the problem if you check the result at TOTAL file (you find 3 rows for DC001 but there should be 4 rows at the first step considering the data file LPMATRIX).  Also, none of them should be 0... they should be GE to 9500, 73000, 15000 and 14000. Otherwise, the solution should be infeasible regardless the other constraints... How can this be possible?

The TOTAL file is extracted from solufile which is the direct output of the procedure.

 

PROC LP DATA = LPMATRIX SPARSEDATA PRINTFREQ = 1 PRINTLEVEL = -1
TIME = 6000 MAXIT1 = 99000 MAXIT2 = 99000 IMAXIT = 99000
PRIMALOUT = SOLUFILE VARSELECT = PRIOR ;

RUN ;

 

1 REPLY 1
RobPratt
SAS Super FREQ

Can you please show how you got from SOLUFILE to TOTAL?

 

The following PROC PRINT call shows several variables involving DC001:

proc print data=solufile(where=(_VAR_ contains 'DC001'));
run;

SAS Output

Obs _OBJ_ID_ _RHS_ID_ _VAR_ _TYPE_ _STATUS_ _LBOUND_ _VALUE_ _UBOUND_ _PRICE_ _R_COST_
1 MINCOST _RHS_ PFL__DC001H90 01RSL NON-NEG   0 0 1.7977E308 147.330 12.328
2 MINCOST _RHS_ PFL__DC001OFIL01RSL NON-NEG   0 0 1.7977E308 144.486 12.499
3 MINCOST _RHS_ PFL__DC001PG3 01RSL NON-NEG   0 0 1.7977E308 126.126 9.276
717 MINCOST _RHS_ PPT__DC001H-HG01RSL NON-NEG _BASIC_ 0 9500 1.7977E308 177.481 0.000
718 MINCOST _RHS_ PPT__DC001H90 01RSL NON-NEG   0 0 1.7977E308 154.553 19.551
719 MINCOST _RHS_ PPT__DC001OFIL01RSL NON-NEG   0 0 1.7977E308 155.804 23.816
1003 MINCOST _RHS_ PSY__DC001H90 01RSL NON-NEG _BASIC_ 0 73000 1.7977E308 128.317 0.000
1004 MINCOST _RHS_ PSY__DC001OFIL01RSL NON-NEG _BASIC_ 0 15000 1.7977E308 125.132 -0.000
1005 MINCOST _RHS_ PSY__DC001PG3 01RSL NON-NEG _BASIC_ 0 14000 1.7977E308 114.232 0.000
3423 MINCOST _RHS_ D_DC001H-HG01RSL SURPLUS   0 0 1.7977E308 0.000 177.481
3424 MINCOST _RHS_ D_DC001H90 01RSL SURPLUS   0 0 1.7977E308 0.000 135.002
3425 MINCOST _RHS_ D_DC001OFIL01RSL SURPLUS   0 0 1.7977E308 0.000 131.987
3426 MINCOST _RHS_ D_DC001PG3 01RSL SURPLUS   0 0 1.7977E308 0.000 116.850

 

The numbers you mentioned do appear among the nonzero values.

 

Also, note that PROC LP has been considered legacy and no longer maintained since SAS/OR 9.3 (July 2011) and is not even documented as of SAS/OR 14.2 (November 2016).  Please see this SAS Global Forum paper to migrate to PROC OPTMODEL.  As demonstrated in that paper, I used the MPSOUT= option in PROC LP and then ran PROC OPTLP as a sanity check.  I got the same optimal objective value (290555420.58) in both cases, so another possibility to consider is that maybe your LPMATRIX doesn't correctly capture the problem you want to solve.

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
  • 1 reply
  • 642 views
  • 0 likes
  • 2 in conversation