Reputation: 127
I have a set of linear equations, I want to optimize in such a way that the minimum outcome of any equation is best possible.
for example
Solve for
x1*1 + x2*2
x1*3 + x2*4
constraint
x1+x2=<12
I am doing linear maximization with Pulp in python and results yield one output too large and other too small. Currently, I am checking the best minimum possible value by setting another constraint
x1*1 + x2*2 >= minval
x1*3 + x2*4 >= minval
I am now iterating for the best possible value of minval till the problem is unfeasible, but this is CPU costly way to do as optimization runs for each value of minval
Upvotes: 1
Views: 565
Reputation: 281958
Introduce a new variable z
and new constraints z <= x1 + 2*x2
and z <= 3*x1 + 4*x2
, then maximize z
. This is similar to what you tried with minval
, but telling the linear programming solver to optimize the value instead of fiddling it up and down yourself.
Upvotes: 1