I've solved a simple LP problem where all constraints are "less than or equal to".
I used scipy.optimize.linprog for those.
The problem is when one or more of the constraints equation is "greater than or equal to". How do I specify that? I need to use the two-phase approach provided by scipy.optimize.linprog
An example of such is:
7X1 + 4X2 + 9X3 ≥ 750 4X1 + 6X2 + 7X3 ≤ 40 17X1 + 9X2 + 2.5X3 ≥ 3540 56X1 + 3X2 + 27X3 ≤ 6450
Here is a wrapper that incorporates lower bound rows in the lingprog formulation. Note that more error trapping is necessary (for example, the number of columns of each
A
matrix need to be equal), this is not meant to be a robust implementation. For proper error trapping, I suggest you skim through the linprog source code.Note that for the instance that you presented, there is no feasible solution (I checked this with another solver as well and got an infeasibility proof).
I hope this helps.
This code can be tested here.