You are on page 1of 14

# Duality

Definition: Associated with each linear programming problem there is another linear programming
problem is called the dual. The original LPP is called the primal. The dual linear program possesses
many important properties relative to the primal problem. While solving a LPP by simplex method,
we shall simultaneously be solving its associated dual problem as well. The concept of duality will
become clear from the following example:
Primal Problem:
Minimize; z = 3x1 4x 2
Subject to constraint

2x1 4x 2 10

3x1 +2x 2 + 20
x1 ,x 2 0
Let us now introducing two dual variables

## Maximize, z = 10y1 +20y 2

Subject to constraint

2y1 +3y 2 3

4y1 +2y 2 4
y1 ,y2 0
Steps to Form a Dual Problem
There are five steps for formulating a dual problem from a given LPP
Step One: If the primal is maximization, the dual is a minimization and vice versa.
Step Two: The right hand side values of the primal constraints become the duals
objective function coefficients
Step Three: The primal objective function coefficients becomes the right hand side values
of the dual constraints
Step Four: The transpose of the primal constraint coefficients become the dual constraint
coefficients
Step Five: Constraint inequality signs are reversed.
Dual Problem when Primal is in the Canonical Form
The general linear programming problem always can be written as the following form;
Maximize

z = c1x1 +c 2 x 2 +...................+c n x n

## We have to find the values of the decision variables

following m constraints;

## a11x1 +a12 x 2 +.........+a 1n x n b1

a 21x1 +a 22 x 2 +.........+a 2n x n b 2
.
.
.
a m1x1 +a m2 x 2 +.........+a mn x n b m

and

x j 0; j = 1, 2,.......,n

The above formulation can be written as the following compact form by using the

z=
summation sign maximize
Subject to the conditions;

c x
j

j=1

a x
ij

bi ;i=1, 2,.......,m

j=1

x 0; j = 1, 2,.......,n

and j
In matrix notation the above equations can be written as;
Maximize z = CX
Subject to the conditions

AX b
X0

Where

x1
b1

x 2
b 2
.
.
a11 a12 ...... a1n

X= .
B= .
a 21 a 22 ...... a 2n
.
.
A= .
.
.
.

.
.
.
.
.
.

b
... ... c n 1 n
x n n 1 ;
a m1 a m2 ...... a mn mn ;
m m n
;

C= c1 c 2

Where, A is called the coefficient matrix, X is called the decision vector, B is called the
requirement vector and C is called the cost vector of linear programming problem
The associated dual problem of the given primal problem is given by;

Minimize; z =by

Subject to
Ay C
y0

y=(y , y , y ......, y )

1
2
3
m
Where,
These relationships are called symmetric primal-dual pairs.
The above pair of programs can be written as

Primal

Dual

Maximize, z=

c jx j
j 1

Subject to

ij

Minimize, z= bi yi
i=1

x j bi ; i 1, 2,....., m Subject t

j=1

x j 0; j = 1, 2,...,n

a y

ij i

c j ; j=1, 2,...,n

i=1

yi 0; i = 1, 2,.....,m

