Duality

You might also like

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

Linear Programming

DUALITY
DUALITY
 Important concept in Linear Programming

 Forms the basis for the Simplex algorithm

 Helps in deciding whether a feasible corner point


solution is optimal

 Gives the economic information with respect to


the constraints.
Primal Problem
Manvi Motors:

Max 3500 C + 5000 T


20 C + 40 T <=12000 (Fabrication)
25 C + 10 T <=10000 (Assembly)

C >= 0, T >= 0
and other constraints
Dual Problem
 What is an hour in fabrication
department worth? (y1)

 What is an hour in assembly department


worth? (y2)
Dual LP
Dual Problem:

Min 12000 y1 + 10000 y2


such that:
20 y1 + 25 y2 >= 3500
40 y1 + 10 y2 >= 5000
y1 >= 0
y2 >= 0
Dual LP
 For every Primal LP there is an equivalent
Dual LP
 If Primal LP is a Max problem, the Dual
LP is a Min problem
 # of constraints in the Primal = # of
variables in the Dual
 # of variables in the Primal = # of
constraints in the Dual
Dual LP
 RHS values of constraints in the Primal
LP are the OF coefficients of the Dual LP

 OF coefficients of the Primal LP are RHS


values of constraints in the Dual LP
Dual LP
 Dual of the Dual is the Primal

 Can solve either problem!

 Dual variables = dual prices = shadow prices


= marginal worth
Primal and Dual LPs
Primal LP:
Max cTx s.t.
A x <= b, x >= 0

Dual LP:
Min bTy s.t.
AT y >= c, y >= 0
Relationship between OF
Values of Primal and Dual
 Weak Duality Property:

 For any feasible solutions, x (for Primal)


and y (for Dual),
c T x <= bT y

 Economic Interpretation:
Profit <= worth of resources
Relationship between OF
Values of Primal and Dual
• Strong Duality Property:

 If for feasible solutions x* (for Primal LP) and


y* (for Dual LP)
c T x* = bT y* , then

x* and y* are optimal solutions for the Primal


and Dual.

 Economic Interpretation:
Profit = Worth of Resources
Complimentary Slackness
(CS)Property
If the feasible solutions x* (for Primal) and
y* (for Dual) are optimal, then the
following holds:
(Ax* – b)y* = 0 and
(Aty* – c)x* = 0

i.e. if a constraint is non-binding, the


corresponding dual variable must = 0
Complementary Slackness
 If a constraint in the primal problem is non-binding,
then the corresponding variable in the dual must equal
to ______.

 If a constraint in the dual problem is non-binding, then


the corresponding variable in primal will be ______.

 If a variable in the optimal solution of primal is non-


zero, then the corresponding dual constraint is
_______.
Check for Optimality
 Is the Primal Feasible solution (200,200) Optimal?

 How about (350,125)?


Primal Problem
Manvi Motors:
Max 3500 C + 5000 T
20 C + 40 T <=12000 (Fabrication)
25 C + 10 T <=10000 (Assembly)
45 C + 50 T >= 14000 (Labour)
C >= 150 (Backorders Cars)
T >= 100 (Backorders Trucks)
C <= 500 (Max Assemblies Cars)
T <= 200 (Max Assemblies Trucks)
C >= 0, T >= 0
Primal Problem in Standard Form
Manvi Motors:
Max 3500 C + 5000 T
20 C + 40 T <=12000 (Fabrication)
25 C + 10 T <=10000 (Assembly)
- 45 C - 50 T <= -14000 (Labour)
-C <= -150 (Backorders Cars)
-T <= -100 (Backorders Trucks)
C <= 500 (Max Assemblies Cars)
T <= 200 (Max Assemblies Trucks)
C >= 0, T >= 0
Dual Variables for Manvi Motors
Manvi Motors:
Max 3500 C + 5000 T
20 C + 40 T <=12000 (Fabrication) (y1)
25 C + 10 T <=10000 (Assembly) (y2)
- 45C - 50 T <= -14000 (Labour) (y3)
-C <= -150 (Backorders Cars) (y4)
-T <= -100 (Backorders Trucks) (y5)
C <= 500 (Max Assemb Cars) (y6)
T <= 200 (Max Assemb Trucks) (y7)
C >= 0, T >= 0
Dual Problem
 Manvi Motors Dual:
Min 12000y1 + 10000y2 - 14000y3 -150y4 - 100y5 +
500y7 + 200y8 such that:
20y1 + 25y2 - 45y3 - y4 + y6 >= 3500
40y1 + 10y2 - 50y3 - y5 + y7 >= 5000
y1, y2, y3, y4, y5, y6, y7 >= 0
Complimentary Slackness Conditions
(Ax-b)y = 0 => (20C + 40T - 12000)y1 = 0 (1)
(25C + 10T - 10000)y2 = 0 (2)
(-45C - 50T + 14000)y3 = 0 (3)
(-C + 150)y4 =0 (4)
(-T + 100)y5 =0 (5)
(C - 500)y6 =0 (6)
(T - 200)y7 =0 (7)
(A Ty – c)x = 0 =>
(20y1 + 25y2 - 45y3 - y4 + y6 - 3500)C = 0 (8)
(40y1 + 10y2 - 50y3 - y5 + y7 - 5000)T = 0 (9)
y1, y2, y3, y4, y5, y6, y7 >= 0
Check Other Primal Feasible
Solutions for Optimality
 A (150,200) Profit@ A = 15.25 lakhs
 B (150,145) Profit@ B = 10.25 lakhs
 C (200,100) Profit@ C = 12.0 lakhs
 D (360,100) Profit@ D = 17.6 lakhs
 E (350,125) Profit@ E = 18.5 lakhs
 F (200,200) Profit@ F = 17.0 lakhs
Adding a Variable to the Primal
 Adding a variable to Primal
 What does it mean for the Dual?
A constraint is added to the Dual!

 Can current primal optimal solution become infeasible?


No!
 Is it still optimal?
Depends! if the corresponding dual optimal solution is
still feasible, then Yes.

Example: Vans (Manvi Motors)


Example:
 Add the variable Vans to Manvi Motors

 (350,125) will still remain feasible for Primal (can set Vans =0)
 We now have an additional constraint in the Dual (therefore,
dual solution can become infeasible)
30y1 +20y2 – 50y3 >= 4000
 Is the constraint satisfied by the dual solution?
30*(112.5) + 20*(50) = 4375 >= 4000 Yes!
 Therefore, the current Primal and Dual solutions continue to be
Optimal.
 NOTE: The slack/surplus (375) in the dual constraint = reduced
cost for the corresponding primal variable (Vans) in the Primal.
Primal and Dual Solutions
Manvi Motors DUAL
(PRIMAL)
Variable
Cells Final Reduced
Variable Cells Final Reduced Cell Name Value Cost
Cell Name Value Cost
$D$7 y1 112.5 0
$C$5# to Produce of: Cars 350 0 $E$7 y2 50 0

$D$5# to Produce of: Trucks 125 0 $F$7 Y3 0 8000

$E$5 # to Produce of: Vans 0 -375 Constraints


Final Shadow
Constraints Final Shadow Cell Name Value Price
Cell Name Value Price
$G$9 Constraint 1 3500 350
$E$7 Labour Hrs. in Fabrication 12000 112.5
$G$10 Constraint 2 5000 125
$E$8 Labour Hrs. in Assembly 10000 50
$E$9 Min. Labour Usage 22000 0 $G$11 Constraint 3 4375 0
Primal and Dual Solutions
Manvi Motors DUAL
(PRIMAL)
Variable
Cells Final Reduced
Variable Cells Final Reduced Cell Name Value Cost
Cell Name Value Cost
$D$7 y1 112.5 0
$C$5# to Produce of: Cars 350 0 $E$7 y2 50 0

$D$5# to Produce of: Trucks 125 0 $F$7 Y3 0 8000

