Open jmcarthur opened 10 years ago
I just discovered that I get the expected answer if I change constant 1
to constant 1.1
. Perhaps this is a rounding error somewhere?
I just realized that the issue (which I am now certain is due to rounding) is easily surmountable (at least in my case) by using Rational
instead of Double
. I will leave the ticket open, since I still believe this indicates a bug; after all, Double
is a common instantiation for this sort of problem.
Thank you for reporting and sorry for the late reply. As you guessed, the problem is due to numerical error of floating point numbers.
After introducing a mixed integer Gomory cut and branching, the expected solution is excluded due to the slight violation of feasibility condition (non-negative variable took the value -5.551115123125783e-17).
To fix the problem, it is necessary to tolerate small amounts of violation and also add parameters for controlling the degree of tolerance, as all all practical MIP solvers do.
Try the following program:
The output is
Optimum 0.0 (fromList [(1,0.0),(2,0.0)])
. However, I expectedOptimum 1.0 (fromList [(1,1.0),(2,2.0)])
.I am using the version on Hackage.