You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A problem in the current implementation: after phase 1 an artificial variable can still be in the basis (with value 0). Such variables need to be driven out of the basis before starting phase 2, otherwise they might become non-zero in phase 2, which will make the solution invalid.
Drive artificial variables out of the basis: If l-th basic variable is artificial examine l-th row of B^−1 A. If all elements = 0 ⇒ row redundant. Otherwise pivot with non-0 element.
The following program demonstrates this issue. The returned solution violates the constraints:
A = [
1//1 1 0 0 0;
0 0 1 1 0;
1 0 1 0 0;
0 1 0 1 1;
0 0 0 0 1;
];
c = vec([0//1 1 1 0 0]);
b = vec([1//2 1//2 1 1 1 ]);
(status,sol) = simplex(c, A, b); # already in standard form
println(A * sol == b); # prints false, should be true
The text was updated successfully, but these errors were encountered:
chatziko
changed the title
Invaiid solution if artificial variables are still in basis after phase one
Invalid solution if artificial variables are still in basis after phase one
Mar 10, 2019
Interesting, I'd accept a fix + a test for this use case!
It should be necessary to explicitly drive all the artificial variables at, iirc, but I'm clearly missing a step to make it work. You can see the handling of cB partially addresses this in the phase-switching code.
I'm actually not using your julia code directly, but a C++ port of it included in my libqif library (here) (using a patched version of armadillo that works with rationals).
I've fixed the issue by driving out the artificial variables, the corresponding lines are here. It should be easily transferable back to julia, I'll do it if I find some time.
A problem in the current implementation: after phase 1 an artificial variable can still be in the basis (with value 0). Such variables need to be driven out of the basis before starting phase 2, otherwise they might become non-zero in phase 2, which will make the solution invalid.
This is explained here:
The following program demonstrates this issue. The returned solution violates the constraints:
The text was updated successfully, but these errors were encountered: