Вы находитесь на странице: 1из 14

Lecture 6 and 7 Material

Instructor: K. Gita Ayu November 8, 2011

1
1.1

Matrix Form of Systems of Linear Equations


Review on Matrices and Systems of Linear Equations

Assume: BVi be the basic variable for row i of the optimal tableau, BV = {BV1 , BV2 , , BVm } is an mx1 vector and N BV is (n m) x 1 vector listing the nonbasic variables. cBV is the 1 x m row vector whose elements are the coecients of the basic variables and cN BV is the 1 x (n m) row vector whose elements are the coecientss of the nonbasic variables. an m x m matrix B is the matrix whose j-th column is the column for BVj . N is the m x (n m) matrix whose columns are the columns for the N BVi A is the matrix of the coecients of all of the constraints m x 1 column vector b is the rhs of the constraints. Write in the matrix format: z = cBV xBV + cNBV xNBV BxBV + NxNBV = b xBV , xNBV 0 Determining the optimal Tableau Multiply (2) by B 1 to obtain the optimal tableaus constraint B1 (BxBV + NxNBV ) = B1 b xBV + B1 NxNBV = B1 b By multiplying (3), the constraints of the optimal tableau, with vector cBV , we get cBV (xBV + B1 NxNBV ) = cBV B1 b cBV xBV + cBV B1 NxNBV = cBV B1 b Add (4) to (1), the original objective function, to get the optimal z-value z + (cBV xBV + cBV B1 NxNBV ) z + cBV B1 NxNBV = = cBV xBV + cNBV xNBV + cBV B1 b cNBV xNBV + cBV B1 b cNBV xNBV + cBV B1 b cBV B1 NxNBV cBV B1 b + cNBV xNBV cBV B1 NxNBV cBV B1 b + (cNBV cBV B1 N)xNBV 1 (5) (4) (3) (1) (2)

z = z = z =

Given xNBV = 0, the optimal z-value can be determined as cBV B1 b. Thus, The optimal objective function: with the optimal constraint tableau: z = cBV B1 b + (cNBV cBV B1 N)xNBV xBV + B1 NxNBV = B1 b

Example For the following LP, given the optimal basis is BV = {x2 , s2 }. Compute the optimal tableau! Max s.t. z = x1 + 4x2 x1 + 2x2 6 2x1 + x2 8 x1 , x2 0

Solution LP standard form: z = x1 + 4x2 x1 + 2x2 + s1 2x1 + x2 + s2 = = 6 8

BV = {x2 , s2 }, thus . . . B= 2 1 0 1 , B1 =
1 2

1 1

0 2

1 2 1 2

0 1

N=

1 2

1 0

b=

6 8

Calculate the optimal constraint tableau: xBV + B1 NxNBV = B1 b B1 N =


1 2 1 2 1 2 1 2

0 1 0 1

1 2 6 8

1 0 =

= 3 5

1 2 3 2

1 2 1 2

B1 b =

Calculate the optimal objective tableau: z = cBV B1 b + (cNBV cBV B1 N)xNBV z-value = cBV B1 b = cBV B1 N cNBV = 4 4 0 0
1 2 3 2

3 5

= 12
1 2 1 2

Thus, the optimal tableau is: z + x1 + 2s1 1 1 x1 + x2 + 2 s1 2


3 2 x1

= 12 = 3 = 5

1 s1 + s2 2

2
2.1

Duality
Dual of a Normal LP

Let refer the given LP as the primal. Associated with any LP is another LP, called the dual. The relationship between primal and its dual gives economic insights as well as provides additional insights into sensitivity analysis. Quick fact about duality: A normal max LP problem if all variables are required to be nonnegative and all constraints are constraints. A normal min LP problem if all variables are required to be nonnegative and all constraints are constraints. The primal can be read across and the dual is found by reading down.

