Professional Documents
Culture Documents
Micha Kulej
The development of the potential and academic programmes of Wrocaw University of Technology
OPERATIONS RESEARCH
BIS
1 / 41
The linear programming problem in which all constraints are () with nonnegative right-hand sides offers a all-slack starting basic feasible solution. Problems with (=) and/or () constraints need to use articial variables to the beginning of simplex algorithm. There are two methods: the M-method(also called the Big M-method) and the Two-Phase method.
OPERATIONS RESEARCH
BIS
2 / 41
Example
max Z = 2x1 + x2 3x3 x1 + x2 + x3 6 2x1 + x2 = 14 x1 , x2 , x3 0 After converting to standard form we have: max Z = 2x1 + x2 3x3 x1 + x2 + x3 s1 = 6 2x1 + x2 = 14 x1 , x2 , x3 , s1 0
OPERATIONS RESEARCH
BIS
3 / 41
The above system of equations is not in basic form - there is not a basic variable in each equation. If the equation i does not have a slack (or a variable that can play the role of a slack), an articial variable, ai , is added to form a starting solution similar to the all-slack basic solution. However, because the articial variables are not part of the original linear model, they are assigned a very high penalty in the objective function, thus forcing them (eventually) to equal zero in the optimal solution. In the considering example we add two articial variables a1 and a2 .
OPERATIONS RESEARCH
BIS
4 / 41
OPERATIONS RESEARCH
BIS
5 / 41
It is enough to add only one articial variable : max Z = 2x1 + 2x2 Ma2 s1 +6x1 + 4x2 = 24 a2 +x1 s2 = 5 x1 , x2 , s1 , s2 0
OPERATIONS RESEARCH
BIS
8 / 41
cB BV 0 s1 M a2 Z
cB BV 2 x1 M a2 Z
1 6M
1 3
a2 x1 0 1 1 0 0 0
x2
2 3 2 3
2 3M
2 3
s2 Solution 0 4 1 1 M M + 8
The last simplex tableau is optimal - all Z - row coefcients are nonnegative. The articial variable a2 is basic variable with positive value so the problem is not consistent - it has no feasible solutions.
OPERATIONS RESEARCH
BIS
9 / 41
OPERATIONS RESEARCH
BIS
10 / 41
Example
We use this method to solve the following problem: max Z = 4x1 + x2 3x1 + x2 = 3 4x1 + 3x2 6 x1 + 2x2 4 x1 , x2 0 Using s2 as a surplus in the second constraint and s3 as a slack in the third constraint, the standard form of the problem is given as: max Z = 4x1 + x2 3x1 + x2 = 3 4x1 + 3x2 s2 = 6 x1 + 2x2 + s3 = 4 x1 , x2 , s2 , s3 0
Micha Kulej (Wroc Univ. of Techn.) OPERATIONS RESEARCH BIS 11 / 41
Taking a1 , a2 , s3 as a basic variables and using formula (2) for computing coefcients of Z a - row we obtain the rst simplex tableau: cB BV 1 a1 1 a2 0 s3 Za
Micha Kulej (Wroc Univ. of Techn.)
x1 x2 s2 a1 a2 s3 Solution 3 1 0 1 0 0 3 4 3 1 0 1 0 6 1 2 0 0 0 1 4 7 4 1 0 0 0 9
OPERATIONS RESEARCH BIS 12 / 41
s3 Solution 3 0 5 3 6 0 5 5 1 1 1 1 1 1 0 0
a1
a2 1 5
Because minimum Z a = 0. Phase I produces the basic feasible 6 3 , x2 = 5 , s3 = 1. We can eliminate columns for a1 and solution x1 = 5 a2 from tableau and move to Phase II.
OPERATIONS RESEARCH
BIS
13 / 41
Phase II
After deleting the articial columns, we write the original problem as max Z = 4x1 + x2 3 = 5 x1 +1 5 s2 6 x2 3 = 5 5 s2 s2 +s3 = 1 x1 , x2 , s2 , s3 0 Now we can begin the simplex algorithm with the following simplex tableau: cB BV x1 x2 s2 s3 Solution 1 3 0 4 x1 1 0 5 5 6 3 1 x2 0 1 5 0 5 0 s2 0 0 1 1 1 1 18 0 Z 0 0 5 5 Because we are maximizing, this is the optimal tableau. The optimal 18 3 , x2 = 6 solution is x1 = 5 5 and Z = 5 .
Micha Kulej (Wroc Univ. of Techn.) OPERATIONS RESEARCH BIS 14 / 41
Step 1. Select a zero articial variable to leave the basic solution (choosing the leaving variable) and designate its row as the pivot row. The entering variable can be any nonbasic variable with a nonzero(positive or negative) coefcient in the pivot row. Perform the associated simplex iteration. Step 2. Remove the column of the (just-leaving) articial variable from the tableau. If all the zero articial variables have been removed, go to Phase II. Otherwise, go back to Step 1. Remark All commercial packages use the two-phase method to solve linear programming problems.
Micha Kulej (Wroc Univ. of Techn.) OPERATIONS RESEARCH BIS 15 / 41
Sensitivity Analysis
The optimal solution of the model is x1 = 20, x2 = 60 with Z = 180. We want to determine the range of values of parameter (i.e. coefcient of objective function - unit price of product W1 in our example ) over which the optimal solution remain unchanged.
Micha Kulej (Wroc Univ. of Techn.) OPERATIONS RESEARCH BIS 16 / 41
Sensitivity Analysis
Let us assumed that unit price of W 1 equals 3 + . Then we have: cB BV 3 + x1 2 x2 0 s3 Z s1 s2 s3 x1 x2 Solution 1 1 0 1 0 20 1 2 0 0 1 60 1 1 1 0 0 20 1 + + 1 0 0 0 180
OPERATIONS RESEARCH
BIS
17 / 41
Sensitivity Analysis
The optimal solution remains optimal as long as all the Z row coefcients are nonnegative, so we get: 1+ 0 + 1 0 Solving these system inequalities we obtain that [1, 1]. Thus optimal solution will remain optimal for values of price of W1 belonging to the interval [2,4].
OPERATIONS RESEARCH
BIS
18 / 41
Sensitivity Analysis
OPERATIONS RESEARCH
BIS
19 / 41
Sensitivity Analysis
OPERATIONS RESEARCH
BIS
20 / 41
Sensitivity Analysis
The inverse matrix we could obtain from the optimal simplex tableau. It is consisting of the columns in the optimal tableau that correspond to the initial basic variables BV = {s1 , s2 , s3 }(taking in the same order): 1 1 1 0 2 1 0 1 1 0 = 1 2 0 1 1 1 1 0 1
OPERATIONS RESEARCH
BIS
21 / 41
Sensitivity Analysis
Hence we get: 0 100 + 1 1 0 0 1 2 0 80 0 40 1 1 1 For the current set of basic variable (basis) to remain optimal we require that the following system of inequalities holds: 20 + 0 60 0 20 0 The solution remains optimal (basic variable x1 , x2 , s3 ) as long as [20, 20] or if between 80 and 120 row material S 1 (b1 [80, 120], where the current amount is b1 = 100) are available.
OPERATIONS RESEARCH
BIS
22 / 41
Dual Problem
Associated with any linear programming problem is another linear problem, called the dual problem (Dual in short). Now we explain how to nd the dual problem to the given LPP, we discuss the economic interpretation of the dual problem and we discuss the relation that exist between an LPP (called Primal) and its dual problem. We consider the LPP with normal (canonical) form : max Z = c1 x1 + c2 x2 + + cn xn a11 x1 a21 x1 . . . + + a12 x2 a22 x2 . . . + + + + a1n xn a2n xn . . . b1 b2
am1 x1 + am2 x2 +
+ amn xn bm
Dual Problem
The dual problem is dened as follows: min W = b1 y1 + b2 y2 + + bm ym a11 y1 + a21 y2 + a12 y1 + a22 y2 + . . . . . . a1n y1 + a2n y2 + + am1 ym c1 + am2 ym c2 . . . + amn ym cn
yi 0 (i = 1, 2, . . . , m)
OPERATIONS RESEARCH
BIS
24 / 41
Dual Problem
(ym 0) ym
b1 b2 . . . bm
OPERATIONS RESEARCH
BIS
25 / 41
Dual Problem
Example
The Furniture Company STYLE manufactures tables and chairs. A table sells for $160, and chair sells for $200. The demand for tables and chairs is unlimited. The manufacture of each type of furniture require labor, lumber, and inventory space. The amount of each resource needed to make tables and chairs and daily limit of available resources is given in the following table:
Resource Labor(hours) Lumber((feet )3 ) Inventory space((feet )2 ) Resources needed Table Chair 2 4 18 18 24 12 Amount of resource available(hours) 40 216 240
OPERATIONS RESEARCH
BIS
26 / 41
Dual Problem
Dual Problem
Dual Problem
Dual Problem
We illustrate how to nd the dual problem on the following example: max z = 2x1 + x2 x1 + x2 = 2 2x1 x2 3 x1 x2 1 x1 0 x2 Unrestricted min w = 2y1 + 3y2 + y3 y1 - Unrestricted y2 0 y3 0 y1 + 2y2 + y3 2 y1 y2 y3 = 1.
OPERATIONS RESEARCH
BIS
30 / 41
Dual Problem
OPERATIONS RESEARCH
BIS
31 / 41
Dual Problem
Primal-Dual Relationships
Dual Problem
Primal-Dual Relationships
Property
= (x = (y 1 , x 2 , . . . , x n ) and y 1 , y 2 , . . . , y m ) are feasible solutions of If x primal problem and dual problem respectively such that m = W , then x 2 + . . . + bm y 1 + b2 y n = b1 y 2 + . . . + cn x 1 + c2 x Z = c1 x must be optimal must be optimal solution for primal problem and y solution for dual problem.
Property
If the primal(dual) is unbounded, then the dual(primal) problem is infeasible.
OPERATIONS RESEARCH
BIS
33 / 41
Dual Problem
Primal-Dual Relationships
Duality Theorem
Theorem
The following are only possible relations between the primal and dual problems:
1
If one problem has feasible solutions and a bounded objective function(and so has optimal solution), then so does the other problem. If one problem has feasible solutions and an unbounded objective function(and so no optimal solution), then the other problem has no feasible solutions. If one problem has no feasible solutions, then the other problem has either no feasible solution or an unbounded objective function.
OPERATIONS RESEARCH
BIS
34 / 41
Dual Problem
Primal-Dual Relationships
Now we can give an interpretation of the dual problem for of primal maximization problem. We know that for optimal solutions x of dual problem the following equality holds: problem and y m = W 2 + . . . + bm y 1 + b2 y n = b1 y 2 + . . . + cn x 1 + c2 x Z = c1 x i can be interpreted as the contribution to prot by having So each bi y bi units of resource i available for the primal problem. Thus, the i (it is called shadow price) is interpreted as the optimal dual variable y contribution to prot per unit of resource i (i = 1, 2, . . . , m).
OPERATIONS RESEARCH
BIS
35 / 41
Dual Problem
Reading Optimal Dual from Z-row of Optimal Simplex Tableau for STYLE
After solving primal problem by simplex method we could read the optimal dual solution from the optimal simplex tableau. Let us consider the LPP for rm STYLE. The optimal simplex tableau is as follows:
Table: Optimal simplex tableau
s1 200 160 0 x2 x1 s3 Z
1 2 1 2
s2 1 18
1 9
6 20
-2
20 3
s3 0 0 1 0
x1 0 1 0 0
x2 1 0 0 0
8 4 48 2240
The basic variables are ZB = {x2 , x1 , s3 } and the basis is 1 1 4 2 0 2 18 0 1 1 B = 18 18 0 . Inverse matrix for B is: B1 = 2 9 0 12 24 1 6 2 1
Micha Kulej (Wroc Univ. of Techn.) OPERATIONS RESEARCH BIS
36 / 41
Dual Problem
0 1 = (20, 20 , 0). 9 0 3 2 1
where the vector cB contains the coefcients of objective function corresponding the basic variables. The optimal dual solution are coefcients of variables s1 , s2 , s3 of Z row optimal simplex tableau.
OPERATIONS RESEARCH
BIS
37 / 41
Dual Problem
OPERATIONS RESEARCH
BIS
38 / 41
Dual Problem
Example
max z = 3x1 + 2x2 + 5x5 x1 + 3x2 + 2x3 15 2x2 x3 5 2x1 + x2 5x3 = 10 x1 , x2 , x3 0. To solve the problem we use the M method: max Z = 3x1 + 2x2 + 5x5 Ma2 Ma3 x1 + 3x2 + 2x3 + s1 = 15 2x2 x3 e2 + a2 = 5 2x1 + x2 5x3 + a3 = 10 x1 , x2 , x3 , s1 , a2 , a3 0.
Micha Kulej (Wroc Univ. of Techn.) OPERATIONS RESEARCH BIS 39 / 41
Dual Problem
5 x3 2 x2 3 x1 Z
9 23 17 23 58 M 23
M+
9 23
15 23 65 23 120 23 565 23
The dual problem has the following form: min W = 15y1 + 5y2 + 10y3 y1 + 2y3 3 3y1 + 2y2 + y3 2 2y1 y2 5y3 5 y1 0, y2 0, y3 Unrestricted.
Micha Kulej (Wroc Univ. of Techn.) OPERATIONS RESEARCH BIS 40 / 41
Dual Problem
Reading optimal dual solution from optimal simplex tableau we get: The rst constraint is inequality so y1 = row for column s1 ).
51 23
(coefcient of Z
9 23
(coefcient of Z
Optimal value of objective function of dual problem is 9 565 51 + 5( 58 W = 15 23 23 ) + 10 23 = 23 and equals optimal value of objective function of the primal problem.
OPERATIONS RESEARCH
BIS
41 / 41