# 4/17/20151 2. Simplex Method – standard form Key concept ： Change constraints from inequality to equality then find the solutions of the linear equations’

## Presentation on theme: "4/17/20151 2. Simplex Method – standard form Key concept ： Change constraints from inequality to equality then find the solutions of the linear equations’"— Presentation transcript:

4/17/20151 2. Simplex Method – standard form Key concept ： Change constraints from inequality to equality then find the solutions of the linear equations’ system. x 1 + x 2  3 x 1 - 2x 2 ≤ 4 x 1 + x 2 – s 2 = 3x 1 - 2x 2 + s 1 = 4 加上 slack variable (  0) 使得等式成立 加上 surplus variable (  0) 使得等式成立 Maximize f = 4x 1 + 3x 2 x 1 + x 2 ≤ 3 2x 1 - x 2  3 x 1  0, x 2  0 Maximize f = 4x 1 + 3x 2 x 1 + x 2 + s 1 = 3 2x 1 - x 2 - s 2 = 3 x 1, x 2, s 1, s 2  0 標準化

4/17/20152 a 11 x 1 + a 12 x 2 + … + a 1n x n = b 1 2.1 The steps of Simplex Method 1.Transform into standard form. 2.Establish simplex tableau. 3.Choose the basic variables x B for initial feasible solution. ( 正常狀況下是 slack var.s) 4.Calculate the cost f j of each x j to produce objective benefit. f j 5.Calculate the pure objective benefit C j – f j of each x j under the current x B. x j * 6.Choose the max benefit producer x j * (the x j with max C j – f j ) as pivot variable. 7.Do the ratio test  i = b i /a ij of each x Bi. Replace x B * (the x B having min  i ) with x j *. 8.Do pivoting (elementary row operations), such that a ij * = 1 (a ij * : the coefficient in x B *’s row and x j *’s column), and such that the other coefficients in x j *’s column are 0. ------ A new tableau is obtained. C j – f j 9.Repeat from 4. until no C j – f j > 0. MaxC1C1 C2C2.. C j..CnCn i cBcB xBxB x1x1 x2x2 x j *.. xnxn bibi iiii 1c B1 x B1 a 11 a 12 …a 1n b1b1 b 1 a 1j 2c B2 x B2 a 21 a 22 …a 2n b2b2 b 2 a 2j … ……… mc Bm x Bm a m1 a m2 a mn bmbm b m a mj fjfj ∑ i c Bi a ij ∑ i c Bi b i C j -f j … Simplex Tableau 目標函數 的係數 技術矩陣 目標函數值 在目標函 數上的係數 x B 在目標函 數上的係數 c 1 x 1 + c 2 x 2 + … + c n x n

4/17/20153 2.2 Simplex method’s example CjCjCjCj 128000 i cBcB xBxB x1x1 x2x2 s1s1 s2s2 s3s3 bibi iiii 1c B1 =0 x B1 =s 1 52100150 30 2c B2 =0 x B2 =s 2 2301010050 3c B3 =0 x B3 =s 3 4200180 20 fjfj 00000∑ i c Bi b i =0 C j -f j 128000 Max f = 12x 1 + 8x 2 5x 1 + 2x 2 ≤ 150 2x 1 + 3x 2 ≤ 100 x 1, x 2  0 4x 1 + 2x 2 ≤ 80 5x 1 + 2x 2 + s 1 = 150 Max f = 12x 1 + 8x 2 + 0s 1 + 0s 2 + 0s 3 2x 1 + 3x 2 + s 2 = 100 4x 1 + 2x 2 + s 3 = 80 x 1, x 2, s 1, s 2, s 3  0 pivot Variable x 1 ratio test pivoting Row 3 用 x 1 換 s 3 step 9 step 8 step 7 step 6 step 5 step 4 step 3 step 2 step 1 [N|B] = [b] xNxBxNxB Initial Feasible Solution NX N + BX B = [b] B -1 NX N + X B = B -1 [b]

4/17/20154 2.2 Simplex method’s example – cont’s 0 0 0 1 0 s2s2 0 0 0 0 0 1 s1s1 0 0812C j -f j ∑ i c Bi b i =0 000 fjfj 80 124 x B3 =s 1 c B3 =0 3 100 032 x B2 =s 2 c B2 =0 2 150 025 x B1 =s 1 c B1 =0 1 ii bibi s3s3 x2x2 x1x1 xBxB cBcB i 0812CjCj Row3/4 1 0.5 0 00.2520 0 2 0 1-0.560 0 -0.5 1 0-1.2550 -2*Row3+Row2 -5*Row3+Row1 12 6 0 03 ∑ i c Bi b i =240 0 2 0 0-3 step 9 step 8 step 7 step 6 step 5 step 4 step 3 step 2 step 1 step 9 step 8 step 7 step 6 step 5 step 4 step 3 step 2 step 1 Loop 1 Loop 2 Pivoting x B3 =x 1 c B3 =12 40 30 - 5x 1 + 2x 2 + s 1 = 150 2x 1 + 3x 2 + s 2 = 100 4x 1 + 2x 2 + s 3 = 80 x 1, x 2, s 1, s 2, s 3  0 Max f = 12x 1 + 8x 2 + 0s 1 + 0s 2 + 0s 3

4/17/20155 2.2 Simplex method’s example – cont’s CjCjCjCj 128000 icBcB xBxB x1x1 x2x2 s1s1 s2s2 s3s3 bibi iiii 1c B1 =0x B1 =s 1 0010.25-1.37565 2c B2 =8x B2 =x 2 0100.5-0.2530 3c B3 =12x B3 =x 1 100-0.250.3755 fjfj 128012.5 300 ∑ i c Bi b i =300 C j -f j 000-2.5 step 9 step 8 step 7 step 6 step 5step 4step 3 step 2 step 1 沒有大於 0 的值 x 1 = 5, x 2 = 30, Max f =300

4/17/20156 2.3 Summary for simplex method C1C1 C2C2.. C j..CnCn i cBcB xBxB x1x1 x2x2 x j *.. xnxn bibi iiii 1c B1 x B1 a 11 a 12 …a 1n b1b1 b 1 a 1j 2c B2 x B2 a 21 a 22 …a 2n b2b2 … ……… mc Bm x Bm a m1 a m2 a mn bmbm fjfj ∑ i c Bi a ij ∑ i c Bi b i C j -f j … a 11 x 1 + a 12 x 2 + … + a 1n x n = b 1 a 21 x 1 + a 22 x 2 + … + a 2n x n = b 2 …… a i1 x 1 + a i2 x 2 + … + a in x n = b i …… a m1 x 1 + a m2 x 2 + … + a mn x n = b m x 1, x 2, …, x n  0 Maximize f = C 1 x 1 + C 2 x 2 + … + C n x n

4/17/20157 2.3.1 simplex method example again (example from Topic 1) CjCjCjCj 1.51.2000 icBcB xBxB xaxa xgxg s1s1 s2s2 s3s3 bibi iiii 1c B1 =0x B1 =s 1 1.521001200 2c B2 =0x B2 =s 2 330102100 3c B3 =0x B3 =s 3 630013600 fjfj 00000 0 ∑ i c Bi b i =0 C j -f j 1.51.2000 800 700 600 Max f = 1.5x a + 1.2x g 1.5x a + 2x g ≤ 1200 3x a + 3x g ≤ 2100 x a, x g  0 6x a + 3x g ≤ 3600 Max f = 1.5x a + 1.2x g 1.5x a + 2x g + s 1 = 1200 3x a + 3x g + s 2 = 2100 x a, x g, s 1, s 2, s 3  0 6x a + 3x g + s 3 = 3600 標準化 6

4/17/20158 2.3.1 simplex method example again (cont’) CjCjCjCj 1.51.2000 icBcB xBxB xaxa xgxg s1s1 s2s2 s3s3 bibi iiii 1c B1 =0x B1 =s 1 1.521001200 2c B2 =0x B2 =s 2 330102100 3c B3 =1.5x B3 =x a 630013600 fjfj 00000 C j -f j 1.51.2000 66 1  (-3)+ 1/2 1/6 600 0 3/2-1/2 300  (-1.5)+ 0 -1/4 300 1.5 0 0.75 0.45 0.25 -0.25 900 ∑ i c Bi b i =900 – 200 1200 CjCjCjCj 1.51.2000 icBcB xBxB xaxa xgxg s1s1 s2s2 s3s3 bibi iiii 1c B1 =0x B1 =s 1 0-1/410 300 2c B2 =1.2x B2 =x g 0102/3-1/3200 3c B3 =1.5x B3 =x a 11/2001/6600 fjfj 1.50.7500 0.25 C j -f j 00.4500 -0.25 * 900 ∑ i c Bi b i =900 CjCjCjCj 1.51.2000 icBcB xBxB xaxa xgxg s1s1 s2s2 s3s3 bibi iiii 1c B1 =0x B1 =s 1 0011/6-1/3350 2c B2 =1.2x B2 =x g 0102/3-1/3200 3c B3 =1.5x B3 =x a 100-1/31/3500 fjfj1.51.200.90.1 C j -f j 000-0.9-0.1 990 ∑ i c Bi b i =990 1.5x g +s 2 － 0.5s 3 = 300 s 2 = 300 － 1.5x g +0.5s 3 s 2 /1.5= 300/1.5 － x g +(0.5/1.5)s 3 x g = 200 － 2s 2 /3 +s 3 /3 <<< i=2 x g = 1200 － 2x a +(1/3)s 3 <<< i=3 s 2 對目標函數值最沒貢獻， 所 以換成有貢獻的 x g ?

4/17/20159 C j -f j 是什麼 ? f j 與 C j -f j 是什麼 ? 5x 1 + 2x 2 + s 1 = 150 s 1 = 150 - 5x 1 - 2x 2 x 1 每增加 1 每個 s 1 就會減少 5 2x 1 + 3x 2 + s 2 = 100 4x 1 + 2x 2 + s 3 = 80 x 1 每增加 1 每個 s 2 就會減少 2 x 1 每增加 1 每個 s 3 就會減少 4 f j 是 x j 生產 basic var.s 的單位成本 C-f C j -f j 是 x j 當 basic var.s 後可創造的單位利益 s 2 = 100 - 2x 1 - 3x 2 s 3 = 80 - 4x 1 - 2x 2

Download ppt "4/17/20151 2. Simplex Method – standard form Key concept ： Change constraints from inequality to equality then find the solutions of the linear equations’"

Similar presentations