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??
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.
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:
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.
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.
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.
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
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.
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/
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. 🙂
The SAS Global Forum 2016 paper I mentioned is now available:
http://support.sas.com/resources/papers/proceedings16/SAS3161-2016.pdf
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! 🙂
Thanks for your request Rob!
I use allsolns to find all solutions but i can not print them.
how can i print all solutions?
See the "Multiple Solutions" section of the PROC OPTMODEL documentation for an example.
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
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.