Duality
For every linear programming problem there is a related unique linear programming problem involving the
same data which also describe the original problem. The given original programme is called the primal
programme. This programme can be rewritten by transposing (reversing) the rows and column of the
algebraic statement of the problem. Inverting the programme in this way results in dual programme. A
solution to the dual programme may be found in a manner similar to that used for the primal. The two
programmes have very closely related properties so that optimal solution of the dual gives complete
information about the optimal solution of the primal and vice-versa.
Duality is an extremely important and interesting feature of linear programming. The various useful
aspects of this property are:
(i) If the primal problem contains a large number of rows (constraints) and a smaller number of columns
(variables), the computational procedure can be considerably reduced by converting it into dual and then
solving it. Hence it offers an advantage in many applications.
(ii) It gives additional information as to how the optimal solution changes as a result of the changes in the
coefficients and the formulation of the problem. This is termed as post optimality or sensitivity analysis.
(iii) Duality in a linear programming has certain far reaching consequences of economic nature.
(iv) Calculation of the dual checks the accuracy of the primal solution.
The general linear programming problem (primal problem) is in the canonical form can be stated as
follows:
Minimize f X c 1 x 1 c 2 x 2 ... ... c n x n 1
Subject to the constraints
a 11 x 1 a1 2 x 2 ... ... a1 n x n b 1
a 21 x 1 a2 2 x 2 ... ... a2 n x n b 2
2
… … … … … … … … …
a m1 x 1 am 2 x 2 ... ... am n x n b m
and the non negativity restrictions x j 0; j 1, 2,, n . 3
Page 1 of 14
The corresponding dual problem can be stated as follows:
Maximize g W w 1b 1 w 2 b 2 ... ... wm b m 4
Subject to the constraints
a 11 w 1 a 21w 2 ... ... am1 w m c 1
a 12 w1 a 22 w 2 ... ... am2 w m c 2
5
… … … … … … … … …
a 1n w1 a 2n w 2 ... ... amnw m c n
and the non negativity restrictions w i 0; i 1, 2,, m . 6
The general linear programming problem (primal problem) is in the canonical form can be stated as
follows:
Maximize f X c 1 x 1 c 2 x 2 ... ... c n x n 1
Subject to the constraints
a 11 x 1 a1 2 x 2 ... ... a1 n x n b 1
a 21 x 1 a2 2 x 2 ... ... a2 n x n b 2
2
… … … … … … … … …
a m1 x 1 am 2 x 2 ... ... am n x n b m
and the non negativity restrictions x j 0; j 1, 2,, n . 3
The corresponding dual problem can be stated as follows:
Minimize g W w 1b 1 w 2 b 2 ... ... wm b m 4
Subject to the constraints
a 11 w 1 a 21w 2 ... ... am1 w m c 1
a 12 w1 a 22 w 2 ... ... am2 w m c 2
5
… … … … … … … … …
a 1n w1 a 2n w 2 ... ... amnw m c n
and the non negativity restrictions w i 0; i 1, 2,, m . 6
Page 2 of 14
From the above two programmes, the following points are clear:
(i) If the primal contains n variables and m constraints, the dual will contain m variables and n
constraints.
(ii) The maximization problem in the primal becomes the minimization problem in the dual and
vice versa.
(iii) The maximization problem has (≤) constraints while the minimization problem has (≥)
constraints.
(iv) The constants c1, c2, … , cn in the objective function of the primal appear in the constraints of
the dual.
(v) The constants b1, b2, … , bm in the constraints of the primal appear in the objective function of
the dual.
(vi) The variables in both the problems are non-negative.
Different forms of the primal problems and the corresponding dual problem:
Primal Dual
1. n m
Minimize Z c j x j Maximize Z bi y i
j 1 i 1
n m
Subject to a ij x j bi Subject to a
i 1
ij yi c j
j 1
and x j 0 ; i=1, 2, … , m; j=1, 2, … , n and y i 0 ; i=1, 2, … , m; j=1, 2, … , n
2. n m
Maximize Z c j x j Minimize Z bi y i
j 1 i 1
n m
Subject to a ij x j bi Subject to a
i 1
ij yi c j
j 1
and x j 0 ; i=1, 2, … , m; j=1, 2, … , n and y i 0 ; i=1, 2, … , m; j=1, 2, … , n
3. n m
Maximize Z c j x j Minimize Z bi y i
j 1 i 1
n m
Subject to a ij x j bi Subject to a
i 1
ij yi c j
j 1
and x j 0 ; i=1, 2, … , m; j=1, 2, … , n and y i unrestricted in sign;
i=1, 2, … , m; j=1, 2, … , n
4. n m
Maximize Z c j x j Minimize Z bi y i
j 1 i 1
Page 3 of 14
n m
Subject to a
j 1
ij x j bi Subject to a
i 1
ij yi c j
and x j unrestricted in sign; and y i 0 ; i=1, 2, … , m; j=1, 2, … , n
i=1, 2, … , m; j=1, 2, … , n
5. n m
Maximize Z c j x j Minimize Z bi y i
j 1 i 1
n m
Subject to a ij x j bi Subject to a
i 1
ij yi c j
j 1
and x j 0 ; i=1, 2, … , m; j=1, 2, … , n and y i 0 ; i=1, 2, … , m; j=1, 2, … , n
6. n m
Maximize Z c j x j Minimize Z bi y i
j 1 i 1
n m
Subject to a ij x j bi Subject to a
i 1
ij yi c j
j 1
and x j unrestricted in sign; and y i unrestricted in sign;
i=1, 2, … , m; j=1, 2, … , n i=1, 2, … , m; j=1, 2, … , n
7. n m
Maximize Z c j x j Minimize Z bi y i
j 1 i 1
n m
Subject to a ij x j bi Subject to a
i 1
ij yi c j
j 1
and x j unrestricted in sign; and y i 0 ; i=1, 2, … , m; j=1, 2, … , n
i=1, 2, … , m; j=1, 2, … , n
Construct the dual of the following primal problem:
Primal Dual
Maximize Z 3 x 1 5x 2 Min Y 50 y 1 35 y 2 10 y3 20 y 4
Subject to 2 x 1 6 x 2 50 Subject to 2 y 1 3 y 2 5 y3 3
3x 1 2 x 2 35 6 y 1 2 y 2 3 y3 y 4 5
5x 1 3 x 2 10 and y 1 , y 2 , y3 , y 4 0 .
x 2 20
x1, x 2 0 .
Page 4 of 14
Let y1, y2, y3 and y4 be the corresponding dual variables.
Then the dual problem is given by
Minimize Y 50 y 1 35 y 2 10 y3 20 y 4
Subject to 2 y 1 3 y 2 5 y3 3
6 y 1 2 y 2 3 y3 y 4 5
and y 1 , y 2 , y3 , y 4 0 .
Obtain the dual of the following primal problem:
Minimize Z 3 x 1 2 x 2 x 3
Subject to 2 x 1 3 x 2 x 3 5
4 x1 2 x 2 9
8 x1 4 x 2 3 x 3 8
x 1 , x 2 0 , x 3 unrestricted.
Since x 3 is unrestricted, let x 3 x3 x3 , where x3 0, x3 0 .
Then the given problem becomes
Minimize Z 3 x 1 2 x 2 x3 x3
Subject to 2 x 1 3 x 2 x3 x3 5 2<3 -2>-3
4 x1 2 x 2 9
8 x 1 4 x 2 3 x3 3 x3 8
x 1 , x 2 , x3 , x3 0
Since the given problem is minimization type, the first constraint is multiplied by -1 to get
2 x 1 3 x 2 x3 x3 5
The equation 8 x 1 4 x 2 3 x3 3 x3 8 can be expressed as a pair of inequalities
Page 5 of 14
8 x 1 4 x 2 3 x3 3 x3 8
8 x 1 4 x 2 3 x3 3 x3 8
Or, 8 x 1 4 x 2 3 x3 3 x3 8
8 x 1 4 x 2 3 x3 3 x3 8
Thus the given problem becomes
Primal Dual
Minimize Z 3 x 1 2 x 2 x3 x3
Max Y 5 y 1 9 y 2 8 y 3 y3
Subject to 2 x 1 3 x 2 x3 x3 5
Subject to 2 y 1 4 y 2 8 y 3 y3 3
4 x1 2 x 2 9 3 y 1 2 y 2 4 y 3 y3 2
8 x 1 4 x 2 3 x3 3 x3 8 y1 3 y 3 y3 1
8 x 1 4 x 2 3 x3 3 x3 8 y1 3 y 3 y3 1
x 1 , x 2 , x3 , x3 0 y 1 , y 2 , y 3 , y3 0
Let y 1 , y 2 , y 3 , y3 be the associated non-negative dual variables. Then the dual of this problem is
Maximize Y 5 y 1 9 y 2 8 y 3 y3
Subject to 2 y 1 4 y 2 8 y 3 y3 3
3 y 1 2 y 2 4 y 3 y3 2
y1 3 y 3 y3 1
y1 3 y 3 y3 1
y 1 , y 2 , y 3 , y3 0
Replacing y 3 y3 by y 3 , where y 3 is unrestricted in sign and combining the last two inequalities so as
to form equation, this dual may be written as
Maximize Y 5 y 1 9 y 2 8 y3
Subject to 2 y 1 4 y 2 8 y3 3
Page 6 of 14
3 y 1 2 y 2 4 y3 2
y1 3 y3 1
y 1 , y 2 0 , y3 unrestricted in sign.
Write down the dual problem of the primal problem
Max x1 x 2
Subject to x1 x 2 1;
x1 x 2 1 ;
x1 x 2 1 and x j 0 ; j 1, 2
As the problem is of maximization type, all the constraints must be expressed in ≤ form. Multiplying the
first inequality constraints by -1 on both sides we obtain,
Max x1 x 2
Subject to x1 x2 1 ;
x1 x 2 1 ;
x1 x 2 1 and x j 0 ; j 1, 2
Let y1, y2 and y3 be the corresponding dual variables.
Then the dual problem is given by
Minimize Y y 1 y 2 y3
Subject to y 1 y 2 y3 1
y 1 y 2 y3 1
and y 1 , y 2 , y3 0 .
The duality Theorem:
If either the primal or the dual problem has a finite optimum solution, then the other problem has
a finite optimum solution and the extremes of the linear functions are equal, that is, min f(X)=max
g(W). If either problem has an unbounded optimum solution, then the other problem has no
feasible solution.
Verify the duality theorem for the following Linear Programming Problem:
Page 7 of 14
Maximize Z 4x1 x2
Subject to
x1 2x2 4
2 x1 3x2 12
4 x1 4 x2 12
x1 , x2 0 .
Complementary Slackness Theorem:
For optimal feasible solutions of the primal and dual systems whenever inequality occurs in the
kth relation of either system (the corresponding slack variable is positive), then the kth variable of
its dual vanishes; if the kth variable is positive in either system, the kth relation of its dual is
equality (the corresponding slack variable is zero).
The primal problem can be stated as follows:
Minimize f X c 1 x 1 c 2 x 2 ... ... c n x n 1
Subject to the constraints
a 11 x 1 a1 2 x 2 ... ... a1 n x n b 1
a 21 x 1 a2 2 x 2 ... ... a2 n x n b 2
2
… … … … … … … … …
a m1 x 1 am 2 x 2 ... ... am n x n b m
and the non negativity restrictions x j 0; j 1, 2,, n . 3
The corresponding dual problem can be stated as follows:
Maximize g W w 1b 1 w 2 b 2 ... ... wm b m 4
Subject to the constraints
a 11 w 1 a 21w 2 ... ... am1 w m c 1
a 12 w1 a 22 w 2 ... ... am2 w m c 2
5
… … … … … … … … …
a 1n w1 a 2n w 2 ... ... amnw m c n
Page 8 of 14
and the non negativity restrictions w i 0; i 1, 2,, m . 6
We rewrite the inequalities (2) of the primal system as equalities by subtracting a nonnegative slack
variable x n i from the ith inequality to obtain
a 11 x 1 a12 x 2 ... ... a1n x n x n1 b1
a 21 x 1 a2 2 x 2 ... ... a2 n x n x n 2 b2
7
… … … … … … … … … … … … … … …
a m1 x 1 am 2 x 2 ... ... am n x n x n m b m
Similarly, for the dual inequalities (5) we add a nonnegative slack variable w m j to the jth
inequality to obtain
a 11 w1 a 21w 2 ... ... am1 w m wm1 c1
a 12 w1 a 22 w 2 ... ... am2 w m wm2 c 2 8
… … … … … … … … … … … … … … …
a1n w1 a 2n w2 ... ... amn wm wmn c n
We next multiply the ith equation of (7) by the corresponding dual variable w i , i 1, 2 , , m ,
and add the resulting set of equations, and subtract this sum from (1) to obtain
m m m
c 1 a i1 w i x 1 c 2 a i 2 w i x 2 ... ... c n a in w i x n
i 1 i 1 i 1
w1 xn 1 w2 xn 2 wm xn m f X wi bi
m
i 1
Noting that wm j c j a ij w i and g W w i b i we have
m m
i 1 i 1
wm1 x1 wm 2 x2 wm n xn w1 xn1 w2 xn 2 wm xn m f X g W 9
0 0 0 0
From the duality theorem, we have for an optimum solution X x 1 , x 2 , , x n to the primal problem
0 0
0 0
and W w 1 , w 2 , , w m an optimum solution to the dual problem that f X 0 g W 0 0 . Thus for
these optimum solutions and corresponding slack variables x n i 0 and w n j 0 , (9) becomes
0 0
w m0 1 x 10 w m0 2 x 02 w 0m n x n0 w 10 x n0 1 w 20 x n0 2 w m0 x n0 m 0 10
Page 9 of 14
We note that the terms w 0m j x 0j are the product of the jth slack variable of the dual and the jth variable of
the original primal; while the terms w 0i x n0 i are the product of the ith variable of the original dual and the
ith slack variable of the primal.
Since all variables are restricted to be nonnegative, all the product terms of (10) are nonnegative, and as the
sum of these terms must be equal to zero, they individually must be equal to zero.
Thus w 0m j x 0j 0 for all j and w 0i x n0 i 0 for all i .
If w 0m k 0 , we must have x k0 0 ;
If x 0n k 0 then w k0 0 , which establishes the first part of the theorem.
If x 0k 0 , then w m0 k 0 ; if w 0k 0 then x n0k 0 , which completes the proof.
Write down the dual of the following primal problem and find the optimal solution of the dual
problem. Using complementary slackness theorem conditions derive the optimal solution of the
primal problem.
Maximize Z= 4x1+x2
Subject to
-x1+2x2≤4
2x1+3x2≤12
4x1 –4x2≤12
x1, x2 ≥0
Dual of the given problem
Minimize W= 4w1+12w2+12w3
Subject to -w1+2w2+4w3 ≥4
2w1+3w2 –4w3 ≥1
w1, w2, w3 ≥0
Standard form of the primal problem
Maximize Z= 4x1+x2
Subject to
-x1+2x2 +x3 =4
2x1+3x2 +x4 =12
4x1 –4x2 +x5=12
x1, x2 , ... … , x5 ≥0
Standard form of the dual problem
Minimize W= 4w1+12w2+12w3
Subject to -w1+2w2+4w3 –w4 =4
2w1+3w2 –4w3 -w5 =1
Page 10 of 14
wj ≥0, j=1, 2, … , 5
Introducing artificial variable in the dual problem, we get
Minimize W= 4w1+12w2+12w3 +Mw6 +Mw7
Subject to -w1+2w2+4w3 –w4 +w6 =4
2w1+3w2 –4w3 -w5 +w7 =1
wj ≥0, j=1, 2, … , 7.
4 12 12 0 0 M M
i Basis C PO
P1 P2 P3 P4 P5 P6 P7
P6 M 4 -1 2 4 -1 0 1 0 4/2=2
1
P7 M 1 2 3 -4 0 -1 0 1 1/3(min)
0 -4 -12 -12 0 0 0 0
z j c j Max.→(5)
5 1 5 0 -1 -1 0 0
P6 M 10/3 -7/3 0 20/3 -1 2/3 1 1/2(min)
2
P2 12 1/3 2/3 1 -4/3 0 -1/3 0 ----
4 4 0 -28 0 -4 0
z j c j Max.→(20/3)
10/3 -7/3 0 20/3 -1 2/3 0
P3 12 1/2 -7/20 0 1 -3/20 1/10
3
P2 12 1 1/5 1 0 2/15 -1/5
z j c j 18 -29/5 0 0 -33/5 -6/5
Since all z j c j 0 , the optimality condition is satisfied and the optimal solution of the dual problem is
1
w1=0, w2=1, w3= and
2
Minimum value, W=18
Complementary slackness conditions are
w1x3 =0, w2x4 =0, w3x5 =0, w4 x1 =0, w5x2 =0
From dual constraint of standard form
1
-w1+2w2+4w3 –w4 =4 -0+2.1+4. -w4=4 -w4 +2+2=4 w4 =0
2
1
2w1+3w2 –4w3 -w5 =1 2.0+3.1-4. -w5=1 -w5 +3-2=1 w5 =0
2
Since w1=0 x3>0
w2=1>0 x4=0
Page 11 of 14
1
w3 = >0 x5=0
2
w4=0 x1>0
w5=0 x2>0
Therefore, primal constraints of standard form becomes
-x1+2x2+x3 =4
2x1+3x2 =12
4x1- 4x2 =12
21 6 29
Solution of the above system of linear equations is x1= , x2= , x3=
5 5 5
21 6 29
Optimal primal solution x1= , x2= , x3= and
5 5 5
21 6 90
Maximum value Z= 4x1+x2 =4. + = =18
5 5 5
Therefore, max Z = Min W=18.
Write down the dual of the following primal problem and find the optimal solution of the dual
problem. Using complementary slackness theorem conditions derive the optimal solution of the
primal problem.
Maximize Z= 3x1+2x2
Subject to -x1+2x2≤4
3x1+2x2≤14
x1 –x2≤3
x1, x2 ≥0
Standard form of primal problem
Maximize Z= 3x1+2x2
Subject to -x1+2x2+x3 =4
3x1+2x2 +x4 =14
x1 –x2 + x5 = 3
xi ≥0, i=1, 2, … , 5.
Dual of the given problem
Minimize W= 4w1+14w2+3w3
Subject to -w1+3w2+w3 ≥3
2w1+2w2 –w3 ≥2
w1, w2, w3 ≥0
Standard form of the dual problem
Minimize W= 4w1+14w2+3w3
Page 12 of 14
Subject to -w1+3w2+w3 –w4 =3
2w1+2w2 –w3 -w5 =2
wj ≥0, j=1, 2, … , 5
Introducing artificial variable in the dual problem, we get
Minimize W= 4w1+14w2+3w3 +Mw6 +Mw7
Subject to -w1+3w2+w3 –w4 +w6 =3
2w1+2w2 –w3 -w5 +w7 =2
wj ≥0, j=1, 2, … , 7.
4 14 3 0 0 M M
i Basis C PO
P1 P2 P3 P4 P5 P6 P7
P6 M 3 -1 3 1 -1 0 1 0 3/3=1
1
P7 M 2 2 2 -1 0 -1 0 1 2/2=1(min)
-4 -14 -3 0 0 0 0
z j c j Max.→(5)
5 1 5 0 -1 -1 0 0
P6 M 0 -4 0 5/2 -1 3/2 1 0/(5/2)=0(min)
2
P2 14 1 1 1 -1/2 0 -1/2 0 ----
14 10 0 -10 0 -7 0
z j c j Max.→(5/2)
0 -4 0 5/2 -1 3/2 0
P3 3 0 -8/5 0 1 -2/5 3/5
3
P2 14 1 1/5 1 0 -1/5 -1/5
z j c j 14 -6 0 0 -4 -1
Since all z j c j 0 , the optimality condition is satisfied and the optimal solution of the dual problem is
w1=0, w2=1, w3=0 and Minimum value, W=14
Complementary slackness conditions are
w1x3 =0, w2x4 =0, w3x5 =0, w4 x1 =0, w5x2 =0
From dual constraint of standard form
-w1+3w2+w3 –w4 =3 -0+3.1+0-w4=3 w4=0
2w1+2w2 –w3 -w5 =2 2.0+2.1-0-w5=2 w5=0
Since w1=0 x3>0
w2=1 x4=0
w3 is basic variable x5=0
w4=0 x1>0
w5=0 x2>0
Therefore, primal constraints of standard form becomes
Page 13 of 14
-x1+2x2+x3 =4 -x1+2x2+x3 =4
3x1+2x2 +x4 =14 3x1+2x2 =14 x1=4, x2=1, x3=6
x1 – x2 + x5 = 3 x1 – x2 =3
Optimal primal solution x1=4, x2=1, x3=6
and Maximum value Z= 3x1+2x2 =3.4+2.1=14
Therefore, max Z = Min W=14.
Page 14 of 14