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

Unit 2

Duality and Methods


Dr. Munish Mehta
Associate professor
SME, LPU
Without solving this problem, lets try to get some estimate of this objective function
Suppose there are no constraints, then obvious values of X1 and X2 will be infinity
(∞) . And then Z will also be equal to ∞. This infinity is upperbound (UB) to the simple
optimal solution.
Now, lets see other ways of getting better UBs.
For example if we say that Z cant be greater than 1000, then 1000 will be UB.
Now, for example, lets multiply second constraint with 3, we shall get
9X1+6X2≤36
Therefore we can say that
6X1+5X2 ≤ 36
Therefore the optimum solution should have an objective function < 36
So, we can say Z=36 is UB
Now, lets do another thing.
Lets multiply the first constraint by 6
We get 6X1+6X2 ≤30
So, using same logic as above,
Z should be equal to 30 so , 30 is UB
So now, we realize that this problem cant have its objective function value more than
30. It can be either 30 or less.
Now, lets do one more thing.
Multiply first constraint by 1 (a1) and multiply second constraint by 2 (a2) then add
these, we shall get:
7X1+5X2 ≤29
Now, we see that 7X1+5X2 is more than objective function. And it is also less than this
29.
Hence we can say that Z cant be more than 29
Hence, we are continuously reducing UB value.
We are doing all this to get the smallest value of the upper bound.
Next, to calculate values of a1 and a2,
Following equation has been developed:
Minimize: 5a1+12a2
a1+3a2 ≥6
a1+2a2 ≥5
a1, a2 ≥0
Now, we replace a with Y in the above equations:
Minimize: 5Y1+12Y2
Y1+3Y2 ≥6
Y1+2Y2 ≥5
Y1, Y2 ≥0
This problem is called the dual of original problem which is called Primal.
We also see that Primal is a maximization problem then dual is the minimization
problem.
Also, dual will have number of constraints equal to the variables of the Primal.
The dual will have as many variables as the number of constraints in the Primal.
Summary:
If primal is a maximization problem then dual is a minimization
problem.
The dual will have as many constraints as the number of
variables in the Primal
The dual will have as many variables as the number of
constraints in the Primal.
We use W to represent the objective function value of dual.
So, the objective function now is:
Minimize W = 5Y1+12Y2
Subject to:
Y1+3Y2 ≥6
Y1+2Y2 ≥5
Y1, Y2 ≥0
Example 2:
Minimize 8X1+5X2+4X3
Subject to:
4X1+2X2+8X3 = 12
7X1+5X2+6X3 ≥9
8X1+5X2+4X3≤10
3X1+7X2+9X3 ≥7
X1 ≥0, X2 is unrestricted, X3≤0
We have covered all the possibilities in this example
X2 is unrestricted is new for us. What to do with this?
Replace X2 as the difference of two variables i.e. X2 = X4-X5 where X4, X5 ≥0
Also, X3≤0 is new for us. What to do with this?
Replace X3 by –X6, where X6 ≥0
So The problem now becomes:
Minimize 8X1+5X4-5X5-4X6
Subject to:
4X1+2X4-2X5-8X6 = 12…………(i)
7X1+5X4-5X5-6X6 ≥9…………..(ii)
8X1+5X4-5X5-4X6≤10…………..(iii)
3X1+7X4-7X5-9X6 ≥7……………(iv)
X1,X4,X5,X6 ≥0
Now, bring it into the form we are comfortable with
Multiply objective function with -1 to convert it into maximization problem.
Equation (ii) and (iv) are having ≥ sign which can be converted to ≤ sign by multiplying
by -1
Equation (i) which is an equation is re-written as two constraints, one with a ≥ sign
and another with a ≤ sign
Minimize 8X1+5X4-5X5-4X6
Subject to:
4X1+2X4-2X5-8X6 = 12………(i)
7X1+5X4-5X5-6X6 ≥9…………(ii)
8X1+5X4-5X5-4X6≤10………..(iii)
3X1+7X4-7X5-9X6 ≥7…………(iv)
X1,X4,X5,X6 ≥0
Making these changes, we get:
Maximize -8X1-5X4+5X5+4X6
Subject to:
4X1+2X4-2X5-8X6 ≤ 12
-4X1-2X4+2X5+8X6 ≤ -12
-7X1-5X4+5X5+6X6 ≤ -9
8X1+5X4-5X5-4X6≤10
-3X1-7X4+7X5+9X6 ≤ -7
X1,X4,X5,X6 ≥0
Remember, this is still the Primal. Now. We shall write the dual for this
Dual of this can be written by introducing Y1 to Y5 for each of the constraints. We can
write the dual as:
Minimize 12Y1-12Y2-9Y3+10Y4-7Y5
Subject to
4Y1-4Y2-7Y3+8Y4-3Y5 ≥-8
2Y1-2Y2-5Y3+5Y4-7Y5 ≥-5
-2Y1+2Y2+5Y3-5Y4+7Y5 ≥5
-8Y1+8Y2+6Y3-4Y4+9Y5 ≥4
Y1, Y2, Y3, Y4, Y5 ≥0
Since the primal is a minimization problem, the dual will be maximization problem as
follows:

