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

I am working on an assignment problem using PROC OPTMODEL which is likely to have multiple solutions which are all equally optimized. Given such a situation, is it possible for PROC OPTMODEL to generate one solution in one run of the optimization program and another solution given another run of the optimization program?

 

I am thinking of something like a random seed. Each random seed leads to a different flow of numerical values which next lead to a different solution. I am not sure if PROC OPTMODEL allows something like a random seed??

1 ACCEPTED SOLUTION

Accepted Solutions
RobPratt
SAS Super FREQ

You will get that error even if you just declare continuous variables.  Please try commenting out those declarations and any other statements that use those variables.

View solution in original post

12 REPLIES 12
RobPratt
SAS Super FREQ

The CLP solver in PROC OPTMODEL can return all or some specified number of optimal solutions.  You can use either the FINDALLSOLNS option or the MAXSOLNS= option in the SOLVE WITH CLP statement:

http://support.sas.com/documentation/cdl/en/ormpug/68156/HTML/default/viewer.htm#ormpug_clpsolver_sy...

PatrickYang
Obsidian | Level 7

Hi Rob:

 

Thank you for your promot reply. I did replace the CLP solver with the MILP solver by using: solve with clp obj objfun /  FINDALLSOLNS;

 

However, I got an error message: ERROR: The CLP solver does not allow continuous variables.

 

Based on the SAS log information (found below), I only have binary variables, no continuous variables at all. The only place that might contain continuous variables is the objective function which linearizes an absolute value operation by using surplus and slack. However, the same error message continues even when I disable the objective function by using: solve with clp noobjective /  FINDALLSOLNS;

 

NOTE: Problem generation will use 4 threads.
NOTE: The problem has 15006 variables (0 free, 0 fixed).
NOTE: The problem uses 1 implicit variables.
NOTE: The problem has 15000 binary and 0 integer variables.
NOTE: The problem has 5012 linear constraints (5003 LE, 6 EQ, 3 GE, 0 range).
NOTE: The problem has 67224 linear constraint coefficients.
NOTE: The problem has 0 nonlinear constraints (0 LE, 0 EQ, 0 GE, 0 range).
NOTE: The OPTMODEL presolver removed 0 variables, 0 linear constraints, and 0 nonlinear constraints.

RobPratt
SAS Super FREQ

You will get that error even if you just declare continuous variables.  Please try commenting out those declarations and any other statements that use those variables.

PatrickYang
Obsidian | Level 7

Thank you, Rob.

 

What you said worked perfectly.

 

I removed all variables which are listed after the VAR statement but without a BINARY option. I also removed all those lines of code which use those variables. The code is able to run.

 

Thank yo so much.

RobPratt
SAS Super FREQ

I'm glad to help.  I should also mention that I will be presenting a paper on multiple solutions in PROC OPTMODEL at SAS Global Forum 2016 in April:

http://www.sas.com/en_us/events/sas-global-forum/sas-global-forum-2016.html

 

PatrickYang
Obsidian | Level 7

Hi Rob:

 

I wish I could go to listen to your talk which I am confident would be very helpful to me, provided that the company would fund me with money and time. 🙂

 

Do you think your talk would be posted online as a whitepaper or posted on Youtube sometime in the future? I have so far taught myself PROC OPTMODEL by viewing the Youtube videos and the whitepapers that you posted online. They are really helpful to me. I could find only one book dedicated to SAS/OR for optimization which is not as helpful as the videos and whitepapers.

RobPratt
SAS Super FREQ

Yes, the paper will be available online as part of the conference proceedings.  Until then, here are a few other links to resources that might be helpful for you to learn PROC OPTMODEL:

 

Papers and slides:

http://support.sas.com/rnd/app/or/papers/index.html

 

Official documentation, especially Mathematical Programming Examples:

http://support.sas.com/documentation/onlinedoc/or/index.html

 

PROC OPTMODEL course:

https://support.sas.com/edu/schedules.html?id=2616&ctry=US

 

“OPERATIONS RESEARCH WITH SAS” blog:
http://blogs.sas.com/content/operations/

 

 

PatrickYang
Obsidian | Level 7

Thank you, Rob.

 

These materials have been/will be very helpful in my work. In particular, the Papers and Slides link and the SAS/OR course link were unknown to me. 🙂

PatrickYang
Obsidian | Level 7

Thank you, Rob, for showing us the link for the paper on identiifying multiple best solutions within PROC OPTMODEL. I will be reading it and try to figure out its relevance to our work. At this point, we truly enjoy this optimization program that is provided as part of SAS/OR.

 

It surprises me that you still remember this question that I posted regarding the procedure, after nearly THREE months. We much appreciate it! 🙂

dali74
Fluorite | Level 6

Thanks for your request Rob!

 

 

I use allsolns to find all solutions but i can not print them.

 

how can i print all solutions?

 

RobPratt
SAS Super FREQ

See the "Multiple Solutions" section of the PROC OPTMODEL documentation for an example.

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
  • 12 replies
  • 2942 views
  • 6 likes
  • 3 in conversation