BookmarkSubscribeRSS Feed
Crubal
Quartz | Level 8

Hi,

The problem is about cost minimization in a serial supply chain.

My code for optimization runs without error, but always shows "Infeasible or Unbounded" for solution status.

I changed parameters of demand and initial or ending inventory, but still remains same.

Thanks! And below in the attachment is the code as well as diagram description.

6 REPLIES 6
RobPratt
SAS Super FREQ

You have indexing issues in several constraint declarations.  For example, it does not make sense to use "j in SUPPLIERS" and "p in PRODUCTS" in both places here:


constraint inv_flow1 {j in SUPPLIERS, m in RAW_MATERIALS, p in PRODUCTS}:

   sum {j in SUPPLIERS} raw_quantity_1[j,m] + initial_1 = inv_raw1 + sum {p in Products} bill_ratio[m,p]*pro_size1

;


I suspect that you mean instead:


constraint inv_flow1 {m in RAW_MATERIALS}:

   sum {j in SUPPLIERS} raw_quantity_1[j,m] + initial_1 = inv_raw1 + sum {p in Products} bill_ratio[m,p]*pro_size1

;


But you might have meant:


constraint inv_flow1 {j in SUPPLIERS, m in RAW_MATERIALS, p in PRODUCTS}:

   raw_quantity_1[j,m] + initial_1 = inv_raw1 + bill_ratio[m,p]*pro_size1

;


Please correct these and see if that takes care of things.

By the way, you might find the EXPAND statement helpful to see whether the model you generated is what you intended:

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

Crubal
Quartz | Level 8

Thanks for your reply!

Then I tried to change my constraints in the way you mentioned, where this is what I mean.

constraint inv_flow1 {m in RAW_MATERIALS}:

   sum {j in SUPPLIERS} raw_quantity_1[j,m] + initial_1 = inv_raw1 + sum {p in Products} bill_ratio[m,p]*pro_size1

;

But errors come out for example:

con raw_interval1 {m in RAW_MATERIALS}:

      sum {q in PRICE_INTERVALS} raw_quantity1_1[m,q]+raw_quantity2_1[m,q]+raw_quantity3_1[m,q] = sum {j in SUPPLIERS} raw_quantity_1[j,m];

ERROR 537-782: The symbol 'q' is unknown.

And similar errors show up. I guess whether it should be at the prior way I did?

Thanks!

RobPratt
SAS Super FREQ

You need parentheses around the entire summand:

sum {q in PRICE_INTERVALS} (raw_quantity1_1[m,q]+raw_quantity2_1[m,q]+raw_quantity3_1[m,q])

Crubal
Quartz | Level 8

Hi,

Thank you!

I tried to change the constraints in this way, and run the code again.

Still no errors, but the Solution Status is still Infeasible or Unbounded. 

And I noticed that in the log file, the following conditions happen a lot :

constraint inv_flow1 {m in RAW_MATERIALS}:

                                            -

                                            777

NOTE 777-782: The name 'm' hides an outer declaration.

Does it matter?

Thank you so much!

RobPratt
SAS Super FREQ

That note is because you declare M as a numeric parameter:

     num M = 1000000;

but then later use it as a dummy index:

    

     m in RAW_MATERIALS

(M and m are treated the same because PROC OPTMODEL is case-insensitive.)  It is better to rename one of them, say bigM instead of M.

Please make these changes and then attach the new code.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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