2 Simplex Method standard form Key conceptChange constraints

  • Slides: 9
Download presentation
2. Simplex Method – standard form Key concept:Change constraints from inequality to equality then

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 - 2 x 2 ≤ 4 加上slack variable ( 0) 使得等式成立 x 1 - 2 x 2 + s 1 = 4 x 1 + x 2 – s 2 = 3 Maximize f = 4 x 1 + 3 x 2 x 1 + x 2 ≤ 3 2 x 1 - x 2 3 11/23/2020 x 1 0, x 2 0 加上surplus variable ( 0) 使得等式成立 Maximize f = 4 x 1 + 3 x 2 標準化 x 1 + x 2 + s 1 =3 2 x 1 - x 2 - s 2 = 3 x 1, x 2, s 1, s 2 0 1

2. 1 The steps of Simplex Method 1. Transform into standard form. 2. Establish

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) Max 4. Calculate the cost fj of each xj to produce i objective benefit. 5. Calculate the pure objective benefit Cj – fj 1 of each xj under the current x. B. 6. Choose the max benefit producer xj* (the xj with max Cj – fj) as pivot variable. a 11 xc 1 1+x 1 a+ + a+1 ncxnnx= c 22 x+2 … +… 12 x n b 1 2 Simplex Tableau C 1 C 2 . . Cj. . Cn c. B x 1 x 2 . . xj*. . xn bi i c. B 1 x. B 1 a 12 … a 1 n b 1 a 1 j c. B 2 x. B 2 a 21 a 22 … a 2 n b 2 a 2 j amn bm bm amj 技術矩陣 7. Do the ratio test i = bi/aijof each x. Bi. … … Replace x. B* (the x. B having min i) with xj*. 8. Do pivoting (elementary row operations), m c. Bm x. Bm am 1 am 2 such that aij* = 1 (aij*: the coefficient in x. B*’s row and xj*’s column), and such that the other coefficients in xj*’s column ∑ic. Biaij fj are 0. ------ A new tableau is obtained. Cj-fj … 9. Repeat from 4. until no Cj – fj > 0. x 在目標函 B 數上的係數 11/23/2020 ∑ic. Bibi 目標函數值 2

2. 2 Simplex method’s example Max f = 12 x 1 + 8 x

2. 2 Simplex method’s example Max f = 12 x 1 + 8 x 2 + 0 s 1 + 0 s 2 + 0 s 3 Max f = 12 x 1 + 8 x 2 step 1 5 x 1 + 2 x 2 ≤ 150 step 2 2 x 1 + 3 x 2 ≤ 100 step 3 step 6 step 7 step 8 step 9 11/23/2020 2 x 1 + 3 x 2 4 x 1 + 2 x 2 ≤ 80 x 1, x 2 0 step 4 step 5 5 x 1 + 2 x 2 + s 1 i c. B Cj 12 x. B 8 0 0 + s 2 = 100 + s 3 = 80 x 1, x 2, s 1, s 2, s 3 0 0 bi i 0 150 30 1 0 100 50 0 0 1 80 20 0 0 ∑ic. Bibi=0 8 0 0 0 x 1 x 2 s 1 s 2 s 3 1 c. B 1=0 x. B 1=s 1 5 2 1 0 2 c. B 2=0 x. B 2=s 2 2 3 0 3 c. B 3=0 x. B 3=s 3 4 2 fj 0 Cj-fj 12 pivot Variable x 1 = 150 ratio test pivoting Row 3 用x 1換s 3 x [N|B] x = [b] Initial N = B-1[b] -1 Feasible B NX + X NXN +NBXBB= [b] Solution B 3

Max f = 12 x 1 + 8 x 2 + 0 s 1

Max f = 12 x 1 + 8 x 2 + 0 s 1 + 0 s 2 + 0 s 3 2. 2 Simplex method’s example – cont’s 5 x 1 + 2 x 2 + s 1 = 150 2 x 1 + 3 x 2 + s 2 = 100 4 x 1 + 2 x 2 + s 3 = 80 Pivoting x 1, x 2, s 1, s 2, s 3 0 Loop 1 step 2 step 3 step 4 step 5 step 6 step 7 step 8 step 9 Loop 2 step 1 step 2 step 3 step 4 step 5 step 6 step 7 step 8 Cj 12 8 0 0 0 s 3 step 9 i c. B x 1 x 2 s 1 s 2 1 c. B 1=0 x. B 1=s 1 50 -0. 5 2 1 0 150 -1. 25 50 0 2 c. B 2=0 x. B 2=s 2 20 32 0 1 -0. 5 0 3 cc. B 3 B 3=12 =0 x. B 3=x =s 1 41 0. 5 2 0 0 0. 25 1 fj 0 12 06 0 0 03 Cj-fj 0 12 82 0 0 -3 0 11/23/2020 bi i - -5*Row 3+Row 1 100 60 30 -2*Row 3+Row 2 80 20 40 Row 3/4 ∑ ∑icic. Bibbi=240 i=0 4