Example: Dakota Problem Revisited Primal: max z = s.t. 60x1 + 30x2 + 20x3 8x1 + 6x2 + x3 4x1 + 2x2 + 1.5x3 2x1 + 1.5x2 + .5x3 x1 , x2 , x3 Dual: min w = 48y1 + 20y2 + 8y3 s.t. 8y1 + 4y2 + 2y3 60 6y1 + 2y2 + 1.5y3 30 y1 + 1.5y2 + .5y3 20 y1 , y2 , y3 0 48 20 8 0 y1 y2 y3

Example: Diet Problem Revisited Primal: min z = .5B + .2C + .3K + .8P s.t. 400B + 200C + 150K + 500P 500 3B + 2C 2B + 2C 2B + 4C + 4K +K + 4P + 5P 6 10 8 0 y1 y2 y3 y4

B, C, K, P

Dual: max w = 500y1 + 6y2+ 10y3 + 8y4 s.t. 400y1 + 3y2 + 2y3 + 2y4 .5 200y1 + 2y2 + 2y3 + 4y4 .2 150y1 500y1 + 4y3 + y4 .3 + 4y3 + 5y4 .8 y1 , y2 , y3 , y4 0

2.2

Dual of a Non-normal LP

For the non-normal LP, we proceed as follows for max (min) LP: 1. Normalize the constraints by multiply each () constraint by 1, converting it into a () 2. Replace each equality constraint by two inequality constraints then convert the () constraint to a () constraint 3. Replace each urs variable xi by xi = xi xi Example 1 max z =2x1 + x2 s.t. x1 + x2 = 2x1 x2 x1 x2 x1 0, x2 urs Steps: 1. The rst constraint: x1 + x2 = 2 is an equality. It has to be split into two inequalities: x1 + x2 2 x1 + x2 2, Multiply it with 1 to transform it to a normal max LP: x1 x2 2 2. The second constraint: 2x1 x2 3. Transform it into a normal max LP by multiplying 1 to the constraint to get: 2x1 + x2 3 3. The third constraint: OK 4. x1 0, OK 5. x2 urs, introduce new variables: x2 = x2 x2 6. Now rewrite the whole LP: max z =2x1 + x2 x2 s.t. x1 + x2 x2 x1 x2 + x2 2x1 + x2 x2 x1 x2 + x2 x1 , x2 , x2 4 2 2 3 1 0 : y1 : y1 : y2 : y3 2 3 1

7. The dual is: min w = 2y1 2y1 3y2 + y3 s.t.y1 y1 2y2 + y3 y1 y1 + y2 y3 y1 + y1 y2 + y3 y1 , y1 , y2 , y3 2 1 1 0 (6) (7)

8. Observe equation (6) and (7). These two equations are similar to an equality constraint transformed into two inequality constraints. Thus, combining these two equations to get y1 y1 + y2 y3 = 1. We can conclude now that if the primal is a urs variable then the dual will be an equality constraint. 9. Observe the y1 and y1 constraints in the primal. They represent one constraint in the original primal. Look at the dual in a horizontal way, it is as if we have y = y1 y1 which means y is urs. Thus, we can conclude that if we have an equality constraint in the primal, the dual will be urs variable. 10. Lastly, rewrite the dual into the primal, we get 2x1 + x2 3, which is the 1 of the actual constraint. By multiplying 1 to the y2 variable, the dual of the dual will now be the primal constraint. In other words, y2 0 and all of the coecients of y2 variable shall be negatatived, otherwise it will no longer represent the original LP. 11. Finally, rewrite the dual (assume y = y1 ): min w = 2y1 + 3y2 + y3 s.t. y1 + 2y2 + y3 y1 y2 y3 y1 urs, y2 0, y3 Always KISS, simplify your dual! Example 2 min w = 2y1 + 4y2 + 6y3 s.t. y1 + 2y2 + y3 y1 2y1 + y2 y1 urs, y2 , y3 Steps: 1. Rewrite the whole LP: min w = 2y1 2y1 + 4y2 + 6y3 s.t. y1 y1 + 2y2 + y3 y1 y1 y3 y2 + y3 y2 y3 2y1 + 2y1 y2 y1 , y1 , y2 , y3 5 2 1 1 1 3 0 : x1 : x1 : x2 : x2 : x3 y3 y2 + y3 2 1 = 1 3 0 2 = 1 0

