You are on page 1of 16

4.

Duality
4.1 The Dual Problem
If the solution of a problem yields the solution of another
problem, then the first one is known as the “primal” and
the second, the “dual”. The parameter in the two problems
are the same, except they are being arranged in different
orders. For example, minimization and maximization
problems in LP forms a pair of primal and dual problems.

Consider the primal of a maximization problem in LP,


n
max z   c j x j
j 1
Constraints: n
 aij x j  bi ; i  1,2,..., m
or j 1

Ax  b
xj  0 ; j  1,2,..., n

Prof. C.W. Lim CA3122 Engineering Analysis Part 2: Operations Research 1

4.1 Dual Problem (Cont.)


The dual problem is given by
m
min w   bi yi
i 1

m
Constraints:  aij yi  c j ; j  1,2,..., n
i 1
or ATy  b
yi unrestricted ; i  1,2,..., m

where y = {yi}T is a vector of the dual variables.

Remarks:
 A dual variable is defined for each of the m primal
constraint equations.

Prof. C.W. Lim CA3122 Engineering Analysis Part 2: Operations Research 2


4.1 Dual Problem (Cont.)

Prof. C.W. Lim CA3122 Engineering Analysis Part 2: Operations Research 3

4.1 Dual Problem (Cont.)

Prof. C.W. Lim CA3122 Engineering Analysis Part 2: Operations Research 4


4.1 Dual Problem (Cont.)
Remarks
 A dual constraint is defined for each of the n primal
constraint variables.
 The lhs coefficients of the dual constraint equal the
constraint (column) coefficient of the associated
primal variable. Its rhs equals the objective coefficient
of the same primal variable.
 The objective coefficients of the dual equal the rhs of
the primal constraint equations.
 The number of constraints eqns. and the number of
variables in the objective function swaps.

Standard primal Dual problem


problem objective Objective Constraints type Variables sign
Maximization Minimization  Unrestricted
Minimization Maximization  Unrestricted

Prof. C.W. Lim CA3122 Engineering Analysis Part 2: Operations Research 5

4.1 Dual Problem (Cont.)


Example 4.1:
Dual
Primal Standard primal
variables
Max z = 5x1+12x2+4x3 Max z = 5x1+12x2+4x3+0x4
subject to subject to
x1+2x2+x3  10 x1+2x2+x3+x4 = 10 y1
2x1 - x2+3x3 = 8 2x1 - x2+3x3+0x4 = 8 y2
x1, x2, x3  0 x1, x2, x3, x4  0
Dual problem: min w  10 y1  8 y2
constraints: y1  2 y2  5
2 y1  y2  12
y1  3 y2  4
y1  0 y2  0   y1  0

y1 , y2 unrestricted   y2 unrestricted

Prof. C.W. Lim CA3122 Engineering Analysis Part 2: Operations Research 6


4.1 Dual Problem (Cont.)
Example 4.2:
Dual
Primal Standard primal
variables
Min z = 15x1+12x2 Min z = 15x1+12x2+0x3+0x4
subject to subject to
x1+2x2  3 x1+2x2 -x3 = 3 y1
2x1 - 4x2 5 2x1 - 4x2+x4 = 5 y2
x 1, x 2  0 x1, x2, x3, x4  0

Dual problem: max w  3 y1  5 y2


y1  2 y2  15
constraints:
2 y1  4 y2  12
 y1 0
y2  0
y1 , y2 unrestricted (redundant)
 an unrestricted primal variable always corresponds to an equality
dual constraint
 a primal equation produces an unrestricted dual variable.
Prof. C.W. Lim CA3122 Engineering Analysis Part 2: Operations Research 7

4.1 Dual Problem (Cont.)


 Example 4.3

Prof. C.W. Lim CA3122 Engineering Analysis Part 2: Operations Research 8