2. 2 Simplex method’s example – cont’s step 1 step 2 Cj step 3

2. 2 Simplex method’s example – cont’s step 1 step 2 Cj step 3 step 4 step 5 12 8 0 0 0 step 6 step 7 step 8 step 9 i c. B x 1 x 2 s 1 s 2 s 3 bi 1 c. B 1=0 x. B 1=s 1 0 0 1 0. 25 -1. 375 65 2 c. B 2=8 x. B 2=x 2 0 1 0 0. 5 -0. 25 30 3 c. B 3=12 x. B 3=x 1 1 0 0 -0. 25 0. 375 5 fj 12 8 0 1 2. 5 Cj-fj 0 0 0 -1 -2. 5 沒有大於 0的值 11/23/2020 i ∑ic. Bibi=300 x 1 = 5, x 2 = 30, Max f =300 5

2. 3 Summary for simplex method Maximize f = C 1 x 1 +

2. 3 Summary for simplex method Maximize f = C 1 x 1 + C 2 x 2 + … + Cnxn C 2 . . Cj. . Cn i c. B x 1 x 2 . . xj*. . xn bi i 1 c. B 1 x. B 1 a 12 … a 1 n b 1 a 1 j a 21 a 22 … a 2 n b 2 amn bm a 11 x 1 + a 12 x 2 + … + a 1 nxn = b 1 a 21 x 1 + a 22 x 2 + … + a 2 nxn = b 2 2 c. B 2 x. B 2 …… ai 1 x 1 + ai 2 x 2 + … + ainxn = bi … ……     am 1 x 1 + am 2 x 2 + … + amnxn = bm m c. Bm x 1, x 2, …, xn 0 11/23/2020 C 1 … am 1 am 2 fj ∑ic. Biaij Cj-fj … ∑ic. Bibi 6

2. 3. 1 simplex method example again (example from Topic 1) Max f =

2. 3. 1 simplex method example again (example from Topic 1) Max f = 1. 5 xa + 1. 2 xg 1. 5 xa + 2 xg ≤ 1200 1. 5 xa + 2 xg + s 1 標準化 3 xa + 3 xg ≤ 2100 6 xa + 3 xg ≤ 3600 xa, xg 0 Cj 1. 5 1. 2 i c. B x. B 3 xa + 3 xg + s 2 = 2100 6 xa + 3 xg + s 3 = 3600 xa, xg, s 1, s 2, s 3 0 0 xg s 1 s 2 s 3 1 c. B 1=0 x. B 1=s 1 1. 5 2 1 0 0 1200 800 2 c. B 2=0 x. B 2=s 2 3 3 0 1 0 2100 700 3 c. B 3=0 x. B 3=s 3 6 3 0 0 1 3600 0 0 ∑ic. Bibi=0 0 Cj-fj 1. 5 1. 2 bi i xa fj 11/23/2020 = 1200 600 7

2. 3. 1 simplex method example again (cont’) Cj 1. 5 1. 2 0

2. 3. 1 simplex method example again (cont’) Cj 1. 5 1. 2 0 0 0 c. B xa xg s 1 s 2 1 c. B 1=0 x. B 1=s 1 0 c. B 2=0 x. B 2=s 2 -1/4 2 3/2 3* 1 2 0 1. 5 03 0 1 x. B 3=xa 16 0 0 fj 1/2 3 1. 5 0 0. 75 0 0 0 Cj-fj 0 0. 45 1. 2 0 -0. 25 0 1. 5 x g 0+s 2-0. 5 s 3= 300 3 c. B 3=1. 5 s 3 bi -1/4 300 0 1200 i – i (-1. 5)+ -1/2 0 2100 300 200 (-3)+ 1/6 600 1200 1 3600 ? 6 0. 25 0 ∑ic. Bibi=900 i c. B x. BB xa xg s 1 1 c. B 1=0 x. B 1=s 11 0 -1/4 0 1 1. 5 xg= 300-s 2+0. 5 s 3 xg= 200-2 s 2 /3 +s 3/3 << i=2 0 =200 0 代表當s 2>0時xg的最大值, 目前xg的單位利益是 0. 45 s 2 x 的x s 3 = 1200-2 x bi i +(1/3)s g g a 3 << i=3 0 =-1/3 -1/4 300 a>0時xg的最大值 1/6 350 1200代表當x 2 c. B 2=1. 2 x. B 2=xgg 0 1 0 2/3 -1/3 200 3 c. B 3=1. 5 x. B 3=xaa 1 1/2 0 0 0 -1/3 1/6 1/3 1. 5 0. 75 1. 2 0 0 0. 9 0. 25 0. 1 600 500 ∑ic. Bibi=900 990 0 0 -0. 25 -0. 9 -0. 1 Cj 1. 5 1. 2 0 fjj 11/23/2020 C Cjj-f -fjj 0 0. 45 0 8