You are on page 1of 21
Simplex method / simple method methadone 2018 ° 30335 Oe. Semele autor of th pubicton ae sto werking on these elated proj 1 snsauaratamngs tents (mance inmatematal cause Vie oe S) Aerme tr emerson BoceT Haagen Matic Ven poet -Acomer flowing page vas uponsed by Junsh snes Zan eneSOeabee2O18 ResearchGate implex method simplex method is the method to solve ( LPP ) models which contain two or more decision variables. Basic variables: Are the variables which coefficients One in the equations and Zero in the other equations. Non-Basic variables: Are the variables which coefficients are taking any of the values, whether positive or negative or zero. Slack, surplus & arti | variables: a) If the inequality be < (less than or equal, then we add a slack variable + S to change < to =. b) If the inequality be > (greater than or equal, then we subtract a surplus variable - S to change > to =. ©) Ifwe have = we use artificial variables. The steps of the simplex metho Step 1: Determine a starting basic feasible solution. Step 2: Select an entering variable using the optimality condition. Stop if there is no entering variable. Step 3: Select a leaving variable using the feasibility condition. Optimality condition: The entering variable in a maximization (minimi: ion) problem is the non-basic variable having the most negative (positive) coefficient in the Z-row. The optimum is reached at the iteration where all the Z-row coefficient of the non-basic variables are non-negative (non-positive). Feasibility conditio For both maximization and minimization problems the leaving variable is the basic associated with the smallest non-negative ratio (with strictly positive denominator). Pivot row: a) Replace the leaving variable in the basic column with the entering variable. b) New pivot row equal to current pivot row divided by pivot element. c) All other rows: New row=current row - (pivot column coefficient) *new pivot row. Example 1: Use the simplex method to solve the (LP) model: max Z = 5x, + 4x2 Subject to 6x, + 4x2 < 24 xX,+2x, <6 xt, <1 x <2 Xy,X2 20 Solution: max Z—5x,+4x,=0 Subject to 6x, + 4x2 +S, = 24 xX, +2x, +52 =6 —x%, +x, +S3 =1 xz +54 Table 1: 4 Basic | x4 X2 Sy Sy S3 Sy Sol. St w 4 1 0 0 0 24 So a 2 0 a 0 0 6 S3 -1 1 0 0 1 0 1 S4 0 1 o 0 0 1 2 MaxZ | (5) 4 0 0 0 0 0 2 we 6_ 7 6 1 : == 71 (ignore) : =o (ignore) The entering variable is x, and S, is a leaving variable. Table 2: 1 Basic | x4 X2 Sy Sy S3 Sy Sol. Xy 1 2/3 «1/6 0 0 0 4 So 0 4/3 -1/6 1 0 0 2 S3 0 5/3 1/6 0 1 0 5 S4 0 1 o 0 0 1 2 Maxz| 0 5/6 0 0 0 20 1 @ Pivot row or new x, “row=- [current 5; -row] tie 7 (a 2 3 1 1 6 0 0 0 24] 00 0 4) - New S,-row=[ current S, —-row]-(1)[ new x, —row] =[1 2010 0 6]- (1)[1 2/3 1/6 0000 4] =[0 4/3 -1/6 1 0 0 2] - New S3-row=[ current S3 —-row]-(1)[ new x, —row] =[-1 1001 0 1J- (1)[1 2/3 1460000 4] =[0 5/3 1/6 0 1 0 5] - New S4-row=[ current S, —row]-(0)[ new x, -row] =[0 1000 1 2)- (0)[1 2/3 1/6 0000 4] =|0) 1; 0) 0.0; 12) - New Z-row=[ current Z —row]-(-5)[ new x, -row] =[5 -4 000 0 O}-(-5)[1 2/3 1/6 0000 4] =[0 -2/3 5/6 0 0 O 20) The entering variable is x2 and S> is a leaving variable. Table 3: (optimal solution): Basic xy Xz Sy Sz S3 Sy Sol. xX 1 0 1/4 -1/2 0 0 3 X 0 1 1/8 3/4 0 0 3/2 S3 0 0 3/8 5/4 1 0 5/2 Sa 0 0 1/8 -3/4 0 1 1/2 Maxz| 0 0 5/6 1/2 0 0 21 @ Pivot row or new Xp-row=+ [current S, -row] 3 =4[0 4/3 -1/6 1 0 0 2] 3 =[0 1 -1/8 % 0 0 3/2] - New x, -row=[ current x, —row]-(2/3)[ new x, -row] =[1 2/3 1/6 0 0 0 4}-(2/3)[(0 1 -1/8 % 0 0 3/2] =[1 0 % -1/2 0 0 3] - New S3-row=[ current S; —row]-(5/2)[ new x, —-row] =[0 5/3 1/6 0 1 0 5)-(5/3)[(0 1 -1/8 % 0 0 3/2] =[0 0 3/8 -5/4 1 0 5/3] - New S4-row=[ current S4 —row]-(1)[ new x2 -row] =[0 10001 2}(1)[(0 1 -1/8 % 0 0 3/2] =[0 0 1/8 -3/4 0 1 ¥%) New Z-row=[ current Z —row]-(-2/3)[ new x2 —-row] =[0 -2/3 5/6 0 0 0 20)-(-2/3)[0 1 -1/8 % 0 03/2] =[(0 0 % % O O 21) Then the solution is: 5 = 3 & x2 =F &S,=5&5=5 5,=0, S,=0 Example Use the simplex method to solve the (LP) model: max Z= 2x, +3xz Subject to 0.25x; + 0.5x2 < 40 0.4x,+0.2x, <40 0.8x, <40 XyXy 20 Solution: max Z—2x,+3x,=0 Subject to 0.25x; + 0.5x2 +5, = 40 0.4x, + 0.2x2 +5, =40 0.8x, +S; =40 X1,X2,+S4, +52, +53 20 Table 1: | Basic | x1 Xz Sy Sz S3 Sol. St 0.25 05 1 0 0 40 Sz 0.4 0.2 0 1 0 40 <| 5; 0 e) 0 0 1 40 MaxZ | -2 @D 0 0 0 0 0 =80 al Is 2 = 200 2 40, aia Pivot row or new S3-row=—— [0 0.8 00 1 40) =[0 1 0 0 1.25 50] New S,-row=[ current S, —row]-(0.5)[ new x2 —row] =[0.25 0.5 1 0 0 40]-(0.5)[0 1 0 0 1.25 50] =[0 0.5 0 0 -0.625 15] New S,-row=[ current S, —row]-(0.2)[ new x2 —row] =[0.4 0.2 0 1 0 40)-(0.2)[0 1 0 0 1.25 50] [0.4 0 0 1 -0.25 30] New Z-row=[ current Z —row]-(-3)[ new x2 —row] =[-2 -3 0 0 O O}-(-3)[0 1 0 O 1.25 50] =[-2 0 0 0 3.75 150] Table 2: \ Basic xy Xz Sy Sz S3 Sol. Sy 25 0 1 0 ©-0.625 | 15 So 0.4 0 0 1 0.25 | 30 X2 0 1 0 0 Mtoe |p 250) Maxz | (2 0 0 0 3.75 | 150 50 =e (ignore) Pivot row or new S,-row=- 5 (0.25 0 1 0 -0.625 15] =[1 0 4 0 -2.5 60] New S2-row=[ current S2 —row]-(0.4)[ new x; —row] =[0.4 0 0 O -0.25 30]-(0.4)[1 0 4 0 -2.5 60] [0 0 -1.6 0 -0.75 6] New x2-row=[0 1 0 0 1.25 50]-(0)[1 0 4 0 -2.5 60] =[0 1 0 0 1.25 50] New Z-row=[ current Z -row]-(-2)[1 0 40 -2.5 60] =[-2 0 0 0 3.75 150]-(-2)[1 0 4 O -2.5 60] [0 0 8 O -1.25 270] Table 3: ‘ Basic | x1 Xz Sy Sy S3 ! Sol. x a 0 4 0 “2.5 60 Sz 0 0 -1.6 a | 6 Xp 0 1 0 0 1.25 50 Maxz| 0 0 8 0 a 270 = —24 (ignore) = 6 7 50 125 =40 =[current S,-row] = [0 0 -1.6 0 0.75 6] New S,-row= a =[0 0 -2.133 0 1 8] New x;-row=[1 0 4 0 -2.5 60]-(-2.5)[0 0 -2.133 0 1 8] =[1 0 -1.333 0 0 80] New x,-row=[0 10 0 1.25 50]-(-1.25)[0 0-2.133 01 8] =[0 1 -2.76 0 0 40] New Z-row= [0 0 8 0 -1.25 270]-(-2.5)[0 0 -2.133 0 1 8] =[0 0 5.33 0 0 280] Table 3: (optimal sol ) Basic | x4 X2 Sy Sz Ss Sol. xy 1 oO -1.333 oO oO 80 S3 0 0 -2.133 oO 1 8 X2 0 1-267 Oo 0 40 MaxZ| 0 0 5.33 0 0 280 The optimal solution : x4=80 , x,=40, S$,=0&S,=0 // 2-280 Example 3: Use the simplex method to solve the (LP) model: min Z = —6x, — 10x, — 4x3 Subject to x1 + x2+x3 < 1000 Xp +%X2 < 500 xy t+ 2x2 < 700 XyX2,X3 =0 min Z + 6x, + 10x, + 4x3 =0 Subject to 21+ Xz +x3 +S, = 1000 xy+x, +S, =500 x,+2x, +53 =700 X1)Xq,%3 515253 20 Table 1: 4 Basic xy Xz x3 Sy Sz S3 Sol. Sy 1 1 1 1 0 0 1000 Sz 1 1 oO 0 1 0 500 S3 a S 0 0 1 a 700 Max Z 6 4 i} 0 0 0 *° = 1000 50° _ S00 New S3-row or X,-row =[1 20001 700) 1 1 = 1000 > 350) New Sy-row=[1 11100 1000}-(1)[; 100 05 350] Z 7 =, 0110-5 650) New S)-row=[1 10010 500}-(1)[ 1000 : 350] = 0001-5 150] New Z-row=[6 104000 O}(10)[> 100 05 350] Table 2: =[1 0 400 -5 -3500] d Basic xy XxX x3 Sy Sz S3 Sol. Sy 1/2 0 @ 1 0 -1/2 | 650 So 1/2 0 0 0 1 -1/2 | 150 X2 1/2 a 0 0 0 1/2_| 350 MaxZ| 1 0 ® 0 0 +5 | -3500 (ignore) (ignore) New S;-row or X3-row =1 or 10 = 650] 1 1 => o1 10-5 650] New S3-row = 5 000 1-5 150)-(0)[ = 0110 5 650] -_ = 7 7 New x2-row = [> 1000; 350}-(0)[ = 0110 3 650] 7 = =f, 1000 > 350] New Z-row=[10 400-5 -3500}-(4)[> 01 10 650] =[-10 0-40 -3 -6100] Basic xy Xz x3 Sy Sz S3 | Sol. x3 1/2 0 1 1 0 1/2 650 Sy 1/2 0 0 0 1 1/2 | 150 x2 1/2 1 0 0 0 1/2_| 350 Max Z -1 oO oO 4 0 3 -6100 The optimal solution : x3=650 , x2=350,5,=0 S3& S,=150 x, =0// 2-280 Example Use the simplex method to solve the (LP) model: max Z = 4x,—X2 Subject to Xyt+ 2x, <4 2x, + 3x, <12 eas xpx. 20 Solution: max Z—4x,+x2,=0 Subject to Xy+2x2+5, =4 2x, + 3x2 +S2=12 x1—%2 +S3 =3 X1,%2,51,52,53 20 Basic xy Xz Sy Sz S3 Sy 1 2 1 0 0 So 2 3 0 1 0 <_| 53 @ 1 0 0 1 MaxZ | (-4) 1 0 0 0 New S3-row or x;-row =1[1 -10 0 1 3] =[1 -10 0 1 3] Sol. 12 w New Sy-row=[1 2100 4]-(1)[1 —100 1 3] =[0 310-1 4] New S)-row=[2 3010 12]-(2)[1 —-100 1 3] =[0 501-2 6] New Z-row=[-4 1000 0]-(-4)[1 —10 0 1 3] =[0 -3004 12] Table 2: J Basic xy Xx Sy Sz S3 Sol. <_| Ss 0 @® 1 0 -1 1 Sy 0 5 0 1 2 6 xy 1 al 0 0 1 3 Maxz| 0 @ 0 0 4 12 -3 (ignore) New S,-row or x2-row =@)lo 310 -1 1) =[0 11/3 0 -1/3 1/3] New Sz-row=[0 5 01 -2 6]-(5)[0 11/3 0 —1/3 1/3] =[0 0 -2/3 1 11/3 13/3] New x,-row=[1 -1001 3]-(-1)[0 11/3 0-1/3 1/3] =[1 0 1/3 0 2/3 10/3] New Z-row=[0 -3004 12}(-3)[0 11/3 0 —1/3 1/3] =[00 10 3 13] Table 3: (optimal solution): Basic xy X2 Sy Sz S3 Sol. x2 0 1 1/3 0 1/3 | 1/3 Sy 0 0 -2/3 1 11/3 | 13/3 4 1 0 1/3 0 2/3 | 10/3 MaxZ Oo oO 1 0 3 13 The optimal solution : x4=10/3 , x2 =1/3 ,S,= 13/3 S,& $3 =0 // 2=13 Example Use the simplex method to solve the (LP) model: max Z = 16x, +17x, + 10x3 Subject to X+ 2x2 +4x3 < 2000 2x,+%2+ %X3 <3600 X,+2x,+2x3 <2400 xy <30 X1%2,X%3 20 Solution: max Z — 16x, — 17x2—10x3 =0 Subject to x1 + 2x2 + 4x3 + S,= 2000 2x, +X2+ X3 + Sz = 3600 X,+2x,+2x3 + S3= 2400 x, + S4 =30 XX, Xz 20, S4,S2, $3,54 20 Table 1: J Basic | x; X2 X3 Sy SS, S3_—-S4_—'|- Sol. Sy 1 @ 4 a) 0 0 0 | 2000 Sz 2 1 1 0 1 0 0 | 3600 S3 1 2 2 0 0 1 0 | 2400 Ss 1 0 0 0 0 0 1 30 MaxZ| -16 G12) -10 0 0 0 0 0 2000 set = 3600 2400 — 1200 2 = = (ignore) New Sy-row or xy-row=(5)[1 2.4 1 0 0 0 2000] =[1/2 12 1/2 0 0 0 1000) New S»-row=[2 1 1 0 1 O O 3600] -(1)[1/2 1 2 1/2 0 0 O 1000| =[3/2 0 -1 -1/2 10 0 2600] New S3-row=[1 2 2 0 0 1 0 2400] -(2)[1/2 1 2 1/2 0 0 0 1000] =[0 0 -2 -1 010 400) New S,-row=[1 0 0 0 O O 1 30) -(0)[1/2 1 2 1/2 0 O O 1000] =[1 0 0 0 O O 1 30] New Z-row=[-16 -17 -10 0 0 0 00} -(-17)[1/2 1 2 1/2 0 0 O 1000] =[15/2 0 24 17/2 0 0 0 17000] Basic xy x2 x3 Sy Sz S3 S4 Sol. x2 1/2 1 2 1/2 oO 0 oO 1000 Sz 3/2 0 1 -1/2 1 oO oO 2600 S3 oO 0 2 1 oO 1 0O 400 Sq 1 oO oO Oo oO oO 1 30 MaxZ | 15/2 0 24 17/2 oO oO oO 17000 The optimal solution : X2=1000 , Sz = 2600 ,S3 = 400,54 = 30 x1,x25,=0/ Z=17000 Example Use the simplex method to solve the (LP) model: max Z = 3x, +5x2+ 4x3 Subject to 2x1 + 3x2 <8 2x, + 5x2 <10 3x, +2x,+4x%3 <15 XX, Xz 20 Solution: max Z—3x,—5x,—4x3=0 Subject to 2x, +3x2+S, <8 2x,+5xz +S2 <10 3x, +2x2+4x%3 +S3 <15 X4,%2, X3, $1, $2,S3 20 \ Basic xy Xz x3 Sy Sz S3 Sol. Sy 2 3 0 1 oO 0 8 <_ S& 2 @®S 0 0 1 0 10 S3 3 2 4 0 0 a 15 Maxzi goon es 0 0 0 0 New S.-row or xyrow =(2)[2 50010 10] =[2/5 100 1/5 0 2] New S;-row=[2 3 0100 8] -(3)[2/5 1 0 0 1/5 O 2] =[4/5 0 0 1 -3/50 2] New S3-row=[3 2 4 0 0 1 15] -(2)[2/5 10 01/5 0 2] =[11/5 0 4 0 -2/51 11] New Z-row=[-3 -5 40000] llr LL =[-1 0 -4 010 10] Basic | x1 Xz x3 Si Sz S3 Sol. Sy 4/5 0 0 1 -3/5 0 2 Xy 2/5 1 0 0 1/5 0 2 S3 | 11/5 1 @ o -2/5 1 11 MaxzZ | -1 0 0 1 0 10 New S-row or x3-row =(Z)[11/5 04 0 -2/5 1 11] =[11/20 010 -1/10 1/4 11/4] New S;-row=[4/5 0 0 1 -3/5 0 2] -(0)[11/20 01 0 —1/10 1/4 11/4] =[4/5 0 0 1 -3/50 2] New x,-row=[2/5 10 0 1/5 0 2] New Z-row=[-1 0 -4 0 1 0 10] -(-4)[11/20 01 0 —1/10 1/4 11/4] =[6/5 0 0 O 3/51 21] Table 3: (optimal sol Basic x X2 x3 Sy Sz S3 Sol. Sy 4/5 0 0 1 -3/5 0 2 Xp 2/5 1 0 0 1/5 0 2 x3 | 11/200 1 0 1/10 1/4 11/4 MaxZ | 6/5 0 0 0 3/5 1 21 The optimal solution : x2=2, x3 =11/4, 5, =2, z=21 x, =0, $2 =0, S3=0,

You might also like