From the above two programmes the following points should be kept in mind
(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 problem becomes the minimization problem in
the dual and vice-versa
(iii) The maximization problem has constraints while the minimization problem has
constraints
(iv) The cost coefficients of the objective function of the primal appear as the RHS values
of the dual constraints
(v) The RHS values of the primal constraints become the coefficient of the objective
function of the dual problem
(vi) The variables in both problems are non-negative.
The Canonical Form of L.P. Problem
The general linear programming problem always can be written as the following form;
2

Maximize

z = c1x1 +c 2 x 2 +...................+c n x n

## We have to find the values of the decision variables

following m constraints;

## a11x1 +a12 x 2 +.........+a1n x n b1

a 21x1 +a 22 x 2 +.........+a 2n x n b 2
.
.
.
a m1x1 +a m2 x 2 +.........+a mn x n b m
and

x j 0; j = 1, 2,.......,n

The above formulation can be written as the following compact form by using the
n

z=
summation sign maximize
Subject to the conditions;
n

a x
ij

c x
j

j=1

bi ;i=1, 2,.......,m

j=1

and

x j 0; j = 1, 2,.......,n

The

constants

c j ; j =1, 2,......,n

are

called

the

cost

coefficients;

the

constants

bi ; i =1, 2,.......,m are called stipulations and the constants a ij ; i =1, 2,.....,m; j=1,2,.....,n are
called structural coefficients. In matrix notation the above equations can be written as;
Optimize z = CX
Subject to the conditions

AX B

And

X0

Where

C= c1 c 2

x1
b1

x 2
b 2
.
.
a11 a12 ...... a1n

X= .
B= .
a 21 a 22 ...... a 2n
.
.
A= .
.
.
.

.
.
.
.
.
.

b
... ... c n 1 n
x n n 1 ;
a m1 a m2 ...... a mn m n ;
m mn
;

Where, A is called the coefficient matrix, X is called the decision vector, B is called the
requirement vector and C is called the cost vector of linear programming problem
The Characteristics for the Canonical Form are as follows;
(1) All decision variables are non-negative
(2) All constraints are of the types
(3) Objective function is of maximization type
Any linear programming problem can be put in the canonical form by the use of some
elementary transformations
(1) The minimization of a function, f(x) is equivalent to the maximization of the negative
3

z=

c x
j

j=1

## expression of this function, -f(x). For example minimize

is equivalent to

G = -z =- c jx j

j=1
maximize
. Therefore for all linear programming problems the objective
function can be expressed in the maximization form

## (2) An inequality in one direction ( , , ) can be changed to an inequality in the opposite

direction by multiplying both sides of the inequality by -1. For example the linear
constraint
n

a x
ij

bi

j=1

is equivalent to

a ij x j -bi
j=1

(3) An equation may be replaced by two weak inequalities in opposite directions. For
example
n

a x =b
ij

j=1

is equivalent to

a ijx j bi
j=1

Or

ij

and

a ijx j bi
j=1

a x

bi

j=1

and

a ij x j -bi
j=1

x1 , x 2 ,.........,x n

## (4) So far, we have assumed that the decision variables

to be all non-negative. It is possible in actual practice, that a variable may be
unconstrained in sign i.e. it may be positive or negative. If a variable is unconstrained, it is
expressed as the difference between two non-negative variables. For example if x is
+

## unconstrained variable, then it can be expressed as x = x -x

There are two important definitions of duality
(i) Canonical form of duality and (ii) Standard form of duality
Canonical Form of Duality:
Suppose the primal LP problem is given in the form

Minimize, z= CX
Subject to
AX b
X0

## Then the dual LP problem is defined as

Maximize; z = by

Subject to
Ay C
y0
For Example
Let us consider the primal problem

where, x 0 and x 0
+

Minimize, z = x1 x 2
Subject to constaint
3x1 x 2 4
5x1 +2x 2 7
x1 ,x 2 0
In matrix form the problem can be written as
Maximize, Z= CX
Subject to constraint

AX b
X0

C= 1, 1

x1

x 2

X=

3 1
4
b=

5 2 ,
7

A=

Where,
,
,
The dual of primal problem is then given by;

Maximize; z = by

Subject to
Ay C
y0
Equivalent to

y1

y2

z 4, 7

Maximize,
Subject to constraint

3 5 y1

1 2 y2

1

1

Equivalent to

z=4y +7y

1
2
Maximize,
Subject to constraint

3y1 +5y 2 1
y1 +2y 2 1
y1 ,y2 0

## Standard Form of Duality:

Suppose the primal LP problem is given in the form

Minimize, z= CX
Subject to
AX = b
X0

## Then the dual LP problem is defined as

Maximize; z = by

Subject to
Ay C
y unrestricted
For Example
Let us consider the primal problem
Minimize;

z=x1 +x 2
5

3x1 x 2 x 3 4
5x1 +2x 2 x 4 7
x1 ,x 2 ,x 3 ,x 4 0
The dual of primal problem is then given by;

Maximize; z = by

Subject to
Ay C
y unrestricted
Or,

y1

y2

z 4, 7

Maximize,
Subject to constraint

1
-1
0

Or

2
0

y1

y
2

z=4y +7y

1
2
Maximize,
Subject to constraint

3y1 +5y 2 1
y1 +2y 2 1
-y1 0

-y 2 0
y1 ,y 2 unrestricted

The primal problem is the standard form of primal canonical form using the surplus

y ,y 0

variables. Since the last three conditions of dual problem are equivalent to 1 2
, we
see that the standard form and canonical form of duality of the same primal are
equivalent.
Remarks:
(i) In the canonical format of duality the primal must have a minimization objective with all
greater than or equal to constraints and all non-negative variables
(ii) There is exactly one dual variable for each primal constraint and exactly one dual
constraints for each primal variable.
Dual Variable, Dual Constraint and Relationship between Dual and Primal
Problem
Let us now consider the primal LP problem given in the form

Minimize, z= CX
Subject to
AX b
X0

The associated linear programming problem of the given linear programming problem in

determining y R so as to
m

Maximize; z = by;b R m
Subject to
Ay C;C R n
y0
Where A is an mXn real matrix, A is the transpose matrix of A, C is the cost coefficient of
the primal problem. The associated problem is called the dual problem. The variables

(y1 , y 2 ,......,y m ) are called dual variables. The n constraints of the dual problem are called

## the dual constraints.

Primal Dual Relationship
If there are n primal variables in a primal problem, then there must be n dual constraints in
a dual problem and similarly if there are m constraints in a primal problem, there must be
m dual variables in a dual problem. If minimization problem is given in a primal problem,
then we do it maximization in a dual problem or a maximization problem can be converted
into a minimization problem.
If

xj

c j;

## be the jth cost coefficient corresponding

to the jth primal variable and ij be the ith coefficient of the jth variable corresponding to
the ith primal constraint (i=1, 2,,m). Let us now consider the primal problem

z = c x +c x +......+c n x n

1 1
2 2
Minimize
Subject to constraint

## a11x1 +a12 x 2 +.......+a1n x n b1

a 21x1 +a 22 x 2 +.......+a 2n x n b 2

.
.
.
a m1x1 +a m2 x 2 +.......+a mn x n b m
x j 0 j
In matrix form the given problem can be written as
Minimize z = CX
Subject to

AX b
X0

aj

## becomes a row of A and provides the

coefficient for jth dual constraint. Moreover the jth cost coefficient j of the jth primal
variable become the right hand side value of the jth dual constraint, and the right side
value of the primal constraint will be the coefficient of the dual objective function. Thus
each primal variable corresponds to a dual constraint. Similar relationship holds for primal
constraints and dual variables. Since there are m constraints in the primal problem, so
there must be m dual variables in the dual problem, let us now define these dual variables

## (y1 , y 2 ,......,y m ) and the dual problem can be written as;

*

Maximize z = b y
as

Subject to constraint

Ay C
y0

Both the primal as well as its dual and the above relationship can be displayed in a single
table as shown below;
7

x1

x2 . . .

y1 a11 a12

y 2 a 21 a 22
.
. .

.
. .
.
. .

y m am1 am 2
c1

c2

xn

. . . a 1n

. . . .
. . . .

. . . .
. . . .

. . . amn

cn

b1

b
2
.

.
.

Primal
Minimization

Dual
Maximization

Variables 0
Constarints ;
Unrestricted
=

Constraints
Variables 0

Unrestricted

## Show that the dual of a dual is primal

Let us now consider the primal problem as follows;
P: Minimize z = CX
Subject to

AX b
X0

## Then the dual of the primal problem is given by;

D: Maximize z=by
Ay C
y0

Since the problem D itself a linear programming problem we can write its dual to do it and
we write D as

Minimize z=(-b)y
(-A)y -C
y0

## Whose dual is given by

Maximize z=(-c)X
(-A)X (b)
X0

Which is equivalent to

Minimize z= CX
AX b
X0

## Hence the theorem is proved

Problem: Obtain the dual problem of the following LPP

z = 2x +5x +6x 3

1
2
Maximize
Subject to constraints

5x1 +6x 2 -x 3 3
-2x1 +x 2 +4x 3 4
x1 -5x 2 +3x 3 1
3x1 -3x 2 +7x 3 6
(x1 , x 2 , x 3 ) 0
Also verify that the dual of the dual is the primal problem.
Solution: The given primal problem can be written in determining
follows;

X = (x1, x 2 , x 3 ) as

Maximize z = CX
Subject to constraint

AX b
X0

Where,

5 6 1
3
x1

2 1 4
4

C =(2, 5, 6) ; A=
; X= x 2 ;b =
1 5 3
1
x

3 3 7
6
y=(y1 , y 2 , y3 , y 4 ) be the dual variables, then the problem is to determine y
Let us define,
so that

## Minimize; z = by =3y1 +4y 2 +y 3 +6 y 4

Subject to

Ay C

y1 ,y 2 ,y3 , y 4 0

y1
5 2 1 3
y 2
6 1 5 3
y
1 4 3 7 3

y
4
5y1 -2y 2 +y3 +3 y 4 2

2
5

6y1 +y 2 -5y 3 -3 y 4 5
-y1 +4y 2 +3y3 +7y 4 6
y1 ,y 2 ,y3 , y 4 0
Now we can restate this dual problem as follows:
Maximize,

## z = -3y1 -4y 2 -y3 -6 y 4

y1
5 2 1 3

y
6 1 5 3 2
1 4 3 7 y3

y
4

2

5
6

The dual problem in this form looks like the primal problem and we can write down the
dual of this dual problem. The dual of this dual problem in determining
be written as

## Minimize z = -2x1 -5x 2 -6x 3

Subject to constraint
9

## X=( x1,x 2 ,x 3 ) can

5 6 1

2 1 4

1 5 3

3 3 7
(x1 , x 2 , x 3 ) 0

x1

x 2
x
3

3

4

1

## The problem can be written as

z = 2x +5x +6x 3

1
2
Maximize
Subject to constraints

5x1 +6x 2 -x 3 3

-2x1 +x 2 +4x 3 4
x1 -5x 2 +3x 3 1
3x1 -3x 2 +7x 3 6
(x1 , x 2 , x 3 ) 0
Fundamental Theorems of Dual Optimality
With regard to the primal and dual linear programming problems exactly one of the
following statements is true
*

*
*
(i) Both possesses optimal solutions x and w with Cx =w b
(ii) One problem has unbounded objective value in which case the other problem must be
infeasible
(iii) Both problems are infeasible
That is;

Optimal
Optimal

## Primal Unbounded Dual Infeasible

Infeasible
Unbounded or Infeasible

Optimal
Optimal

## Dual Unbounded Primal Infeasible

Infeasible
Unbounded or Infeasible

Complementary Slackness
*
*
Let x and w be any pair of optimal solutions to the primal and dual problems
P: Minimize z = CX

Subject to
AX b
X0

And

D: Maximize z = bW=Wb
Subject to
AW C
W0

Then

Cx * W *Ax * W *b
*
*
Since x and w both are optimal, the optimal objective are equal
Cx * =W *b=W *Ax *
This gives
10

W* ( Ax * b) 0
and (C-W *A)x * = 0
*
*
Since W 0 and Ax b , then writing the above two equations in their components
Wi* ( a i x* b i ) 0; i 1, 2,...., m
and (c j -W *a j )x j* = 0;j=1, 2,....,n
These implies that

x j* >0 W *a j = c j
W*a j < c j x j* 0
Wi* 0 a i x * =bi
a i x * >b i Wi* 0
This leads to the fundamental theorem of complementary slackness.
If a variable in one problem is positive then the corresponding constraint in the other
problem must be tight and if a constraint in one problem is not tight, then the
corresponding variable in the other problem must be zero.
Problem: From the given primal problem, make the dual problem and solve the dual
problem graphically.

## P: Minimize 2x1 +3x 2 +5x 3 +2x 4 +3x 5

Subject to;
x1 +x 2 +2x 3 +x 4 +3x 5 4
2x1 -2x 2 +3x 3 +x 4 +x 5 3
x1 ,x 2 ,x 3 ,x 4 ,x 5 0
w1 and w 2 be the dual variables. The dual problem of the given primal
Solution: Let
problem is given by;

w1 +2w 2 2
w1 -2w 2 3

2w1 +3w 2 5
w1 +w 2 2
3w1 +w 2 3
w1 ,w 2 0
w and w 2 be the two dual variables hence it can be solved graphically
Since 1
w1 +2w 2 =2 >0
w1 +2w 2 2 x1* 0
w1 -2w 2 =-2/5<3 x *2 0
2w1 +3w 2 17 / 5 5 x *3 0
w1 +w 2 7 / 5 2 x *4 0
3w1 +w 2 3 x *5 0
w = 4/5>0 , so in optimality of primal constraint must be tight
We have 1
x1* +x*2 +2x *3 +x *4 +3x *5 =4
Similarly since
is

w 2 =3/5>0 , the second constraint of the primal problem must be tight that
11

2x1* -x *2 +3x *3 +x *4 +x *5 =3
Now using
*
1

x *2 =x *3 +x *4 =0

we have

*
5

x +3x =4
2x1* +x *5 =3
Solving these equations we have
problem is

x1* =1 and x *5 =1

## . So the optimal solution for primal

(x1 , x 2 , x 3 , x 4 , x 5 ) (1,0,0,0,1)

Problem: From the given primal problem, make the dual problem and solve the dual
problem graphically.

## P: Maximize, 3x1 +x 2 +4x 3

Subject to;
6x1 +3x 2 +5x 3 25
3x1 +4x 2 +5x 3 20
x1 ,x 2 ,x 3 0
Dual Simplex Method
This method was developed to solve a primal LPP problem on the basis of the relationship
between primal and dual. It does not require the dual problem at all but takes into
consideration its properties.
Suppose we consider the LP problem as;

Min: z = CX
Subject to
AX=b
X0

(i) If the problem are given as maximization, convert it into minimization problem
(ii) If the constraints are of the types, convert these inequalities into by multiplying
corresponding constraint by (-1)
Initializing Step: In this case we choose a starting basis B of the primal problem such that

z j -c j =C BB-1a j -c j 0; j

According

## x=(x B ,x n ), C=(C B ,C N ), A=(B,N) etc

as

the

column

of

included

in

we

write

Main Step:
(1) If b=B b 0, we stop with the conclusion that the current solution is optimal otherwise
-1

## we select the pivotal row r such that

br =Minimum{bi , bi <0}

y 0

2. If rj
for all j, we stop with the conclusion that the dual is unbounded and the primal
is infeasible. Otherwise the pivotal column k is selected by the following minimum ratio
test

z k ck
z c j

= Minimum j
; yrj 0
yrk
j
yrj

x
x
i.e. r will leave the basis B and k will enter into the basis
y

## 3. The tableau is updated by pivoting at pivot rk . We repeat the main step.

The computation of the new basic solution is based on the Gauss-Jordan row operation.
The pivotal column as the one associated with the entering variable and the pivotal row as
the row associated with the leaving variable. The intersection of the pivotal column and
the pivotal row define the pivotal element.
The Gauss-Jordan computations needed to produce the new basic solution included two
12

types
1. Pivotal row
New pivot row = Current pivot row/Pivot element
2. All other rows including z
New row= (Current row)-(Its pivot column coefficient)X(New pivot row)
Problem:

Maximize, z = -3x1 -x 2
Subject to constraint
x1 +x 2 1
2x1 +3x 2 2
x1 ,x 2 0
Solution: Introducing slack variables

## x 3 and x 4 we write the problem as

Minimize z* = 3x1 +x 2 +0 x 3 +0 x 4
subject to
x1 +x 2 x 3 1
2x1 +3x 2 x 4 =2
x1 ,x 2 , x 3 ,x 4 0
1 1 -1 0
A=

2 3 0 1 .
Here,
-1 0
B=

## 0 -1 as the basis we formulate the initial tableau of the dual

Now considering
simplex method.

x1

z
z

x3
x4
z

x3
x2
z

x4
x2

1
0
0

x2
-3
-1
-2

1
0
0

-7/3
-1/3
2/3

1
0
0

-2
1
1

Since there is no
solution

bi <0

x3

x4

RHS

-1
-1
-3

0
1
0

0
0
1

0
-1
-2

0
0
1

0
1
0

-1/3
-1/3
-1/3

2/3
-1/3
2/3

0
1
0

1
1
1

0
0
1

, and

-1
-3
-1

z j -c j 0 j

## , hence this is the optimal table with the optimal

(x1 ,x 2 , x 3 ,x 4 ) =(0, 1, 0, 1)
Max (z) = -1
Problem: Consider the following linear programming problem

13

## Min, z = 2x1 +3x 2 +4x 3

Subject to constraint
x1 +2x 2 +x 3 3
2x1 -x 2 +3x 3 4
x1 ,x 2 , x 3 0
Solution: Introducing slack variables

## x 4 and x 5 we write the problem as

Subject to constraint
-x1 -2x 2 -x 3 x 4 3
-2x1 +x 2 -3x 3 x 5 4
x1 ,x 2 , x 3 , x 4 ,x 5 0
-1 -2 -1 1 0
A=

-2 1 -3 0 1 .
Here,
1 0
B=

## 0 1 as the basis we formulate the initial tableau of the dual simplex

Now considering
method.

x1

z
z

x4
x5
z

x2

1
0
0

-2
-1
-2

2/3

-3
-2
1

x3

2/3

1
0
0

-2
1
1

x4
x2

Since there is no
solution

bi <0

x3

-5/3
-1/3
0
0
1

, and

x4
-4
-1
-3

x5
0
1
0

-1
-3
-1

z j -c j 0 j

0
1
0

RHS
0
0
1

0
-3
-4

4/3
1/3

16/3
4/3
1
1
1

## , hence this is the optimal table with the optimal

(x1 ,x 2 , x 3 ,x 4 ) =(0, 1, 0, 1)
Max (z) = -1

14