190 likes | 338 Views
Maximize: 5 x 1 + 4 x 2 + 3 x 3 subject to: x 1 , x 2 , x 3 ≥ 0 and 2 x 1 + 3 x 2 + 1 x 3 ≤ 5 4 x 1 + 1 x 2 + 2 x 3 ≤ 11 3 x 1 + 4 x 2 + 2 x 3 ≤ 8 After one pivot: H N T = [4 2 3] X1 = 2.5 -1.5 X2 -0.5 X3 -0.5 X4
E N D
Maximize: 5 x1 + 4 x2 + 3 x3 • subject to:x1, x2 , x3 ≥ 0 and • 2 x1 + 3 x2 + 1 x3 ≤ 5 • 4 x1 + 1 x2 + 2 x3 ≤ 11 • 3 x1 + 4 x2 + 2 x3 ≤ 8 • After one pivot: HNT= [4 2 3] • X1 =2.5-1.5 X2 -0.5 X3 -0.5 X4 • X5 = 1.0+5.0 X2 +0.0 X3 +2.0 X4 • X6 = 0.5+0.5 X2 -0.5 X3 +1.5 X4 • What are HBT, CBT, CHT, AB, AH, xB and xHfor this dictionary? • 2. Solve for z: • (a) Solve ABT y = cB for y. • (b) z= yT b + [cNT - yT AN ] xN
Announcements: The deadline for grad lecture notes was extended to Friday Nov. 9 at 3:30pm. Assignment #4 is posted: Due Wed. Nov. 14. Nov. 12-14 is reading break. I plan on holding a Test #2 tutorial on Wed. Nov. 14 at 3:30pm, room TBA. Test #2 is on Thursday Nov. 15, in class. Mandatory attendance starts Mon. Nov. 19. A handout for the integer programming material is coming soon.
HBT = [1 5 6] AB = [2 0 0] [4 1 0] [3 0 1] cB= [5 0 0]T cN= [0 4 3]T xB= [x1x5 x6]T xN= [x4x2x3]T Current solution: xB= [2.5 1 0.5]T HNT= [4 2 3] AN = [1 3 1] [0 1 2] [0 4 2] Z= 12.5
2. Solve for z: • (a) Solve ABT y = cB for y. • ABT= • [2 4 3] [y1] [5] • [0 1 0] [y2] = [0] • [0 0 1] [y3] [0] • y= [2.5] • [ 0 ] • [ 0 ]
(b) z= yT b + (cNT- yT AN) xN • z= + • ([0 4 3]- • z = 12.5 – 2.5 x4 -3.5 x2 + 0.5 x3
The Revised Simplex Method uses more • work to determine the • z row coefficients, • the column that should enter, • and the pivot row number (exiting variable) • but then it takes less work to pivot.
The Revised Simplex Algorithm Step 1: Determine pivot column. Solve ABT y = cB for y. compute [cNT - yT AN] * xN to get coefficients of non-basic variables. Look for a positive coefficient, say r corresponding to non-basic xj.
Step 2: Determine the leaving variable. Solve for entering column d in current dictionary:d= AB-1 a where a is the entering column taken from the initial problem. Or equivalently, solve for d: AB d = a If tightest constraint corresponds to xleaving= v – t * xentering then the new value of xentering will be s= v/t.
Step 3: Update variables (xj enters, xk leaves). Update basic variables headers HBby replacing k with j. Update HN by replacing j with k. Set xj = s in the new solution. Plug this value for xj into the other equations to update the values of the other basic variables. The leaving variable will be 0. Recall r = the coefficient of xj in the z row: Set z = z + r s. Update AB, AN, cB, cN, xB, xN to match basis headers.
After the first iteration: HBT = [15 6] AB = [20 0] [41 0] [30 1] cB= [5 0 0]T cN= [0 4 3]T xB= [x1x5 x6]T xN= [x4x2x3]T Current solution: [5/2 1 1/2] HNT= [42 3] AN = [13 1] [01 2] [04 2] Z= 25/2
Step 1: Determine pivot column. Solve ABTy = cB for y. [2 4 3] [y1] [5] [0 1 0] [y2] = [0] [0 0 1] [y3] [0] y1= 2.5, y2=0, y3=0
Compute [cNT - yTAN] xNto get coefficients of non-basic variables. Look for a positive coefficient, say r corresponding to non-basic xj. [0 4 3]-[ 2.5 0 0][1 3 1] [0 1 2] [0 4 2] = [ -2.5 -3.5 0.5] The third variable should enter. Looking at xN, this is x3: xN= [x4 x2 x3]T r = 1/2
Step 2: Find pivot row. Solve AB d = a where a is column in A for entering variable xj. x3 is entering. [2 0 0] [d1] [1] [4 1 0] [d2] = [2] [3 0 1] [d3] [2] d = [0.5] [ 0 ] [0.5]
d = [0.5] [ 0 ] [0.5] Find the tightest constraint: Current solution is:[5/2 1 1/2]T x1 ≤5/2 - 0.5 x3⟹x3≤ 5 x5 ≤ 1 - 0 x3NO CONSTRAINT x6 ≤ 1/2 - 0.5 x3⟹x3≤ 1 (*) s=1 So the third basis variable exits. HBT= [1 5 6], x6 exits.
Pivot: The new basis value variables: x1 = 5/2 - 0.5 * 1 = 2 x5 = 1 - 0 * 1 = 1 x6 = 1/2 - 0.5 * 1 = 0 x3=1 z= 12.5 + r *s = 12.5 + 0.5*1= 13
After the second iteration: HBT = [15 3] AB = [2 0 1] [4 1 2] [3 0 2] cB= [5 0 3]T cN= [0 4 0]T xB= [x1x5x3]T xN= [x4x2x6]T Current solution: [21 1]T HNT= [4 2 6] AN = [1 3 0] [0 1 0] [0 4 1] Z= 13
Iteration 3: Step 1: Determine pivot column. Solve ABTy = cB for y. [2 4 3] [y1] [5] [0 1 0] [y2] = [0] [1 2 2] [y3] [3] y1= 1, y2=0, y3=1
Compute [cNT - yT AN] xN to get coefficients of non-basic variables. y1= 1, y2=0, y3=1 [0 4 0]- [1 0 1] = [ -1 -3 -1] All the coefficients are negative so the current solution is OPTIMAL
After 1 pivot: X1 = 2.5- 1.5 X2 - 0.5 X3 - 0.5 X4 X5 = 1.0+ 5.0 X2 + 0.0 X3 + 2.0 X4 X6 = 0.5+ 0.5 X2 - 0.5 X3 + 1.5 X4 ------------------------------------ z = 12.5- 3.5 X2 + 0.5 X3 - 2.5 X4 X3 enters. X6 leaves. After 2 pivots: X1 = 2.0- 2.0 X2 - 2.0 X4 + 1.0 X6 X5 = 1.0+ 5.0 X2 + 2.0 X4 + 0.0 X6 X3 = 1.0+ 1.0 X2 + 3.0 X4 - 2.0 X6 ------------------------------------- z = 13.0- 3.0 X2 - 1.0 X4 - 1.0X6 yi’s at each step: -(coeff. of xn+i)