5 Duality

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 31

Duality

Duality in Linear Programming

▪ The Duality in Linear Programming states that every linear


programming problem has another linear programming problem
related to it and thus can be derived from it.
▪ The original linear programming problem is called “Primal”, while
the derived linear problem is called “Dual”.
▪ The two problems are closely related that the optimal solution of
one problem automatically provides the optimal solution to the
other.
▪ Solving an LP problem via its dual may be simpler in certain
cases.

104
Duality in Linear Programming

▪ This theory was first developed in relation to linear programming

▪ Next, it was found out that it has many applications, and perhaps
even a more natural and intuitive interpretation, in several
related areas such as nonlinear programming, networks and
game theory.

105
Defintion of the Dual Problem
Rules of the dual LP formulation

Consider a LP in a standard form:


▪ A dual variable is defined for each primal constraint
▪ A dual constraint is defined for each primal variable
▪ The constraint (column) coefficients of a primal variable define
the row coefficients of a dual constraint
▪ The objective cost of a primal variable defines the right-hand
side of the constraint in the dual.
▪ The objective coefficients in the dual are given by the right-
hand side of the primal (system of equations)
▪ If primal objective is “max” the dual objective is “min” (and vice-
versa)
106
Defintion of the Dual Problem
Example 1

Primal problem

Dual variables
+ 0s1
Primal in s1 y1
standard form y2
S1 ≥ 0

107
Defintion of the Dual Problem
Example 1

right-hand side of the dual constraints

Primal in + 0 s1 Dual variables


standard form s1 y1
y2
S1 ≥
0 Objective coefficients
row coefficients of a dual constraint of the dual

Dual problem

108
Defintion of the Dual Problem
Example 2

Primal

Dual problem

109
Definition of the Dual Problem
Handling variables unrestricted in sign

▪ When a variable is unrestricted, it can assume positive, zero or


negative value.
▪ Therefore, we have to convert them into non-negative variables by
expressing the unrestricted variable as a difference of two non-
negative variables.

110
Definition of the Dual Problem
Handling variables unrestricted in sign

1) Multiply through the greater-than-or-equal-to inequality constraint by -1


2) Convert the equality constraint to a pair of inequality constraints.
3) Replace the variable unrestricted in sign, by the difference of two nonnegative
variables

Maximize Z = 15(a-b)+29𝑥2+11𝑥3+37𝑥4
Maximize Z = 15𝑥1+29𝑥2+11𝑥3+37𝑥4
Subject to:
Subject to:

10𝑥1+15𝑥2+ 14𝑥4≤250 10(a-b)+15𝑥2+ 14𝑥4≤250


-22(a-b)+20𝑥2-20𝑥3≤ - 540
22𝑥1−20𝑥2+20𝑥3 ≥540
15(a-b)+13𝑥2+12𝑥3+13𝑥4 ≤ 600
15𝑥1+13𝑥2+12𝑥3+13𝑥4=600
𝑥2,𝑥3,𝑥4≥0, 𝑥1: 𝑢𝑛𝑟𝑒𝑠𝑡𝑟𝑖𝑐𝑡𝑒𝑑 15(a-b)+13𝑥2+12𝑥3+13𝑥4≥600
111
𝑥2,𝑥3,𝑥4≥0, 𝑥1: 𝑢𝑛𝑟𝑒𝑠𝑡𝑟𝑖𝑐𝑡𝑒𝑑
Definition of the Dual Problem
Handling variables unrestricted in sign

Maximize Z = 15(a-b)+29𝑥2+11𝑥3+37𝑥4 Maximize Z = 15a - 15b +29𝑥2+11𝑥3+37𝑥4


Subject to: Subject to:
10 (a-b)+15𝑥2+ 14𝑥4≤250 10a - 10 b+15𝑥2 + 14𝑥4≤250
-22(a-b)+20𝑥2-20𝑥3≤ - 540 -22a + 22b+20𝑥2 - 20𝑥3≤ - 540
15 (a-b)+13𝑥2+12𝑥3+13𝑥4 ≤ 600 15 a - 15b + 13𝑥2 + 12𝑥3+13𝑥4 ≤ 600
15 (a-b)+13𝑥2+12𝑥3+13𝑥4≥600 -15a + 15b -13𝑥2 - 12𝑥3-13𝑥4 ≤ -600
𝑥2,𝑥3,𝑥4≥0, a,b ≥0 𝑥2,𝑥3,𝑥4≥0, a,b ≥0