Maximize -12Y1+12Y2+9Y3-10Y4+7Y5
Next, because the original problems had four constraints therefore we want the dual
to have four variables. How to do this?
We shall write variables Y2-Y1 as Y6 . For this we have to bring the problem in Y2-Y1
format. For example, objective function has been brought in this format as shown
below:
12Y2-12Y1+9Y3-10Y4+7Y5…………….this is initial form of objective function
12(Y2-Y1)+9Y3-10Y4+7Y5………………this is final form of objective function
12Y6+9Y3-10Y4+7Y5
Similar procedure has to be followed for all the constraints also.
Maximize 12Y6+9Y3-10Y4+7Y5
Subject to
-4Y6-7Y3+8Y4-3Y5 ≥-8
-2Y6-5Y3+5Y4-7Y5 ≥-5
2Y6+5Y3-5Y4+7Y5 ≥5
8Y6+6Y3-4Y4+9Y5 ≥4
Y3, Y4, Y5 ≥0, Y6 is unrestricted in sign
Replacing Y4 by –Y7 such that Y7 ≤ 0, we get:
Maximize: 12Y6+9Y3+10Y7+7Y5
Subject to
-4Y6-7Y3-8Y7-3Y5 ≥-8……………….(i)
-2Y6-5Y3-5Y7-7Y5 ≥-5 ……………….(ii)
2Y6+5Y3+5Y7+7Y5 ≥5 ……………….(iii)
8Y6+6Y3+4Y7+9Y5 ≥4 ……………….(iv)
Y3, Y5 ≥0, Y7 ≤ 0, Y6 is unrestricted in sign
Now, multiply (i) and (ii) by -1 and writing the modified constraints (ii) and (iii) as
equations, we get the dual as:
Maximize: 12Y6+9Y3+10Y7+7Y5
Subject to
4Y6+7Y3+8Y7+3Y5 ≤ 8……………….(i)
2Y6+5Y3+5Y7+7Y5 = 5 ……………….(ii)
8Y6+6Y3+4Y7+9Y5 ≥ 4 ……………….(iv)
Y3, Y5 ≥ 0, Y7 ≤ 0, Y6 is unrestricted in sign
Now, we can use replace Y6, Y3, Y7 and Y5 with Y1, Y2, Y3, Y4 respectively to
get the problem in following form:
Maximize: 12Y1+9Y2+10Y3+7Y4
Subject to
4Y1+7Y2+8Y3+3Y4 ≤ 8
2Y1+5Y2+5Y3+7Y4 = 5
8Y1+6Y2+4Y3+9Y4≥ 4
Y2, Y4 ≥ 0, Y3 ≤ 0, Y1 is unrestricted in sign
Now, this is the dual corresponding to our problem
Summary
Weak Duality Theorem
If the Primal is a maximization problem, then, every feasible solution to the
dual has an objective function value greater than or equal to every feasible
solution to the Primal.

Lets understand this with the help of an example:


Problem:
Maximize Z = 6X1+5X2
Subject to
X1+X2 ≤ 5
3X1+2X2 ≤ 12
X1, X2 ≥ 0
So, Dual of this will be:
Minimize W = 5Y1+12Y2
Subject to Y1+3Y2 ≥6
Y1+2Y2 ≥5
Y1, Y2 ≥ 0
Now, lets consider a couple of feasible solutions for the primal and dual:
Primal:
Putting values of X1, X2 as (0, 0) will give us Z=0
Putting values of X1, X2 as (3, 1) will give us Z = 23 and so on…

Dual:
Putting values of Y1, Y2 as (3, 3) will give us W=51
Putting values of Y1, Y2 as (1, 2) will give us W = 29 and so on…
We can evaluate any number of feasible solutions to the Primal and to the dual. We
shall see that objective function value of Dual is always be greater than the Primal.

Proof:
Since there exists a basic feasible solution X1, X2 to the Primal
We have, X1+X2 ≤ 5
3X1+2X2 ≤ 12
Substituting in the objective function value of a solution feasible to the dual, we get:
W ≥ (X1+X2)Y1+ (3X1+2X2)Y2
Rearranging the terms, we get:
W ≥ X1 (Y1+3Y2)+ X2(Y1+2Y2)
Since Y1 and Y2 are feasible to the dual, we have :
Y1+3Y2 ≥6
Y1+2Y2 ≥5
Substituting, we get
W ≥ 6X1+5X2
Since, X1 and X2 are feasible to the Primal, Z = 6X1+5X2
Hence, W ≥ Z
Optimality Criterion Theorem
If Primal (P) and Dual (D) have basic feasible solutions such that W = Z, then
these are optimal to P and D respectively.

Lets understand this with the help of an example:


Problem: Maximize Z = 6X1+5X2
Subject to
X1+X2 ≤ 5
3X1+2X2 ≤ 12
X1, X2 ≥ 0
So, Dual of this will be:
Minimize W = 5Y1+12Y2
Subject to Y1+3Y2 ≥6
Y1+2Y2 ≥5
Y1, Y2 ≥ 0
Proof:
We say that Primal has a feasible solution as (2, 3) , it will give Z = 27
Similarly. Dual has a feasible solution as (3, 1) , it will give W = 27
Here, we see that W = Z = 27
Now, lets go back to the problem
The primal constraints are:
X1+X2 ≤ 5
3X1+2X2 ≤ 12
We see that (2, 3) satisfies both these constraints
The dual constraints are:
Y1+3Y2 ≥6
Y1+2Y2 ≥5
We see that (3, 1) satisfies both these constraints
So, we can say that (2, 3) is optimal to the primal and (3, 1) is optimal to the dual.
Main Duality Theorem
If Primal (P) and Dual (D) have basic feasible solutions then, both have optimal
solutions with Z* = W* (With same value of objective function) .

Lets understand this:


Every linear programming is either
Optimal
Unbounded
Infeasible
Now, as mentioned in the theorem that if we assume that P & D have feasible
solutions, it means neither of them is infeasible.
It simply means that P & D are optimal or unbounded
Now, if one of them is unbounded then it will violate the weak duality theorem
So, we are left with only one option that that is optimal solution. Hence theorem is
proved
Complimentary Slackness Theorem
If X* and Y* are optimal solutions to Primal and Dual
We have Xv+Yu = 0……….this is called complimentary slackness condition
Where,
X and Y are decision variables corresponding to the Primal and Dual respectively.
v and u are slack variables corresponding to Primal and Dual respectively.
Xv+Yu = 0 equation can be generalized as 𝑥𝑖 𝑣𝑖 + 𝑦𝑗 𝑢𝑗 =0
xi vi = 0 for all i
yj uj = 0 for all j
Where, xi and yj are the decision variables in Primal and Dual respectively.
x, y, u, v are all greater than or equal to zero.
Now, lets apply the complimentary slackness condition to an example
Complimentary Slackness Theorem
Example:
Primal is: Maximize, Z = 6X1+5X2
Subject to
X1+X2+u1=5
3X1+2X2+u2=12
X1,X2,u1,u2 ≥0
Where u1 and u2 are slack variables
The dual is:
Minimize W = 5Y1+12Y2
Subject to
Y1+3Y2-v1=6
Y1+2Y2-v2=5
Y1,Y2,v1,v2 ≥0
The optimal solution to the primal is X1* = 2, X2* = 3, u1 = 0, u2 = 0, Z = 27
The optimal solution to the dual is Y1* = 3, Y2* = 1, v1 = 0, v2 = 0, W = 27
Now. Lets apply complimentary slackness condition:
We see that x1v1 = 0, x2v2 = 0
Also, y1u1 = , y2u2 = 0
Complimentary Slackness Theorem
So, complimentary slackness condition is now satisfied at the optimum.
Now,
Lets apply complimentary slackness condition to some other problem:
Maximize Z = 3X1+4X2
Subject to
X1+X2 ≤ 12 or we can write it as X1+X2+ u1= 12
2X1+3X2 ≤ 30 or we can write it as 2X1+3X2+u2= 30
X1+4X2 ≤ 36 or we can write it as X1+4X2+u3= 36
X1,X2 ≥0 or we can write it as X1, X2,u1, u2 ≥0
The dual of this is
Minimize W = 12Y1+30Y2+36Y3
Subject to
Y1+2Y2+Y3 ≥3 or we can write it as Y1+2Y2+Y3 -v1= 3
Y1+3Y2+4Y3 ≥4 or we can write it as Y1+3Y2+4Y3 -v2= 4
Y1,Y2,Y3 ≥0 or we can write it as Y1, Y2, Y3 ,v1, v2≥0
Variables u1,u2,u3 are primal slack variables while v1,v2 are dual surplus variables
We know that the optimal solution to the Primal is
X1* =6, X2* =6, u3* =6, Z* =42
We know that the optimal solution to the dual is
Y1* =1, Y2* =1, Y3* = 0, W* =42
Complimentary Slackness Theorem
Now. If we look at it carefully and apply complimentary slackness to this,
We see that
X1=6 X2=6 u3=6 u1=0 u2=0
v1=0 v2=0 Y3=0 Y1=1 Y2=1

Which satisfies the complimentary slackness condition


Dual Simplex Algorithm
Subtracting slack variables, we get:
Convert the objective function into maximization by multiplying with-1
Multiply the constraints by -1 to change the sign of ≥ into ≤
Make simplex table now, we get:

Here, we have violated a very important assumption of simplex that RHS


should be ≥ 0, It can not be negative.
Now we have a solution which is non feasible and has negative RHS values
Now, move further calculate Cj-Zj

We see that optimal condition is satisfied but the feasibility condition is not
satisfied.
We have a solution where Primal is infeasible but dual is feasible. This is just
the opposite to what was happening upto now in all the simplex problems we
have discussed
But we can still workout simplex if we can maintain the feasibility of the dual
and slowly make primal feasible than it will become optimal.
So lets do that.
Since Cj-Zj is all negative so we can’t have any entering variable here so first
we have to make Primal feasible which means we need a positive or non
negative value at the RHS.
So, start the procedure
Highest non negative value RHS will leave so -9…hence X4 variable will leave
Now, which variable will enter?
To do that, we compute Ɵ which will now come in the row
How to calculate Ɵ. Divide Cj-Zj by the corresponding element in pivot row
Now, least Ɵ will enter
Now, what happens as a result of this?
Now, we see that there is still -8/7 in RHS. So , this has to go now
To know what will be entering variable, compute Ɵ
Once, again we see that Cj-Zj values are negative so the optimality condition is satisfied
And also RHS is positive so the feasibility condition is also satisfied.
Therefore -123/11 is optimal solution.
So the solution to the primal is X1 = 8/11, X2 = 13/11, Z = 123/11
And optimal solution to the dual will be Y1 = -21/11, Y2 = -2/11, W = 123/11
This algorithm is called Dual Simplex algorithm
This is very much suited for Minimization problems with all positive co efficients in the
objective function and all constraints of the ≥ type with a non negative RHS.
There is no need to add artificial variables, no need to use Big M method
End of Unit-2

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