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

Dr.

Bishram

Duality in LP

 Duality in LPP
 Every LPP called the primal is associated with
another LPP called dual. Either of the problems is
primal with the other one as dual. The optimal
solution of either problem reveals the information
about the optimal solution of the other.

1
Characteristics of Duality
1. Dual of dual is primal
2. If either the primal or dual problem has a solution then the
other also has a solution and their optimum values are equal.
3. If any of the two problems has an infeasible solution, then the
value of the objective function of the other is unbounded.
4. The value of the objective function for any feasible solution of
the primal is less than the value of the objective function for
any feasible solution of the dual.
5. If either the primal or dual has an unbounded solution, then the
solution to the other problem is infeasible.
6. If the primal has a feasible solution, but the dual does not have
then the primal will not have a finite optimum solution and
vice versa.

Steps for Standard Primal Form


 Step 1 – Change the objective function to Maximization form

 Step 2 – If the constraints have an inequality sign ‘≥’ then


multiply both sides by -1 and convert the inequality sign to ‘≤’.

 Step 3 – If the constraint has an ‘=’ sign then replace it by two


constraints involving the inequalities going in opposite directions.
For example x1+ 2x2 = 4 is written as
 x1+2x2 ≤ 4
 x1+2x2 ≥ 4 (using step2) → - x1-2x2 ≤ - 4
 Step 4 – Every unrestricted variable is replaced by the difference
of two non-negative variables.

 Step5 – We get the standard primal form of the given LPP in


which.
 All constraints have ‘≤’ sign, where the objective function is of maximization
form.
 All constraints have ‘≥’ sign, where the objective function is of minimization
from.

2
Primal-Dual Conversion Principles

Primal (Max) Dual (Min)


1 No of const No of variables
2 No of Variables No of Const
3 RHS Obj Function co-efficients
4 Obj Function Co-eff RHS
5 Co-eff Matrix A A-Transpose matrix
6 Equation Unrestricted variable
7 Unrestricted Variable Equation
8 Desired Constrain ( <=) Desired variable >=
9 Undesired Const ( >=) Undesired Variable (<=)
10 >= Variable >= Constraint
11 <= Variable <= Constraint

Rules Summarised

1. Transpose the rows and columns of the constraint co-


efficient.
2. Transpose the co-efficient (c1,c2,…cn) of the
objective function and the right side constants
(b1,b2,…bn)
3. Change the inequalities from ‘≤’ to ‘≥’ sign.
4. Minimize the objective function instead of
maximizing it.

3
Min Zx = 2x2 + 5x3 Max Zx’ = 0x1-2x2 – 5x3
Subject to
Subject to -x1-x2 ≤ -2 w1
x1+x2 ≥ 2 2x1+x2+6x3 ≤ 6 w2
2x1+x2+6x3 ≤ 6 x1 - x2 +3x3 ≤ 4 w3
-x1 + x2 -3x3 ≤ -4 w4
x1 - x2 +3x3 = 4 x1, x2 , x3 ≥ 0
x1, x2 , x3 ≥ 0

Dual
Min Zw = -2w1 + 6w2 + 4w3 – 4w4
Subject to
-w1+2w2+w3-w4 >=0
-w1 +w2 –w3 +w4 >= -2
6w2 +3w3 -3w4 >= -5
w1, w2, w3, w4 ≥ 0

Explanation in class
Max Zx’ = 0x1 -2x2 – 5x3
Subject to
W1 -x1-x2 + 0x3 ≤ -2
W2 2x1+x2+6x3 ≤ 6
W3 x1 - x2 +3x3 ≤ 4
W4 -x1 + x2 -3x3 ≤ -4
x1, x2 , x3 ≥ 0

Min z’ = -2w1 +6w2 +4 w3 -4 w4


ST
-w1+2w2+w3-w4 >=0
So on ….

4
Exercise – Only for writing dual prob

PRIMAL Min G = -3 w1 + 20 w2 +5w3-5w4


Max z = 5x1 + 3x2 ST
ST -w1+w2 >= 5
-X1 + x2 <= -3 w1 W1+w3-w4 >= 3
X1 <= 20 w2
X2 <= 5 w3
-X2 <= -5 w4
X1, x2 >=0

Finding Dual of a LP problem:


An example

Primal Dual
Maximize Z  4 x1  3x2 Minimize Z   6000 y1  2000 y 2  4000 y 3
Subject to Subject to
2 y1  y 2  y 3  4
x1  x 2  6000
3
2
x1  x 2  2000 y1  y 2  3
3
x1  4000 y1  0
x1 unrestricted y2  0
x2  0 y3  0

Note: Second constraint in the primal is transformed to


before constructing the dual.  x1  x2  2000

10

5
Dual Simplex Method
Simplex Method verses Dual Simplex Method

1. Simplex method starts with a nonoptimal but feasible


solution where as dual simplex method starts with an
optimal but infeasible solution.

2. Simplex method maintains the feasibility during