Minimize 𝐶=250𝑦1−540𝑦2+600𝑦3−600𝑦4
Subject to:
10𝑦1−22𝑦2+15𝑦3−15𝑦4≥ 15
−10𝑦1+22𝑦2−15𝑦3+15𝑦4≥−15
15𝑦1+20𝑦2+13𝑦3−13𝑦4≥ 29
0𝑦1−20𝑦2+12𝑦3−12𝑦4≥ 11
14𝑦1+ 0𝑦2+13𝑦3−13𝑦4≥ 37
𝑦1,𝑦2,𝑦3,𝑦4≥0
112
Definition of the Dual Problem
Handling variables unrestricted in sign

Minimize 𝐶=250𝑦1−540𝑦2+600𝑦3−600𝑦4 Minimize 𝐶=250𝑦1−540𝑦2+600𝑦5


Subject to: Subject to:
10𝑦1−22𝑦2+15𝑦3−15𝑦4≥ 15 10𝑦1−22𝑦2+15𝑦5=15
−10𝑦1+22𝑦2−15𝑦3+15𝑦4≥−15 15𝑦1+20𝑦2+13𝑦5 ≥29
15𝑦1+20𝑦2+13𝑦3−13𝑦4≥ 29 −20𝑦2+12𝑦5≥11
0𝑦1−20𝑦2+12𝑦3−12𝑦4≥ 11 14𝑦1 +13𝑦5≥37
14𝑦1+ 0𝑦2+13𝑦3−13𝑦4≥ 37 𝑦1,𝑦2≥0 and 𝑦5: unrestricted
𝑦1,𝑦2,𝑦3,𝑦4≥0

▪ An equality constraint in the primal generates a dual variable that is unrestricted in


sign.
▪ An unrestricted in sign variable in the primal generates an equality constraint in the 113
dual.
Summary of rules for constructing the dual

Maximization Minimization
Constraints Variables
≥ ≤0
≤ ≥0
= unrestricted
Variables constraints
≥0 ≤
≤0 ≥
Unrestricted =

114
Primal-Dual relashionships

▪ Changes made in the original LP model will change the elements of


the current optimal tableau, wich in turn may affect the optimality
and/or feasibility of the current solution.

▪ A number of relashionships between the primal and the dual can be


used to recompute the elements of the optimal simplex tableau,

115
Primal-Dual relashionships
Example (1/2)

Consider the following problem:

ST

Optimal solution:
(x1*, x2*) = (3/5, 4/5) → z* = −7/5 116
Primal-Dual relashionships
Example (2/2)

Its dual is given by:

ST

Optimal solution:
(y1*, y2*) = (1/5, 2/5) → z* = −7/5.

117
In this example, we observe that the minimum value of the primal is equal to the
maximum value of the dual.
Primal-Dual relashionships
Simplex Tableau Layout

Starting tableau Identity


matrix

Inverse
General iteration matrix

118
Primal-Dual relashionships
Optimal dual solution

▪ The primal and dual solutions are closely related that the
optimal solution of one problem directly yields the optimal
solution to the other.
▪ Two methods for determining dual values:

Method 1

Method 2

119
Primal-Dual relashionships
Optimal dual solution

✓ Example: method 1
Final Simplex Tableau

Primal
Primal
Cj-Zj 54.8
Method 1

Dual Dual

(y1,y2) = (29/5 + 0, -2/5+0) = (29/5, -2/5)


120
Primal-Dual relashionships
Optimal dual solution

✓ Example: method 2
Final Simplex Tableau

Primal
Primal
Cj-Zj 54.8
Method 2

Dual Dual

2/5 −1/5 29 2
(y1,y2) = (12, 5) * = ( ,− ) 121
1/5 2/5 5 5
Theorems related to duality

▪ The dual of the dual is the primal


▪ If x is primal feasible and y is dual feasible, then cTx ≤ bTy
(weak duality theorem).

▪ If x* is primal feasible and y* is dual feasible and cTx* =


bTy*, then x* and y* are optimal

122
Theorems related to duality (contd.)

▪ If one of a pair of primal and dual problems has an optimal


solution, then the other also has an optimal solution and
the optimal values of their objective functions are equal.

▪ If the primal is feasible and unbounded then the dual is


infeasible.

▪ If the dual is feasible and unbounded, then the primal is


infeasible.

123
Theorems related to duality (contd.)

▪ Complementary Slackness Theorem (CST)


A primal feasible solution x* and a dual feasible solution y* are
optimal if and only if:
(b-Ax*)Ty* = 0 and (ATy* - c)Tx* = 0.

Primal Dual The CST shows us the following


Example relationships:

X*=14/5 , A=6/5 and B=2/5


Y*=8/5 Z*=20,8
Z*= 20,8 124
Interpretation of Duality

▪ The dual variable y* measures the change in optimal


