SAS Optimization, and SAS Simulation Studio

turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

Topic Options

- RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

11-18-2014 06:11 PM

Hello,

I am looking for help in terms of improving the efficiency/runtime of Proc Optmodel. Here's some background on my problem:

It's specifically optimizing selection. I have 200,000 rows with the variable being a Binary Include flag. The subset I want "included" has to meet various constraints in the aggregate - weighted averages, sums, etc.

I am using the Mixed Integer Linear solver, as that is the one that works given I have a Binary variable.

Issue is that once I add a key constraint, the runtime has increased from 20 seconds to above 4 minutes. I know that this key constraint is "limiting", ie the result is right at my constraint boundary. Otherwise, it is very similar to other constraints I have that do not seem to slow down runtime. I know optmodel has tons of options, but I'm just not sure which could help me.

I did cut the runtime in half by setting Presolver=aggressive, but I'm weary about what this actually does to the data. I get the following in log:

"WARNING: Removed 17 constraint coefficients whose absolute values are not greater than 1E-9." This confuses me because none of the hard coded values I have in there are < 1E-9, but maybe I need to better understand what all is included in a constraint coefficient. I'm nopt using any other options on the solve line.

Let me know if anything else will help describe my problem. Any suggestions are greatly appreciated! Thanks

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to wefeqwF

11-18-2014 06:13 PM

Please post your code, along with the data if possible.

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to wefeqwF

11-18-2014 06:13 PM

Would you be willing to share your data and model code? I can take a look and perhaps make a suggestion.

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to wefeqwF

11-19-2014 12:20 AM

If you are unable to share your original code, you may want to at least try finding these small coefficients. They are probably a sign that your model could be improved by handling some special case in the data more precisely.

One way to find them is to use the expand statement, then search for E- (like that, with no spaces) in the results. That will match scientific notation. For example, this code:

proc optmodel;

var XE, Y;

con SmallCoefficients{i in 1..10}: 1/(10**i)* xE - 6*y <= 1;

expand;

quit;

will produce:

Var XE

Var Y

Constraint SmallCoefficients[1]: 0.1*XE - 6*Y <= 1

Constraint SmallCoefficients[2]: 0.01*XE - 6*Y <= 1

Constraint SmallCoefficients[3]: 0.001*XE - 6*Y <= 1

Constraint SmallCoefficients[4]: 0.0001*XE - 6*Y <= 1

Constraint SmallCoefficients[5]: 0.00001*XE - 6*Y <= 1

Constraint SmallCoefficients[6]: 1E-6*XE - 6*Y <= 1

Constraint SmallCoefficients[7]: 1E-7*XE - 6*Y <= 1

Constraint SmallCoefficients[8]: 1E-8*XE - 6*Y <= 1

Constraint SmallCoefficients[9]: 1E-9*XE - 6*Y <= 1

Constraint SmallCoefficients[10]: 1E-10*XE - 6*Y <= 1

Because of the way optmodel formats the output, you will only encounter the E- pattern in a small number, unless your data encodes it in a string.