Presentation is loading. Please wait.

Presentation is loading. Please wait.

Variables that are unrestricted in sign LI Xiao-lei.

Similar presentations


Presentation on theme: "Variables that are unrestricted in sign LI Xiao-lei."— Presentation transcript:

1 Variables that are unrestricted in sign LI Xiao-lei

2 Preview In solving LPs with the simplex algorithm, we used the ratio test. In solving LPs with the simplex algorithm, we used the ratio test. The ratio test depended on the fact that any feasible point required all variables to be nonnegative. The ratio test depended on the fact that any feasible point required all variables to be nonnegative. If some variables are allowed to be unrestricted in sign (urs), the ratio test and therefore the simplex algorithm are no longer valid. If some variables are allowed to be unrestricted in sign (urs), the ratio test and therefore the simplex algorithm are no longer valid.

3 Preview For each urs variable x i, we begin by defining two new variables x i ’ and x i ’’. Then, substitute x i ’-x i ’’ for xi in each constraint and in the objective function. Also add the sign restrictions x i ’≥ 0 and x i ’’ ≥0. since all variables are now required to be nonnegative, we can proceed with the simplex. For each urs variable x i, we begin by defining two new variables x i ’ and x i ’’. Then, substitute x i ’-x i ’’ for xi in each constraint and in the objective function. Also add the sign restrictions x i ’≥ 0 and x i ’’ ≥0. since all variables are now required to be nonnegative, we can proceed with the simplex.

4 Preview For any basic feasible solution, each urs variable x i must fall into one of the following three cases: Case 1 x i ’> 0 and x i ’’= 0 Case 1 x i ’> 0 and x i ’’= 0 This case occurs if a bfs has x i >0. in this case, x i = x i ’ - x i ’’ = x i ’. Thus, x i = x i ’. For example, if x i =3 in a bfs, this will be indicated by x i ’ =3 and x i ’’ =0. Case 2 x i ’= 0 and x i ’’> 0 Case 2 x i ’= 0 and x i ’’> 0 This case occurs if x i <0. Since x i = x i ’ - x i ’’, we obtain x i =- x i ’’. For example, if x i =-5 in a bfs, we will have x i ’ =0 and x i ’’ =5. then x i =0-5=-5. Case 3 x i ’= x i ’’= 0 Case 3 x i ’= x i ’’= 0 In this case, x i = 0-0=0.

5 Example 7 A baker has 30 oz of flour and 5 packages of yeast. Baking a loaf of bread requires 5 oz of flour and 1 package of yeast. Each loaf of bread can be sold for 30¢. The baker may purchase additional flour at 4¢/oz or sell leftover flour at the same price. Formulate and solve an LP to help the baker maximize profits (revenues-costs). A baker has 30 oz of flour and 5 packages of yeast. Baking a loaf of bread requires 5 oz of flour and 1 package of yeast. Each loaf of bread can be sold for 30¢. The baker may purchase additional flour at 4¢/oz or sell leftover flour at the same price. Formulate and solve an LP to help the baker maximize profits (revenues-costs).

6 Example 7 SolutionDefine x 1 = number of loaves of bread baked x 1 = number of loaves of bread baked x 2 = number of ounces by which flour supply is increased by cash transactions x 2 = number of ounces by which flour supply is increased by cash transactions Therefore, x 2 >0 means that x 2 oz of flour were purchased, and x 2 0 means that x 2 oz of flour were purchased, and x 2 <0 means that – x 2 ounces of flour were sold. x 2 =0 means no flour was bought or sold. x 1 ≥0 and x 2 is urs.

7 Example 7 The appropriate LP is max z =30x 1 -4x 2 max z =30x 1 -4x 2 s.t. 5x 1 ≤30+x 2 (flour constraint) s.t. 5x 1 ≤30+x 2 (flour constraint) x 1 ≤ 5 (Yeast constraint) x 1 ≤ 5 (Yeast constraint) x 1 ≥0, x 2 urs x 1 ≥0, x 2 urs since x2 is urs, we substitute x2 ’ -x2 ’’ for x2 in the objective function and constraints. max z =30x 1 -4x 2 ’ +4x 2 ’’ s.t. 5x 1 ≤30+x 2 ’ -x 2 ’’ (flour constraint) s.t. 5x 1 ≤30+x 2 ’ -x 2 ’’ (flour constraint) x 1 ≤ 5 (Yeast constraint) x 1 ≤ 5 (Yeast constraint) x 1,x 2 ’,x 2 ’’ ≥0 x 1,x 2 ’,x 2 ’’ ≥0

8 Example 7 Transforming the objective function to row 0 form and adding slack variables to the two constraints, we obtain the initial tableau. z x1x1x1x1 x2’x2’x2’x2’ x 2 ’’ s1s1s1s1 s2s2s2s2rhs Basic variable ratio 1-304-4000z=0 0511030 s 1 =30 6 0①00015 s 2 =5 5* 2 2 Note: no matter how many pivots we make, the x 2 ’ column will always be the negative of the x 2 ’’ column.

9 Example 7 x 1 enters the basis in row 2. x 1 enters the basis in row 2. z x1x1x1x1 x2’x2’x2’x2’ x 2 ’’ s1s1s1s1 s2s2s2s2rhs Basic variable ratio 104-4030150z=150 00①1-55 s 1 =5 5* 0100015 x 1 =5 None x 2 ’’ enters the basis in row 1. x 2 ’’ enters the basis in row 1.z x1x1x1x1 x2’x2’x2’x2’ x 2 ’’ s1s1s1s1 s2s2s2s2rhs Basic variable 1000410170z=170 0011-55 x 2 ‘’ =5 0100015 x 1 =5

10 Example 7 The optimal solution to the baker ’ s problem is z=170, x 1 =5, x 2 ’’ =5, x 2 ’ =0,s 1 =s 2 =0. Thus, the baker can earn a profit of 170¢ by baking 5 loaves of bread. Since x 2 =x 2 ’-x 2 ’’=0-5=-5, the baker should sell 5 oz of flour.


Download ppt "Variables that are unrestricted in sign LI Xiao-lei."

Similar presentations


Ads by Google