L7 Duality I
L7 Duality I
Lecture 7: Duality I
Lecturer: Lily PAN
Every linear programming problem has associated with it another linear programming prob-
lem and that the two problems have such a close relationship that whenever one problem
is solved, the other is solved as well. The original LPP is called the primal problem and the
associated LPP is called the dual problem. Together they are called a ”dual pair” (primal +
dual) in the sense that the dual of the dual will again be the primal.
Example 7.1.1. (The Diet Problem) How can a dietician design the most economical diet
that satisfies the basic daily nutritional requirements for a good health? For simplicity, we
assume that there are only two foods F1 and F2 and the daily nutrition required are N1 ,
N2 and N3 . The unit cost of the foods and their nutrition values together with the daily
requirement of each nutrition are given in the following table.
F1 F2 Daily Requirement
Cost 120 180 −
N1 1 1 10
N2 2 4 24
N3 3 6 32
Let xj , j = 1, 2 be the number of units of Fj that one should eat in order to minimize
the cost and yet fulfill the daily nutrition requirement. Thus the problem is to select the xj
such that
x1 + x2 ≥ 10
2x1 + 4x2 ≥ 24
3x1 + 6x2 ≥ 32
7-1
Lecture 7: Duality I 7-2
Min x0 = cT x
Subject to Ax ≥ b
x≥0
where
10
120 x1
c= , x= , b = 24
180 x2
32
and
1 1
A = 2 4 .
3 6
Now let us look at the same problem from a pharmaceutical company’s point of view.
How can a pharmaceutical company determine the price for each unit of nutrient pill so as
to maximize revenue, if a synthetic diet made up of nutrient pills of various pure nutrients
is adopted? Thus we have three types of nutrient pills P1 , P2 and P3 . We assume that each
unit of Pi contains one unit of the Ni . Let ui be the unit price of Pi , the problem is to
maximize the total revenue u0 from selling such a synthetic diet, i.e.
subject to the constraints that the cost of a unit of synthetic food j made up of Pi is no
greater than the unit market price of Fj :
Max u0 = bT u
Subject to AT u ≤ c
u≥0
We said the two problems form a dual pair of linear programming problem, and we
will see that the solution to one should lead to the solution of the other.
Definition 7.1.1. Let x and c be column n-vectors, b and u be column m-vectors and A be
an m-by-n matrix. The primal and the dual problems can be defined as follows:
Lecture 7: Duality I 7-3
Primal Dual
Max cT x Min bT u
Subject to Ax ≤ b Subject to AT u ≥ c
x≥0 u≥0
Calling one primal and the other one dual is completely arbitrary for we have the
following theorem.
Max x0 = cT x
Subject to Ax = b
x ≥ 0
Max x0 = cT x
Subject to Ax ≤ b
−Ax ≤ −b
x ≥ 0
Min u0 = bT u1 − bT u2
Subject to AT u1 − AT u2 ≥ c
u1 , u2 ≥ 0
Min u0 = bT u
Subject to AT u ≥ c
u free
n
X m
X
Max cj xj Min ui bi
j=1 i=1
Xn
Subject to aij xj ≤ bi (i = 1, 2, · · · , k) Subject to ui ≥ 0 (i = 1, 2, · · · , k)
j=1
Xn
aij xj = bi (i = k + 1, · · · , m) ui free (i = k + 1 · · · , m)
j=1
m
X
xj ≥ 0 (j = 1, 2, · · · , l) ui aij ≥ cj (j = 1, 2, · · · , l)
i=1
m
X
xj free (j = l + 1, · · · , n) ui aij = cj (j = l + 1, · · · , n)
i=1
Example 7.1.4. (Transportation Problem) Suppose that there are m sources that can pro-
vide materials to n destinations that require the materials. The following is called the costs
and requirements table for the transportation problem.
Destination Supply
c11 c12 ··· c1n s1
Origin c21 c22 ··· c2n s2
.. .. .. .. ..
. . . . .
cm1 cm2 ··· cmn sm
Demand d1 d2 ··· dn
where cij is the unit transportation cost from origin i to destination j, si is the supply
available from origin i and dj is the demand required for destination j. We assume that
total supply equals to total demand, i.e.
Lecture 7: Duality I 7-6
m
X n
X
si = dj .
i=1 j=1
m X
X n
Min cij xij
i=1 j=1
Xn
Subject to xij = si (i = 1, 2, · · · , m)
j=1
Xm
xij = dj (j = 1, 2, · · · , n)
i=1
xij ≥ 0 (i = 1, 2, · · · , m; j = 1, 2, · · · , m)
m
X n
X
Max si ui + dj vj
i=1 j=1
Subject to ui + vj ≤ cij (i = 1, 2, · · · , m; j = 1, 2, · · · , m)
ui , vj free
We first give the relationship between the objective values of the primal and of the dual.
Theorem 2 (Weak Duality Theorem). Consider the following primal-dual pair.
(P) Max cT x
Subject to Ax ≤ b
x ≥ 0
(D) Min bT u
Subject to AT u ≥ c
u ≥ 0
If x is a feasible solution (not necessarily basic) to the primal and u is a feasible solution
(not necessarily basic) to the dual, then
cT x ≤ bT u.
Lecture 7: Duality I 7-7
uT Ax ≤ uT b = bT u. (7.1)
xT AT u ≥ xT c.
But, the converse of each corollary may not be true. Because, if one problem is infea-
sible, it is also possible for the other to be infeasible. This is illustrated via the following
example.
Example 7.2.1. Consider the following canonical primal-dual pair:
Max x1 + x2
Subject to −x1 + 2x2 ≤ −2
x1 − 2x2 ≤ −2
x1 , x2 ≥ 0
Please sketch the feasible region of the primal-dual pair and show that neither the
primal nor the dual possesses a feasible solution.
Corollary 5. If the primal is infeasible, then the dual is either infeasible or has an un-
bounded objective.
Corollary 6. If the dual is infeasible, then the primal is either infeasible or has an un-
bounded objective.
Corollary 7. If x0 and u0 are feasible solutions to the primal and the dual respectively and
if
c T x 0 = bT u0 ,
then x0 and u0 are optimal solutions to the primal and the dual respectively.
Lecture 7: Duality I 7-8
cT x ≤ bT u0 = cT x0 .
Primal Primal
is feasible not feasible
Dual is both optimal Dual has
feasible solutions exist unbounded solutions
Dual is Primal has possible
not feasible unbounded solutions
We now consider further relationships between the canonical primal and dual, as well
as an actual method for computing the dual solution.
Theorem 8 (The Strong Duality Theorem). A feasible solution x0 to the primal is optimal if
and only if there exists a feasible solution u0 to the dual such that
cT x0 = bT u0 (7.2)
Proof. The “if” part is Corollay 7. Let us now prove the “only if” part. Let the primal be
Max z = cT x
Subject to Ax ≤ b
x ≥ 0
Max z = cT x + cTs xs
Subject to Ax + xs = b
x, xs ≥ 0,
where xs are all slack variables and cs = 0. Suppose that x∗ is an optimal solution
to the primal problem with basis matrix B. The proof will be complete if we can produce
Lecture 7: Duality I 7-9
a feasible solution to (D), which has the same objective value. Consider u0 ≡ (B−1 )T cB .
Clearly, cT x∗ = bT u0 = cTB B−1 b. Thus, it only remains to be shown that u0 is a feasible
solution to (D).
x xs RHS
xB A I b
z −cT 0T 0
Now, because B is an optimal basis matrix, the optimal tableau will be as in the follow-
ing table.
x xs RHS
xB B−1 A B−1 I B−1 b
z cTB B−1 A − cT cTB B−1 I − 0T cTB B−1 b
cTB B−1 A − cT ≥ 0T
and
cTB B−1 I − 0T = cTB B−1 ≥ 0T
But, recall that u0 ≡ (B−1 )T cB . Now, substituting into the above inequalities yields
AT u0 ≥ c
u0 ≥ 0
which are precisely the dual feasibility conditions. Thus u0 is dual feasible and cT x∗ =
bT u0 .
First of all, note that the dual feasibility conditions are precisely the same as primal
optimality conditions. In an analogous manner, it can be shown that primal feasibility
conditions are exactly the same as dual optimality conditions. Also observe that Theorem
8 provides a method for computing the values of the dual variables. That is, whereas the
primal solution can be written as
xN = 0
xB = B−1 b
Lecture 7: Duality I 7-10
u = (B−1 )T cB
us = AT (B−1 )T cB − c
where us is the vector of dual surplus variables. Finally, the objective value of both problem
is
z = cT x = bT u = cTB B−1 b
Thus, given a basis matrix B, the solutions to both problems can be determined directly
from B−1 , b, and c. In the following section, we establish some additional relationships
between the primal and dual variables. These relationships further lead to conditions that
are referred to as complementary slackness conditions. Complementary slackness conditions
have important theoretical implications as well as valuable economic interpretations.
x1
1 0 1 0 0 0 0 x2
6
0 1 0 1 0 0 0 x3 8
1 1 0 0 1 0 0 x4 = 7
3 1 0 0 0 1 0 x5 15
0 −1 0 0 0 0 1 x6 1
x7
x1 x2 x3 x4 x5 x6 x7 b
x3 0 0 1 0 1/2 −1/2 0 2
x2 0 1 0 0 3/2 −1/2 0 3
x4 0 0 0 1 3/2 1/2 0 5
x1 1 0 0 0 −1/2 1/2 0 4
x7 0 0 0 0 1/2 1/2 1 4
x0 0 0 0 0 5/2 1/2 0 25
Thus the optimal solution is [x1 , x2 ] = [4, 3] with [x3 , x4 , x5 , x6 , x7 ] = [2, 5, 0, 0, 4]. From
the x0 row, we see that the optimal solution to the dual is given by
5 1
[u1 , u2 , u3 , u4 , u5 , u6 , u7 ] = 0, 0, , , 0, 0, 0 .
2 2
Let us verify this by considering the dual. The dual of the primal is given by
u1 u2 u3 u4 u5 u6 u7 c
1
u4 6 − 21 0 1 1
2 − 12 1
2
1
2
u3 − 12 3
2 1 0 − 32 1
2 − 32 5
2
u0 2 5 0 0 4 4 3 −25
Thus the optimal solution for the dual is [u1 , u2 , u3 , u4 , u5 ] = 0, 0, 25 , 12 , 0 with optimal
surplus variables [u6 , u7 ] = [0, 0]. Notice that the optimal solution to the primal is given by
the reduced cost coefficients for u6 and u7 , i.e. [x1 , x2 ] = [4, 3] and the optimal values of the
primal slack variables are given by [x3 , x4 , x5 , x6 , x7 ] = [2, 5, 0, 0, 4].