successive iterations where as dual simplex method
maintains the optimality.
Method Feasibility Optimality

Simplex Starts Moves to


Big-M Starts Moves to
Dual Simplex Moves to Starts
In SIMPLEX we move from feasibility to optimality
In Dual Simplex we move from optimality to feasibility

11

Dual Simplex Method: Iterative steps


Steps involved in the dual simplex method are:
1. All the constraints (except those with equality (=) sign) are
modified to ‘less-than-equal-to’ sign. Constraints with greater-
than-equal-to’ sign are multiplied by -1 through out so that
inequality sign gets reversed. Finally, all these constraints are
transformed to equality sign by introducing required slack
variables.
2. Modified problem, as in step one, is expressed in the form of a
simplex tableau. If all the cost coefficients are positive (i.e.,
optimality condition is satisfied) and one or more basic variables
have negative values (i.e., non-feasible solution), then dual
simplex method is applicable.

12

6
Dual Simplex Method: Iterative steps…contd.
3. Selection of exiting variable: The basic variable with the highest
negative value is the exiting variable. If there are two candidates for
exiting variable, any one is selected. The row of the selected exiting
variable is marked as pivotal row.
4. Selection of entering variable: Cost coefficients, corresponding to
all the negative elements of the pivotal row, are identified. Their
ratios are calculated after changing the sign of the elements of
pivotal row, i.e.,

The column corresponding to minimum ratio is identified as the


pivotal column and associated decision variable is the entering
variable.
 Cost Coefficients 
ratio   
  1  Elements of pivotal row 

13

Criteria for pivoting


 Primal Simplex
 Pivot column
 Maximization : Column with lowest value in z-row
 Minimization : Column with Highest value in Z-row
 Pivot Row
 Ratio of RHS to +ve coefficients in Pivot Column

 Take the minimum ratio as outgoing variable

 Dual Simplex
 Pivot Row
 Row with lowest –ve value i.e. –ve RHS with highest modulus
 Pivot Column
 Ratio of z-row/ -(-ve coefficients)

 Choose the lowest Modulus (Ratio) for aij <0

7
Dual Simplex Method: Iterative steps…contd.
5. Pivotal operation: Pivotal operation is exactly same as
in the case of simplex method, considering the pivotal
element as the element at the intersection of pivotal row
and pivotal column.

6. Check for optimality: If all the basic variables have


nonnegative values then the optimum solution is
reached. Otherwise, Steps 3 to 5 are repeated until the
optimum is reached.

15

Dual Simplex Method:


An Example
Consider the following problem:
Minimize Z  2 x1  x 2
subject to x1  2
3 x1  4 x 2  24
4 x1  3 x 2  12
 x1  2 x 2  1

Max z’ = -2x1 –x2 => Z = -Z’


ST
-x1 +s1 = -2
3x1 + 4x2 +s2 =24
-4x1-3x2 +s3 = -12
X1 -2x2 +s4 = -1

16

8
Dual Simplex Method:
An Example…contd.

Max z’ = -2x1 –x2 => Z = -Z’


ST
-x1 +s1 = -2
3x1 + 4x2 +s2 =24
-4x1-3x2 +s3 = -12
X1 -2x2 +s4 = -1

17

Iteration1
Max z’ = -2x1 –x2 => Z = -Z’
ST
-x1 +s1 = -2
3x1 + 4x2 +s2 =24
-4x1-3x2 +s3 = -12
X1 -2x2 +s4 = -1

x1 x2 X3 X4 X5 x6 RHS

x3 -1 0 1 0 0 0 -2
x4 3 4 0 1 0 0 24
x5 -4 -3 0 0 1 0 -12
x6 1 -2 0 0 0 1 -1
Zj-Cj 2 1 0 0 0 0 0

9
Iteration 2
x1 x2 x3 x4 x5 x6 RHS

x3 -1 0 1 0 0 0 -2
x4 -2.333 0 0 1 1.333333 0 8
x2 1.3333 1 0 0 -0.33333 0 4
3.666 -
x6 7 0 0 0 0.66667 1 7
0.666
Zj-Cj 7 0 0 0 0.333333 0 -4

Iteration 3
x1 x2 x3 x4 x5 x6 RHS

x1 1 0 -1 0 0 0 2
x4 0.00 0.00 -2.33 1.00 1.33 0.00 12.67
x2 0 1 1.33 0 -0.33 0 1.33
x6 0 0 3.67 0 -0.67 1 -0.33
Zj-Cj 0 0 0.67 0 0.33 0 -5.33

10
Iteration 4
x1 x2 x3 x4 x5 x6 RHS

x1 1 0 -1 0 0 0 2
x4 0.00 0.00 4.95 1.00 0.00 1.99 12.01
x2 0 1 -0.49 0 0 -0.5 1.49
- -
5.4776 1.4925 0.4925
x5 0 0 1 0 1 4 37
Zj-Cj 0 0 2.49 0 0 0.5 -5.49

Simplex VS Dual Simplex


Simplex Dual Simplex