$E$5 # to Produce of: Vans 0 -375 Constraints


Final Shadow
Constraints Final Shadow Cell Name Value Price
Cell Name Value Price
$G$9 Constraint 1 3500 350
$E$7 Labour Hrs. in Fabrication 12000 112.5
$G$10 Constraint 2 5000 125
$E$8 Labour Hrs. in Assembly 10000 50
$E$9 Min. Labour Usage 22000 0 $G$11 Constraint 3 4375 0
Primal and Dual Solutions
Manvi Motors DUAL
(PRIMAL)
Variable
Cells Final Reduced
Variable Cells Final Reduced Cell Name Value Cost
Cell Name Value Cost
$D$7 y1 112.5 0
$C$5# to Produce of: Cars 350 0 $E$7 y2 50 0

$D$5# to Produce of: Trucks 125 0 $F$7 Y3 0 8000

$E$5 # to Produce of: Vans 0 -375 Constraints


Final Shadow
Constraints Final Shadow Cell Name Value Price
Cell Name Value Price
$G$9 Constraint 1 3500 350
$E$7 Labour Hrs. in Fabrication 12000 112.5
$G$10 Constraint 2 5000 125
$E$8 Labour Hrs. in Assembly 10000 50
$E$9 Min. Labour Usage 22000 0 $G$11 Constraint 3 4375 0
Primal and Dual Solutions
Manvi Motors DUAL
(PRIMAL)
Variable
Cells Final Reduced
Variable Cells Final Reduced Cell Name Value Cost
Cell Name Value Cost
$D$7 y1 112.5 0
$C$5# to Produce of: Cars 350 0 $E$7 y2 50 0

$D$5# to Produce of: Trucks 125 0 $F$7 Y3 0 8000

$E$5 # to Produce of: Vans 0 -375 Constraints


Final Shadow
Constraints Final Shadow Cell Name Value Price
Cell Name Value Price
$G$9 Constraint 1 3500 350
$E$7 Labour Hrs. in Fabrication 12000 112.5
$G$10 Constraint 2 5000 125
$E$8 Labour Hrs. in Assembly 10000 50
$E$9 Min. Labour Usage 22000 0 $G$11 Constraint 3 4375 0
Primal and Dual Solutions
Manvi Motors DUAL
(PRIMAL)
Variable
Cells Final Reduced
Variable Cells Final Reduced Cell Name Value Cost
Cell Name Value Cost
$D$7 y1 112.5 0
$C$5# to Produce of: Cars 350 0 $E$7 y2 50 0

$D$5# to Produce of: Trucks 125 0 $F$7 Y3 0 8000

$E$5 # to Produce of: Vans 0 -375 Constraints


Final Shadow
Constraints Final Shadow Cell Name Value Price
Cell Name Value Price
$G$9 Constraint 1 3500 350
$E$7 Labour Hrs. in Fabrication 12000 112.5
$G$10 Constraint 2 5000 125
$E$8 Labour Hrs. in Assembly 10000 50
$E$9 Min. Labour Usage 22000 0 $G$11 Constraint 3 4375 0
Primal and Dual Solutions
Primal Solution Dual Solution

Objective: Maximization Objective: Minimization

Shadow Prices ?

Variable Values ?

Reduced Costs ?

Slack / Surplus ?
Adding a Constraint to the Primal
 Adding a constraint to the Primal
 What does it mean for the Dual?
A variable is added to the Dual!

 Can the current primal optimal solution become


infeasible?
Yes! If the added constraint is not satisfied
 If still feasible, will it remainoptimal?
Yes. Since the current dual optimal solution remains
feasible
Primal and Dual
• If the Primal has a feasible and optimal
solution, then Dual also has a feasible and
optimal solution

• If Primal has a feasible solution but is


unbounded then Dual is infeasible

• If Primal is Infeasible then Dual is either


Infeasible or Unbounded
Degeneracy
 What if more than necessary number of
constraints pass through a point?

 Implications

You might also like