2. The dual is: max z = 2x1 + x1 + x2 x2 3x3 s.t. x1 + x1 2x3 x1 x1 + 2x3 2x1 + x2 x2 x3 x1 x1 + x2 x2 x1 , x1 , x2 , x2 , x3 3. Simplify it: max z = 2x1 + x1 + x2 + 3x3 s.t. x1 + x1 2x1 x1 x1 + x2 x1 , x1 0, x2 urs, x3 + 2x3 + x2 + x3 = 2 : y1 : y2 : y3 4 6 0 2 2 4 6 0

2.3

Summary

To nd the dual of a max problem: If the i-th primal constraint is a constraint, the corresponding dual variable yi must satisfy yi 0 If the i-th primal constraint is a constraint, the corresponding dual variable yi must satisfy yi 0 If the i-th primal constraint is an equality, then the dual variable yi must be urs If the i-th primal variable is urs, then the i-th dual constraint will be an equality If the i-th primal variable is 0, then i-th dual constraint will be ci If the i-th primal variable is 0, then i-th dual constraint will be ci To nd the dual of a min problem: If the i-th primal constraint is a constraint, the corresponding dual variable yi must satisfy yi 0 If the i-th primal constraint is a constraint, the corresponding dual variable yi must satisfy yi 0 If the i-th primal constraint is an equality, then the dual variable yi must be urs If the i-th primal variable is urs, then the i-th dual constraint will be an equality If the i-th primal variable is 0, then i-th dual constraint will be ci If the i-th primal variable is 0, then i-th dual constraint will be ci

2.4

Dual Interpretation

Revisit the Dakota Problem. Primal: max z = s.t. 60x1 + 30x2 + 20x3 8x1 + 6x2 + x3 4x1 + 2x2 + 1.5x3 2x1 + 1.5x2 + .5x3 x1 , x2 , x3 48 (max board ft of lumber can be used) 20 (available nishing hours) 8 0 (available carpentry hours) y1 y2 y3

Where: x1 = # desks manufactured x2 = # tables manufactured x3 = # chairs manufactured Dual: min w = 48y1 + 20y2 + 8y3 s.t. 8y1 + 4y2 + 2y3 6y1 + 2y2 + 1.5y3 y1 , y2 , y3 0 60 (Desk constraint) 30 (Table constraint)

y1 + 1.5y2 + .5y3 20 (Chair constraint)

Economic interpretation of the dual of a maximization problem: 1. Suppose an entrepreneur must determine the price he or she is willing to pay for a unit of each of Dakotas resources. Dene: y1 = price paid for 1 board of lumber y2 = price paid for 1 nishing hour y3 = price paid for 1 carpentry hour 2. The total price that should be paid for all of the resources is 48y1 + 20y2 + 8y3 (we need to pay 48 boards of lumber, 20 nishing hours, and 8 carpentry hours) and we want to minimize it. This is the objective function of the dual 3. An entrepreneur must oer Dakota at least $60 for a combination of resources for producing a desk to induce Dakota to sell. At least $60 (the price of a desk) must be paid for the resources needed to produce a desk, which is 8y1 + 4y2 + 2y3 60. 4. In summary, when the primal is a normal max problem, the dual variables are related to the value of the resources available to the decision makers. This is why the dual price is often referred as resource shadow price

Revisit the Diet Problem. Primal: min z = .5B + .2C + .3K + .8P s.t. 400B + 200C + 150K + 500P 3B + 2C 2B + 2C 2B + 4C + 4K +K + 4P + 5P 500 (min daily calories intake) 6 10 8 0 (min daily sugar intake) (min daily fat intake) y1 y3 y4 (min daily chocolate intake) y2

B, C, K, P

