Our market gardener eample had the form: min - 900 1500 [ ] suject to: Ñ Ò Ó 1.5 2 â 20 60 á ã Ñ Ò Ó 3 â 60 á ã where: [ acres caages acres tomatoes T ]. We need a more systematic approach to solving these prolems, particularly when there are many variales and constraints. SIMPLEX method (Dantzig). always move to a verte which improves the value of the ojective function. Fraser Fores, 1997 LP Simple 1
SIMPLEX Algorithm 1) Convert prolem to standard form with: positive right-hand sides, lower ounds of zero. 2) Introduce slack / surplus variales: change all inequality constraints to equality constraints. 3) Define an initial feasile asis: choose a starting set of variale values which satisfy all of the constraints. 4) Determine a new asis which improves ojective function: select a new verte with a etter value of P(). 5) Transform the equations: perform row reduction on the equation set. 6) Repeat Steps 4 & 5 until no more improvement in the ojective function is possile. Fraser Fores, 1997 LP Simple 2
Market Gardener Revisited The prolem was written: ma c,t 900 c + 1500 t suject to: trucking 1.5 c + 2 t 3 20 c + 60 t 60 fertilizer 1) in standard form, the prolem is: min - 900 1500 [ ] suject to: Ñ Ò Ó 1.5 2 â 20 60 á ã Ò Ñ Ó 0 3 â 60 á ã where [ c t T ]. Fraser Fores, 1997 LP Simple 3
Market Gardener Revisited 2) Introduce slack variales ( or convert all inequality constraints to equality constraints): min c,t - 900 c - 1500 t suject to: trucking 1.5 c + 2 t + s = 3 20 c + 60 t + s = 60 1 2 c, t, s, s 0 1 2 fertilizer or in matri form: min - 900 1500 0 0 [ ] suject to: 1.5 2 1 0 3 á Ñ = â Ò â 20 60 0 1 60 Ñ Ò Ó ã Ó 0 á ã where c t s s 1 2 [ ]. T Fraser Fores, 1997 LP Simple 4
Market Gardener Revisited 3) Define an initial asis and set up taleau: choose the slacks as the initial asic variales, this is equivalent to starting at the origin. the initial taleau is: c t s 1 asis variales s 1 1.5 2 2.0 6 3.0 6-900 -1500 ojective function coefficients ojective function value Fraser Fores, 1997 LP Simple 5
Market Gardener Revisited 4) Determine the new asis: eamine the ojective function coefficients and choose a variale with a negative weight. (you want to decrease the ojective function ecause you are minimizing. Usually we will choose the most negative weight, ut this is not necessary). this variale will e rought into the asis. divide each element of y the corresponding constraint coefficient of the new asic variale. the variale which will e removed from the asis is in the pivot row (given y the smallest positive ratio of i /a ij ). new non-asic variale new asic variale c t s 1 s 1 1.5 2 2.0 6 3.0 6 1 /a 12 = 3/2 2 /a 22 = 1-900 -1500 pivot most negative coefficient, ring "t" into the asis Fraser Fores, 1997 LP Simple 6
Market Gardener Revisited 5) Transform the constraint equations: perform row reduction on the constraint equations to make the pivot element 1 and all other elements of the pivot column 0. c t s 1 s 1 t 5/6 1/3-1/30 1/60-400 25.0 1500 i) new row #2 = row #2 / 60 ii) new row #1 = row #1-2*new row #2 iii) new row #3 = row #3 + 1500* new row #2 Fraser Fores, 1997 LP Simple 7
Market Gardener Revisited 6) Repeat Steps 4 & 5 until no more improvement is possile: pivot s 1 t c t s 1 5/6 1/3-1/30 1/60-400 25.0 1500 the new taleau is: c t s 1 c t 6/5-1/3-1/25 3/100 6/5 3/5 480 9.0 1980 no further improvements are possile, since there are no more negative coefficients in the ottom row of the taleau. Fraser Fores, 1997 LP Simple 8
Market Gardener Revisited The final taleau is: optimal acres of caages & tomatoes c t s 1 c t 6/5-1/3-1/25 3/100 6/5 3/5 480 9.0 1980 optimal asis contains oth caages and tomatoes. maimum profit shadow prices Fraser Fores, 1997 LP Simple 9
Market Gardener Revisited Recall that we could graph the market garden prolem: 3 fertilizer increasing profit c (acres) 2 * profit contours 1 feasile region trucking start 1 2 t (acres) We can track how the SIMPLEX algorithm moved through the feasile region. The SIMPLEX algorithm started at the origin. Then moved along the tomato ais (this was equivalent to introducing tomatoes into the asis) to the fertilizer constraint. The algorithm then moved up the fertilizer constraint until it found the intersection with the trucking constraint, which is the optimal solution. Fraser Fores, 1997 LP Simple 10
Another SIMPLEX Eample: We have een commissioned y one of Ontario s most famous wineries to schedule their production. The winery makes three types of wine: sweet, regular and dry. The profit per litre, required raw materials and laour for each of these types of wine is: wine type Grade A grapes (u) Grade B grapes (u) sugar (kg) laour (hr) profit sweet regular dry 0.10 0.20 0 0.10 0 0.20 0.2 0.1 0 0.4 0.6 0.2 $1.40 $0 $1.60 The winery has availale 80 kilograms of sugar, 225 hours of laour, 150 ushels each of grade A and grade B grapes per day. What product mi of wines will maimize the companies daily profit. 1) What is the physical interpretation of each slack variale? 2) What can we do to increase daily profit for the winery? 3) What will it cost us to deviate from the optimum mi? Fraser Fores, 1997 LP Simple 11
Some Other Considerations 1) Negative lower ounds on variales: SIMPLEX method requires all variales to have non-negative lower ounds (i.e. 0). prolems can have variales for which negative values are physically meaningful (e.g. intermediate cross-flows etween parallel process units). introduce artificial variales. If we have ounds on the variale 1 such that: -a 1 Then we introduce two new artificial variales (e.g. 5, 6 ) where: and we can require: 1 = 5-6 5 0, 6 0 while satisfying the ounds on 1. Fraser Fores, 1997 LP Simple 12
Some Other Considerations 2) Mied constraints: until this point we have always een ale to formulate our constraints sets using only constraints (with positive right-hand sides). how can we handle constraint sets that also include constraints (with positive right-hand sides). introduce surplus variales. Suppose we have the constraint: [a i1... a in ] The we can introduce a surplus variale s i to form an equality constraint y setting: a i1 1 +... + a in n - s i = i We have a prolem if we start with an initial feasile asis such that = 0 (i.e. starting at the origin). Then: s i = - i which violates the non-negativity constraint on all variales (including slack / surplus variales). i We need a way of finding a feasile starting point for these situations. Fraser Fores, 1997 LP Simple 13
Some Other Considerations 3) Origin not in the feasile region: increasing profit profit contours 1 feasile region 2 The SIMPLEX algorithm requires a feasile starting point. We have een starting at the origin, ut In this case the origin is not in the feasile region. There are several different approaches: Big M method (Murty, 1983). Fraser Fores, 1997 LP Simple 14
Big M Method Consider the minimization prolem with mied constraints: min + 2 suject to: 1 2 3 + 4 5 1 2 + 2 = 3 1 3 + 4 1 2 1) As well as the usual slack / surplus variales, introduce a separate artificial variale a i into each equality and constraint: 3 + 4 - s + a = 5 1 2 1 1 + 2 + a = 3 1 3 2 + + s = 4 1 2 2 2) Augment the ojective function y penalizing non-zero values of the artificial variales: T P( ) = c + Ma Í m i= 1 i Fraser Fores, 1997 LP Simple 15
Big M Method Choose a large value for M ( say 10 times the magnitude of the largest coefficient in the ojective function). For the eample minimization prolem: P( ) = 1 + 2 2 + 20a 1 + 20 a2 3) Set up the taleau as usual. The initial asis will include all of the artificial variales and the required slack variales: 1 2 3 s 1 a 1 a 2 a 1 a 2 3.0 4.0 2.0-5.0 3.0 4.0 2.0 2 2 0 Fraser Fores, 1997 LP Simple 16
Big M Method Phase 1 modify the ojective row in the taleau to reduce the coefficients of the artificial variales to zero: a 1 a 2 1 2 3 s 1 a 1 a 2 3.0 4.0 2.0-5.0 3.0 4.0-59 -78 2 2-100 a 1 a 2 1 2 3 s 1 a 1 a 2 3.0 4.0 2.0-5.0 3.0 4.0-79 -78-40 20-160 Fraser Fores, 1997 LP Simple 17
Big M Method 4) Phase 2, Solve the prolem as efore starting from the final taleau from Phase 1. 1 2 3 s 1 a 1 a 2 a 1 a 2 3.0 4.0 2.0-5.0 3.0 4.0-79 -78-40 20-160 1 2 3 s 1 a 1 a 2 1 a 2 4/3-4/3-1/3 2.0-1/3 1/3 1/3 1/3-1/3-1/3 5/3 4/3 7/4 82/3-40 -19/3 79/3-85/3 Fraser Fores, 1997 LP Simple 18
the final taleau is: 1 2 3 s 1 a 1 a 2 1 3 4/3-2/3-1/3-1/3 1/6 1/3 1/3-1/6-1/3 1/2 5/3 2/3 7/3 2/3 1/3 59/3 20-5/3 The optimal solution is: 1 = 5/3, 2 = 0, 3 = 2/3, P() = 5/3 What would e the effect of: 1) introducing 2 into the asis? 2) introducing s 1 into the asis? 3) introducing a 1 or a 2 into the asis? Fraser Fores, 1997 LP Simple 19
SIMPLEX Method Summary 1) Write the prolem in standard form, 2) Introduce slack, surplus and artificial variales as required, 3) Choose a starting point (usually = 0), 4) Determine a new asis which improves the value of the ojective function, 5) Transform the equation set, 6) Repeat steps 4 & 5 until no further improvement is possile. Fraser Fores, 1997 LP Simple 20
SIMPLEX Algorithm (Matri Form) To develop the matri form for the Linear Programming prolem: T min c suject to: A 0 we introduce the slack variales and partition, A and c as follows: asic B = N non-asic [ M ] A = B N c = c B c N Then, the Linear Programming prolem ecomes: min T c suject to: T + c B B N N B + N = B N, 0 B N Fraser Fores, 1997 LP Simple 21
SIMPLEX Algorithm (Matri Form) Feasile values of the asic variales ( B ) can e defined in terms of the values for non-asic variales ( N ): [ N ] -1 = B - N B The value of the ojective function is given y: [ ] P( ) = c T BB -1 - N N + c T N N or: [ ] P( ) = c T BB -1 + c T N - c T BB -1 N N Then, the taleau we used to solve these prolems can e represented as: B T N T B I B -1 N B -1 0 T T -1 [ c c B N ] - N - T -1 B c B B Fraser Fores, 1997 LP Simple 22
SIMPLEX Algorithm (Matri Form) The Simple Algorithm is: 1) form the B and N matrices. Calculate B -1. 2) calculate the shadow prices (reduced costs) of the nonasic variales ( N ): T T -1 [ c N c B B N ] - - 3) calculate B -1 N and B -1. 4) find the pivot element y performing the ratio test using the column corresponding to the most negative shadow price. 5) the pivot column corresponds to the new asic variale and the pivot row corresponds to the new non-asic variale. Modify the B and N matrices accordingly. Calculate B -1. 6) repeat step through 5 until there are no negative shadow prices remaining. Fraser Fores, 1997 LP Simple 23
SIMPLEX Algorithm (Matri Form) This method is computationally inefficient ecause you must calculate a complete inverse of the matri B at each iteration of the SIMPLEX algorithm. There are several variations on the Revised SIMPLEX algorithm which attempt to minimize the computations and memory requirements of the method. Eamples of these can e found in: Chvatal Edgar & Himmellau (references in 7.7) Fletcher Gill, Murray and Wright Fraser Fores, 1997 LP Simple 24