4.1 Dual Problem (Cont.)
Dual
Example 4.3: Primal Standard primal
variables
Max z = 5x1+6x2 Max z = 5x1+ - 5x1- + 6x2
subject to subject to
x1+2x2 = 5 x1+ - x1- +2x2 = 5 y1
-x1+5x2  3 - x1+ + x1- + 5x2 - x3 = 3 y2
4x1+7x2  8 4x1+ - 4x1- + 7x2 + x4 = 8 y3
x1 unrestricted x1+, x1-, x2, x3, x4  0
x2  0

Dual problem: min w  5 y1  3 y2  8 y3


constraints:
y1  y 2  4 y3  5 
  y1  y 2  4 y3  5
 y1  y 2  4 y3   5 
2 y1  5 y 2  7 y3  6
 y2  0  y2  0
y3  0
y1 unrestricted
y2 unrestricted (redundant)

Prof. C.W. Lim CA3122 Engineering Analysis Part 2: Operations Research 9

4.1 Dual Problem (Cont.)


Primal-Dual Relationships
 Identity matrix

 Inverse matrix

Prof. C.W. Lim CA3122 Engineering Analysis Part 2: Operations Research 10


4.1 Dual Problem (Cont.)
 Right-hand side equals the inverse multiplied by the original
right-hand side vector of the original constraints
Example: Reddy Mikks model
Basic z x1 x2 s1 s2 s3 s4 Solution
z 1 -5 -4 0 0 0 0 0 z -row
s1 0 6 4 1 0 0 0 24 s 1-row
s2 0 1 2 0 1 0 0 6 s 2-row
s3 0 -1 1 0 0 1 0 1 s 3-row
s4 0 0 1 0 0 0 1 2 s 4-row

Basic z x1 x2 s1 s2 s3 s4 Solution
z 1 0 0 3/4 1/2 0 0 21
x1 0 1 0 1/4 -1/2 0 0 3
x2 0 0 1 -1/8 3/4 0 0 3/2
s3 0 0 0 3/8 -5/4 1 0 5/2
s4 0 0 0 1/8 -3/4 0 1 1/2

 1 4 1 2 0 0  24   3 
 0   6  3 2 
 1 8 3 4 0
  
 3 8 5 4 1 0   1  5 2 
 
 1 8 3 4 0 1   2  1 2 
Prof. C.W. Lim CA3122 Engineering Analysis Part 2: Operations Research 11

4.1 Dual Problem (Cont.)


Two methods for determining the dual values

 Method 1
 optimal primal z -coefficient of starting variable xi 
 optimal value of   
   
 dual variable yi   objective coefficient of 
 original xi 
 Method 2
 row vector of 
 optimal value     optimal primal 
 
  original objective coefficients  
 of dual variables   of optimal primal basic variables   inverse 
 

The elements of the row vector must appear in the same order
the basic variables are listed in the Basic column of the simplex
tableau.

Prof. C.W. Lim CA3122 Engineering Analysis Part 2: Operations Research 12


4.2 Relationship of Primal and Dual
Example 4.4:
Primal Standard Primal Dual
Max z = 5x1+12x2+4x3 Max z = 5x1+12x2+4x3+0x4-MR Min w = 10y1+8y2
subject to subject to subject to
x1+2x2+x3  10 x1+2x2+x3+x4 = 10 y1+2y2  5
2x1-x2+3x3 = 8 2x1-x2+3x3+R = 8 2y1-y2  12
x1, x2, x3  0 x1, x2, x3, x4, R  0 y1+3y2  4
y1  0; y2  -M
y2 unrestricted
The tableau of the simplex iterations for the primal problem is
Iteration Basic x1 x2 x3 x4 R Solution
0 z - 5 - 2M - 12 + M - 4 - 3M 0 0 - 8M
x4 1 2 1 1 0 10
R 2 -1 3 0 1 8
1 z - 7/3 - 40/3 0 0 4/3 + M 32/3
x4 1/3 7/3 0 1 - 1/3 22/3
x3 2/3 - 1/3 1 0 1/3 8/3
2 z - 3/7 0 0 40/7 - 4/7 +M 368/7
x2 1/7 1 0 3/7 - 1/7 22/7
x3 5/7 0 1 1/7 2/7 26/7
3 z 0 0 3/5 29/5 - 2/5 + M 274/5
x2 0 1 - 1/5 2/5 - 1/5 12/5
x1 1 0 7/5 1/5 2/5 26/5