Where: B = # brownies consumed daily C = # scoops of chocolate ice cream consumed daily K = # bottles of cola consumed daily P = # pieces of pineapple cheesecake consumed daily Dual: max w = 500y1 + 6y2+ 10y3 + 8y4 s.t. 400y1 + 3y2 + 2y3 + 2y4 .5 200y1 + 2y2 + 2y3 + 4y4 .2 150y1 500y1 + 4y3 + y4 .3 + 4y3 + 5y4 .8 y1 , y2 , y3 , y4 0

Economic interpretation of the dual of a minimization problem: 1. Suppose a nutrient salesperson sells calories, chocolate, sugar, and fat and she wants to ensure that a dieter will meet all of his or her daily requirements by purchasing calories, sugar, fat, and chocolate.

She must dene: y1 y2 y3 y4

= = = =

price price price price

per per per per

calorie to charge dieter ounce of chocolate to charge dieter ounce of sugar to charge dieter ounce of fat to charge dieter

2. Thus, the total revenue that she can obtain from selling the dieter the daily ration of required nutrients is 500y1 + 6y2 + 10y3 + 8y4 (revenue for selling 500 calories, 6 oz. of chocolate, 10 oz. of sugar, and 8 oz. of fat) and she wants to minimize the revenue. This is the objective function of the dual. 3. However, she needs to set prices low enough so that it will be in the dieters economic interest to purchase all nutrients from her. By purchasing a brownie for 50, the dieter can obtain 400 calories, 3 oz. of chocolate, 3 oz. of sugar, and 2 oz. of chocolate. Thus, the salesperson cannot charge more than 50 for this combination of nutrients.

2.5

The Dual Theorem

Weak Duality Theorem Lemma 1 Choose any feasible solution to the primal and any feasible solution to the dual, the w-value for the feasible dual solution will be at least as large as the z-value for the feasible primal solution. Lemma 2 Choose a feasible solution to the primal and a feasible solution to the dual. If the z-value and w-value are the same, then the feasible solution for the primal is optimal and so does the feasible solution for the dual. Lemma 3 If the primal is unbounded, the dual problem is infeasible. Lemma 4 If the dual is unbounded, the primal is infeasible. Dual Theorem: Suppose BV is an optimal basis for the primal. Then cBV B1 is an optimal solution to the dual (z-value = w-value).

2.6

How to Read the Optimal Dual Solution

If primal is a maximization problem Optimal value of dual variable yj = coecient of si in optimal row 0 if constraint i is a constraint. Optimal value of dual variable yj = coecient of si in optimal row 0 if constraint i is a constraint. Optimal value of dual variable yj = coecient of si in optimal row 0 minus M if constraint i is an equality constraint. If primal is a minimization problem Optimal value of dual variable yj = coecient of si in optimal row 0 if constraint i is a constraint. Optimal value of dual variable yj = coecient of si in optimal row 0 if constraint i is a constraint. Optimal value of dual variable yj = coecient of si in optimal row 0 plus M if constraint i is an equality constraint. Example 1 primal: Max z = 3x1 + 2x2 + 5x3 s.t. x1 + 3x2 + 2x3 15 2x2 x1 , x2 , x3 0 x3 5 2x1 + x2 5x3 = 10 dual: Min w = 15y1 + 5y2 + 10y3 s.t. y1 + 2y3 3 3y1 + 2y2 + y3 2 2y1 y2 5y3 2 y1 0, y2 0, y3 urs

Optimal tableau: z x1 x2 x3 1 0 0 0 1 0 0 1 0 0 1 0 0

s1
51 23 4 23 2 23 9 23

s2
58 23 5 23 9 23 17 23

a2
M 58 23 5 23 9 23

a3
M +9 23 2 23 1 23 7 23

rhs
565 23 15 23 65 23 120 23

BV z= x3 x2 x1
565 23

17 23

