Simplex method in prime how to use the constrains maximise s.t. constraints.
|
11-14-2023, 11:48 AM
(This post was last modified: 11-15-2023 10:53 AM by Albert Chan.)
Post: #54
|
|||
|
|||
RE: Simplex method in prime how to use the constrains maximise s.t. constraints.
(11-09-2023 12:09 PM)parisse Wrote: It's unclear for me if it's possible to rewrite the initial problem and call simplex_reduce. Changing the sign of c would replace a max by a min, but you can't change sign of x (since x>=0), and if you negate Ax>=b, b would become <=0 instead of >=0 I just learn we can solve dual problem for answer. Cost is also a constraint, here for the minimum. 2x + 4y >= 22 3x + 2y >= 20 4x + 5y >= 40 6x + 5y >= cost Transpose above, we have dual problem. 2 z1 + 3 z2 + 4 z3 <= 6 4 z1 + 2 z2 + 5 z3 <= 5 22 z1 + 20 z2 + 40 z3 <= cost > simplex_reduce([[2,3,4],[4,2,5]], [6,5], [22,20,40]) \(\frac{320}{7},[0,\frac{10}{7},\frac{3}{7},0,0],\left(\begin{array}{cccccc} \frac{-6}{7} & 1 & 0 & \frac{5}{7} & \frac{-4}{7} & \frac{10}{7} \\ \frac{8}{7} & 0 & 1 & \frac{-2}{7} & \frac{3}{7} & \frac{3}{7} \\ \frac{46}{7} & 0 & 0 & \frac{20}{7} & \frac{40}{7} & \frac{320}{7} \end{array}\right) \) Last row for original problem solution: x = 20/7, y = 40/7, min(cost) = 320/7 But, it would be better if simplex_reduce accept negative b's. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)