Prof. C.W. Lim CA3122 Engineering Analysis Part 2: Operations Research 13

4.2 Primal and Dual (Cont.)


The optimal solution of one problem can be secured directly
from the optimal simplex tableau of the other problem.

Method 1: The starting primal variables x4 and R uniquely correspond


to the dual variables y1 and y2 , respectively.

Starting primal basic variables x4 R


z-eqn coefficient (iteration 3) 29/5 - 2/5 + M
Original objective coefficient 0 -M
Dual variables y1 y2
Optimal dual values 29/5 + 0=29/5 - 2/5 + M + (-M)= - 2/5

Prof. C.W. Lim CA3122 Engineering Analysis Part 2: Operations Research 14


4.2 Primal and Dual (Cont.)
Method 2: The optimal inverse matrix under the starting variables x4 and R
is
 2 5 1 5 
optimal inverse   
1 5 2 5 
The order of the optimal primal basic variables in the Basic column is x2
follow by x1 . The elements of the original objective coefficients for the two
variables must appear in the same order.

 original objective coefficients    coefficient of x2 , coefficient of x1   12, 5


The optimal dual values are
 Original objective 
 y1 , y2       Optimal inverse 
 coefficient of x2 , x1 
 2 5 1 5   29 2 
 12,5      , 
1 5 2 5   5 5

Prof. C.W. Lim CA3122 Engineering Analysis Part 2: Operations Research 15

4.2 Primal and Dual (Cont.)


Primal-dual objective values
For any pair of feasible primal and dual solutions,
 objective value in the   objective value in the 
  
 maximization problem   minimization problem 

At the optimum, the relationship holds as a strict equation, meaning that the two objective values
are equal. Note that the relationship does not specify which problem is primal and which is dual.
Only the sense of optimization (maximization or minimization) is important in this case.

The optimum cannot occur with z strictly less than w (i.e., z  w ) because, no matter how close z
and w are, there is always room for improvement, which contradicts optimality as the figure above
demonstrates.

The objective value for minimization problem provides an upper bound on the objective value for
maximization problem. In the course of successive simplex iteration, an equilibrium will be
reached where the maximization and the minimization objective values are equal.

Prof. C.W. Lim CA3122 Engineering Analysis Part 2: Operations Research 16


4.2 Primal and Dual (Cont.)
Simplex Tableau Computations
Formula 1: Constraint column computations
In any simplex iteration, a left-hand or a right-hand side column is
computed as follows:
 constraint column   inverse in   original 
   
 in iteration i   iteration i   constraint column 

Formula 2: Objective z-row computations


In any simplex iteration, the objective equation coefficient of xi is

 Primal z -equation   left-hand side of   right-hand side of 


   
 coefficient of variable x j   j th dual constraint   jth dual constraint 

Prof. C.W. Lim CA3122 Engineering Analysis Part 2: Operations Research 17

4.2 Primal and Dual (Cont.)


From Example 4.4:
Formula 1
 2 5 1 5 
optimal inverse   
1 5 2 5 
 x1 -column in   inverse in   original   2 5  1 5  1   0 
     x -column        
 optimal iteration   optimal iteration   1   1 5 2 5  2   1 
 29 2
Formula 2: The optimal values of the dual variables are  y , y    5 ,  5  .
1 2

These values are used to compute all the z-coefficients, as


illustrates here for x1 and R.
29  2
z -coefficient of x1  y1  2 y2  5   2    5  0
5  5
2 2
z -coefficient of R  y2    M       M     M
5 5

Prof. C.W. Lim CA3122 Engineering Analysis Part 2: Operations Research 18


