binary Y variable results are sometimes close to 1 but not exact. Intentional or a bug?

16 views
Skip to first unread message

edward.s...@gmail.com

unread,
Nov 4, 2019, 8:03:00 AM11/4/19
to OPTANO Modeling
Hi all,

I expanded upon the knapsack example in the documentation and yielded a strange phenomenon that I am not sure is intentional or not. I am looking for some verification that results are still guaranteed valid.
I expanded the possible knapsack items to 150, and iterated on the solution until it yields 100 valid solutions.  In iteratively adding constraints against Y values of prior solutions to ensure variance in next solutions, I noticed that in some cases, the Y value of given solution, which is supposed to be binary 1 or 0, actually had values that were fractional.  Interestingly, the yielded solutions with fractional Y values still appear valid.  However, more interestingly, if I throw away any solution that has Y values that are not EXACTLY = 1, and continue to iterate to 100 solutions, the program executes an order of magnitude longer, BUT, the average result values yielded are slightly higher!  This seems intuitive, but I am wondering if this is known, and is an intentional tradeoff between speed and optimality, or a bug of some kind that happens to yield valid but sub optimal results.  

Thanks, 
Edward
 

ORCONOMY Team

unread,
Nov 5, 2019, 9:26:59 AM11/5/19
to OPTANO Modeling
Hi,

please use IsAlmost(...) to evaluate any integer variable.
It will take EPSILON into account (the percision level the solver uses internally)
Default value of EPSILON is 1e-6.

EPSILON might be set, bevore the Model Scope is built, using the Configuration.Epsilon

Best,
jp
Reply all
Reply to author
Forward
0 new messages