BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hi all,

Is there another way to modeling a milp problem with special ordered set (SOS)? there 're keywords SOSEQ and SOSLE in PROC LP format, But if I convert this to MPS-format Sas Data Set (to input it to OPTMILP), they will be ignored. So if I have a model with SOS, I can solve it with PROC LP only?

thanks!
4 REPLIES 4
YanXu
SAS Employee
OPTMILP doesn't support SOS yet. It is in our plan to add it.

If the variables (for example, x1, x2, x 3, x4) in SOS are all binary, then can add a constraint

x1 + x2 + x3 + x4 = 1 (for SOREQ) or x1 + x2 + x3 + x4 <= 1 (for SORLQ)

If the variables are not all binary (but all are >= 0), then can add a set of constraints and same extra variables

x1 <= M1 * y1
x2 <= M2 * y2
x3 <= M3 * y3
x4 <= M4 * y4
y1 + y2 + y3 + y4 = 1 (for SOREQ) or y1 + y2 + y3 + y4 <= 1 (for SORLQ)
yi are binary. Mi is the upper bound of xi

You can use OPTMODEL to model and solve your problem efficiently. Document is here
http://support.sas.com/documentation/cdl/en/ormpug/63352/HTML/default/viewer.htm#optmodel_toc.htm

PROC LP is a legacy proc. It may have trouble when solving large instances.
YanXu
SAS Employee
My first post got messed up. Here is my whole answer

OPTMILP doesn't support SOS yet. It is in our plan to add it.

If the variables (for example, x1, x2, x 3, x4) in SOS are all binary, then can add a constraint

x1 + x2 + x3 + x4 = 1 (for SOREQ) or x1 + x2 + x3 + x4 = 0 (for SORLE)


If the variables in SOS are not all binary, but all >= 0, then can add a set of constraints and some extra variables

x1 < M1 * y1
x2 < M1 * y2
x3 < M1 * y3
x4 < M1 * y4
y1 + y2 + y3 + y4 = 1 (for SOREQ) or y1 + y2 + y3 + y4 = 0 (for SORLE)
yi are binary, Mi are upper bound of xi.

PROC LP is a legacy proc, it may not perform well when the instances are large.
OPTMODEL can be used to model this efficiently, it doc can be found at www.sas.com and search for documentation and OPTMODEL.

(somehow the forum doesn't display web link correctly)
YanXu
SAS Employee
x1 + x2 + x3 + x4 = 0 (for SORLE) should be

x1 + x2 + x3 + x4 lessOrEq 1 (for SORLE)
deleted_user
Not applicable
Thank you so much Yan Xu.

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