4.2 Primal and Dual (Cont.)
Applying Formula 2 to the starting variables x4 and R in optimal
iteration 3
 Primal z -equation   left-hand side of   right-hand side of 
   
 coefficient of variable x j   jth dual constraint   jth dual constraint 

Starting primal variables x4 R


z-eqn coefficient (iteration 3) 29/5 - 2/5 + M
Associated dual constraints y1  0 y2  - M
Eqn resulting from Property I y1 -0=29/5 y2 - (-M)= - 2/5 + M

Prof. C.W. Lim CA3122 Engineering Analysis Part 2: Operations Research 19

4.2 Primal and Dual (Cont.)


Example: From the previous example, the primal and dual problems
have feasible solutions (x1 = 0, x2 = 0, x3 = 8/3) and (y1 = 6, y2 = 0)
by inspection of the constraints (not from simplex computation or
from Property I). The associated values of the objective functions are
z = 32/3 and w = 60 (Property II is satisfied). Conversely, the
optimum solution for the two problems (x1 = 26/5, x2 = 12/5, x3 = 0)
and (y1 = 29/5, y2 = -2/5) yield z = w = 274/5 (Property II is also
satisfied).
Iteration Basic x1 x2 x3 x4 R Solution
0 z - 5 - 2M - 12 + M - 4 - 3M 0 0 - 8M
x4 1 2 1 1 0 10
R 2 -1 3 0 1 8 Min : w  10 y1  8 y2
1 z - 7/3 - 40/3 0 0 4/3 + M 32/3 y1  2 y2  5
x4 1/3 7/3 0 1 - 1/3 22/3
x3 2/3 - 1/3 1 0 1/3 8/3 2 y1  y2  12
2 z - 3/7 0 0 40/7 - 4/7 +M 368/7 y1  3 y2  4
x2 1/7 1 0 3/7 - 1/7 22/7
x3 5/7 0 1 1/7 2/7 26/7
y1  0; y2   M
3 z 0 0 3/5 29/5 - 2/5 + M 274/5
x2 0 1 - 1/5 2/5 - 1/5 12/5
x1 1 0 7/5 1/5 2/5 26/5

Prof. C.W. Lim CA3122 Engineering Analysis Part 2: Operations Research 20


4.4 Economic Interpretation of Duality
Consider the general primal and dual problems in which the
primal takes the role of a resource allocation model
Primal Dual
n
max z   c j x j m
min w   bi yi
j 1
i 1
n m
 aij x j  bi ; i  1,2,..., m  aij yi  c j ; j  1,2,..., n
j 1 i 1

xj  0 ; j  1,2,..., n yi  0 ; i  1,2,..., m

For the primal problem


n = the number of economic activities
m = the number of resources
cj = profit per unit activity of j
bi = maximum availability of resource i
aij = the i-resource consumption rate per unit activity of j

Prof. C.W. Lim CA3122 Engineering Analysis Part 2: Operations Research 21

4.2 Economic Interpretation of Duality (Cont.)


Economic Interpretation of Dual Variables

From Property II,


n m
z   c j x j   bi yi  w
j 1 i 1

and strict equality holds when both are optimal.

Consider the optimal where z represents the profit in $,


zw
$revenue   (units of resource i ) ($ per unit of resource i )
i

where the dual variables yi represent the worth per unit of


resource i. The dual variables are referred as dual prices,
shadow prices and simplex multipliers.
Prof. C.W. Lim CA3122 Engineering Analysis Part 2: Operations Research 22
4.2 Economic Interpretation of Duality (Cont.)
Using the similar logic, the inequality
zw
Profit  Worth of resources

for any two feasible primal and dual solutions. This relationship
also implies that so long as the total return from all the activities
is less than the worth of the resources, the corresponding primal
and dual solutions cannot be optimal.

Prof. C.W. Lim CA3122 Engineering Analysis Part 2: Operations Research 23

4.2 Economic Interpretation of Duality (Cont.)


