simplex_reduce

Bugs

Modérateur : xcasadmin

Harrie Hendriks
Messages : 1
Inscription : mer. août 07, 2013 1:13 pm

simplex_reduce

Message par Harrie Hendriks » mer. août 07, 2013 3:06 pm

simplex_reduce is a useful command.
Unfortunately there is a bug in it, if not more.
Maximize x+y
subject to
x+y+z <= 3
x,y,z >= 0
yields the solution
x=3,y=3,z=0
but then x+y+z=3+3+0=6 > 3.
See
simplex_reduce([[1,1,1]],[3],[1,1,0]);

The problem seems to be that the code does not know how to handle the two
"vertex" solutions {x=3,y=0,z=0} and {x=0,y=3,z=0}.

parisse
Messages : 5739
Inscription : mar. déc. 20, 2005 4:02 pm
Contact :

Re: simplex_reduce

Message par parisse » ven. août 09, 2013 7:20 pm

The optimum returned is 3, it is correct, the solution returned is bugged because it's a degenerated problem, there are in fact infinitely many solutions on the segment joining (3,0,0) to (0,3,0). I don't know if I can easily fix that... you can get a correct solution as soon as you modify a little bit one coefficient e.g.
simplex_reduce([[1,1,1]],[3],[1,1.0001,0]);
or
simplex_reduce([[1,1,1]],[3],[1.0001,1,0]);

Répondre