• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

boolean constraints in solver

ultros1234

New Member
Hi all --

I'm trying to set up a complex Solver problem, and I ran into a brick wall.

Eighteen of the variable cells have a boolean constraint. Specifically, the value needs to be either $0 or >=$3000, unless another value two columns over <>0. For each row, I've made a boolean value with a formula like this in cell AJ4:
=OR(AH4>=3000,AF4<>0,AH4=0)

And then a master boolean value at the bottom, that is all 18 of the other booleans multiplied together. It equals 1 if all eighteen of them are true. Then I add that master boolean as a constraint in my solver.

If all the values begin as true, the solver works fine. If any of them are false, it tells me "Solver encountered an error value in the Objective Cell or a Constraint cell. One of the cells in the worksheet became an error value when Solver tried certain values for the Variable cells."

It seems to me that Solver has a hard time parsing this kind of logical expression, which is too complex to put into one mathematical constraint.

Has anyone encountered this problem, and do you know a workaround?

Thanks!
 
Hi ,

If you can upload your workbook with enough data in it , it may make it easier to resolve your problem.

Narayan
 
Okay, attached.

Just to be clear, the sticky wicket is that the values in column AH must be either 0 or >=3000, unless there's a non-zero value in column AF already. The constraint AJ28=1 is the problem. Change one of the AH variable values such that AJ28<>1, and the solver will fail.
 

Attachments

  • asset allocation helper v.2015.06.04b - clean for upload.xlsx
    22.3 KB · Views: 2
Back
Top