Economic Interpretation of Dual Constraints

From Property I,
m
Objective coefficient of x j   aij yi  c j
i 1

at any primal iteration. Consider


cj = profit per unit of activity j (in dollars per unit)
aij = amount of resource i used by activity j
yi = imputed cost per unit of resource i
m
 aij yi = imputed cost of all the resources needed to produce 1
i 1

unit of activity j

Prof. C.W. Lim CA3122 Engineering Analysis Part 2: Operations Research 24


4.2 Economic Interpretation of Duality (Cont.)
Example 4.5: Reddy Mikks model

Reddy Mikks primal Reddy Mikks dual


max z = 5x1 + 4x2 min w = 24y1 + 6y2 + y3 + 2y4
subject to subject to
6x1 + 4x2  24 (resource 1) 6y1 + y2 - y3  5
x1 + 2x2  6 (resource 2) 4y1 + 2y2 + y3 + y4  4
- x1 + x2  1 (resource 3) y1, y2, y3, y4  0
x2  2 (resource 4)
x1, x 2  0
Optimal solution: Optimal solution:
y1 = 0.75, y2 = 0.5, y3 = y4 = 0,
x1 = 3, x2 = 1.5, z = 21
w = 21

Prof. C.W. Lim CA3122 Engineering Analysis Part 2: Operations Research 25

4.2 Economic Interpretation of Duality (Cont.)


Example: TOYCO assembles three types of toys: trains, trucks, and cars using
three operations. The daily limits on the available times for the three
operations are 430, 460, and 420 minutes, respectively, and the profits per
toy train, truck, and car are $3, $2, and $5, respectively. The assembly
times per train at the three operations are 1, 3, and 1 minutes, respectively.
The corresponding times per truck and per car are (2,0,4) and (1,2,0)
minutes (a zero time indicates that the operation is not needed).

Letting x1, x2, x3 represent the daily number of units assembled of trains, trucks
and cars, the associated LP model and its dual are given as:

TOYCO primal TOYCO dual


max z = 3x1 + 2x2 + 5x3 min w = 430y1 + 460y2 + 420y3
subject to subject to
x1 + 2x2 + x3  430 (operation 1) y1 + 3y2 + y3  3
3x1 + 2x3  460 (operation 2) 2y1 + 4y3  2
x1 + 4x2  420 (operation 3) y1 + 2y2  5
x1, x2, x3  0 y1, y2, y3  0
Optimal solution: Optimal solution:
x1 = 0, x2 = 100, x3 = 230, z = $1350 y1 = 1, y2 = 2, y3 = 0

Prof. C.W. Lim CA3122 Engineering Analysis Part 2: Operations Research 26


4.2 Economic Interpretation of Duality (Cont.)
The maximization optimality condition of the simplex method says that an increase in
the level of an
m
unused (nonbasic) activity j can improve profit only if its objective
coefficient  a y  c is negative, or
ij i j
i 1

Imputed cost of used resources per unit of activity j < Profit per unit of activity j

In the example, x1= 0 means that toy trains are not profitable. Toy trains will
become profitable only if z1 < c1 for x1. There are two options to increase profit :
(i) increase the profit per unit c1 by raising the unit selling price (not advisable), or
(ii) decrease the imputed cost of the used resources z1 (= y1 + 3y2 + y3). This option
is more plausible because it entails making improvements in the assembly
operations, mainly by reducing their unit usage of available operations times. To
determine a new imputed cost such that it falls below the unit profit c1, we have
1(1  r1 ) y1  3(1  r2 ) y2  1(1  r3 ) y3  3
where (0  r1, r2, r3  1) are the proportions by which the unit times of the three
operations are reduced. For y1 = 1, y2 = 2, and y3 = 0, we obtain
r1  6r2  1
Any feasible values of r1 and r2 that satisfies this inequality render toy trains
profitable. For example, r1 = 0.25 and r2 = 0.2, we have z1 - c1 = - 2.55.

