MME Chapter 19 Linear Programming
MME Chapter 19 Linear Programming
MME Chapter 19 Linear Programming
Linear Programming
Linear programming is the name used for problems in which the objective is to
maximize or minimize a linear function subject to linear inequality constraints.
As the opening quotation from Lovasz indicates, linear programming is a
mathematical technique of immense practical importance. Since its ongins in the
1940s, there have been important theoretical and computational developments, and
its methods are now used every day in many parts of the world.
Because of its extensive use in economic decision problems, all economists
should have some basic knowledge of this theory. However, its importance extends
even beyond its practical applications. In particular, the duality theory of linear
programming is a basis for understanding more complicated opumization problems
with even more interesting economic applications.
In pnnciple, any linear programming problem (often called an LP problem)
can be solved, if a solution exists. The simplex method introduced in 1947 by
G. B. Dantzig is a very efficient numerical procedure that finds the solution in a
finite number of operations. This method will not be discussed in this book. In
fact, for economists. it is probably more important to understand the duality theory
of LP than the details of the simplex method. After all, faced with a nontrivial
LP problem, it is natural to use one of the great number of available LP computer
programs to find the solution.
722
Sec. 19.1 / Preliminaries 723
19.1 Preliminaries
A general linear programming problem with only two decision variables involves
maximizing or minimizing a linear function
subject to m constraints
Note that the direction of the inequalities in the inequality constraints is a conven-
tion in the sense that any inequality of the form ax; + bx2 > c is equivalent to the
inequality —ax; — bx2 < —c.
Of course, x; > 0 and x2 > 0. The profit obtained from producing x; dozen
A cakes and x2 dozen B cakes is
FIGURE 19.1
FIGURE 19.2
In principle, the baker can find the point in the feasible region that
maximizes profit by calculating 20x; + 30x2 at each point of S and picking
the highest value. In practice, this is impossible because there are infinitely
many feasible points. Let us argue this way instead. Can the baker obtain a
profit of 600? If so, the straight line 20x; + 30x. = 600 must have points
in common with S. This line is represented in Fig. 19.2 by dashed line L).
It does have points in common with S. (One of them is (x;. x2) = (0, 20),
where no A cakes are produced, but 20 dozen B cakes are, and the profit
is 20-0+ 30-20 = 600.) Can the baker do better? Yes. For instance, the
straight line 20x; + 30x2 = 601 also has points in common with S and the
profit is 601. In fact, the straight lines
are all parallel to 20x; + 30x. = 600. As c increases, the line given by [6]
moves out farther and farther to the northeast. It is clear that the straight line
(6] that has the highest value of c and still has a point in common with S
is dashed line L> in the figure. It touches set $ at point B. Note that B is
at the intersection of the flour border and the butter border. Its coordinates,
therefore, satisfy the two equations:
Example 19.2
A firm is producing two goods, A and B. It has two factories that jointly
produce the two goods in the following quantities (per hour):
Factory 1 Factory 2
Good A 10 20
Good B 25 25
The firm receives an order for 300 units of A and 500 units of B. The costs of
operating the two factories are 10,000 and 8000 per hour. Formulate the linear
programming problem of minimizing the total cost of meeting this order.
Solution Let u, and u> be the number of hours that the two factories
operate to produce the order. Then 10u;+20u2 units of good A are produced,
and 25u; + 25u2 units of good B. Because 300 units of A and 500 units of
B are required,
10u; + 20u2 > 300
[1]
25u; + 25u2 > 500
In addition, of course, u; > 0 and uz > 0. The total costs of operating the
two factones for u; and u2 hours, respectively, are 10.000u,;+ 8000 u2. The
problem is, therefore,
FIGURE 19.3
30.
25u; + 25u2 = 500
uy
10u, + 20u2 = 300
Sec. 19.1 / Preliminaries 727
the level curves 10,000u,; + 8000u2 = c, marked L;, Lz, and L;. These
three correspond to the values 100,000; 160,000; and 240,000 of the cost
level c. As c increases, the level curve moves farther and farther to the
northeast.
The solution to the minimization problem is clearly the level curve that
touches the feasible set S at point A with coordinates (0,20). Hence, the
optimal solution is to operate factory 2 for 20 hours and not to use factory
1 at all. The minimum cost of producing the order is 160,000.
where elements a;; and b; are given constants. Usually, we assume explicitly that
FIGURE 19.4
Problems
My ae Xo
dad. max 8x; + 9x2 s.t. 2X oxo ls tp 0s 0
Xi ct | xan 0
€. max —2x|
+ X92 St. OS x) — 397 SS eS 2. xX)
=] 0 SS 0
x
'Because an extreme point typically involves n of the n +m inequality constraints holding with
equality. there can be as many as (n + m)!/n!m! extreme points. For example. if n = 50 and m = 60
(which is quite small by the standards of the problems that can be solved numerically). then there can
be as many as 110!/50!60! or more than 6- 10°! extreme points.
Sec. 19.2 / Introduction to Duality Theory 729
—xX; + 0 < -l
max x; + 2X2 S.t. a x, >0, x >0
rer 3 Eis as
—2x,+ x<2
XO 91> 0
x; + 2x.
<8
set S will expand slightly and point B will move up to the left a little along
the butter border. The new optimal point B’ will be at the intersection of the
lines 3x, + 6x2 = 151 and x; + x2 = 27.5. Solving these equations gives
x; = 14/3 and x. = 137/6. Then the criterion function becomes equal to
20(14/3) + 30(137/6) = 2335/3 = 775 + 10/3. So profit rises by 10/3.
If the baker receives an extra kilo of sugar, the feasible set will expand,
but the optimal point is still at B. Recall that at the optimum in the onginal
problem, the baker had 5.75 kilos of unused sugar. There is no extra profit.
An extra kilo of butter would give a new optimal point at the intersec-
tion of the lines 3x; +6x2 = 150 and x; +x = 28.5. Solving these equations
gives x; = 7 and x2 = 21.5 with 20x, + 30x2 = 775+ 10. Profit mses by 10.
These results can be summarized as follows:
Now add all these inequalities, using the obvious fact that if A < B, C < D,
and E< F,thnA+C+£E<B+D+4+F. Theresultis
10
10x; + 20x. + 10x; + 10x. < 3 - 150+ 10- 27.5
which reduces to
Thus, using the “magic” numbers uj, u3, and u3 defined before, we have
proved that if (x;, x2) is any feasible pair, then the criterion function has to
be less than or equal to 775. Because x, = 5 and x2 = 22.5 give z the value
775, we have in this way proved algebraically that (5, 22.5) is the solution.
Sec. 19.2 / Introduction to Duality Theory 731
Suppose the baker gets tired of running the business. (After all, there must be
many complaints about the rather plain cakes.) Somebody else wants to take over
and buy all the baker’s ingredients. The baker intends to charge a price u, for each
kilo of flour, u. for each kilo of sugar, and u3 for each kilo of butter.
Because one dozen A cakes requires 3 kilos of flour and 1 kilo each of sugar
and butter, the baker will charge 3u; +u2+u3 for the ingredients needed to produce
a dozen A cakes. The baker originally had a profit of 20 for each dozen A cakes,
and he wants to earn at least as much from these ingredients if he quits. Hence,
the baker insists that the prices (u;. U2, u3) must satisfy
The entrant pays for each ingredient exactly the marginal profit for that ingredient
which was calculated previously. In particular, the price of sugar is zero, because
the baker has more than he can use optimally.
Problem [2] is called the dual of problem [1]. The two problems turn out to
be closely related. Let us explain in general how to construct the dual of an LP
problem.
Check carefully that problem [2] is the dual of problem [1] in the sense we have
just explained. Due to the symmetry between the two problems, we call either the
dual of the other.
Sec. 19.3 / The Duality Theorem 733
Matrix Formulation
Let us introduce the following column vectors (matrices):
x) C} by uy
a eke se bee (19.7)
Ses Gr loys un
Then the primal can be written as follows (with A and A’ given by [19.6]):
And the dual can be wnitten as min b’u subject to A’u>c, u> 0. It is more
convenient, however, to write the dual in a slightly different way. Transposing
A’u > ¢ using the rules in [12.44] of Section 12.9 yields u’A > c’, and moreover
b’u = w’b. So the dual can be written as
Problems
new inequality
(3x; + 6x2)uy + (x) + 0.5x2)ur + (x) + X2)Uu3 < 150U, + 22u2 + 27.5u3
(Bu, tur +u3)x; + (64; + 0.5u2 + u3)xX2 < 150u; +22u2+27.5u3 [*]
for all feasible (x;, x2) in problem [1] and for all feasible (u;.u2.u3) in
problem [2]. We conclude that in this example. the criterion function in
the dual problem is always greater than or equal to the criterion func-
tion of the primal problem, whatever feasible (x). x2) and (u;,u2,.u3) are
chosen.
The inequality [x**] is valid for the feasible pair (x). x2) = (5, 22.5)
in particular. For each feasible tiple (u;. u2.u3), we therefore obtain
(QyjX1 H-+-
+ AynXn Uy +--+ + (m1X1 +--+
+ AmnXn)um < buy +---
+ Dmum
(211Uy +--+
Am Um)X] ++ 2+ + (Gin) +--+ Omnllm)Xn > CX] +++
+ CnXn
By rearranging the terms on the left-hand side of each inequality, we see that
each is equal to the double sum )°"_, )0"_, ajjuixj. Then [19.10] follows
immediately.
Then (xj, ...,x7) solves problem [19.4] and (uj,...,u*,) solves problem
{19.5}.
byuy +--+
+ Omtim = CX} He Henx,
Theorem 19.2 shows that if we are able to find feasible solutions for prob-
Jems [19.4] and [19.5] that give the same value to the criterion function in each of
the two problems, then these feasible solutions are, in fact, optimal solutions.
736 = Chapter 19 / Linear Programming
The proofs of Theorems 19.1 and 19.2 were very simple. It is much more difficult
to prove the first statement in Theorem 19.3 concerning the existence of a solution
to the dual, and so we shall not attempt to provide a proof here. The last state-
ment in Theorem 19.3, however, follows readily from inequality [19.10]. For if
(u;,...,U,) is any feasible solution to the dual problem, then b)u; +--- + d,_um
is a finite number greater than or equal to any number c)x; + --- +¢,X, when
(x}....,%Xn,) iS feasible in the pnmal. This puts an upper bound on the possible
values of c)x) +--+ + CpXp-
Note: It is a useful exercise to formulate and prove Theorems 19.] and 19.2 using
matrix algebra. Let us do so for Theorem 19.1. Suppose x is feasible in [19.8]
and u is feasible in [19.9]. Then
You should note carefully how these inequalities correspond to those we established
in the earlier proof of Theorem 19.1.
Problems
and 2 both have a capacity of at most 16 hours per day, and division 3 has
a capacity of at most 11] hours per day. Let x, and x2 denote the number of
small and medium television sets that are produced per day.
a. Show that in order to maximize profits per day, one must solve the
following problem:
aj\ Qin
xy{ ot |te--t+2n
am} amn
If the available resources are b;....,b,, then the feasible activity levels are those
that satisfy the m constraints in [19.4]. The nonnegativity constraints reflect the
fact that we cannot run the activities at negative levels.
Each activity brings a certain “reward.” Let c; be a measure of the reward
(or value) created by running activity j at unit level. The total reward obtained by
running the activities at levels x,,..., x, is then c)x; +---+c,x,. The problem of
the firm is therefore to solve the following LP problem: Find those levels for the n
activities that maximize the total reward, subject to the given resource constraints .
The problem in Example 19.1 can be interpreted in this way. There are two
activities of making each of the two types of cake, and there are three resources—
flour, sugar, and butter.
Let us turn to the dual problem [19.5]. In order to be in business, the firm
has to use some resources. Each resource, therefore, has a value or price. Let u;
738 Chapter 19 / Linear Programming
be the price associated with one unit of resource j. Rather than think of u; as
a market price for resource j. we should think of it as (Somehow) measuring the
relative contribution that one unit of resource j makes to the total economic result.
These prices are not real prices, so they are often called shadow prices.
Because aj ;.@2;,....@mj are the numbers of units of each of the m resources
needed to run activity j at unit level, a);u; + a2j;u2 + --- + Qmjum is the total
(shadow) cost of running activity j at unit level. Because c; is the reward (value)
of running activity j at unit level,
can be regarded as the (shadow) profit of running activity j at unit level. Note
that the jth constraint in the dual problem [19.5] says that the (shadow) profit from
running activity j at unit level is < 0.
The criterion function Z = bu; +--- + bmu, in the dual LP problem
measures the (shadow) value of the initial stock of all the resources. The dual
problem is, therefore, the following: Among all choices of nonnegative shadow
DIICES Ug. > sx Um such that the profit of running each activity at unit level is < 0,
find one that minimizes the (shadow) value of the initial resources.
Qy\X; + FAX = i
max €)xX; +--+ +CpXn subject TO.) Cc dae ks bepertbaes Sedo rendiece ER 258 [x]
QmiX, + + @mnXn S bm
withix; 2.0.5. .3 X, > 0. What happens to the optimal value of the criterion
function if the numbers })..... b,, change? If the changes Ab,..... Ab, are
positive, then the feasible set increases and the new optimal value of the criterion
function cannot be smaller. (Usually it increases.) The following analysis also
applies when some or all the changes Ab), .... Ab, are negative.
How big is the change in the optimal value? Suppose (xf,...,x*) and
(ey ACen x; + Ax,) are optimal solutions to the primal when the nght-hand
side is respectively (b). ..., bm) and (b} + Ad), ..-.bm + Abm). If Ab,...., Abn
are all sufficiently small, the duals of the two problems often have the same optimal
solution uj..... u*. Then, according to Theorem 19.3, one has
Hence, by subtraction,
CA, +--+
+ CpAX, = UpAb, + +--+
u* Abp,
Sec. 19.5 / Complementary Slackness 739
Here the left-hand side is the change we obtain in the criterion function in [*] when
b,...., bm are changed by Ab),..., Abm, respectively. Denoting this change in
z by Az*, we obtain
Note: The assumption underlying [19.12] is that the changes in the b’s do not
cause the optimal dual vanables to change.
Problems
4x+ Sy a 20
max 2x
+ 7y subject to {es Ge im x=
00 = 0
21
We interpret [2] this way: Because the shadow prices of flour and butter are posi-
tive, in the optimal solution, all the available flour and butter are used. We do not
use all the available sugar, so its shadow price is zero—it is not a scarce resource.
These results hold more generally.
Indeed, first, consider the problem
QjX1 + Qy2X2
max €;X; +C2x2 subject to ¢ @2)x; + a72Xx2 = v oO y V oO ¥
€31X| + 32X2 IA epee
INIA
740 = Chapter 19 / Linear Programming
with uv}, u2, and u3; > 0. Suppose (xf. x3) solves (3] whereas (u7.u}. U3) solves
[4]. Then
Multiply the three inequalities in [5](a) by the three nonnegative numbers uj, u3,
and u3, respectively. Then add the results. This yields the inequality
(Ay, Xf +Qy2X5) Ul + (a2) X7 +422X5 U5 + (43) X} +4323) UZ < Diu} +b2u,+b3u; [6]
Muluply the two inequalities in [5](b) by xf and x}. respectively, and then add.
This gives
Looking closely at the left-hand sides of the two inequalities in [6] and [7] reveals
that they are equal. Moreover, by the duality theorem of LP (Theorem 19.3), the
nght-hand sides of [6] and [7] are equal. Hence, both inequalities in [6] and [7] can
be replaced by equalities. Thus, replacing < by = in (6) and rearranging. we obtain
(ay,
xX}+@12x7 — by uy + (a2)
x} + a22x3 — b2)UZ + (a3)xf+€32x5 —b3)uz = 0 [8]
Each term in the parentheses within [8] is < 0 because (xf.x3) is feasible. So,
because uj}, u5, and u3 are all > 0, the three terms in [8] are < 0. If any were < 0,
their sum would be < 0. Because their sum is 0, each of them must be 0. Thus,
We conclude that
Using the fact that > in [7] can be replaced by =, and reasoning in exactly the
same way as before, we also get
The results in [9] and [10] are called the complementary slackness conditions.
The arguments used to show that these conditions are necessary extend in a straight-
Sec. 19.5 / Complementary Slackness 741
forward way to the general case. Furthermore, the same complementary slackness
conditions are also sufficient for optimality. Here is a general statement and proof:
Multiplying the first inequality in [1] on the left by (u*)’ > 0 and the second
inequality on the right by x* > 0 yields
Now [19.14] follows immediately. Property [19.13] is proved in the same way
by noting how [5] implies that
Suppose on the other hand that x* and u™ have all their components
nonnegative and satisfy [19.13] and [19.14]. It follows immediately that [6]
and [7] are satisfied. So summing over j and i, respectively. we obtain [4] and
[5]. From these equalities. it follows that 5° , bus = Sor Dias SjixpuF
and also S°7_, cix? = Doj_) Loja ajiM7x7. But the two double sums are
equal. Hence, }°7_, bjut = >) ix? So according to Theorem 19.2, the
vector (xf.---.x;) solves problem [1] and (uj. ---.u™) solves the dual.
Note: Using the general economic interpretations we gave in Section 19.4, condi-
tions [19.13] and [19.14] can be interpreted as follows:
If the optimal solution of the primal problem implies that activity i is in operation
(x > 0), then the (shadow) profit from running that activity at unit level is 0.
If the shadow price of resource j ts positive (u; > 0), then all the available stock
of resource j must be used in any optimum.
x2+ x3 <2 a
+ 6x3
+ 4x. subject to 3x) +
max 3x;
; X, + 2x2 + 6x3 <1
with x; > 0, x2 > 0, and x3 > 0. Write down the dual problem and solve it
by a geometric argument. Then use complementary slackness to solve [1].
3u;+ U2 ma
min 2u; +u2 subject of uy + 2u. >4 uj.u2>0 [2]
uy; + 6u2 >6
Sec. 19.5 / Complementary Slackness 743
Using the geometric solution technique shown in Example 19.2, we find the
solution uj = 2/5, and u = 9/5. Then 3uj + u3 = 3. uj + 2u3 = 4, and
ui + 6u3 > 6.
What do we know about the solution (xf, x3, xj) to [1]? According
to [19.14], because uj > 0 and u5 > 0, both inequalities in [1] are satisfied
with equality. So
=3/f5, x5, xf =0
This is the solution to problem [1]. Note that the optimal values of the
criterion functions in the two problems are indeed equal: 2uj + u3 = 13/5
and 3xf + 4x3 + 6x3 = 13/5, just as they should be according to the duality
theorem.
QyjX1
= + Anke, = OY
TNAXCCI
A Cake eS Mate Seana ih eae ee Xi Ola kee)
QmiX1 t--> t+ amnXn < bm 1]
1
This problem is obviously a special case of the general nonlinear programming
problem
g(x, Xn) Sc
MAX sii is Mack) GSE XR esd.
36<e ie! Res
ag x, 08 Se}
Qin x jeearent kn) sere
which was studied in Section 18.9. Note that the functions f and g; in [1] are
all linear, so are concave as well as convex. Thus, the Kuhn—Tucker conditions
[18.42] and [18.43] are sufficient for optimality of a vector x = (x), x2..... i)
satisfying the constraints specified in [1]. Let us see what form these conditions
take in the linear case.
If we let A; = uj for j=1..... m, conditions [18.42] and [18.43] become
When combined with the requirement that x satisfy the constraints in problem [1],
these conditions are precisely the complementary slackness conditions in Theo-
rem 19.4.
jy X] +--+
+ AinXn = 5; [*]
in order to put the problem into standard form. Constraint [*] thus gives rise to
two dual variables u‘ and u’’. In the matrix describing the dual constraints, the two
columns associated with uw; and w;’ are equal except for opposite signs everywhere.
Therefore, we can replace the two variables u; and u/ with u; = u; — u7, but
then there is no restriction on the sign of u;. We see that if the ith constraint in
the primal is an equality, then the ith dual variable has an unrestricted sign. This
is consistent with the economic interpretation we have given. If we are forced
to use all of resource i, then it is not surprising that the resource may command
a negative shadow price—it may be something that is harmful in excess. For
instance, if the baker of Example 19.1 was forced to include all the stock of sugar
in the cakes, the best point in Fig. 19.2 would be B, not C. Some profit would
be lost.
From the symmetry between the primal and the dual, we realize now that if
one of the variables in the primal has an unrestricted sign, then the corresponding
constraint in the dual is an equality.
Problems
1. Consider Problem 1 of Section 19.3. The optmal solution of the primal was
x” = 0, and y* = 3, whereas u} = 0, u3 = 1 was the optimal solution of the
dual. Verify that [19.13] and [19.14] are satisfied in this case.
2. a. Solve the following problem geometrically:
pT Be SP Retake
‘
min y; + 2y2 subject to aybs tea ap aS 5 ; :
es yn 20, 2 =0
’ y= 2)3 B20
b. Write down the dual problem and solve it.
c. What happens to the optimal dual variables if the constraint y) +6y2 > 15
is changed to y) + 6y2 > 15.1?
Sec. 19.5 / Complementary Slackness 745
3. A firm produces two commodities A and B. The firm has three factories
that jointly produce both commodities in the amounts per hour given in the
following table:
Commodity A 10 20 20
Commodity B 20 10 20
The firm receives an order for 300 units of A and 500 units of B. The cost
per hour of running factories 1, 2, and 3 are respectively 10,000: 8000; and
11,000.
a. Let y), y2, and y3, respectively, denote the number of hours for which
the three factories are used. Write down the linear programming problem
of minimizing the costs of fulfilling the order.
b. Show that the dual of the problem in part (a) is
Solve this problem and then find the solution of the problem in part (a).
c. By how much will the minimum cost of production increase if the cost
per hour in factory 1 increases by 100?
Harder Problems
bg asd!
where vaniablesx e%75, o-oex. wares all =O; Here, 62) 9Vi. Vaux 252:
x are fixed constants. (Superscripts i = 1]. .... N refer to production
units; V, and V> are available quantities of two resources; each x/ is a
capacity constraint on the output of unit j.) Wnte down the dual to prob-
lem [1], with g; and g2 denoting the dual prices associated with the firsi two
constraints in [1], whereas r', r?, .... r% are the dual variables associated
with the last N constraints. Let the values of the variables that solve the
746 = Chapter 19 / Linear Programming
two problems be those indicated with a hat. Show that if [1] has a finite
optimum, then
X} = xe <
max 3x;+2x2 subject to 2x) Pe Xeo— -xs <1 xp izraOeG >0
X; + 2x. -— 2x3 < 1