Solver delivers wrong answer when 2 constraints are close
Thiago Neves <[email protected]> Wed, 3 Mar 2021 15:19:48 -0300
| Newsgroups | gmane.comp.gnu.glpk,gmane.comp.gnu.glpk.bugs |
|---|---|
| Message-ID | <CAK6rbN3w_vW8disk8UTS5oe56q9oa_FEp+EDB3itvopz8fabnw@mail.gmail.com> |
Hi. I've found a strange behaviour in glpk which I don't know how to fix nor how to contour it. It seems like GLPK can't distinguish constraints that differs from about 1e-4. Follows simple examples that explain and reproduce the problem. *The first model gives the desired answer (x = 1.0001):* *param min_bound default 0;* *var x >= 0;minimize y: x;* * s.t. PART_MIN_X: x >= 1 + min_bound;solve;display min_bound;display x; # EXPECTED RESULT: X == 1.0001data;param min_bound := 1e-4;end;* *_____________________________________* *OUTPUT:* *x.val = 1.0001* *_____________________________________ * *Now, if I add a second constraint "close" to the first one, the solver will deliver an answer that is actually infeasible:* *param min_bound default 0;* *var x >= 0;minimize y: x;* *s.t. LIM_INF_X: x >= 1;* *s.t. PART_MIN_X: x >= 1 + min_bound;solve;display min_bound;display x; # EXPECTED RESULT: X == 1.0001data;param min_bound := 1e-4;end;* *_____________________________________* *OUTPUT:* x.val = 1 *_____________________________________ * *If I change the "min_bound" parameter to 1e-2, the second model works as expected (x = 1.01):* *param min_bound default 0;* *var x >= 0;minimize y: x;* *s.t. LIM_INF_X: x >= 1;* *s.t. PART_MIN_X: x >= 1 + min_bound;solve;* *display x; # EXPECTED RESULT: X == 1.01data;param min_bound := 1e-2;end;* *_____________________________________* *OUTPUT:* x.val = 1.01 *_____________________________________ * Att, *Thiago H. Neves* (31) 98608-0666