On Thu, 2015-08-06 at 14:18 +0200, Michal Trněný wrote:
> Here is a simple LP problem that GLPK didn't solve correctly: 
> maximize objective: 4*x1 + x2 + 2*x2 
> given constraints: 
> var x1>=0;
> var x2>=0;
> var x3>=0;
> c1: x1 <= 1;
> c2: x2 <= 1;
> c3: x3 <= 1;
> c4: x1 + x2 + x3 = 2.5;
> 
> Solver yielded answer: 
> x1=1, x2=1, x3=0.5, obj=7 
> that is obviously wrong, 

The answer is correct. Please check the last term in your objective.

> because: 
> 4*1 + 1 + 2*0.5 != 7 but 
> 4*1 + 1 + 2*0.5 = 6 
> and this solution (1,1,0.5) isn't optimal, because ... 
> there exist solution (1,0.5,1), which objective is 6.5 - bigger, than
> objective of (1,1,0.5). 
> 
> You may imagine feasible region as unit cube with vertex (1,1,1) cuted
> off. 
> 
> I'd like you to nottice me, when you fix this bug. 
> I want commented pseudocode of GLPK. 
> Do you have it? Thank you. 
> 
> -- 
> Michal Trněný
> www.michaltrneny.cz



_______________________________________________
Bug-glpk mailing list
Bug-glpk@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-glpk

Reply via email to