profit due to a unit change in resource i.
▪ The fact that profit would increase by yi* if an additional
unit of resource i were available imputes a value or price
to resource i.
▪ This value or price is called a shadow price. Thus, the
shadow price is the amount of contribution of an
additional unit of a resource to total profit.

125
Interpretation of Duality

▪ Note from the weak duality theorem that we always have

▪ The inequality is strict except at optimal solution where


equality holds.
▪ At optimality yi, is interpreted as the worth of resource i.
▪ Thus, the weak duality theorem states that the profit is
less than or equal to the worth of resources.
▪ That is, the resources are not exploited according to the
best allocation except at optimality
126
Interpretation of Duality

▪ The yi's are the shadow prices of the resources.


▪ A shadow price can be interpreted as the additional unit profit
that could be made by acquiring additional units of resource i.
▪ In particular, when a resource is not totally consumed at
optimal exploitation the related constraint is inactive and the
corresponding shadow price must be zero. In this case, the
corresponding slack variable is basic;
▪ If however the constraint is active (i.e., the resource is entirely
consumed at optimal exploitation), then the corresponding
shadow price is positive and therefore it will be profitable to
acquire additional units of that resource.
127
Interpretation of Duality
Example 1

▪ Consider the following LP and its dual:

Primal Dual

Max ZX = 5X1 + 2X2 + 7X3 Min ZY = 50Y1 + 75Y2


ST X1 + X2 + X3  50 ST Y1 + 2Y2  5
Y1 + 4 Y2  2
2X1 + 4X2 + 3X3  75
Y1 + 3 Y2  7
X1, X2, X3  0
Y1,Y2  0

128
Interpretation of Duality
Example 1 (contd.)

▪ The optimal dual table is given by:


CJ 5 2 7 0 0
Basis X1 X2 X3 S1 S2 bI

0 S1 0 -1 -1/2 1 -1/2 12,5


5 X1 1 2 3/2 0 1/2 37,5

J 0 -8 -1/2 0 -5/2 187,5

Dual E1 E2 E3 Y1 Y2 Zy
Solution 0 8 1/2 0 5/2 187,5
129
Interpretation of Duality
Example 1 (contd.)

Primal
▪ Assume that in the context of this LP, 3 products P1, Max ZX = 5X1 + 2X2 + 7X3
P2 et P3 are to be manufactured.
▪ The production process requires the use of 2
ST X1 + X2 + X3  50

2X1 + 4X2 + 3X3  75


resources R1 & R2 , which are available in limited
quantities of 50 et 75 units respectively X1, X2, X3  0

130
Interpretation of Duality
Example 1 (contd.)

Primal
CJ 5 2 7 0 0
Max ZX = 5X1 + 2X2 + 7X3
Basis X1 X2 X3 S1 S2 bI
ST X1 + X2 + X3  50 (R1)
0 S1 0 -1 -1/2 1 -1/2 12,5
2X1 + 4X2 + 3X3  75 (R2) 5 X1 1 2 3/2 0 1/2 37,5
X1, X2, X3  0 J 0 -8 -1/2 0 -5/2 187,5

▪ From the corresponding optimal Tableau, the marginal value or


shadow price of R1 is 0 and the shadow price of R2 is 2.5.
▪ That is, an additional unit of R1 has no effect on the value of Z, whereas
an additional unit of R2 will increase Z by 2.5 dinars.
131
Interpretation of Duality
Example 1 (contd.)

Primal
CJ 5 2 7 0 0
Max ZX = 5X1 + 2X2 + 7X3
Basis X1 X2 X3 S1 S2 bI
ST X1 + X2 + X3  50 (R1)
0 S1 0 -1 -1/2 1 -1/2 12,5
2X1 + 4X2 + 3X3  75 (R2) 5 X1 1 2 3/2 0 1/2 37,5
X1, X2, X3  0 J 0 -8 -1/2 0 -5/2 187,5

▪ The producer will not be ready to cede a unit of R1 (respectively R2) unless
he obtains against it at least 0 (respectively 2.5 dinars) additional gain.
▪ Equivalently, in order to acquire one more unit of R1 (respectively R2), the
producer will be willing to pay additional cost of 0 (respectively 2.5 dinars).
132
Interpretation of Duality
Example 1 (contd.)

▪ CJ-ZJ is called the reduced cost of the corresponding decision variable


▪ It is interpreted as the deficit for the decision variable to become basic
▪ In the last tableau, C2-Z2 =-8. This says that the unit profit of P2 must
increase at least by 8 dinars for P2 to become profitable.
▪ Equivalently, by forcing one unit of P2 to be produced, the profit will be
reduced by 8 dinars.
▪ Similarly, the unit profit of P3 must increase at least by 0.5 dinars for P3 to
become profitable

133

You might also like