Prof. C.W. Lim CA3122 Engineering Analysis Part 2: Operations Research 27

Example
Write the dual problem for Reddy Mikks model and determine its
optimum solution from the optimal tableau in the standard primal
problem.
Standard primal:
Maximize z  5 x1  4 x2  0 s1  0 s2  0 s3  0 s4
subject to 6 x1  4 x2  s1  24
x1  2 x2  s2 6
 x1  x2  s3 1
x2  s4  2
x1 , x2 , s1 , s2 , s3 , s4  0
Optimal tableau:
Basic z x1 x2 s1 s2 s3 s4 Solution
z 1 0 0 3/4 1/2 0 0 21
x1 0 1 0 1/4 -1/2 0 0 3
x2 0 0 1 -1/8 3/4 0 0 3/2
s3 0 0 0 3/8 -5/4 1 0 5/2
s4 0 0 0 1/8 -3/4 0 1 1/2

Prof. C.W. Lim CA3122 Engineering Analysis Part 2: Operations Research 28


Example (Cont.)

Dual:

Primal Standard Primal Dual

Max: Max: Min:


z = 5x1+4x2 z = 5x1+4x2+0s1+0s2+0s3+0s4 w = 24y1+6y2+y3+2y4
subject to subject to subject to
6x1+4x2  24 6x1+4x2+s1 = 24 6y1+y2-y3 ≥5
x1+2x2 6 x1+2x2 +s2 =6 4y1+2y2+y3+y44
-x1+x2 1 -x1+ x2 + s3 =1 y10
x2 2 x2 + s4=2 y20
x1 , x 2  0 x1, x2, s1, s2, s3, s4  0 y30, y40

Prof. C.W. Lim CA3122 Engineering Analysis Part 2: Operations Research 29

Example (Cont.)
Applying Property I to the starting variables s1,s2,s3,s4 in
optimal iteration
Starting primal
variables
s1 s2 s3 s4
z-eqn coefficient 3/4 1/2 0 0
Associated dual
constraints y1  0 y2  0 y3  0 y4  0
Eqn resulting from
Property I
y1 -0=3/4 y2 -0=1/2 y3 -0=0 y4 -0=0

we obtain the dual optimum solution as:


y1  3 4, y2  1 2, y3  0, y4  0
w  24  3 4  6 1 2  1 0  2  0  21
Note that the dual optimal solution is the same as the primal
optimal solution, i.e., woptimal = zoptimal

Prof. C.W. Lim CA3122 Engineering Analysis Part 2: Operations Research 30


Example (Cont.)

What if applying Property I to the other variables, for example,


x1,x2,s3,s4?

primal variables x1 x2 s3 s4
z-eqn coefficient 0 0 0 0
Associated dual constraints 6y1 + y2- y3 5 4y1 +2y2+ y3 +y4 4 y3  0 y4  0
Eqn resulting from Property I 6y1 + y2- y3 -5=0 4y1 +2y2+ y3 +y4-4=0 y3 -0=0 y4 -0=0

y1,y2,y3,y4 can be solved from the eqns resulting from Property I:

y1  3 4, y2  1 2, y3  0, y4  0, w  21

Prof. C.W. Lim CA3122 Engineering Analysis Part 2: Operations Research 31

Gaussian elimination
Example
1 4 2 : 3  r1 1 4 2 : 3  r1
 2 2 1 : 1  r   0 10 5 : 5 r  r  2r
  2   2a 2 1
 3 1 2 : 11 r3  0 11 8 : 2  r3a  r3  3r1

1 4 2 : 3  r1 x  4 y  2z  3
  0 10 5 : 5  r2 a1   10y  5 z  5
 0 0 2.5 : 7.5 11 2.5 z  7.5
r3b  r3a  r2 a
10
x 1 1 4 2  1   3 
 y2  2 2 1   2    1 
    
z3  3 1 2   3  11
Prof. C.W. Lim CA3122 Engineering Analysis Part 2: Operations Research 32

You might also like