I have a system of linear equations that I already reduced to a row echelon matrix using Gauss-Jordan elimination. My system with n variables Xn (where Xn is in N0 (=positive integers)) has multiple solutions and I want to find the solution for witch the Sum of all Xn is minimal.
How could I do that programmatically?
For example consider this system of linear equations:
x1 + + x5 + x6 = 2
x2 + x5 = 1
x3 + x6 = 1
x4 + x5 + x6 = 1
one of the minimal solution I want to obtain is:
x3 = x4 = x5 = 0
x1 = x2 = x6 = 1
another one would be
x2 = x4 = x6 = 0
x1 = x3 = x5 = 1
But I don't want
x1 = 2
x2 = x3 = x4 = 1
x5 = x6 = 0
which is also a solution of this system, but not a minimal one according to my criteria as x1 + x2 + x3 + x4 + x5 + x6 = 5 (whereas it is only 3 for the 2 first solutions)
In case of multiple minimal solutions (like here, where solutions 1 and 2 are both minimal), I don't care about the minimal solution that is returned as long as it is one of the minimal ones