Question

I created a model in Excel to use in conjunction with Solver. It mostly works. The only problem is that Solver is not really treating the cells constrained as binary properly. When it's done finding a solution, some of the numbers are actually 0.9999996, 1.0000000003, 0.0000017, and so on.

I am using Excel 2004 on Mac OS X. Any ideas?

Was it helpful?

Solution

Due to the finite precision of computers and the nature of the optimization algorithms, the solver has tolerances built in. I would try selecting the Options button on the Solver Parameters dialogue box and then increase the Precision (say from the default of 0.000001 to 0.00000001). I am not sure if this will work, but it is worth a try.

My company makes a commercial grade solver hooked to Excel called What’sBest. If the above does not work you could consider it. You can find more info at www.lindo.com

OTHER TIPS

If the binary values are far from 0 or 1, you might have to go to options in the Solver window and check if the box "Ignore integer constraints is checked".

If solver is unable to find a solution within the time frame or number of iterations allowed (or if there is no correct answer possible) it will not return binary answers.

One possible work-around, depending on the type of problem you are trying to solve and how exact an answer you need, is to set a few cells (probably the ones with the smallest values in the cells you are calculating for) with the contstraints <=1 and >=0 rather than binary. The image you provided is not showing up, so I'm not exactly sure what you were after.

(It may be helpful to set up a cell with a sumproduct for the cells not set as binary; see below.)

As an example, if you are trying to solve for a total of 22 (which has no solution), you start with:

9   1
9   1
9   1
6   1
3   1

If you set all the values in the second column as binary, you will end up with:

9   0.5625
9   0.5625
9   0.5625
6   0.708333333
3   0.854166667

If you set the first 3 as binary, and the last two as <=1 & >=0, you end up with:

9   0
9   1
9   1
6   0.333333333
3   0.666666667

The sumproduct for the last two rows = 4, which you could then use to manually set one of the last two as 1 and the other 0, depending on whether you want an answer slightly below or above the target.

I had similar issue and could resolve it by going to solver options and then checking "Use Automatic scaling". I am not sure this will fix your issue or not but worth a try.

Likely not your problem, but be aware there is an Ignore Integer Constraints checkbox in Options that is checked by default in Excel Solver. At least that's the case in my copy of Excel 2011 for Mac.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top