Optimal solution: Primal: z = 565/23, x1 = 120/23, Dual: w = 565/23, y1 = 51/23, Example 2 primal: Min w = 3y1 + 2y2 + y3 s.t. y1 + y2 + y3 4 y2 y3 2 y1 + y2 + 2y3 = 6 y1 , y2 , y3 0 dual: Max z = 4x1 + 2x2 + 6x3 s.t. x1 + x3 3 x1 + x2 + x3 2 x1 x2 + 2x3 1 x1 0, x2 0, x3 urs x2 = 65/23, x3 = 15/23 y2 = 58/23, y3 = 9/23

Optimal tableau: z y1 y2 y3 1 -1 0 0 1 1 0 -1 0 0 0 0 1 Optimal solution:

s1 -3 -2 3 1

s2 0 0 1 0

a1 3M 2 -3 -1

a3 1 M -1 2 1

rhs 6 2 2 2

Primal: w = 6, y1 = 0, y2 = 2, y3 = 2 Dual: z = 6, x1 = 3, x2 = 0, x3 = 1 Dual can be found through: z-value = w-value = 6 x1 is the dual variable for the rst constraint which is represented as s1 with value of 3 x2 is the dual variable for the second constraint which is represented as s2 with value of 0 x3 is the dual variable for the third constraint which is represented as a3 with value of 1 M . Considering this is an articial variable, we have to add +M which result in 1.

10

2.7

Complementary Slackness

Let x = {x1 , x2 , . . . , xn } be a feasible primal solution and y = {y1 , y2 , . . . , yn } be a feasible dual solution. Let s1 , s2 , . . . , sn be the slack variables for the primal and e1 , e2 , . . . , en be the excess variables of the dual. Then x is the primal optimal and y is the dual optimal i si yi = 0 for (i = 1, 2, . . . , m) and ej xj = 0 for (j = 1, 2, . . . , n). Use complementary slackness to nd the optimum solution for the dual given the primal and vice versa. Revisit the Dakota problem Optimal tableau: z x1 x2 x3 1 0 0 0 0 0 -2 0 0 0 -2 1 0 1 1.25 0 0 0 1 0

s1 0 1 0 0 0

s2 10 2 2 -.5 0

s3 10 -8 -4 1.5 0

rhs 280 24 8 2 5

BV z = 280 s1 = 24 x3 = 8 x1 = 2 s4 = 5

Optimal solution for the primal is x1 = 2, x2 = 0, x3 = 8, s1 = 24, s2 = 0, s3 = 0 with z = 280 Since y1 = 0, solve these two equations 2y2 + 1.5y3 = 30 and 1.5y2 + .5y3 = 20 to get y2 = 10 = y3 We know that x1 and x3 is not zero, thus the e1 and e3 should be zero Optimal solution for the dual is e1 = 0, e2 = 5, e3 = 0, y1 = 0, y2 = 10, y3 = 10 with w = 280 Primal: z = 280, x1 = 2, x2 = 0, x3 = 8 s1 = 24 s2 = 0 s3 = 0 Dual: w = 280,e1 = 0, e2 = 5, e3 = 0 y1 = 0 y2 = 10 y3 = 10 The multiplication between primal variables and dual excess and slack with dual variables are zeroes (complementary slackness says, si yi = 0 and ei xi = 0), and it is proven.

Sensitivity Analysis

Revisit the Dakota problem: z 60x1 30x2 20x3 8x1 + 6x2 + x3 + s1 + s2 + s3 4x1 + 2x2 + 1.5x3 2x1 + 1.5x2 + .5x3 = = = = 0 48 20 8

Optimal tableau can be seen as follows with: BV = {s1 , x3 , x1 }, N BV = {x2 , s2 , s3 } and the optimal bfs is z = 280, x1 = 2, x2 = 0, x3 = 8, s1 = 24, s2 = 0, s3 = 0.

11

z 1 0 0 0 0

x1 0 0 0 1 0

x2 0 -2 -2 1.25 1

x3 0 0 1 0 0

s1 0 1 0 0 0

s2 10 2 2 -.5 0

s3 10 -8 -4 1.5 0