Start Pivot Col Pivot Row


Then Pivot Row Pivot Col

Criteria Pivot Col Min Value Pivot Row Min Val

Ratio RHS & Col elements Z row & row elements


Elements >0 Elements <0
Take modulus

Selection Min ratio Min ratio

11
Problem
Min 50 y1 + 30 y2
ST
2y1 +5y2 >=48
-8y1 -5y2 < = -72
Y1, y2 >=0

Max G = -50y1 -30y2


ST
-2y1 -5y2 +s1=-48
-8y1 -5y2 +s2 = -72
Y1, y2 >=0

Max G = -50y1 -30y2


ST
-2y1 -5y2 +s1=-48
-8y1 -5y2 +s2 = -72
Y1, y2 >=0

Basic Y1 Y2 S1 s2 RHS

s1 -2 -5 1 0 -48

s2 -8 -5 0 1 -72

z 50 30 0 0 0

Basic Y1 Y2 S1 s2 RHS

s1 6 0 1 -1 24

y2 1.6 1 0 -0.2 14.4

z 2 0 0 6 -432

12
25

26

13
We will discuss
 The Optimal Solution
 What would happen to objective function if
 The Unit of Profit of B decreases by 20?
 The unit profit on C decreases by 45?
 The Unit Profit on A & C changes to 53?
 Interpret the reduced cost for A
 What would happen to the objective function if
 The RHS of Constraint 1 increases by 5?
 The RHS of Constraint 2 decreases by 250?
 The RHS of Constraint 4 changes to 44?
 Understand Binding & Non-Binding Constraints
 The Slack Variables values in final solution
27

Solver Problem Formulation


Sinsitivity Analysis - Excel Report

A B C

Decision Variables0 70 30 5850

Objective Function
50 60 55

Constraints Usage
Constraint 1 1 1 1 100 <= 100
Constraint 2 2 3 2 270 <= 300
Constraint 3 2 3 2 270 >= 250
Constraint 4 1 0 2 60 >= 60

28

14
Sensitivity – Report - Excel
Variable Cells
Final Reduced Objective Allowable Allowable
Cell Name Value Cost Coefficient Increase Decrease
$C$6 Decision Variables A 0 -7.5 50 7.5 1E+30
$D$6 Decision Variables B 70 0 60 1E+30 5
$E$6 Decision Variables C 30 0 55 5 15

Constraints
Final Shadow Constraint Allowable Allowable
Cell Name Value Price R.H. Side Increase Decrease
$G$11 Constraint 1 Usage 100 60 100 10 6.66666667
$G$12 Constraint 2 Usage 270 0 300 1E+30 30
$G$13 Constraint 3 Usage 270 0 250 20 1E+30
$G$14 Constraint 4 Usage 60 -2.5 60 40 60

29

The Optimal Solution


Objective Cell (Max)
Cell Name Original Value Final Value
$I$6 Decision Variables 5850 5850

Variable Cells
Cell Name Original Value Final Value Integer
$C$6 Decision Variables A 0 0 Contin
$D$6 Decision Variables B 70 70 Contin
$E$6 Decision Variables C 30 30 Contin

30

15
What Would Happen to
Objective Function if
 The Unit of Profit of B decreases by 20?
 The unit profit on C decreases by 45?
 The Unit Profit on A & C changes to 53?

Final Reduced Objective Allowable Allowable UL LL


Cell Name Value Cost Coefficient Increase Decrease
$C$6 Decision Variables A 0 -7.5 50 7.5 1E+30 57.5 -Infinity
$D$6 Decision Variables B 70 0 60 1E+30 5 Infinity 55
$E$6 Decision Variables C 30 0 55 5 15 60 40

The Unit Profit on A & C changes to 53?

Ratio for A = 3/7 = 0.43


Ratio for C = 2/15 = 0.133
Sum = +.43 +0.133 = 0.563 which less than 1
31

What would happen to the objective function if

 The RHS of Constraint 1 increases by 5?


 The RHS of Constraint 2 decreases by 250?
 The RHS of Constraint 4 changes to 44?

Constraints
Final Shadow Constraint Allowable Allowable
Cell Name Value Price R.H. Side Increase Decrease UL LL
$G$11 Constraint 1 Usage 100 60 100 10 6.66666667 110 93.33
$G$12 Constraint 2 Usage 270 0 300 1E+30 30 Inf 270
$G$13 Constraint 3 Usage 270 0 250 20 1E+30 270 0
$G$14 Constraint 4 Usage 60 -2.5 60 40 60 100 0

32

16
Slack & Surplus Variables
Final Shadow Constraint
Name Value Price R.H. Side
Constraint 1 Usage 100 60 100 Slack 0 BINDING
Constraint 2 Usage 270 0 300 Sack 30 Non-Binding
Constraint 3 Usage 270 0 250 Surplus 20 Non-Binding
Constraint 4 Usage 60 -2.5 60 Surplus 0 Binding

33

Thank You

17

You might also like