Duality and Sensitivity: 4.1 Primal Dual Formulations
Duality and Sensitivity: 4.1 Primal Dual Formulations
For every instance of an LP, there is an associated LP known as the dual problem. The
original problem is known as the primal problem.
There are two denitions of the dual pair of problems, which are equivalent. Duality can
also be shown to be a `symmetric relationship (property of involution) in that the dual of
the dual is the primal problem.
CANONICAL FORM
P1: Minimize cT x
subject to Ax b
x 0
D1: Maximize yT b or bT y
T
subject to y T A cT or A y c
y 0
STANDARD FORM
P2 Minimize cT x
subject to Ax = b
x 0
D2 Maximize y T b or bT y
T
subject to y T A cT (or A y c)
y free variables (u.r.s.)
Note that if the number of variables in the primal problem is n and the number of
constraints is m then the the number of variables in the dual problem is m and the number
of constraints is n: In fact variables in the dual problem correspond to constraints in the
primal problem and vice-versa.
T
A y c
1
represents a system of n inequalities (the dual constraints) in m new unknown dual variables
(y1 ; :::; ym ) :
Example 1
Primal:
Dual:
Example 2
Primal:
Dual:
2
The primal in this example is stated in standard form P2. However the variables s1 ; s2
play the part of non-negative surplus variables since they do not appear in the objective
function and it is easy to write down an equivalent primal problem in the canonical form
P1. The dual problem is the same, whether written in the form of D1 or as D2.
min cT x
x
s.t. Ax r
x 0
is
max yT r
y
s.t. yT A cT
y 0
Recall that aij represents the amount of nutrient i contained in unit amount of the j th
food.
Consider a pill maker (an alternative supplier of nutrients) who wants to set a price for
each nutrient. Let i be the price per unit of the ith nutrient (i = 1; :::; m) forming a price
vector . The pill makers price to supply the required amount of each nutrient in the diet
is
Xm
i ri :
i=1
The price of all nutrients needed to make up a unit amount of the j th food should be
competitive, therefore not be more than the price of unit amount of the j th food. Hence
X
m
i aij cj j = 1; :::; n
i=1
Identifying y with we see that the dual problem maximizes the income of the pill maker
subject to a competitiveness constraint.
3
4.2 Duality - basic properties
4.2.1 Equivalence of dual forms
The duality relationships P1-D1, P2-D2 are equivalent.
Proof
We rst take the dual pair in standard form P2-D2 as the denition and nd the dual of
a problem in the canonical form P1:
Minimize cT x
subject to Ax b
x 0
Ax s=b
!
x
or A Im =b
s
which is of the form A0 x0 = b where A0 and x0 are partitioned matrices. Applying the
duality result for the primal in standard form P2, the dual problem is
Maximize bT y
! !
AT c
subject to y
Im 0
In this dual problem, although the D2 dual variables are not explicitly unrestricted in
sign (free variables), the constraints imply that AT y c and y 0, which provides the
dual problem D1.
We can also take the dual pair in canonical form P1-D1 as the denition and nd the
dual of a problem in the canonical form P2. (Exercise)
4
Consider the dual in canonical form D1 (y2Rm ; A(m n))
Maximize bT y
T
subject to A y c
y 0
Minimize bT y
T
subject to A y c
y 0
Maximize cT w
T
subject to AT w b
w 0
Minimize cT w
subject to Aw b
w 0
The dual of LP problems that are neither in standard form nor in canonical form can be
written down using rules summarized in the following table.
5
Notes:
Primal:
Maximize z = 5x1 + 6x2
subject to x1 + 2x2 = 5
x1 + 5x2 3
4x1 + 7x2 8
x1 u.r.s., x2 0
Dual:
Minimize w = 5y1 + 3y2 + 8y3
subject to y1 y2 + 4y3 = 5
2y1 + 5y2 + 7y3 6
y1 u.r.s., y2 0; y3 0
Since primal is a maximization, refer to Table 2nd column for primal properties -
read o dual properties from Table 1st column.
6
4.3 Duality Theorems
The primal and dual LP problems are so intimately related that solving either problem
provides the solution to the other. For the following results we assume the primal is a
minimization in standard form P2 with dual D2.
cT x yT b (4.1)
Proof
Let x, y be feasible for problems P2, D2 respectively. Then
yT A cT (4.2a)
yT A cT 0 (4.2b)
) yT A cT x 0 (4.2c)
Pn
(4.2c) follows from (4.2b) because x 0 (feasible for P2) so i=1 yT A cT i
xi 0.
Now Ax = b; again because x is feasible for P2, so
y T Ax cT x 0
yT b cT x 0
yT b cT x
as required.
Corollary 1
If x, y are feasible for P2, D2 respectively and cT x = y T b then x and y are optimal for
their respective problems.
i.e. If a pair of feasible solutions for the primal and dual problems have the same objective
function value, then they are optimal for their respective problems.
Corollary 2
7
If either problem is unbounded (optimal solution is at innity) the other problem in
infeasible.
Example
In Example 2 of Section 4.1 the primal and dual objective functions are
z = 6x1 + 8x2
and
w = 4y1 + 7y2 :
42
It can easily be veried (e.g. graphically) that zmin = wmax = and these optima are
5
7 T T
achieved at x = 5
;0 and y = 0; 56 .
Let us solve the dual problem through simplex iterations. In standard form constraints
are
3y1 + 5y2 + v1 = 6
y1 + 2y2 + v2 = 8
Max y1 y2
v1 3 5 6
v2 1 2 8
z 4 7 0
y1 v1
3 1 6
y2 5 5 5
1 2 28
v2 5 5 5
1 7 42
z 5 5 5
8
!
1 1 1 0
B =
5 2 5
! !
3 1
1 1 3 1 5 5
B N = = 1 2
= (yij )
5 1 2 5 5
! ! !
6
1 1 1 0 6 5
y2
b=B b= = 28
5 2 5 8 5
v2
(zj cj ) = cTB y j cj = 1
5
; 7
5
!
6
42
z0 = cTB b = 7; 0 5
28
= 5
5
Non-basic variables
1
Basic vars Y = B N = (yij ) b (4.3)
z fzj cj g z0
1
y T0 = cTB B (4.4)
known as simplex multipliers are the dual variables associated with a particular basis B: The
dual vector is generally infeasible for the dual problem during intermediate tableau iterations.
Only when the bottom row satises primal optimality does y T0 become dual feasible.
9
Therefore by Corollary 1 to the weak duality lemma we have constructed an optimal
dual vector y 0 .
If either the primal or the dual has a nite optimal solution then so has the other and the
corresponding objective function values are equal. If either problem is unbounded the other
problem is infeasible.
Proof
1
Let y T0 = cTB B where B is an optimal basis.
h i h i
1
y T0 A = y T0 B N = cTB B B N
h i
T T 1
= cB cB B N (4.5a)
h i
cTB cTN = cT (4.5b)
w0 = y T0 b
= cTB B 1 b
= cTB xB
= z0
Notice that in going from (4.5a) to (4.5b) we have assumed that cTB B 1 N cTN .
This follows from the optimality conditions zj cj 0 8j, which are simply the compo-
nents of cTB B 1 N cTN .
Example (continued)
1
y T0 = cTB B
!
1 1 0
= 7; 0
5 2 5
7
= 5
; 0
= x1 ; x2 :
10
Hence the primal optimal solution is
7
x1 = ; x2 = 0:
5
The complementary slackness (C-S) conditions, which are a consequence of duality, relate
the values of the primal and dual vectors at a common optimum. They can be stated for
either the asymmetric (P2,D2) or the symmetric (P1 D1) primal dual pair.
Let x; y be feasible for P2, D2 respectively. A necessary and su cient condition (NSC)
that they both be optimal is that for each j (j = 1; :::; n)
i) If xj > 0 then y T Aj = cj
Proof.
Since x; y are feasible for their respective problems, we have
Ax = b , x 0
yT A cT
y T Ax + v T x = cT x
y T b + v T x = cT x
cT x yT b = vT x (4.6)
By corollary 2 to the Weak Duality theorem, x; y are optimal if and only if r.h.s.= 0.
P
Since v T x = nj=1 vj xj with vj ; xj 0; r.h.s.= 0 if and only if vj xj = 0 for each j.
So i) xj > 0 ) vj = 0 and ii) vj > 0 ) xj = 0 as required:
[In fact ii) follows from i) and feasibility of y ]
11
Let x; y be feasible for P1, D1 respectively. A necessary and su cient condition (NSC)
that they both be optimal is that
i) xj vj = 0 8j
ii) si yi = 0 8i
where vj is the j th dual slack (corresponding to xj ) and si is the ith primal slack
Comment: By analogy with the asymmetric case, we can write each equation as a pair
of implications, so
Ax b, x 0
yT A cT , y 0
Ax s=b, x; s 0
y T A + v T = cT , y; v 0
Then
y T Ax yT s = yT b
y T Ax + v T x = cT x
so
cT x yT b = vT x + yT s (4.8)
Example 2 (continued)
12
and the dual
Maximize 4w1 + 7w2
subject to 3w1 + 5w2 6
w1 + 2w2 8
w1 ; w2 0
The optimal solution to the primal is
7 1
(x1 ; x2 ; s1 ; s2 ) = ; 0; ; 0
5 5
From the C-S conditions, the optimal solution to the dual takes the form
(v1 ; v2 ; w1 ; w2 ) = (0; ; 0; )
i.e. the 1st dual variable is zero at the optimum (w1 = 0). Hence 5 = 6 from the 1st dual
constraint which is active (satised with equality) since v1 = 0: Hence
6
(w1 ; w2 ) = 0;
5
Suppose we have a tableau that satises the bottom row optimality conditions but which
corresponds to an infeasible solution.
i.e. we have
non-basic variables
xB Y =(yij ) b
z-row zj cj s z0
Such a tableau is said to be dual feasible because the associated dual vector y T0 =
cTB B 1 satises
y T0 A=y T0 [BjN ] cT
The dual simplex algorithm is applicable. The rules for selecting a pivot element are:
13
(bp < 0)
zj cj zq cq
min : ypj < 0 = (4.9)
j ypj ypq
3. Pivot on the element ypq (< 0) according to usual Simplex rules and return to Step 1.
Notes
i) The dual simplex algorthm is in fact the primal simplex algorithm applied to the dual
problem.
x1 x2 x3
s1 1 2 1 3
s2 2 1 3 4
2 3 4 0
"
14
After 1st dual simplex pivot
s2 x2 x3
5
1 1
s1 2
2
2
1
1 1 3
x1 2 2 2
2
1 4 1 4
"
s2 s1 x3
1 2 1 2
x2 5 5 5 5
2 1 7 11
x1 5 5 5 5
1 8 9 28
5 5 5 5
11 2
Optimal solution is (x1 ; x2 ; x3 ; s1 ; s2 ) = ; ; 0; 0; 0
5 5
8 1
Optimal solution to dual (w1 ; w2 ) = ;
5 5
can be conrmed using C-S conditions (Ex.)
N.B.
15
From a knowledge of the simplex tableau at optimality
non-basic variables
xB Y =B 1 N b = B 1b (4.10)
1
z-row cTB B N cTN 1
z0 = cTB B b
we see that
A manufacturer of furniture makes three products: desks, tables and chairs. Each item of
furniture made consumes amounts of three resources: timber, nishing time and carpentry
time.
To manufacture one desk requires 8 ft. of timber, 4 hours nishing time and 2 hours
carpentry time A table requires 6 ft. of timber, 2 hours nishing time and 1.5 hours carpentry
time A chair requires 1 ft. of timber, 1.5 hours nishing time and 0.5 hours carpentry time
The total weekly availability of timber is 48 ft., of nishing time is 20 hrs and of carpentry
time is 8 hrs. The unit prot from selling a desk is $60, from a table is $30, from a chair is
$20.
The LP formulation to maximize the manufacturers prot subject to the given resource
constraints is as follows:
Let x1 ; x2 ; x3 = no. of units of each product (desks, tables and chairs respectively) to
make per week.
16
resulting in the following tableaux
The optimal solution is to manufacture 2 desks and 8 chairs resulting in a prot of $280.
There is a surplus of 24 ft. of timber, but all available hours of nishing time, carpentry
time are used up.
Often the data assumed in the calculation are imprecise or subject to change. We now
ask
Q1. What range of variation in unit prot leaves the current solution optimal?
Q2. What is the optimal product mix if the unit prot for a table increases to $40?
1. Changes to c
From (4.10) we see these aect the optimality conditions zj cj 0 (for max) each j,
and the optimal value z0 = cTB b (though not of course the polytope representing the
feasible region).
Consider increasing a single component of cB ; say c1 by an amount , i.e. c1 c1 + :
The modied nal tableau is
s3 x2 s2
s1 8 2 2 24
x3 4 2 2 8
3 5 1
x1 2 4 2
2
10 5 10 280
+ 32 + 54 1
2
+2
17
The condition for the current solution to remain optimal is
3
10 + 0
2
5
5+ 0
4
1
10 0
2
4 20
or equivalently
56 c1 80
s3 x2 s2 s3 x1 s2
s1 8 2 2 24 136
s1 5
(27:2)
x3 4 2 2 8 56
x3 5
(11:2)
3 5 1 8
x1 2 4 2
2 x2 5
(1:6)
10 5 10 280 16 4 8 288
18
This is the same BFS as before.
3. Changes to b
These aect the rhs. of an optimal tableau (4.10). Consider an increase of to the
second resource limitation b2 , b2 b2 + :
We consider the eect on b of the rhs. becoming b0 = b + b with b = (0; ; 0)T =
e2 where e2 = (0; 1; 0), the 2nd column of the identity matrix I 3 :
b = B 1b
0 1
b =B (b + b)
1
= b +B b
=b+ B 1 e2
Notice that the product B 1 e2 picks out the second column of B 1 which appears in
the nal tableau under s2 . In the original A matrix the column Aj corresponding
to s2 is e2 . Hence B 1 Aj = B 1 e2 appears in the body of the nal tableau under s2 :
Hence 2 3
2
6 7
b=4 2 5
1
2
1
24 + 2 0; 8 + 2 0; 2 2
0
i.e. while
4 4 () 16 b2 24
e.g. if b2 = 30 ( = 10) the nal tableau becomes infeasible. In this example feasibility
(hence the optimal solution) is obtained after one iteration of the dual simplex algorithm
s3 x2 s2 s3 x2 x1
s1 8 2 2 44 s1 32
x3 4 2 2 28 x3 16
3 5 1
x1 2 4 2
3 s2 6
10 5 10 380 40 30 20 320
19