rhs 280 24 8 2 5

BV z = 280 s1 = 24 x3 = 8 x1 = 2 s4 = 5

3.1

Changing the objective function coecient of a NBV

How would a change in c2 aect the optimal solution to the Dakota problem? What values of c2 would BV remains optimal? Let c2 to be (30 + ) Find the new coecient of the objective function for N BV : 6 cBV B1 Nx2 cx2 = 0 10 10 2 30 + = 5 5 Remains optimal if c2 = 5 0 or 5 The reduced cost for a nonbasic variable (in a max problem) is the maximum amount to buy in which the variables objective function coecient can be increased before the current basis becomes suboptimal and it becomes optimal for the nonbasic variable to enter the basis

3.2

Changing the objective function coecient of a BV

How would a change in c1 aect the optimal solution to the Dakota problem? What values of c1 would BV remains optimal? Let c1 to be (60 + ) Find the new coecient of the objective function for BV: 1 2 8 2 4 = 0 10 .5 cBV B1 = 0 20 60 + 0 0 .5 1.5 cBV B1 N cNBV = = 0 10 .5 10 + 1.5 6 0 0 2 1 0 1.5 0 1

10 + 1.5

30

5 + 1.25

10 .5

10 + 1.5

True i all 0, we have: 5 + 1.25 0 true i 10 .5 0 true i 10 + 1.5 0 true i 4 20 20 3

12

Thus, as long as 4 20, the current basis will remain optimal. For any simplex tableau, B 1 is the m x m matrix consisting of the columns in the current tableau that correspond to the initial tableau set of basic variables (taken in the same order).

3.3

Changing the rhs

As long as the rhs of each constraint in the optimal tableau remains nonnegative, the current basis remains feasible and optimal. If at least one rhs in the optimal tableau becomes negative, the current basis is no longer feasible and therefore no longer optimal. How changing the amount of nishing hours (b2 ) aects the optimal solution to the Dakota problem? 1 B1 b = 0 0 2 8 48 24 + 2 2 4 20 + = 8 + 2 .5 1.5 8 2 .5

As long as all 0, the current basis remains optimal. 24 + 2 0 true i 8 + 2 0 true i 2 .5 0 true i 12 4 4

Thus, as long as 4 4, the current basis will remain optimal. The current basis remains optimal but the values of the decision variables and z changes Suppose the nishing s1 x3 = B1 b = x1 hours is now 22, the new decision variables: 48 28 1 2 8 0 2 4 22 = 12 8 1 0 .5 1.5

Meaning Dakota will manufacture 12 chairs and 1 desk. 48 The new z-value = cBV B1 b = 0 10 10 22 = 300 8

3.4

Changing the Column of a NBV

Suppose a table required 5 board feet of lumber, 2 nishing hours, and 2 carpentry hours. The price of tables increased to $43. Would this change the optimal solution to the Dakota Problem? Compute the new coecient of x2 (table) 5 cBV B1 Nx2 cx2 = 0 10 10 2 [43] = 3 2

13

Since c2 < 0, the current basis is no longer optimal which means manufacturing a table will increases revenues by $3, x2 will leave the basis.

3.5

Adding a New Activity

Suppose that Dakota is considering making footstools. A stool sells for $15 and requires 1 board foot of lumber, 1 nishing hour, and 1 carpentry hour. Should the company manufacture any stools? Dene x4 = # footstools manufactured by Dakota Revise the initial tableau: z 60x1 30x2 20x3 15x4 8x1 + 6x2 + x3 + x4 + s1 + s2 + s3 4x1 + 2x2 + 1.5x3 + x4 2x1 + 1.5x2 + .5x3 + x4 Must compute c4 in the optimal tableau: 1 cBV B1 Nx4 cx4 = 0 10 10 1 [15] = 5 1 Since c4 is 0, the current basis remains optimal. Meaning each stool manufactured will decrease revenues by $5, therefore we do not choose producing any footstools. = = = = 0 48 20 8

14

Вам также может понравиться