Denardo (2009) LinearProgramming
Denardo (2009) LinearProgramming
Volume 149
Series Editor
Frederick S. Hillier
Stanford University, CA, USA
1 3
Eric V. Denardo
Yale University
P.O. Box 208267
New Haven CT 06520-8267
USA
[email protected]
ISSN 0884-8289
ISBN 978-1-4419-6490-8â•…â•…â•…â•… e-ISBN 978-1-4419-6491-5
DOI 10.1007/978-1-4419-6491-5
Springer New York Dordrecht Heidelberg London
Over the past half century, dozens of excellent books have appeared on
this subject. Why another? This book fuses five components:
v
vi Linear Programming and Generalizations
has become vastly easier to learn and to use. Spreadsheets help the student to
become facile with the subject, and it helps them use it to shape their profes-
sional identities.
The book is designed for use in courses that focus on the applications of
constrained optimization, in courses that emphasize the theory, and in cours-
es that link the subject to economics. A “use’s guide” is provided; it takes the
form of a brief preview of each of the six Parts that comprise this book.
Acknowledgement
This book’s style and content have been shaped by decades of interac-
tion with Yale students. Their insights, reactions and critiques have led me
toward a problem-based approach to teaching and writing. With enthusiasm,
I acknowledge their contribution. This book also benefits from interactions
with my colleagues on the faculty. I am deeply indebted to Uriel G. Rothblum,
Kurt Anstreicher, Ludo Van der Heyden, Harvey M. Wagner, Arthur J. Swer-
sey, Herbert E. Scarf and Donald J. Brown, whose influences are evident here.
vii
Contents
Part I – Prelude
Part IV – LP Theory
Chapter 13. The Dual Simplex Pivot and Its Uses���������������������������������╇ 413
ix
x Linear Programming and Generalizations
Chapter 2 contains the facets of Excel that are used in this book. Also
discussed in Chapter 2 is the software that accompanies this text. All of the
information in it is helpful, and some of it is vital.
1. Preview
The goals of this chapter are to introduce you to linear programming and
its generalizations and to preview what’s coming. The chapter itself is orga-
nized into six main sections:
• In the first of these sections, the terminology that describes linear pro-
grams is introduced and a simple linear program is solved graphically.
• The fourth section introduces four themes that pervade this book.
• The fifth section introduces the computer codes that are used in this
text.
• The sixth section consists of a brief account of the origins of the field.
2. An Example
1x + 2y ≤ 4,
3x + 2y ≤ 6,
x â•› ≥ â•›0,
╅╅╇ y ≥ 0.
Chapter 1: Eric V. Denardo 5
The decision variables in a linear program are the quantities whose val-
ues are to be determined. Program 1.1 has two decision variables, which are
x and y. Program 1.1 has four constraints, each of which is a linear inequality.
A big deal?
A linear program seems rather simple. Can something this simple be im-
portant? Yes! Listed below are three reasons why this is so.
• The ideas that underlie the simplex method generalize readily to situa-
tions that are far from linear and to settings that entail several decision
makers, rather than one.
Feasible solutions
Like any field, linear programming has its own specialized terminology
(jargon). Most of these terms are easy to remember because they are sug-
gested by normal English usage. A feasible solution to a linear program is
a set of values of its decision variables that satisfies each of its constraints.
Program 1.1 has many feasible solutions, one of which xâ•›=â•›1 and yâ•›=â•›0. The
feasible region of a linear program is its set of feasible solutions. Program 1.1
has only two decision variables, so its feasible region can be represented on
the plane. Figure 1.1 does so.
6 Linear Programming and Generalizations
y
3
1x + 2y = 4
2
3x + 2y = 6
1
feasible region
x=0
0 x
0 1 2 3 4
y=0
Figure 1.1 is easy to construct because the pairs (x, y) that satisfy a par-
ticular linear constraint form a “half-plane” whose boundary is the line on
which this constraint holds as an equation. For example:
• Two points determine a line, and the line 1xâ•›+â•›2yâ•›=â•›4 includes the points
(pairs) (0, 2) and (4, 0).
• In Figure 1.1, a thick arrow points from the line 1xâ•›+â•›2yâ•›=â•›4 into the half-
plane that satisfies the inequality 1xâ•›+â•›2yâ•›≤â•›4.
The feasible region for Program 1.1 is the intersection of four half-planes,
one per constraint. In Figure 1.1, the feasible region is the area into which the
thick arrows point, and it is shaded.
Chapter 1: Eric V. Denardo 7
Optimal solutions
An optimal solution to Program 1.1 is xâ•›=â•›1 and yâ•›=â•›1.5, and its optimal
value z*â•›=â•›2xâ•›+â•›2yâ•›=â•›(2)(1)â•›+â•›(2)(1.5)â•›=â•›5. To convince yourself that this is the
optimal solution to Program 1.1, consider Figure 1.2. It augments Figure 1.1
by including two “iso-profit” lines, each of which is dashed. One of these lines
contains the points (x, y) whose objective value equals 4, the other contains
the pairs (x, y) whose objective value that equals 5. It is clear, visually, that the
unique optimal solution to Program 1.1 has xâ•›=â•›1 and yâ•›=â•›1.5.
Figure 1.2.↜ Feasible region for Program 1.1, with two iso-profit lines.
y
3
2x + 2y = 4
2 (1, 1.5)
2x + 2y = 5
1
feasible region
0 x
0 1 2 3 4
A linear program can have only one optimal value, but it can have more
than one optimal solution. If the objective of Program 1.1 were to maximize
(xâ•›+â•›2y), its optimal value would be 4, and every point on the line segment
connecting (0, 2) and (1, 1.5) would be optimal.
8 Linear Programming and Generalizations
A taxonomy
Each linear program that is feasible and bounded has at least one opti-
mal solution.
• It may be unbounded.
╅╛╛╛╅╇╛1u + 3v ≥ 2,
╛╛2u + 2v ≥ 2,
╇╛╛u â•› ≥ 0,
╅╅╇╛╛v ≥ 0.
Figure 1.3 plots the feasible region for Program 1.2. This feasible region is
clearly unbounded. Program 1.2 is bounded, nonetheless; every feasible solu-
tion has objective value that exceeds 0.
v
2u + 2v = 2
1
feasible region
1u + 3v = 2
(1/2, 1/2)
0 u
0 1 2
You might suspect that unbounded feasible reasons do not arise in prac-
tice, but that is not quite accurate. In a later chapter, we’ll see that every linear
program is paired with another, which is called its “dual.” We will see that if a
10 Linear Programming and Generalizations
linear program is feasible and bounded, then so is its dual, in which case both
linear programs have the same optimal value, and at least one of them has an
unbounded feasible region. Programs 1.1 and 1.2 are each other’s duals, by
the way. One of their feasible regions is unbounded, as must be.
3. Generalizations
This problem does not have an optimal solution. The “infimum” of its
objective equals 6, and setting y slightly above 2 comes “close” to 6, but an
objective value of 6 is not achievable. Ruling out strict inequalities eliminates
this difficulty.
On the other hand, the simplex method can – and will – be used to find
solutions to linear systems that include one or more strict inequalities. To
illustrate, suppose a feasible solution to Program 1.1 is sought for which the
variables x and y are positive. To construct one, use the linear program:
θ ≤ x,
θ ≤ y.
Integer-valued variables
A linear program lets us impose constraints that require the decision vari-
able x to lie between 0 and 1, inclusive. On the other hand, linear programs
do not allow us to impose the constraint that restrict a decision variable x to
the values 0 and 1. This would seem to be a major restriction. Lots of entities
(people, airplanes, and so forth) are integer-valued.
Competition
Non-linear functions
Linear programs require that the objective and constraints have a par-
ticular form, that they be linear. A nonlinear program is an optimization
problem whose objective and/or constraints are described by functions
that fail to be linear. The ideas used to solve linear programs generalize
to handle a variety of nonlinear programs. How that occurs is probed in
Chapter 20.
12 Linear Programming and Generalizations
4. Linearization
A “maximin” objective
â•…â•… 1x + 2y ≤ 4,
â•…â•… 3x + 2y ≤ 6,
â•…â•… x â•›≥ 0,
╅╅╅╅╇ y ≥ 0.
The object of Program 1.3 is to maximize the smaller of two linear expres-
sions. This is not a linear program because its objective is not a linear expres-
sion. To convert Program 1.3 into an equivalent linear program, we maximize
the quantity t subject to constraints that keep t from exceeding the linear ex-
pressions (2xâ•›+â•›2y) and (xâ•›−â•›3y). In other words, we replace Program 1.3 by
A “minimax” objective
(2xâ•›+â•›2y) and (xâ•›−â•›3y), subject to the constraints of Program 1.3. The same
trick works, as is suggested by:
t ≥ 2x + 2y,
t ≥ 1x – 3y,
A linear program seems to require that the objective vary linearly with
the level of a decision variable. In Program 1.1, the objective is to maximize
the linear expression, 2xâ•›+â•›2y. Let us replace the addend 2y in this objective by
the (nonlinear) function p(y) that is exhibited in Figure 1.4. This function il-
lustrates the case of decreasing marginal benefit, in which the (profit) func-
tion p(y) has slope that decreases as the quantity y increases.
14 Linear Programming and Generalizations
S\
VORSHHTXDOV
VORSHHTXDOV
\
y1 ≥ 0, y1 ≤ 0.75, y2 ≥ 0, y = y1 + y2,
and replacing the addend 2y in the objective by (2y1â•›+â•›0.25y2). This results in:
1x + 2y ≤ 4,
3x + 2y ≤ 6,
y = y1 + y2,
â•›y1 ≤ 0.75,
x ≥ 0, y ≥ 0, y1 ≥ 0, y2 ≥ 0.
To verify that Program 1.5 accounts correctly for the profit function p(y)
in Figure 1.4, we consider two cases. First, if the total quantity y does not
exceed 0.75, it is optimal to set y1â•›=â•›y and y2â•›=â•›0. Second, if the total quantity y
does exceed 0.75, it is optimal to set y1â•›=â•›0.75 and y2â•›=â•›yâ•›−â•›0.75.
Chapter 1: Eric V. Denardo 15
An unintended option
Program 1.5 is a bit more subtle than it might seem. Its constraints allow
an unintended option, which is to set y2â•›>â•›0 while y1â•›<â•›1. This option is ruled
out by optimization, however. In this case and in general:
The point is that a linear program will not engage in a more costly way to
do something if a less expensive method of doing the same thing is available.
Net profit is the negative of net cost: A net profit of $6.29 is identical to a
net cost of −$6.29, for instance. Maximizing net profit is precisely equivalent
to minimizing net cost. Because of this, the same trick that handles the case
of decreasing marginal profit also handles the case of increasing marginal
cost. One or more unintended options are introduced, but they are ruled out
by optimization. Again, the more costly way of doing something is avoided.
T\
VORSH
HTXDOV
VORSHHTXDOV
\
16 Linear Programming and Generalizations
Let us turn our attention to the variant of Program 1.1 whose object is to
maximize the nonlinear expression, {2xâ•›+â•›q(y)}. Proceeding as before would
lead to:
1x + 2y ≤ 4,
3x + 2y ≤ 6,
╅╅╇ y = y1 + y2,
╅╅╇ y1 ≤ 1,
x ≥ 0, y ≥ 0, y1 ≥ 0, y2 ≥ 0.
Program 1.6 introduces an unintended option, which is to set y2 posi-
tive while y1 is below 1, and this option is selected by optimization. Indeed,
in Program 1.6, it cannot be optimal to set y1 positive. Given the option, the
linear program chooses the more profitable way to do something. In this case
and in general:
(1) x – 1 ≤ t, – t ≤ x – 1, y – 2 ≤ u, – u ≤ y – 2.
Chapter 1: Eric V. Denardo 17
• If x exceeds 1, the first two constraints in (1) are satisfied by any value
of t that has tâ•›≥â•›xâ•›−â•›1, and the fact that a is positive guarantees that the
objective is minimized by setting tâ•›=â•›xâ•›−â•›1.
• If 1 exceeds x, the first two constraints in (1) are satisfied by any value
of t that has tâ•›≥â•›1â•›−â•›x, and the fact that a is positive guarantees that the
objective is minimized by setting tâ•›=â•›1â•›−â•›x.
A similar observation applies to y. Programs 1.7 and 1.7´ have the same
optimal value, and the optimal solution to Program 1.7´ specifies values of x
and y that are optimal for Program 1.7.
Program 1.8.╇ Minimize {a(x − 1)2 + b(y − 2)2 }, subject to the constraints
in Program 1.1.
and convert the model to a linear program, exactly as was done for
Program 1.7.
On the other hand, the variance squares the difference between the out-
come and its expectation, and it weighs upside and downside differences
equally. Substituting a “mean absolute deviation” for the variance produces
a linear program that may make better sense. Also, removing two of the
constraints in (1) minimizes the expected downside variability, which might
make still better sense.
Constraints on ratios
But the other constraints in Program 1.1 guarantee yâ•›≥â•›0, and multiply-
ing an inequality by a nonnegative number preserves its sense. In particular,
multiplying the ratio constraint that is displayed above by the nonnegative
number y produces the linear constraint
x ≤ 0.8y.
This conversion must be qualified, slightly, because ratios are not defined
when their denominators equal zero. If the constraint x/yâ•›≤â•›0.8 is intended
to mean that x cannot be positive when yâ•›=â•›0, it is equivalent to xâ•›≤â•›0.8y. In
general:
Optimizing a ratio*
The next three subsections concern a linear program whose objective func-
tion is a ratio of linear expressions. These subsections are starred. They cover a
specialized topic that can be skipped or deferred with no loss of continuity. Read-
ers who are facile with matrix notation may wish to read them now, however.
Chapter 1: Eric V. Denardo 19
Program 1.9, below, maximizes the ratio of two linear expressions, sub-
ject to linear constraints. Its data form the mâ•›×â•›n matrix A, the mâ•›×â•›1 vector b,
the 1â•›×â•›n vector c and the 1â•›×â•›n vector d. Its decision variables are the entries
in the nâ•›×â•›1 vector x.
cx
Program 1.9.╇ z* = Maximize , subject to the constraints
dx
(2) â•…â•…â•…â•…â•… â•…â•… Ax = b, x ≥ 0.
Hypothesis A:╇
1.╇ Every vector x that satisfies Axâ•›=â•›b and xâ•›≥â•›0 has dxâ•›>â•›0.
Interpretation of Hypothesis A*
In applications, it is often evident that every vector x that satisfies (2) as-
signs a value to d x that is bounded away from 0 and from +∞.
A change of variables*
1
(3) t= and x̂ = xt.
dx
Programs 9 and 10 have the same data, namely, the matrix A and the vec-
tors b, c and d. They have different decision variables. Feasible solutions to
these two optimization problems are related to each other by:
cx
(5) = cx̂.
dx
cx cx cx
= ×t= × t = cx̂,
dx d x̂ 1
which completes the proof. ■
Chapter 1: Eric V. Denardo 21
Proposition 1.1 shows how every feasible solution to Program 1.9 cor-
responds to a feasible solution to Program 1.10 that has the same objective
value. Thus, rather than solving Program 1.9 (which is nonlinear), we can
solve Program 1.10 (which is linear) and use (3) to construct an optimal solu-
tion to Program 1.9.
5. Themes
Discussed in this section are several themes that are developed in later
chapters. These themes are:
• The broad array of situations that can be modeled and solved as linear
programs and their generalizations.
Pivoting
At the heart of nearly every software package that solves linear programs
lies the simplex method. The simplex method was devised by George B.
Dantzig in 1947. An enormous number of person-years have been invested in
attempts to improve on the simplex method. Algorithms that compete with it
in specialized situations have been devised, but nothing beats it for general-
purpose use, especially when integer-valued solutions are sought. Dantzig’s
simplex method remains the best general-purpose solver six decades after he
proposed it.
At the core of the simplex method lies the pivot, which plays a central
role in Gauss-Jordan elimination. In Chapter 3, we will see how Gauss-Jordan
elimination pivots in search of a solution to a system of linear equations. In
Chapter 4, we will see that the simplex method keeps on pivoting, in search of
an optimal solution to a linear program. In Chapter 15, we’ll see how a slightly
different pivot rule (called complementary pivoting) finds the solution to a
non-zero sum matrix game. And in Chapter 16, we’ll see how complementary
22 Linear Programming and Generalizations
Impact on mathematics
The analysis of linear programs and their generalizations have had a pro-
found impact on mathematics. Three facets of this impact are noted here.
The simplex method actually solves a pair of linear programs – the one
under attack and its dual. That it does so is an important – and largely un-
anticipated – facet of linear algebra whose implications are probed in Chap-
ter 12. Duality is an important addition to the mathematician’s tool kit; it
facilitates the proof of many theorems, as is evident in nearly every issue of
the journals, Mathematics of Operations Research and Mathematical Program-
ming.
Economic reasoning
Within economics, these three concepts are usually described in the con-
text of an optimal allocation of resources. In Chapter 12, however, it will be
seen that these three concepts apply to each step of the simplex method, that
it uses them to pivot from one “basis” to another as it seeks an optimal solu-
tion.
It was mentioned earlier that every linear program is paired with another,
in particular, that Programs 1.1 and 1.2 are each duals. This duality provides
economic insight at several different levels. Three illustrations of its impact
are listed below.
well-being while requiring the market for each good to “clear.” The dual
linear program sets prices that maximize the producers’ profits. Their
optimal solutions satisfy the consumer’s budget constraint, thereby
constructing a general equilibrium.
Areas of application
Several chapters of this book are devoted to the situations that can be
modeled as linear programs and their generalizations.
The applications in the above list are of a linear program, without regard
to its dual. Models of competition can be analyzed by a linear program and
its dual. These include the aforementioned model of an economy in general
equilibrium.
6. Software
One choice
• Solver, which comes with Excel. The original version of Solver was
written by Frontline Systems. Solver is now maintained by Microsoft.
These packages are introduced in Chapter 2, and their uses are elaborated
upon in subsequent chapters. These packages (and many others) have user
interfaces that are amazingly user-friendly.
Large problems
Solver and Premium Solver for Education can handle all of the linear and
nonlinear optimization problems that appear in this text. These codes fail
on problems that are “really big” or “really messy” – those with a great many
variables, with a great many constraints, with a large number of integer-val-
ued variables, or with nonlinear functions that are not differentiable. For big
problems, you will need to switch to one of the many commercially available
packages, and you may need to consult an expert.
Leoinid V. Kantorovich
the best way to plan for production2. This monograph included a linear pro-
gram, and it recognized the importance of duality, but it seemed to omit a
systematic method of solution. In 1942, Kantorovich published a paper that
included a complete description of a network flow problem, including dual-
ity, again without a systematic solution method3.
For the next twenty years, Kantorovich’s work went unnoticed in the
West. Nor was it applauded within the U. S. S. R., where planning was central-
ized and break-even prices were anathema. It was eventually recognized that
Kantorovich was the first to explore linear programming and that he probed
it deeply. Leonid V. Kantorovich richly deserved his share of the 1975 Nobel
Prize in Economics, awarded for work on the optimal allocation of resources.
George B. Dantzig
After war’s end, Dantzig returned to Berkeley for a few months to com-
plete his Ph. D. degree. By the summer of 1946, Dantzig was back in Washing-
ton as the lead mathematician in a group whose assignment was to mechanize
the planning problems faced by the Air Force. By the spring of 1947, Dantzig
had observed that a variety of Air Force planning problems could be posed
as linear programs. By the summer of 1947 he had developed the simplex
method. These and a string of subsequent accomplishments have cemented
his stature as the preeminent figure in linear programming.
Tjalling C. Koopmans
2╇
Kantorovich, L. V., The mathematical method of production planning and organiza-
tion, Leningrad University Press, Leningrad, 1939. Translated in Management Sci-
ence, V. 6, pp. 366-422, 1960.
3╇
Kantorovich, L. V., “On the translocation of masses,” Dokl. Akad. SSSR, V. 37,
pp. 227–229.
Chapter 1: Eric V. Denardo 27
daughter. During the war, while serving as a statistician for the British Mer-
chant Shipping Mission in Washington, D.C., he built a model of optimal
routing of ships, with the attendant shadow costs. Koopmans shared the 1975
Nobel Prize in economics with Kantorovich for his contributions to the opti-
mal allocation of resources.
An historic conference
A conference on activity analysis was held from June 20-24, 1949, at the
Cowles Foundation, then located at the University of Chicago. This confer-
ence was organized by Tjalling Koopmans, who had become very excited
about the potential for linear programming during a visit by Dantzig in the
spring of 1947. The volume that emerged from this conference was the first
published compendium of results related to linear programming4. The par-
ticipants in this conference included six future Nobel Laureates (Kenneth Ar-
row, Robert Dorfman, Tjalling Koopmans, Paul Samuelson, Herbert Simon
and Robert Solow) and five future winners of the von Neumann Theory Prize
in Operations Research (George Dantzig, David Gale, Harold Kuhn, Herbert
Simon and Albert Tucker).
With amazing foresight, the Air Force organized Project SCOOP (sci-
entific computation of optimal programs) and funded the development and
acquisition of digital computers that could implement the simplex method.
These computers included:
Industrial applications
8. Review
5╇
Cooper. W. W., “Abraham Charnes and W. W. Cooper (et al): A brief history of a
long collaboration in developing industrial uses of linear programming,” Operations
Research, V. 50, pp. 35-41.
6╇
Charnes, A., W. W. Cooper and B. Mellon, “Blending aviation gasolines – a study of
programming interdependent activities in an integrated oil company, Econometrica,
V. 20, pp 135-159, 1952.
7╇
Charnes, A., “Optimality and degeneracy in linear programming,” Econometrica, V.
20, pp 160-170, 1952.
Chapter 1: Eric V. Denardo 29
Terminology
Utility
It is hoped that you now have a feel for the value of studying linear pro-
gramming and its generalizations. Within this chapter, it has been observed
that:
• The methods have broad applicability – they adapt to handle strict in-
equalities, integer-valued variables, nonlinearities, and competition.
• Pivots are potent – with them, we can tackle systems of linear equa-
tions, linear programs, and fixed-point problems.
Its breadth, insight and usefulness may make linear programming the
most important development in applicable mathematics to have occurred
during the last 100 years.
30 Linear Programming and Generalizations
1.╇ (subway cars) The Transit Authority must repair 100 subway cars per
month, and it must refurnish 50 subway cars per month. Both tasks can
be done by the Transit Authority, and both can be contracted to private
shops, but at a higher cost. Private contracting increases the cost by $2000
per car repaired and $2500 per car refurnished.
(a)╇ Formulate the problem of minimizing the monthly expense for private
contracting as a linear program. Solve it graphically.
in the case of a fire. On a normal school day, there are 450 people in the
building. It has three exterior doors. With a bit of experimentation, she
learned that about 1.5 minutes elapse between the sounding of a fire alarm
and the emergence of people from door A, after which people can emerge
at the rate of 60 per minute. The comparable data for doors B and C are
delay of 1.25 minutes and 1.0 minutes, and rates of 40 per minute and 50
per minute, respectively.
(b) Can you “eyeball” the optimal solution to this linear program? Hint:
After the first 1.5 minutes, are people filing out at the rate of 150 per
minute?
4. (deadheading) SW airline uses a single type of aircraft. Its service has been
disrupted by a major winter storm. A total of 20 aircraft, each with its
crew, must be deadheaded (flown without passengers) in order to resume
its normal schedule. To the right of the table that appears below are the
excess supplies at each of three airports. (These total 20). To the bottom
are the excess demands at five other airports. (They also total 20). Within
the table are the deadheading costs. For instance, the airline has 9 aircraft
too many at airport A, it has 5 aircraft too few at airport V, and the cost
of deadheading each aircraft from airport A to airport V is 25 thousand
dollars. The airline wishes to resume its normal schedule with the least
possible expense on deadheading.
(b) Subtract the smallest cost in each column from every cost in that col-
umn. Did this alter the relative desirability of different plans?
(c) With respect to the costs obtained from part (b), “eyeball” a shipping
plan whose cost is close to zero. How far from optimum can it be?
Have you established a lower bound on the cost of resuming SW air-
line’s normal schedule?
32 Linear Programming and Generalizations
V W X Y Z supply
A 25 10 20 25 20 9
B 5 10 80 20 40 4
C 10 40 75 10 10 7
demand 5 2 4 6 3
1.╅ Preview����������������������������������尓������������������������������������尓������������������������ 33
2.╅ The Basics����������������������������������尓������������������������������������尓�������������������� 34
3.╅ Expository Conventions����������������������������������尓���������������������������������� 38
4.╅ The Sumproduct Function����������������������������������尓������������������������������ 40
5.╅ Array Functions and Matrices����������������������������������尓������������������������ 44
6.╅ A Circular Reference ����������������������������������尓������������������������������������尓�� 46
7.╅ Linear Equations ����������������������������������尓������������������������������������尓�������� 47
8.╅ Introducing Solver ����������������������������������尓������������������������������������尓������ 50
9.╅ Introducing Premium Solver����������������������������������尓�������������������������� 56
10.╇ What Solver and Premium Solver Can Do����������������������������������尓���� 60
11.╇ An Important Add-In����������������������������������尓������������������������������������尓�� 62
12.╇ Maxims for Spreadsheet Computation����������������������������������尓���������� 64
13.╇ Review����������������������������������尓������������������������������������尓�������������������������� 65
14.╇ Homework and Discussion Problems����������������������������������尓������������ 65
1. Preview
Excel has evolved, and it continues to evolve. The same is true of Solver.
Several versions of Excel and Solver are currently in use. A goal of this chapter
is to provide you with the information that that is needed to make effective
use of the software with which your computer is equipped.
If your computer is a PC, you could be using Excel 2003, 2007 or 2010.
Excel 2003 remains popular. Excel 2007 and Excel 2010 have different file
structures. To ease access, each topic is introduced in the context of Excel
2003 and is adapted to more recent versions of Excel in later subsections.
Needless to say, perhaps, some subsections are more relevant to you than
others.
But if your computer is equipped with Excel 2008 (for Macs only), its
software has a serious limitation. Excel 2008 does not support Visual Basic.
This makes it less than ideal for scientific and business uses. You will not be
able to use your computer to take the grunt-work out of the calculations in
Chapters 3 and 4, for instance. Upgrade to Excel 2011 as soon as possible.
It does support Visual Basic. Alternatively, use a different version of Excel,
either on your computer or on some other.
This section contains basic information about Excel. If you are familiar
with Excel, scan it or skip it.
Chapter 2: Eric V. Denardo 35
Cells
Table 2.1.↜ A spreadsheet
You select a cell by putting the cursor in that cell and then clicking it.
When you select a cell, it is outlined in heavy lines, and a fill handle appears
in the lower right-hand corner of the outline. In Table 2.1, cell C9 has been
selected. Note the fill handle – it will prove to be very handy.
Entering numbers
Entering functions
In Excel, functions (and only functions) begin with the “=” sign. To enter a
function into a cell, select that cell, depress the “=” key, then type the function,
and then depress the Enter key. The function you enter in a cell will not appear
there. Instead, the cell will display the value that the function has been assigned.
It Table 2.1, cell A3 displays the value 24, but it is clear (from column C)
that cell A3 contains the function 23â•›×â•›3, rather than the number 24. Similarly,
√
cell A5 displays the number 1.414…, which is the value of the function 2,
evaluated to ten significant digits.
Entering text
To enter text into a cell, select that cell, then type the text, and then de-
press either the Enter key or any one of the arrow keys. To make cell A6 look
as it does, select cell A6 and type mean. Then hit the Enter key. If the text
you wish to place in a cell could be misinterpreted, begin with an apostrophe,
which will not appear. To make cell A7 appear as it does in Table 2.1, select
cell A7, type ‘= mean, and hit the Enter key. The leading apostrophe tells Excel
that what follows is text, not a function.
Formatting a cell
In Table 2.1, cell A8 displays the fraction 1/3. Making that happen looks
easy. But suppose you select cell A8, type 1/3 and then press the Enter key.
What will appear in cell A8 is “3-Jan.” Excel has decided that you wish to put
a date in cell A8. And Excel will interpret everything that you subsequently
enter into cell A8 as a date. Yuck!
With Excel 2003 and earlier, the way out of this mess is to click on the
Format menu, then click on Cells, then click on the Number tab, and then
select either General format or a Type of Fraction.
With Excel 2007, the Format menu disappeared. To get to the Format
Cells box, double-click on the Home tab. In the menu that appears, click on
Chapter 2: Eric V. Denardo 37
the Format icon, and then select Format Cells from the list that appears. From
here on, proceed as in the prior subsection.
With Excel 2010, the Format Cells box has moved again. To get at it, click
on the Home tab. A horizontal “ribbon” will appear. One block on that ribbon
is labeled Number. The lower-right hand corner of the Number block has a
tiny icon. Click on it. The Format Cells dialog box will appear.
Entering Fractions
How can you get the fraction 1/3 to appear in cell A8 of Table 2.1? Here is
one way. First, enter the function =1/3 in that cell. At this point, 0.333333333
will appear there. Next, with cell A8 still selected, bring the Format Cells box
into view. Click on its Number tab, select Fraction and the Type labeled Up
to one digit. This will round the number 0.333333333 off to the nearest one-
digit fraction and report it in cell A8.
If you select a cell, its content appears in the formula bar, which is the
blank rectangle just above the spreadsheet’s column headings. If you select
cell A5 of Table 2.1, the formula =SQRT(2) will appear in the formula bar, for
instance. What good is the formula bar? It is a nice √ place to edit your func-
tions. If you want to change the number in cell A5 to 3, select cell A5, move
the cursor onto the formula bar, and change the 2 to a 3.
Arrays
In Excel jargon, a relative reference to a column or row omits the “$” sign,
and an absolute (or fixed) reference to a column or row includes the “$” sign.
With Excel 2003 and earlier, select the cell or array you want to repro-
duce. Then move the cursor to the Copy icon (it is just to the right of the scis-
sors), and then click it. This puts a copy of the cell or array you selected on the
Clipboard. Next, select the cell (or array) in which you want the information
to appear, and click on the Paste icon. What was on the clipboard will appear
where you put it except for any cell addresses in functions that you copied
onto the Clipboard. They will change as follows:
• The relative addresses will shift the number rows and/or columns that
separate the place where you got it and the place where you put it.
This may seem abstruse, but its uses will soon be evident.
With Excel 2007, the Copy and Paste icons have been moved. To make
them appear, double-click on the Home tab. The Copy icon will appear just
below the scissors. The Paste icon appears just to the left of the Copy icon,
and it has the word “Paste” written below it. With Excel 2010, the Copy and
Paste icons are back in view – on the Home tab, at the extreme left.
An effort has been made to present material about Excel in a way that is
easy to grasp. As concerns keystroke sequences, from this point on:
Chapter 2: Eric V. Denardo 39
This text displays each Excel keystroke sequence in boldface type, omit-
ting both:
The spreadsheets that appear in this text display the values that have been
assigned to functions, rather than the functions themselves. The convention
that is highlighted below can help you to identify the functions.
In Table 2.1, for instance, cells A3, A4 and A5 are outlined in dotted lines,
and column C specifies the functions whose values they contain. Finally:
The Springer website contains two items that are intended for use
with this book. They can be downloaded from http://extras.springer.
com/2011/978-1-4419-6490-8.
One of the items at the Springer website is a folder that is labeled, “Excel
spreadsheets – one per chapter.” You are encouraged to download that folder
now, open its spreadsheet for Chapter 2, note that this spreadsheet contains
sheets labeled Table 2.1, Table 2.2, …, and experiment with these sheets as
you proceed.
40 Linear Programming and Generalizations
Problem 2.A.╇ For the random variable X that is described in Table 2.2, com-
pute the mean, the variance, the standard deviation, and the mean absolute
deviation.
The sumproduct function will make short work of Problem 2.A. Before
discussing how, we interject a brief discussion of discrete probability models.
If you are facile with discrete probability, it is safe to skip to the subsection
entitled “Risk and Return.”
The probability model in Table 2.2 has four outcomes, and the sum of
their probabilities does equal 1.0. Outcome b will occur with probability 0.55,
and the random variable X will take the value 3.2 if outcome b occurs.
The random variable X in Table 2.2 takes values between –6 and +22. The
mean (a.k.a. expectation) of a random variable represents the “center” of its
probability distribution. The mean of a random variable X is denoted as μ or
E(X), and it is found by multiplying the probability of each outcome by the
value that the random variable takes when that outcome occurs and taking
the sum. For the data in Table 2.2, we have
The mean of a random variable has the same unit of measure as does the
random variable itself. If X is measured in dollars, so is its mean. The mean is
a weighted average; each value that X can take is weighed (multiplied) by its
probability.
There are several measures of the spread of a random variable, that is, of
the difference (X – μ) between the random variable X and its mean. The most
famous of these measures of spread is known as the variance. The variance of
a random variable X is denoted as σ 2 or Var(X) and is the expectation of the
square of (X – μ). For the data in Table 2.2, we have
The unit of measure of the variance is the square of the unit of measure of
the random variable. If X is measured in dollars, Var(X) is measured in (dol-
lars)â•›×â•›(dollars), which is a bit weird.
The standard deviation of a random variable has the same unit of mea-
sure as does the random variable itself.
Taking the square (in the variance) and then the square root (in the stan-
dard deviation) seems a bit contrived, and it emphasizes values that are far
from the mean. For many purposes, the mean absolute deviation may be a
more natural measure of the spread in a distribution.
Interpret the random variable X as the profit that will be earned from a
portfolio of investments. A tenet of financial economics is that in order to
obtain a higher return one must accept a higher risk. In this context, E(X) is
taken as the measure of return, and StDev(X) as the measure of risk. It can
make sense to substitute MAD(X) as the measure of risk. Also, as suggested in
Chapter 1, a portfolio X that minimizes MAD(X) subject to the requirement
that E(X) be at least as large as a given threshold can be found by solving a
linear program.
The arguments in the sumproduct function must be arrays that have the
same number of rows and columns. Let us suppose we have two arrays of
the same size. The sumproduct function multiplies each element in one of
these arrays by the corresponding element in the other and takes the sum.
The same is true for three arrays of the same size. That makes it easy to com-
pute the mean, the variance and the standard deviation, as is illustrated in
Table 2.3
Chapter 2: Eric V. Denardo 43
Note that:
• The function in cell C13 multiplies each entry in the array C5:C8 by
the corresponding entry in the array D5:D8 and takes the sum, thereby
computing μ = E(X).
The arrays in a sumproduct function must have the same number of rows
and the same number of columns. In particular, a sumproduct function will
not multiply each element in a row by the corresponding element in a column
of the same length.
Dragging
• Move the cursor to the lower right-hand corner of cell E5. The fill han-
dle (a small rectangle in the lower right-hand corner of cell E5) will
change to a Greek cross (“+” sign).
• While this Greek cross appears, depress the mouse, slide it down to cell
E8 and then release it. The functions =D6 – C$13 through =D8 – C$13
will appear in cells E6 through E8. Nice!
Dragging downward increments the relative row numbers, but not the
fixed row numbers. Similarly, dragging to the right increases the relative col-
umn numbers, but leaves the fixed column numbers unchanged. Dragging is
an especially handy way to repeat a pattern and to execute a recursion.
• Select the array (block) of cells whose values this array function will
determine.
• Type the name of the array function, but do not hit the Enter key. In-
stead, hit Ctrl+Shift+Enter (In other words, depress the Ctrl and Shift
keys and, while they are depressed, hit the Enter key).
Matrix multiplication
3 2
0 1 2 4 2
A= , B = 2 0 , C= ,
−1 1 −1 1 3
1 1
element is found by multiplying each element in the ith row of A by the cor-
responding element in the jth column of B and taking the sum.
A spreadsheet
• Hit Ctrl+Shift+Enter
Quirks
Excel computes array functions with ease, but it has its quirks. One of
them has been mentioned – you need to remember to end each array func-
tion by hitting Ctrl+Shift+Enter rather than by hitting Enter alone.
The third quirk occurs when you decide to alter an array function or to
eliminate an array. To do so, you must begin by selecting all of the cells in
which its output appears. Should you inadvertently attempt to change a por-
tion of the output, Excel will proclaim, “You cannot change part of an Array.”
If you then move the cursor – or do most anything – Excel will repeat its
proclamation. A loop! To get out of this loop, hit the Esc key.
x = 6 – 0.5y,
y = 2 + 0.5x.
This is easy. Substituting (2â•›+â•›0.5x) for y in the first equation gives xâ•›=â•›4
and hence yâ•›=â•›4.
Let us see what happens when we set this problem up in a naïve way for
solution on a spreadsheet. In Table 2.5, formulas for x and y have been placed
in cells B4 and B5. The formula in each of these cells refers to the value in
Chapter 2: Eric V. Denardo 47
the other. A loop has been created. Excel insists on being able to evaluate the
functions on a spreadsheet in some sequence. When Excel is presented with
Table 2.5, it issues a circular reference warning.
This seems ominous. Excel cannot solve a system of equations. But it can,
with a bit of help.
To see how to get around the circular reference problem, we turn our
attention to an example that is slightly more complicated than Problem 2.B.
This example is
Problem 2.C.╇ Find values of the variables A, B and C that satisfy the equa-
tions
2A + 3B + 4C = 10,
2A – 2B – C = 6,
A + B + C = 1.
48 Linear Programming and Generalizations
You probably recall how to solve Problem 2.C, and you probably recall
that it requires some grunt-work. We will soon see how to do it on a spread-
sheet, without the grunt-work.
An ambiguity
Problem 2.C exhibits an ambiguity. The letters A, B and C are the names
of the variables, and Problem 2.C asks us to find values of the variables A, B
and C that satisfy the three equations. You and I have no trouble with this
ambiguity. Computers do. On a spreadsheet, the name of the variable A will
be placed in one cell, and its value will be placed in another cell.
Table 2.6 presents the data for Problem 2.C. Cells B2, C2 and D2 contain
the labels of the three decision variables, which are A, B and C. Cells B6, C6
and D6 have been set aside to record the values of the variables A, B and C.
The data in the three constraints appear in rows 3, 4 and 5, respectively.
Note that:
• Trial values of the decision variables have been inserted in cells B6, C6
and D6.
• The “=” signs in cells F3, F4 and F5 are memory aides; they remind
us that we want to arrange for the numbers to their left to equal the
numbers to their right, but they have nothing to do with the computa-
tion.
Chapter 2: Eric V. Denardo 49
• The “$” signs in cell E5 suggest – correctly – that this function has been
dragged upward onto cells E4 and E3. For instance, cell E3 contains the
value assigned to the function
=â•›SUMPRODUCT(B3:D3, B$6:D$6)
and the number 9 appears in cell E3 because Excel assigns this function
the value 9 = 2â•›×â•›1â•›+â•›3â•›×â•›1â•›+â•›4â•›×â•›1.
The pattern in Table 2.6 works for any number of linear equations in
any number of variables. This pattern is dubbed the “standard format” for
linear systems, and it will be used throughout this book. A linear system is
expressed in standard format if the columns of its array identify the variables
and the rows identify the equations, like so:
• One row is reserved for the values of the variables (row 6, above).
–╇An “=” sign that serves (only) as a memory aid (as in cell F3).
What is missing?
Our goal is to place numbers in cells B6:D6 for which the values of the
functions in cells E3:E5 equal the numbers in cells G3:G5, respectively. Excel
cannot do that, by itself. We will see how to do it with Solver and then with
Premium Solver for Education.
50 Linear Programming and Generalizations
Let us begin with a bit of the history. Solver was written by Frontline
Systems for inclusion in an early version of Excel. Shortly thereafter, Micro-
soft took over the maintenance of Solver, and Frontline Systems introduced
Premium Solver. Over the intervening years, Frontline Systems has improved
its Premium Solver repeatedly. Recently, Microsoft and Frontline Systems
worked together in the design of Excel 2010 (for PCs) and Excel 2011 (for
Macs). As a consequence:
• If your computer is equipped with Excel 2003 or Excel 2007, Solver is per-
fectly adequate, but Premium Solver has added features and fewer bugs.
• If your computer is equipped with Excel 2010 (for PCs) or with Excel
2011 (for Macs), a great many of the features that Frontline Systems
introduced in Premium Solver have been incorporated in Solver itself,
and many bugs have been eliminated.
• If your computer is equipped with Excel 2008 for Macs, it does not sup-
port Visual Basic. Solver is written in Visual Basic. The =pivot(cell, ar-
ray) function, which is used extensively in this book, is also written in
Visual Basic. You will not be able to use Solver or the “pivot” function
until you upgrade to Excel 2011 (for Macs). Until then, use some other
version of Excel as a stopgap.
Preview
This section begins with a discussion of the version of Solver with which
Excel 2000, 2003 and 2007 are equipped. The discussion is then adapted to
Excel 2010 and 2011. Premium Solver is introduced in the next section.
Finding Solver
When you purchased Excel (with the exception of Excel 2008 for Macs),
you got Solver. But Solver is an “Add-In,” which means that it may not be
ready to use. To see whether Solver is up and running, open a spreadsheet.
Chapter 2: Eric V. Denardo 51
With Excel 2003 or earlier, click on the Tools menu. If Solver appears
there, you are all set; Solver is installed and activated. If Solver does not ap-
pear on the Tools menu, it may have been installed but not activated, and it
may not have been installed. Proceed as follows:
• Click again on the Tools menu, and then click on Add-Ins. If Solver is
listed as an Add-In but is not checked off, check it off. This activates
Solver. The next time you click on the Tools menu, Solver will appear
and will be ready to use.
• If Solver does not appear on the list of Add-Ins, you will need to find
the disc on which Excel came, drag Solver into your Library, and then
activate it.
If your computer is equipped with Excel 2007, Solver is not on the Tools
menu. To access Solver, click on the Data tab and then go to the Analysis box.
You will see a button labeled Solver if it is installed and active. If the Solver
button is missing:
• Click on the Office Button that is located at the top left of the spread-
sheet.
• In the bottom right of the window that appears, select the Excel Op-
tions button.
• Next, click on the Add-Ins button on the left and look for Solver Add-
In in the list that appears.
• If it is in the inactive section of this list, then select Manage: Excel Add-
Ins, then click Go…, and then select the box next to Solver Add-in and
click OK.
• If Solver Add-in is not listed in the Add-Ins available box, click Browse
to locate the add-in. If you get prompted that the Solver Add-in is not
currently installed on your computer, click Yes to install it.
To find Solver with Excel 2010, click on the Data tab. If Solver appears
(probably at the extreme right), you are all set. If Solver does not appear, you
52 Linear Programming and Generalizations
will need to activate it, and you may need to install it. To do so, open an Excel
spreadsheet and then follow this protocol:
• Click on the File menu, which is located near the top left of the spread-
sheet.
• Click on the Options tab (it is near the bottom of the list) that appeared
when you clicked on the File menu.
• A dialog box named Excel Options will pop up. On the side-bar to its
left, click on Add-Ins. Two lists of Add-Ins will appear – “Active Appli-
cation Add-Ins” and “Inactive Application Add-Ins.”
–╇If Solver is on the “Inactive” list, find the window labeled “Manage:
Excel Add-Ins,” click on it, and then click on the “Go” button to its
right. A small menu entitled Add-Ins will appear. Solver will be on
it, but it will not be checked off. Check it off, and then click on OK.
–╇If Solver is not on the “Inactive” list, click on Browse, and use it to
locate Solver. If you get a prompt that the Solver Add-In is not cur-
rently installed on your computer, click “Yes” to install it. After in-
stalling it, you will need to activate it; see above.
To make your Solver dialog box look like that in Figure 2.1, proceed as
follows:
• With Excel 2003, on the Tools menu, click on Solver. With Excel 2007,
go to the Analysis box of the Data tab, and click on Solver.
• Move the cursor to the By Changing Cells window, then select cells
B6:D6, and then click.
–╇Click on the Cell Reference window, then select cells E3:E5 and click.
–╇Click on the Constraint window. Then select cells G3:G5 and click.
This will cause the Add Constraint dialog box to look like:
–╇Click on OK. This will close the Add Constraint dialog box and re-
turn you to the Solver dialog box, which will now look exactly like
Figure 2.1.
• In the Solver dialog box, do not click on the Solve button. Instead, click
on the Options button and, on the Solver Options menu that appears
54 Linear Programming and Generalizations
(see below) click on the Assume Linear Model window. Then click on
the OK button. And then click on Solve.
In a flash, your spreadsheet will look like that in Table 2.7. Solver has
succeeded; the values it has placed in cells B6:D6 that enforce the constraints
E3:E5â•›=â•›G3:G5; evidently, setting Aâ•›=â•›0.2, Bâ•›=â•›–6.4 and Câ•›=â•›7.2 which solves
Problem 2.C.
Presented as Figure 2.2 is a Solver dialog box for Excel 2010. It differs from
the dialog box for earlier versions of Excel in the ways that are listed below:
Chapter 2: Eric V. Denardo 55
• The method of solution is selected on the main dialog box rather than
on the Options page.
Fill this dialog box out as you would for Excel 2007, but remember to
select the option you want in the “nonnegative variables” box.
Frontline Systems has made available for educational use a bundle of soft-
ware called the Risk Solver Platform. This software bundle includes Premium
Solver, which is an enhanced version of Solver. This software bundle also in-
cludes the capability to formulate and run simulations and the capability to
draw and roll back decision trees. Sketched here are the capabilities of Pre-
mium Solver. This sketch is couched in the context of Excel 2010. If you are
using a different version of Excel, your may need to adapt it somewhat.
Note to instructors
If you adopt this book for a course, you can arrange for the participants
in your course (including yourself, of course) to have free access to the edu-
cational version of the Risk Solver Platform. To do so, call Frontline Systems
at 755 831-0300 (country code 01) and press 0 or email them at academics@
solver.com.
Note to students
If you are enrolled in a course that uses this book, you can download
the Risk Solver Platform by clicking on the website http://solver.com/student/
and following instructions. You will need to specify the “Textbook Code,”
which is DLPEPAE, and the “Course code,” which your instructor can pro-
vide.
cussed in this subsection. Using it as part of the Risk Solver Platform is dis-
cussed a bit later.
• In the window to the left of the Options button, click on Standard LP/
Quadratic.
• If the button that makes the variables nonnegative is checked off, click
on it to remove the check mark. Then click on Solve.
In a flash, your spreadsheet will look like that in Table 2.7. It will report
values of 0.2, –6.4 and 7.2 in cells B7, C7, and D7.
But when Premium Solver is operated from the Risk Solver Platform, it is
modeless, which means that you can move back and forth between Premium
Solver and your spreadsheet without closing anything down. The modeless
version can be very advantageous.
To see how to use Premium Solver from the Risk Solver Platform, begin
by reproducing Table 2.6 on a spreadsheet. Then click on the File button. A
Risk Solver Platform button will appear at the far right. Click on it. A menu
will appear. Just below the File button will be a button labeled Model. If that
button is not colored, click on it. A dialog box will appear at the right; in it,
click on the icon labeled Optimization. A dialog box identical to Figure 2.4
will appear, except that neither the variables nor the constraints will be identi-
fied.
Chapter 2: Eric V. Denardo 59
Making this dialog box look exactly like Figure 2.4 is not difficult. The
green Plus sign (Greek cross) just below the word “Model” is used to add
information. The red “X” to its right is used to delete information. Proceed
as follows:
• Select cells B6:D6, then click on Normal Variables, and then click on
Plus.
• Click on Normal Constraints and then click on Plus. Use the dialog box
that appears to impose the constraints E3:E5 = G3:G5.
It remains to specify the solution method you will use and to execute the
computation. To accomplish this:
• Click on Engine, which is to the right of the Model button, and select
Standard LP/Quadratic Engine.
• Click on Output, which is to the right of the Engine button. Then click
on the green triangle that points to the right.
60 Linear Programming and Generalizations
In an instant, your spreadsheet will look exactly like Table 2.7. It will ex-
hibit the solution Aâ•›=â•›0.2, Bâ•›=â•›–6.4 and Câ•›=â•›7.2.
Premium Solver and the versions of Solver that are in Excel 2010 and Ex-
cel 2011 include all three packages. Earlier editions of Excel include the first
two of these packages. A subsection is devoted to each.
The LP software
When solving linear programs and integer programs, use the LP soft-
ware. It is quickest, and it is guaranteed to work. If you use it with earlier
versions of Solver, remember to shift to the Options sheet and check off As-
sume Linear Model. To use it with Premium Solver as an Add-In, check off
Standard LP/Quadratic in a window on the main dialog box. The advantages
of this package are listed below:
• Its software checks that the system you claim to be linear actually is
linear – and this is a debugging aid. (Excel 2010 is equipped with a ver-
sion of Solver that can tell you what, if anything, violates the linearity
assumptions.)
Chapter 2: Eric V. Denardo 61
• When you use the LP software, you can place any values you want in
the changing cells before you click on the Solve button. The values you
have placed in these cells will be ignored.
• On the other hand, when you use the GRG software, the values you
place in the changing cells are important. The software starts with the
values you place in the changing cells and attempts to improve on them.
The closer you start, the more likely the GRG software is to obtain a solu-
tion. It is emphasized:
When using the GRG software, try to “start close” by putting reasonable
numbers in the changing cells.
Premium Solver’s GRG code includes (on its options menu) a “multi-
start” feature that is designed to find solutions to problems that are not con-
vex. If you are having trouble with the GRG code, give it a try.
A quirk
The GRG Solver may attempt to evaluate a function outside the range for
which it is defined. It can attempt to evaluate the function =LN(cell) with a
negative number in that cell, for instance. Excel’s =ISERROR(cell) function
can help you to work around this. To see how, please refer to the discussion
on page 643 of Chapter 20.
62 Linear Programming and Generalizations
Numerical differentiation
It is also the case that the GRG Solver differentiates numerically; it ap-
proximates the derivative of a function by evaluating that function at a variety
of points. It is safe to use any function that is differentiable and whose deriva-
tive is continuous. Here are two examples of functions that should be avoided:
If you use a function that is not differentiable, you may get lucky. And you
may not. It is emphasized:
Needless to say, perhaps, it is a very good idea to avoid functions that are
not continuous when you use the GRG Solver.
This software package is markedly slower, but it does solve problems that
elude the simplex method and the generalized reduced gradient method. Use
it when the GRG solver does not work.
The Risk Solver Platform includes other optimization packages. The Gu-
robi package solves linear, quadratic, and mixed-integer programs very ef-
fectively. Its name is an amalgam of the last names of the founders of Gurobi
Optimization, who are Robert Bixby, Zonghao Gu, and Edward Rothberg.
The SOCP engine quickly solves a generalization of linear programs whose
constraints are cones.
random variable having μ as its mean and σ as its standard deviation exceeds
the number q. That function sees action in Chapter 7.
Begin by clicking on the Springer website for this book, which is speci-
fied on page 39. On that website, click on the icon labeled OP_TOOLS, copy
it, and paste it into a convenient folder on your computer, such as My Docu-
ments. Alternatively, drag it onto your Desktop.
What remains is to insert this Add-In in your Library and to activate it.
How to do so depends on which version of Excel you are using.
With Excel 2003, the Start button provides a convenient way to find and
open your Library folder (or any other). To accomplish this:
• Click on the Start button. A menu will pop up. On that menu, click on
Search. Then click on For Files and Folders. A window will appear. In
it, type Library. Then click on Search Now.
• After a few seconds, the large window to the right will display an icon
for a folder named Library. Click on that icon. A path to the folder that
contains your Library will appear toward the top of the screen. Click on
that path.
• You will have opened the folder that contains your library. An icon for
your Library is in that folder. Click on the icon for your Library. This
opens your Library.
With your library folder opened, drag OP_TOOLS into it. Finally, acti-
vate OP_TOOLS, as described earlier.
With Excel 2007 and Excel 2010, clicking on the Start button is not the
best way to locate your Library. Instead, open Excel. If you are using Excel
64 Linear Programming and Generalizations
2007, click on the Microsoft Office button. If you are using Excel 2010, click
on File.
Next, with Excel 2007 or 2010, click on Options. Then click on the Add-
Ins tab. In the Manage drop-down, choose Add-Ins and then click Go. Use
Browse to locate OP_TOOLS and then click on OK. Verify that OP_TOOLS
is on the Active Add-Ins list, and then click on OK at the bottom of the
window.
The fact that Excel gives instant feedback can help you to “debug as you
go.”
Chapter 2: Eric V. Denardo 65
13. Review
All of the information in this chapter will be needed, sooner or later. You
need not master all of it now. You can refer back to this chapter as needed.
Before tackling Chapters 3 and 4, you should be facile with the use of spread-
sheets to solve systems of linear equations via the “standard format.” You
should also prepare to use the software on the Springer website for this book.
A final word about Excel: When you change any cell on a spreadsheet, Ex-
cel automatically re-computes the value of each function on that sheet. This
happens fast – so fast that you may not notice that it has occurred.
3. (↜the famous birthday problem) Suppose that each child born in 2007 (not
a leap year) was equally likely to be born on any day, independent of the
others. A group of n such children has been assembled. None of these
children are related to each other. Denote as Q(n) the probability that at
least two of these children share a birthday. Find the smallest value of n for
which Q(n)â•›>â•›0.5. Hints: Perhaps the probability P(n) that these n children
were born on n different days be found (on a spreadsheet) from the recur-
sion P(n)â•›=â•›P(n – 1) (365 – n)/365. If so, a “drag” will show how quickly
P(n) decreases as n increases.
4. For the matrices A and B in Table 2.4, compute the matrix product BA.
What happens when you ask Excel to compute (BA)–1? Can you guess
why?
66 Linear Programming and Generalizations
3A + 2B + 1C + 5 ln(A) = 6
2A + 3B + 2C + 4 ln(B) = 5
1A + 2B + 3C + 3 ln(C) = 4
6. Recreate Table 2.4. Replace the “0” in matrix A with a blank. What hap-
pens?
7. The spreadsheet that appears below computes 1 + 2n and 2n for various
values of n, takes the difference, and gets 1 for nâ•›≤â•›49 and gets 0 for nâ•›≥â•›50.
Why? Hint: Modern versions of Excel work with 64 bit words.
Chapter 3: Mathematical Preliminaries
1.╅ Preview����������������������������������尓������������������������������������尓������������������������ 67
2.╅ Gaussian Operations����������������������������������尓������������������������������������尓�� 68
3.╅ A Pivot����������������������������������尓������������������������������������尓�������������������������� 69
4.╅ A Basic Variable����������������������������������尓������������������������������������尓���������� 71
5.╅ Trite and Inconsistent Equations����������������������������������尓�������������������� 72
6.╅ A Basic System����������������������������������尓������������������������������������尓������������ 74
7.╅ Identical Columns����������������������������������尓������������������������������������尓������� 76
8.╅ A Basis and its Basic Solution����������������������������������尓������������������������ 78
9.╅ Pivoting on a Spreadsheet ����������������������������������尓������������������������������ 78
10.╇ Exchange Operations����������������������������������尓������������������������������������尓�� 81
11.╇ Vectors and Convex Sets����������������������������������尓���������������������������������� 82
12.╇ Vector Spaces����������������������������������尓������������������������������������尓���������������� 87
13.╇ Matrix Notation����������������������������������尓������������������������������������尓���������� 89
14.╇ The Row and Column Spaces ����������������������������������尓������������������������ 93
15.╇ Efficient Computation* ����������������������������������尓���������������������������������� 98
16.╇ Review����������������������������������尓������������������������������������尓������������������������ 103
17.╇ Homework and Discussion Problems����������������������������������尓���������� 104
1. Preview
One section of this chapter is starred. That section touches lightly on ef-
ficient numerical computation, an advanced topic on which this book does
not dwell.
3. A Pivot
• Then, for each k other than j, replace equation (k) by itself minus equa-
tion (j) times the coefficient of x in equation (k).
70 Linear Programming and Generalizations
This definition may seem awkward, but applying it to system (1) will
make everything clear. This will be done twice – first by hand, then on a
spreadsheet.
This pivot transforms system (1) into system (2), below. This pivot con-
sists of Gaussian operations, so it preserves the set of solutions to system (1).
In other words, each set of values of the variables x1, x2, x3, and x4 that satis-
fies system (1) also satisfies system (2), and conversely.
This pivot has eliminated the variable x1 from equations (2.2), (2.3) and
(2.4) because its coefficients in these equations equal zero.
Chapter 3: Eric V. Denardo 71
The next pivot will occur on a nonzero coefficient in equation (2.2). The
variables x3 and x4 have nonzero coefficients in this equation. We could pivot
on either. Let’s pivot on the coefficient of x3 in equation (2.2). This pivot con-
sists of the following sequence of Gaussian operations:
These Gaussian operations transform system (2) into system (3), below.
They create no solutions and destroy none.
This pivot made x3 basic for equation (3.2). It kept x1 basic for equation
(3.1). That is no accident. Why? The coefficient of x1 in equation (2.2) had
been set equal to zero, so replacing another equation by itself less some con-
72 Linear Programming and Generalizations
stant times equation (2.2) cannot change its coefficient of x1 . The property
that this illustrates holds in general. It is emphasized:
•╇The variable x becomes basic for the equation that has the coef-
ficient on which the pivot occurred.
•╇Any variable that had been basic for another equation remains ba-
sic for that equation.
For the remainder of this section, it is assumed that pâ•›=â•›−4/3. In this case,
equations (3.1) and (3.2) have basic variables, and equation (3.3) is trite.
Gauss-Jordan elimination continues to pivot, aiming for a basic variable for
each non-trite equation. Equation (3.4) lacks a basic variable. The variables x2
Chapter 3: Eric V. Denardo 73
In system (4), each non-trite equation has been given a basic variable. A
solution to system (4) is evident. Equate each basic variable to the right-hand-
side value of the equation for which it is basic, and equate any other variables
to zero. That is, set:
x1 = 1, x3 = –2/3, x2 = 1/3, x4 = 0.
These values of the variables satisfy system (4), hence must satisfy sys-
tem (1).
(5.1) x1 = 1 – (5/3)x4,
satisfies system (4) and, consequently, satisfies system (1). By the way, the
question posed earlier can now be answered: If p ≠â•›−â•›4/3. system (1) has no
solution, and if pâ•›=â•›−4/3, system (1) has infinitely many solutions, one for
each value of x4 .
The dictionary
System (5) has been written in a format that is dubbed the dictionary
because:
• Each equation has a basic variable, and that basic variable is the sole
item on the left-hand side of the equation for which it is basic.
• The nonbasic variables appear only on the right-hand sides of the equa-
tions.
Basic solution
x1 = 1, x3 = −2/3, x2 = 1/3, x4 = 0.
Chapter 3: Eric V. Denardo 75
Each equation has n + 1 data elements, including its right-hand side val-
ue. The first Gaussian operation in a pivot divides an equation by the coef-
ficient of one of its variables. This requires n divisions (not n + 1) because it
is not necessary to divide a number by itself. Each of the remaining Gaussian
operations in a pivot replaces an equation by itself less a particular constant d
times another equation. This requires n multiplications (not n+1) because it
is not necessary to compute dâ•›−â•›dâ•›=â•›0. We’ve seen that each Gaussian operation
in a pivot requires n multiplications or divisions. Evidently:
• Each pivot entails m Gaussian operations, one per equation, for a total
of m n multiplications and divisions per pivot.
In brief:
A minor complication has been glossed over: a basic system can have
more than one basic solution. To indicate how this can occur, consider system
(6), below. It differs from system (1) in that p equals −4/3 and in that it has a
fifth decision variable, x5 , whose coefficient in each equation equals that of
x2 .
The variables x2 and x5 are basic for equation (7.4). When x2 became
basic, x5 also became basic. Do you see why?
System (7) has two basic solutions. One basic solution corresponds to
selecting x2 as the basic variable for equation (7.4), and it sets
If an equation has more than one basic variable, two or more variables
in the original system had identical columns of coefficients, and all of
them became basic for that equation.
The fact that identical columns stay identical is handy – in later chapters,
it will help us to understand the simplex method.
Consider any basic system. A set of variables is called a basis if this set
consists of one basic variable for each equation that has a basic variable. Sys-
tem (4) has one basis, which is the set {x1 , x3 , x2 } of variables. System (7) has
two bases. One of these bases is the set {x1 , x3 , x2 } of variables. The other
basis is {x1 , x3 , x5 }.
Again, consider any basic system. Each basis for it has a unique basic
solution, namely, the solution to the equation system in which each nonbasic
variable is equated to zero and each basic variable is equated to the right-
hand-side value of the equation for which it is basic. System (7) is basic. It has
two bases and two basic solutions; equation (8) gives the basic solution for the
basis {x1 , x3 , x2 }, and (9) gives the basic solution for the basis {x1 , x3 , x5 }.
The terms “basic variable,” “basis,” and “basic solution” suggest that a ba-
sis for a vector space lurks nearby. That vector space is identified later in this
chapter.
Pivoting by hand gets old fast. Excel can do the job flawlessly and pain-
lessly. This section tells how.
A detached-coefficient tableau
The spreadsheet in Table 3.1 will be used to solve system (1) for the case
in which pâ•›=â•›−4/3. Rows 1 through 5 of Table 3.1 are a detached-coefficient
tableau for system (1). Note that:
Chapter 3: Eric V. Denardo 79
Table 3.1.↜ Detached coefficient tableau for system (1) and the first pivot.
Excel functions could be used to create rows 7-10. For instance, row 7
could be obtained by inserting in cell B7 the function =B2/$B2 and dragging
it across the row. Similarly, row 8 could be obtained by inserting in cell B8
the function =B3â•›−â•›$B3 * B$7 and dragging it across the row. But there is an
easier way.
80 Linear Programming and Generalizations
An Add-In
• Select the array B7:F10 (This causes the result of the pivot to appear in
cells B7 through F10.)
Table 3.2 reports the result of executing two more pivots with the same
array function.
• Select the block B12:F15 of cells, type =pivot(D8, B7:F10) and then hit
Ctrl+Shift+Enter
• Select the block B17:F20 of cells, type =pivot(C15, B12:F15) and then
hit Ctrl+Shift+Enter
Rows 17-20 report the result of these pivots. The data in rows 17-20 are
identical to those in system (4) with pâ•›=â•›−4/3. In particular:
Like the others, these exchange operations can be undone. To recover the
original equation system after doing an exchange operation, simply repeat it.
Exchanging rows 19 and 20 shifts the trite equation to the bottom. Then, ex-
changing columns C and D puts the basic variables on the diagonal.
In linear algebra, the two Gaussian operations that were introduced ear-
lier and the first of the above two exchange operations are known as elemen-
tary row operations. Most texts on linear algebra begin with a discussion
of elementary row operations and their properties. That’s because Gaussian
operations are fundamental to linear algebra.
Vectors
Similarly, the symbol n denotes the set of all n-vectors, namely, the set
that consists of each vector x = (x1 , x2 , . . . , xn ) as x1 through xn vary, in-
dependently, over the set of all real numbers. This set n of all n-vectors is
known as n-dimensional space or, more succinctly, as n-space. The n-vector
xâ•›=â•›(0, 0, …, 0) is called the origin of n .
Figure 3.1.↜ The vectors xâ•›=â•›(5, 1) and yâ•›=â•›(−2, 3) and their sum.
x + y = (3, 4)
y = (–2, 3)
3 x = (5, 1)
–2 0 3 5
Vector addition
(10) x + y = (x1 + y1 , x2 + y2 , . . . , xn + yn ).
The gray lines in Figure 3.1 indicate that, graphically, to take the sum of
the vectors (5, 1) and (−2, 3), we can shift the “tail” of either vector to the head
of the other, while preserving the “length” and “direction” of the vector that is
being shifted.
Scalar multiplication
What happens when the vector x in Figure 3.1 is multiplied by the scalar
câ•›=â•›0.75? Each entry in x is multiplied by 0.75. This reduces the length of the
vector x without changing the direction in which it points.
What happens when the vector x is multiplied by the scalar câ•›=â•›−1? Each
entry in x is multiplied by −1. This reverses the direction in which x points,
but does not change its length.
x – y = x + (–1)y = (x1 x– =
y1,(xx12 ,–xy22,, . . . , xxnn )– yn).
Figure 3.2.↜ The vectors xâ•›=â•›(5, 1) and yâ•›=â•›(−2, 3) and their difference.
y = (–2, 3)
3 x = (5, 1)
–2 0 3 5 7
–2 x – y = (7, –2)
cx + (1 − c)y
Figure 3.3.↜ The thick gray line segment is the interval between x╛=╛(5, 1)
and yâ•›=â•›(−2, 3).
c=0
c = 1/4
c = 1/2
3 c = 3/4
c=1
y = (–2, 3) 1
x = (5, 1)
–2 0 5 7
–2 x – y = (7, –2)
Each convex combination of the vectors x and y that are depicted in Fig-
ure 3.3 can be written as
where c is a number that lies between 0 and 1, inclusive. Evidently, the interval
between x and y consists of each vector y + c(xâ•›−â•›y) obtained by adding y and
the vector c(xâ•›−â•›y) as c varies from 0 to 1. Figure 3.3 depicts y + c(xâ•›−â•›y) for the
values câ•›=â•›0, 1/4, 1/2, 3/4 and 1.
86 Linear Programming and Generalizations
By the way, if x and y are distinct n-vectors, the line that includes x and y
is the set L that is given by
This line includes x (take câ•›=â•›1) and y (take câ•›=â•›0), it contains the interval
between x and y, and it extends without limit in both directions.
Convex sets
Convex sets will play a key role in linear programs and in their general-
izations. A vector x that is a member of a convex set C is said to be an extreme
point of C if x is not a convex combination of two other vectors in C. Read-
ing from left to right, the four convex sets in Figure 3.4 have infinitely many
extreme points, three extreme points, no extreme points, and two extreme
points. Do you see why?
Linear constraints
Let us recall from Chapter 1 that each constraint in a linear program re-
quires a linear expression to bear one of three relationships to a number, these
three being “=”, “≤”, and “≥.” In other words, with a0 through an as fixed
numbers and x1 through xn as decision variables, each constraint takes one
of these forms:
a1 x1 + a1 x2 + · · · + an xn = a0
a1 x1 + a1 x2 + · · · + an xn ≤ a0
a1 x1 + a1 x2 + · · · + an xn ≥ a0
It’s easy to check that the set of n-vectors xâ•›=â•›(x1, x2, …, xn) that satisfy a
particular linear constraint is convex. As noted above, the intersection of con-
vex sets is convex. Hence, the set of vectors xâ•›=â•› (x1 , x2 , · · · , xn ) that satisfy
all of the constraints of a linear program is convex. It is emphasized:
The set of vectors that satisfy all of the constraints of a linear program
is convex.
Convex sets play a crucial role in linear programs and in nonlinear pro-
grams.
• V is not empty.
Each vector space V must contain the origin; that is so because V must
contain at least one vector x and because it must also contain the scalar 0
times x, which is the origin. Each vector space is a convex set. Not every con-
vex set is a vector space, however.
Geometric insight
It’s clear, visually, that the subsets V of 2 (the plane) that are vector
spaces come in these three varieties:
Linear combinations
(15) c1 v1 + c2 v2 + · · · + cK vK ,
(16) 0 = c1 v1 + c2 v2 + · · · + cK vK
bination of these vectors is to multiply each of them by the scalar 0 and then
add them up.
A basis
Trouble?
A basis has just been defined as a set of vectors. Earlier, in our discussion
of Gauss-Jordan elimination, a basis had been defined as a set of decision
variables. That looks to be incongruous, but a correspondence will soon be
established.
In the prior section, the entries in the n-vector xâ•›=â•›(x1, x2, …, xn) could
have been arranged in a row or in a column. When doing matrix arithmetic,
it is necessary to distinguish between rows and columns.
90 Linear Programming and Generalizations
Matrices
A1j
A2j
Aj = , Ai = [Ai1 Ai2 · · · Ain ]
..
.
Amj
Matrix multiplication
Thus, the ijth element of the matrix (EF) equals the product Ei Fj of the ith
row of E and the jth column of F.
Similarly, the ith row (EF)i of EF and jth column (EF)j of EF are given by
(19) (EF)i = Ei F,
It is emphasized:
The ith row of the matrix product (EF) equals EiF and the jth column of
this matrix product equals EFj
Vectors
In this context, a vector is a matrix that has only one row or only one
column. Whenever possible, lower-case letters are used to represent vectors.
Displayed below are an n × 1 vector x and an m × 1 vector b.
x1 b1
x2 b2
x = . , b= .
.. ..
xn bm
• The data in the equation Axâ•›=â•›b are the m × n matrix A and the m × 1
vector b.
• The decision variables (unknowns) in this equation are arrayed into the
n × 1 vector x.
In brief, the integer m is the number of rows in the matrix A, and the
integer n is the number of columns. Put another way, the matrix equation
Axâ•›=â•›b is a system of m equations in n unknowns.
92 Linear Programming and Generalizations
Note in expression (21) that the number (scalar) x1 multiplies each entry
in A1 (the 1st column of A), that the scalar x2 multiplies each entry in A2 , and
so forth. In other words,
(22) Ax = A1 x1 + A2 x2 + · · · + An xn .
You may recall that the “column space” of a matrix A is the set of all linear
combinations of the columns of A; we will get to that shortly.
(23) yâ•›Ax==
(yâ•›A
(x1,1 , yâ•›xA2 ,2 . . . , yâ•›
xAn )n).
(24) yA = y1 A1 + y2 A2 + · · · + ym Am
Chapter 3: Eric V. Denardo 93
In brief:
An ambiguity
is called the column space of the matrix A. Equation (25) reads, “ Vc equals
the set that contains Ax for every n × 1 vector x.” It is clear from equation
(22) that Vc is the set of all linear combinations of the columns of the matrix
A, moreover, that Vc is a vector space.
(26) Vr = {yA : y ∈ 1 × m },
is called the row space of A. Evidently, Vr is the set of all linear combinations
of the rows of the matrix A, and it too is a vector space.
construct a basis for the column space of the 4 × 4 matrix A that is given
by
2 4 −1 8
1 2 1 1
(27) A= .
0 0 2 −4
−1 1 −1 1
Let us see how. With A given by (27) and with x as a 4 × 1 vector, equa-
tion (22) shows the matrix product A x is this linear combination of the col-
umns of A.
2 4 −1 8
1 2 1 1
(28) Ax =
0 x1 + 0 x2 + 2 x3 + −4 x4 .
−1 1 −1 1
Please observe that (28) is identical to the left-hand side of system (1).
A homogeneous equation
2 4 −1 8 0
1 2 1 1 0
(29) x1 + x2 + x3 + x4 = ,
0 0 2 −4 0
−1 1 −1 1 0
No new work is needed to identify the solutions to (29). To see why, re-
place the right-hand side values of system (1) by 0’s and repeat the Gaussian
operations that transformed system (1) into system (4), getting:
1 0 0 5/3 0
0 0 1 −2 0
(30) x1 + x2 + x3 + x4 = .
0 0 0 0 0
0 1 0 2/3 0
Chapter 3: Eric V. Denardo 95
2 4 −1 8
1 2 1 1
x1 + x 2 + x3 =
0 0 2 −4
−1 1 −1 1
transforms it into
1 0 0 5/3
0 0 1 −2
x1 + x2 + x3 = ,
0 0 0 0
0 1 0 2/3
{Aj : j ∈ C} the set of columns on which pivots have occurred. This set
{Aj : j ∈ C} of columns is a basis for the column space of A.
The analog of (30) indicates that the set {Aj : j ∈ C} of columns must
be linearly independent and that each of the remaining columns must be a
linear combination of these columns. Thus, the set {Aj : j ∈ C} of columns
span the column space of A, which completes a proof.
Reconciliation
In the current section, the same Gauss-Jordan procedure has been used to
identify the set {A1 , A2 , A3 } of columns as a basis for the column space of A.
These are two different ways of making the same statement. It is emphasized:
The statement that a set of variables is a basis for the equation system
Ax = b means that their columns of coefficients are a basis for the col-
umn space of A and that b lies in the column space of A.
When the variables in the equation system Axâ•›=â•›b are labeled x1 through
xn , a basis can also be described as a subset β of the first n integers. A subset β
of the first n integers is now said to be a basis if {Aj : j ∈ β} is a basis for the
column space of A . In brief, the same basis for the column space of the 4 × 4
matrix A in equation (27) is identified in these three ways:
• As the set {A1 , A2 , A3 } of columns of A.
A basis for the row space of a matrix A could be found by applying Gauss-
Jordan elimination to the equation AT x = 0, where AT denotes the trans-
pose of A. A second application of Gauss-Jordan elimination is not necessary,
however.
Three key results about vector spaces are stated and illustrated in this
subsection. These three results are highlighted below:
Three results:
•╇Every basis for a vector space contains the same number of ele-
ments, and that number is called the rank of the vector space.
•╇The row space and the column spaces of a matrix A have the same
rank.
All three of these results are important. Their proofs are postponed, how-
ever, to Chapter 10, which sets the stage for a deeper understanding of linear
programming.
• The set {A1 , A2 , A3 } of columns is a basis for the column space of the
matrix A in (27).
The rank of a vector space is also called its dimension; these terms are
synonyms. “Dimension” jives better with our intuition. In 3-space, every
plane through the origin has 2 as its dimension (or rank), for instance.
Pivots make the simplex method easy to understand, but they are rela-
tively inefficient. Gaussian elimination substitutes “lower pivots” for pivots. It
solves an equation system with roughly half the work. Or less.
Lower pivots
• For each equation (k) that remains in S, replace equation (k) by itself
less the multiple of equation (j) that equates the coefficient of x in equa-
tion (k) to zero.
A familiar example
Initially, before any lower pivots have occurred, the set S consists of equa-
tions (31.1) through (31.4).
The variable x1 does not appear in equations (32.2), (32.3) and (32.4).
These three equations are identical to equations (2.2), (2.3) and (2.4), as
must be.
Equation (31.1) has been set aside, temporarily. After equations (32.2)
through (32.4) have been solved for values of the variables x2 , x3 and x4 ,
equation (31.1) will be solved for the value of x1 that is prescribed by these
values of x2 , x3 and x4 .
This lower pivot replaces (32.3) and (32.4) by equations (33.3) and (33.4).
The variable x3 has been eliminated from equations (33.3) and (33.4).
These two equations are identical to equations (3.3) and (3.4), exactly as in
the case for the first lower pivot.
Equation (32.2), on which this pivot occurred, is set aside. After solving
equations (33.3) and (33.4) for values of the variables x2 and x4 , equation
(32.2) will be solved for the variable x3 on which the lower pivot has occurred.
The next lower pivot is slated to occur on equation (33.3). Again, there
are two cases to consider. If p is unequal to −4/3, equation (33.3) is inconsis-
tent, so no solution can exist to the original equation system. Alternatively, if
pâ•›=â•›−4/3, equation (33.3) is trite, and it has nothing to pivot upon.
Chapter 3: Eric V. Denardo 101
Only equation (34.4) remains in S. The next step calls for a lower pivot on
equation (34.4). The variables x2 and x4 have nonzero coefficients in equa-
tion (34.4), so a lower pivot could occur on either of them. As before, we pivot
on the coefficient of x2 in this equation. But no equations remain in S after
equation (34.4) is removed. Hence, this lower pivot entails no arithmetic. As
concerns lower pivots, we are finished.
Back-substitution
1.5x3 = −1
3x2 =1
The first lower pivot eliminated x1 from the bottom two equations. The
second lower pivot eliminated x3 from the bottom equation. Thus, these
equations can be solved for the variables on which their lower pivots have
occurred by working from the bottom up. This process is aptly called back-
substitution. For our example, back-substitution first solves the bottom
equation for x2 , then solves the middle equation for x3 , and then solves the
top equation for x1 . This computation gives x2 = 1/3 and x3 = −2/3 and
x1 = 1, exactly as before.
102 Linear Programming and Generalizations
An adroit sequence of pivots can reduce the rate at which fill-in occurs.
A simple method for retarding fill-in counts the number of nonzero elements
that might be created by each pivot and select a pivot element that minimizes
this number. This method works with full pivots, and it works a bit better
with lower pivots, for which it is now described. Specifically:
• Keep track of the set R of rows on which lower pivots have not yet oc-
curred and the set C of columns of for which variables have not yet
been made basic.
While R is nonempty:
Among the pairs (j, k) with j ∈ R and k ∈ C for which the coefficient
of xk in row j of the current tableau is nonzero, pick a pair that mini-
mizes (rj − 1)(ck − 1).
To see what can go awry, consider a matrix (array) whose nonzero entries
are between 1 and 100, except for a few that are approximately 10−6 . Pivoting
on one of these tiny entries multiplies everything in its row by 106 and shifts
the information in some of the other rows about 6 digits to the right. Doing
that once may be OK. Doing two or three times can bury the information in
the other rows. And that’s without worrying about the round-off error in the
pivot element. In brief:
16. Review
1A − 1B + 2C = 10
−2A + 4B − 2C = 0
0.5A − 1B − 1C = 6
Chapter 3: Eric V. Denardo 105
2A + 3B − 1C = 12
−2A + 2B − 9C = 3
4A + 5B = 21
(a) Use Gauss-Jordan elimination to find a solution to this equation sys-
tem.
(b) Plot those solutions to this equation system in which each variable
is nonnegative. Complete this sentence: The solutions that have been
plotted form a ________________.
(c) What would have happened if one of the right-hand-side values had
been different from what it is? Why?
(b) Can you continue in a way that produces a basic solution? If so, do so.
6. The matrix A given by (27) consists of the coefficients of the decision vari-
ables in system (1). For this matrix A:
106 Linear Programming and Generalizations
(c) Which subsets of {A1 , A2 , A3 , A4 } are a basis for the row space of A?
Why?
8. (a basis) This problem concerns the four vectors that are listed below.
Solve parts (a), (b) and (c) without doing any numerical computation.
2 4 −1 8
1 2 1 1
, , , .
0 0 2 −4
−1 1 −1 1
(a) Show that the left-most three of these vectors are linearly indepen-
dent.
(b) Show that the left-most three of these vectors span the other one.
(c) Show that the left-most three of these vectors are a basis for the vector
space that consists of all linear combinations of these four vectors.
(c) If a pivot makes x5 basic for some equation, then x12 ____________.
Chapter 3: Eric V. Denardo 107
(b) Every (homogeneous) system Axâ•›=â•›0 has at least one non-trivial solu-
tion, that is, one solution that has x ≠ 0
(b) Prove or disprove: There exists a nonzero vector x such that Axâ•›=â•›0.
12. True or false? Each subset V of n that is a vector space has a basis. Hint:
take care.
13. This problem concerns the matrix equation Axâ•›=â•›b. Describe the condi-
tions on A and b under which this equation has:
(a) No solutions.
15. Prove that a set V of n-vectors that includes the origin is a vector space if
and only if V contains the vector [(1 − α)u + αv] for every pair u and v
of elements of V and for every real number α.
(b) For the case nâ•›=â•›2, describe three types of affine space, and guess the
“dimension” of each.
17. Designate as X the set consisting of each vector x that satisfies the matrix
equation Axâ•›=â•›b. Suppose X is not empty. Is X a vector space? Is X an affine
space? Support your answers.
18. Verify that equations (19) and (20) are correct. Hint: Equation (18) might
help.
19. (↜Small pivot elements) You are to solve following system twice, each time
by Gauss-Jordan elimination. Throughout each computation, you are to
approximate each coefficient by three significant digits; this would round
the number 0.01236 to 0.0124, for instance.
0.001A + 1B = 10
1A − 1B = 0
(a) For the first execution, begin with a pivot on the coefficient of A in
the topmost equation.
(b) For the second execution, begin with a pivot on the coefficient of B in
the topmost equation.
Remark: The final two problems (below) refer to the starred section on
efficient computation.
20. (Work for lower pivots and back-substitution) Imagine that a system of m
equations in n unknowns is solved by lower pivots and back-substitution
and that no trite or inconsistent equations have been encountered.
(b) For each j < m, show that the j-th lower pivot requires (m + 1â•›−â•›j) (n)
multiplications and divisions.
Chapter 3: Eric V. Denardo 109
(c) How many multiplications and divisions are needed to execute Gauss-
Jordan elimination with lower pivots and back-substitution? Hint: sum-
ming part (b) gives (2 + 3 + · · · + m)(n) = (n)(m)(m + 1)/2 − n.
Equation x1 x2 x3 x4 x5 RHS
(1) * * * * * *
(2) * * *
(3) * * *
(4) * * * *
(5) * * *
Part II–The Basics
This section introduces you to the simplex method and prepares you to
make intelligent use of the computer codes that implement it.
In this chapter, you will learn how to formulate linear programs for solu-
tion by Solver and by Premium Solver for Education. You will also learn how
to interpret the output that these software packages provide. A linear pro-
gram is seen to be the ideal environment in which to relate three important
economic concepts – shadow price, “relative” opportunity cost, and marginal
benefit. This chapter includes a “Perturbation Theorem” that can help you
to grapple with the fact that a linear program is a model, an approximation.
This chapter plays a “mop up” role. If care is not taken, the simplex meth-
od can pivot forever. In Chapter 6, you will see how to keep that from oc-
curring. The simplex method, as presented in Chapter 4, is initiated with a
feasible solution. In Chapter 6, you will see how to adapt the simplex method
to determine whether a linear program has a feasible solution and, if so, to
find one.
Chapter 4: The Simplex Method, Part 1
1. Preview
The simplex method is the principal tool for computing solutions to lin-
ear programs. Computer codes that execute the simplex method are widely
available, and they run on nearly every computer. You can solve linear pro-
grams without knowing how the simplex method works. Why should you
learn it? Three reasons are listed below:
• Understanding the simplex method helps you make good use of the
output that computer codes provide.
• The “feasible pivot” that lies at the heart of the simplex method is cen-
tral to constrained optimization, much as Gauss-Jordan elimination is
fundamental to linear algebra. In later chapters, feasible pivots will be
adapted to solve optimization problems that are far from linear.
The simplex method also has a surprise to offer. It actually solves a pair
of optimization problems, the one under attack and its “dual.” That fact may
seem esoteric, but it will be used in Chapter 14 to formulate competitive situ-
ations for solution by linear programming and its generalizations.
x ≤ 6,
x + y ≤ 7,
â•… ╛╛2y ≤ 9,
– x + 3y ≤ 9,
x ≥ 0,
y ≥ 0.
Feasible solutions
7
2y ≤ 9
6 –x + 3y ≤ 9
4
x+y≤7
3
2
feasible region x≤6
x≥0 1
0 x
y≥0
0 1 2 3 4 5 6 7
In Problem A and in general, the feasible region is the set of values of the
decision variables that satisfy all of the constraints of the linear program. In
Figure 4.1, the feasible region is shaded. Let us recall from Chapter 3 that the
feasible region of a linear program is a convex set because it contains the in-
terval (line segment) between each pair of points in it. A constraint in a linear
program is said to be redundant if its removal does not change the feasible
region. Figure 4.1 makes it clear that the constraint 2y ≤ 9 is redundant.
Iso-profit lines
Figure 4.1 omits any information about the objective function. Each fea-
sible solution assigns a value to the objective in the natural way; for instance,
feasible solution (5, 1) has objective value 2xâ•›+â•›3yâ•›=â•›(2)(5)â•›+â•›(3)(1)â•›=â•›13.
parallel to each other. Notice in Figure 4.2 that the point (3, 4) has a profit of
18 and that no other feasible solution has a profit as large as 18. Thus, xâ•›=â•›3 and
yâ•›=â•›4 is the unique optimal solution to Problem A, and 18 is its optimal value.
Figure 4.2.↜ Feasible region for Problem A, with iso-profit lines and
objective vector (2, 3).
7 objective vector
3 equals (2, 3)
6
2x + 3y = 18 2
5
4 (3, 4)
2x + 3y = 12
3
2
2x + 3y = 6 feasible region
1 (6, 1)
0 x
2x + 3y = 0 0 1 2 3 4 5 6 7
ing 2 units toward the right of the page and 3 units toward the top. In Fig-
ure 4.2, the objective vector shown touching the iso-profit line 2xâ•›+â•›3yâ•›=â•›18.
The objective vector can have its tail “rooted” anywhere in the plane. In
Figure 4.2 and in general, the objective vector is perpendicular to the iso-
profit lines. It’s the direction in which the objective vector points that matters.
In a maximization problem, we seek a feasible solution that lies farthest in
the direction of the objective vector. Similarly, in a minimization problem, we
seek a feasible solution that lies farthest in the direction that is opposite to the
objective vector. It is emphasized:
Extreme points
Edges
a different extreme point. Suppose, for instance, that the objective vector is
(3, 3). In this case, the objective vector has rotated clockwise, and extreme
points (3, 4) and (6, 1) are both optimal, as is each point in the edge con-
necting them. If the objective vector is (4, 3), the objective vector has rotated
farther clockwise, and the unique optimal solution is the extreme point (6, 1).
Two extreme points are said to be adjacent if the interval between them
is an edge. In Figure 4.2, extreme points (0, 0) and (0, 3) are adjacent. Extreme
points (0, 0) and (3, 4) are not adjacent.
Simplex pivots
When the simplex method is applied to Problem A, the first pivot will
occur from extreme point (0, 0) to extreme point (0, 3), and the second pivot
will occur to extreme point (3, 4), which will be identified as optimal.
A linear program is said to be feasible and bounded if it has at least one fea-
sible solution and if its objective cannot be improved without limit. Problem
A is feasible and bounded. It would not be bounded if the constraints xâ•›+â•›y ≤ 7
and x ≤ 6 were removed. It is easy to convince oneself, visually, of the following:
A linear program can be feasible and bounded even if its feasible region is
unbounded. An example is: Minimize {x}, subject to x ≥ 0.
A canonical form?
The simplex method will be used to solve every linear program that has
been cast in Form 1. Can every linear program be cast in Form 1? Yes. To
verify that this is so, observe that:
A canonical form for linear programs is any format into which every lin-
ear program can be cast. Form 1 is canonical form. Since Form 1 is canonical,
describing the simplex method for Form 1 shows how to solve every linear
program. It goes without saying, perhaps, that it would be foolish to describe
the simplex method for linear programs that have not been cast in a canoni-
cal form.
Recasting Problem A
2x + 3y = z,
which equates z to the value of the objective function. Problem A has four
“ ≤ ” constraints, other than those on its decision variables. Each of these in-
equality constraints is converted into an equation by inserting a slack vari-
able on its left-hand side. This re-writes Problem A as
(1.0) 2x + 3y – z = 0,
(1.1) 1x + s1 = 6,
(1.2) 1x + 1y + s2 = 7,
(1.3) â•…â•…â•›2y + s3 = 9,
(1.4) – 1x + 3y + s4 = 9,
x ≥ 0, y ≥ 0, â•›s1 ≥ 0 for i = 1, 2, 3, 4.
Chapter 4: Eric V. Denardo 121
To see where the “slack variables” get their name, consider the constraint
xâ•›+â•›y ≤ 7. In the constraint xâ•›+â•›yâ•›+â•› s2 = 7, the variable s2 is positive if xâ•›+â•›y < 7
and s2 is zero if xâ•›+â•›y = 7. Evidently, s2 “takes up the slack” in the constraint
xâ•›+â•›y ≤ 7.
The variable –z
In Form 1, the variable z plays a special role because it measures the ob-
jective. We elect to think of –z as a decision variable. In Problem A’, the vari-
able –z is basic for equation (1.0) because –z has a coefficient of +1 in equa-
tion (1.0) and has coefficients of 0 in all other equations. During the entire
course of the simplex method, no pivot will ever occur on any coefficient in
the equation for which –z is basic. Consequently, –z will stay basic for this
equation.
Reduced cost
The equation for which –z is basic plays a guiding role in the simplex
method, and its coefficients have been given names. The coefficient of each
variable in this equation is known as that variable’s reduced cost. In equation
(1.0), the reduced cost of x equals 2, the reduced cost of y equals 3, and the
reduced cost of each slack variable equals 0. The term “reduced cost” is firmly
established in the literature, and we will use it. But it will soon be clear that
“marginal profit” would have been more descriptive.
Problem A’ has seven decision variables. It might seem that the feasible
region for Problem A’ can only be “visualized” in seven-dimensional space.
Figure 4.3 shows that a 2-dimensional picture will do. In Figure 4.3, each line
in Figure 4.1 has been labeled with the variable in Problem A’ that equals zero
on it. For instance, the line on which the inequality xâ•›+â•›y ≤ 7 holds as an equa-
tion is relabeled s2 = 0 because s2 is the slack variable for the constraint
xâ•›+â•›yâ•›+â•› s2 = 7.
122 Linear Programming and Generalizations
y
7
6
s4 = 0 s3 = 0
5
3 s2 = 0
2
x=0 feasible region
1 s1 = 0
0 x
y=0 0 1 2 3 4 5 6 7
Figure 4.3 also enables us to identify the extreme points with basic solu-
tions to system (1). Note that each extreme point in Figure 4.3 lies at the inter-
section of two lines. For instance, the extreme point (0, 3) is the intersection
of the lines xâ•›=â•›0 and s4 = 0. The extreme point (0, 3) will soon be associated
with the basis that excludes the variables that x and s4 .
System (1) has five equations and seven variables. The variables –z and
s1 through s4 form a basis for system (1). This basis consists of five variables,
one per equation. A fundamental result in linear algebra (see Proposition 10.2
on page 334 for a proof) is that every basis for a system of linear equations
has the same number of variables. Thus, each basis for system (1) contains
exactly five variables, one per equation. In other words, each basis excludes
two of the seven decision variables. Each basis for system (1) has a basic solu-
tion, and that basic solution equates its two nonbasic variables to zero. This
identifies each extreme point in Figure 4.3 with a basis. Extreme point (0, 3)
corresponds to the basis that excludes x and s4 because (0, 3) is the intersec-
tion of the lines xâ•›=â•›0 and s4 = 0. Similarly, extreme point (3, 4) corresponds to
Chapter 4: Eric V. Denardo 123
the basis that excludes s2 and s4 because (3, 4) is the intersection of the lines
s2 = 0.and s4 = 0.
Problem A’ will now be used to introduce the simplex method, and Fig-
ure 4.3 will be used to track its progress. System (1) is basic because each of its
equations has a basic variable. The basis for system (1) consists of –z and the
slack variables. This basis excludes x and y. Its basic solution equates to zero
its nonbasic variables (which are x and y) and is
x = 0, y = 0, −z = 0, s1 = 6, s2 = 7, s3 = 9, s4 = 9.
A feasible basis
A basis for Form 1 is now said to be feasible if its basic solution is feasible,
that is, if the values of the basic variables are nonnegative, with the possible
exception of –z. Evidently, the basis {–z, s1, s2, s3, s4â•›} is feasible.
Phases I and II
For Problem A, a feasible basis sprang immediately into view. That is not
typical. Casting a linear program in Form 1 does not automatically produce
a basis, let alone a feasible basis. Normally, a feasible basis must be wrung
out of the linear program by a procedure that is known as Phase I of the
simplex method. Using Problem A to introduce the simplex method begins
with “Phase II” of the simplex method. Phase I has been deferred to Chapter
6 because it turns out to be a minor adaptation of Phase II.
Phase II of the simplex method begins with a feasible basis and with –z
basic for one of its equations. Phase II executes a series of pivots. None of
these pivots occurs on any coefficient in the equation for which –z is basic.
Each of these pivots:
• keeps –z basic;
Phase II stops pivoting when it discerns that the basic solution’s objective
value cannot be improved. How this occurs will soon be explained.
A simplex tableau
The dictionary
• Shift the non-basic variables x and y to the right-hand sides of the con-
straints.
• Multiply equation (1.0) by –1, so that z (and not –z) appears on its left-
hand side.
Writing system (1) in the format of a dictionary produces system (2), below.
(2.0) z = 0 + 2x + 3y
(2.1) s1 = 6 − 1x + 0y
(2.2) s2 = 7 − 1x + 1y,
(2.3) s3 = 9 − 0x − 2y
(2.4) s4 = 9 + 1x − 3y
his lovely book, Linear Programming, published in 1983 by W. H. Freedman and Co.,
New York. In that book, Chvátal attributes the term to J. E. Strum’s, Introduction to
Linear Programming, published in 1972 by Holden-Day, San Francisco.
Chapter 4: Eric V. Denardo 125
In system (2), the variable z (rather than –z) is basic for the topmost equa-
tion, and the slack variables are basic for the remaining equations. The basic
solution to system (2) equates each non-basic variable to zero and, conse-
quently, equates each basic variable to the number on the right-hand-side
value of the equation for which it is basic.
setting that nonbasic variable equal to 1 and adjusting the values of the basic
variables accordingly.
A pivot
Our goal is to pivot in a way that improves the basic solution’s objec-
tive value. Each pivot on a simplex tableau causes one variable that had been
nonbasic to become basic and causes one basic variable to become nonbasic.
Equation (2.0) shows that the objective function improves if the basic solu-
tion is perturbed by setting x positive or by setting y positive. We could pivot
in a way that makes x basic or in a way that makes y basic.
(3.0) z = 0 + 3y;
Evidently, the largest value of y that keeps the perturbed solution feasible
is y = 3. If y exceeds 3, the perturbed solution has s4 < 0.
Graphical interpretation
Figure 4.3 is now used to interpret the ratios in system (3). The initial ba-
sis excludes x and y, and so the initial basic solution lies at the intersection of
the lines x = 0 and yâ•›=â•›0, which is the point (0, 0). The perturbation in system
(3) keeps xâ•›=â•›0 and allows y to become positive, thereby moving upward on
the line xâ•›=â•›0. Each “ratio” in system (3) is a value of y for which (0, y) inter-
sects a constraint. No ratio is computed for constraint (3.1) because the lines
(0, y) and s1 = 0 do not intersect. The smallest ratio is the largest value of y
for which the perturbed solution stays feasible.
Chapter 4: Eric V. Denardo 127
Feasible pivots
• Excluding the equation for which –z is basic, each equation whose co-
efficient of the entering variable is positive has a ratio that equals this
equation’s right-hand side value divided by its coefficient of the enter-
ing variable.
System (1) is now used to illustrate feasible pivots. In this system, let y
be the entering variable. No ratio is computed for equation (1.0) because
–z stays basic for that equation. No ratio is computed for equation (1.1)
because the coefficient of y in this equation is not positive. Ratios are com-
puted for equations (1.2), (1.3) and (1.4), and these ratios equal 7, 4.5 and
3, respectively. The pivot occurs on the coefficient of y in equation (1.4) be-
cause that equation’s ratio is smallest. Note that this pivot results in a basic
tableau for which y becomes basic and the variable s4 that had been basic
for equation (1.4) becomes nonbasic. Equation (3.4) with s4 = 0 shows that
yâ•›=â•›3, hence that this pivot keeps the basic solution feasible. In this case and
in general:
With x (and not y) as the entering variable in system (1), ratios would be
computed form equations (1.1) and (1.2), these ratios would equal 6/1â•›=â•›6 and
7/1â•›=â•›7, respectively, and a feasible pivot would occur on the coefficient of x
in equation (1.1). This pivot causes s1 to leave the basis, resulting in a basic
tableau whose basic solution has xâ•›=â•›6 and remains feasible. By the way, the
coefficient of x in equation (1.4) equals –1, which is negative, and a pivot on
this coefficient would produce a basic solution having xâ•›=â•›9/(–1)â•›=â•›–9, which
would not be feasible.
A simplex pivot
Is the simplex pivot unambiguous? No, it is not. More than one nonbasic
variable can have marginal profit that is positive. Also, two or more rows can
tie for the smallest ratio.
Rule #1
To execute this pivot, select the block B12:I16, type the function
=pivot(C7, B3:I7) and then hit Ctrl+Shift+Enter to remind Excel that this
is an array function (because it sets values in an array of cells, rather than in
a single cell).
The pivot in Table 4.1 causes y to enter the basis and s4 to depart. The
basic solution that results from this pivot remains feasible because it equates
each basic variable other than –z to a nonnegative value.
130 Linear Programming and Generalizations
This pivot improves z by 9, which equals the product of the reduced cost
(marginal profit) of y and the ratio for its pivot row. This reflects a property
that holds in general and is highlighted below:
In each feasible pivot, the change in the basic solution’s objective value
equals the product of the reduced cost of the entering variable and the
ratio for its pivot row.
(4)
change in the basic solution’s reduced cost of the ratio for its
= × .
objective value entering variable pivot row
In Problem A, each pivot will improve the basic solution’s objective value.
That does not always occur, however. The RHS value of the pivot row can
equal 0. If it does equal 0, equation (4) shows that no change occurs in the
basic solution’s objective value. That situation is known as “degeneracy,” and
it is discussed in the next section.
Let us resume the simplex method. For the tableau in rows 12-16 of Table
4.1, x is the only nonbasic variable whose marginal profit is positive; its re-
duced cost equals 3. So x will be the entering variable for the next simplex
pivot. The spreadsheet in Table 4.2 identifies that 3 is the smallest ratio and
displays the tableau that results from a pivot on the coefficient of x in this
row. Equation (4) shows that this pivot will improve the basic solution’s objec-
tive value by 9 = 3 × 3. This pivot causes x to become basic and causes s2
(which had been basic for the pivot row) to become nonbasic. Rows 21-25 of
Table 4.2 exhibit the result of this pivot.
The basic solution to the tableau in rows 21-25 of Table 4.2 has xâ•›=â•›3,
yâ•›=â•›4 and zâ•›=â•›18. The nonbasic variables in this tableau are s2 and s4 . In Fig-
ure 4.3, this basic solution lies at the intersection of the lines s2 = 0 and
s4 = 0. Visually, it is optimal.
Chapter 4: Eric V. Denardo 131
An optimality condition
In system (5), the variables s2 and s4 are nonbasic. The basic solution
to system (5) is the unique solution to system (5) in which the nonbasic vari-
ables s2 and s4 are equated to zero. This basic solution has zâ•›=â•›18. Since the
132 Linear Programming and Generalizations
coefficients of s2 and s4 in equation (5.0) are negative, any solution that sets
either s2 and s4 to a positive value has z < 18. In brief, the basic solution to
system (5) is the unique optimal solution to Problem A’.
Test for optimality. The basic solution to a basic feasible system for
Form 1 is optimal if the reduced costs of the nonbasic variables are:
Recap
• The reduced cost of each nonbasic variable equals the change that oc-
curs in the objective value if the basic solution is perturbed by setting
that nonbasic variable equal to 1.
• If an equation has a ratio, this ratio equals the value of the entering
variable for which the perturbed solution reduces the equation’s basic
variable to zero.
• The smallest of these ratios equals the largest value of the entering vari-
able that keeps the perturbed solution feasible.
5. Degeneracy
In a feasible pivot, the RHS value of the pivot row must be nonnegative. A
feasible pivot is said to be nondegenerate if the right-hand-side value of the
Chapter 4: Eric V. Denardo 133
Nondegenerate pivots
Equation (4) holds for every pivot that occurs on a basic tableau. If a pivot
is nondegenerate:
• The coefficient of the entering variable in the pivot row must be posi-
tive, so the ratio for the pivot row must be positive.
• Hence, equation (4) shows that each nondegenerate simplex pivot im-
proves the basic solution’s objective value.
It is emphasized:
Degenerate pivots
Let us now interpret equation (4) for the case of a feasible pivot that is
degenerate. In this case:
• This pivot (like any other) multiplies the pivot row by a constant, and
it replaces the other rows by themselves less constants times the pivot
row. Since the pivot is degenerate, the RHS value of the pivot row equals
0, so the pivot changes no RHS values.
• The variables that had been basic for rows other than the pivot row
remain basic for those rows; their values in the basic solution remain as
they were because the RHS values do not change.
• The variable that departs from the basis had equaled zero, and the vari-
able that enters the basis will equal zero.
134 Linear Programming and Generalizations
In brief:
Cycling
On the other hand, each degenerate pivot changes the basis without
changing the basic solution. The simplex method is said to cycle if a sequence
of simplex pivots leads to a basis visited previously. If a cycle occurs, it must
consist exclusively of degenerate pivots.
−x + y ≤ 2,
╇╛x ≥ 0, y ≥ 0.
Please sketch the feasible region of Problem B. Note that its constraints
are satisfied by each pair (x, y) having y ≥ 2 and xâ•›=â•›y – 2; moreover, that each
such pair has objective value of 0xâ•›+â•›3yâ•›=â•›3y, which becomes arbitrarily large
as y increases. To see what happens when the simplex method is applied to
Problem B, we first place it in Form 1, as
(6.0) 0x+ 3y – z = 0,
(6.1) –x+ y + s1 = 2,
x ≥ 0 ,â•…â•›y ≥ 0 ,â•…â•›s1 ≥ 0.
Table 4.3 shows what happens when the simplex method is applied to
Problem B’. The first simplex pivot occurs on the coefficient of y in equa-
tion (6.1), producing a basic feasible tableau whose basis excludes x and s1
and is
x = s1 = 0, y = 2, −z = −6.
(7.0) z = 6 + 3x − 3s1 ,
(7.1) y = 2 + 1x − 1s1 .
Shadow prices are present not just for the final basis, but at every step
along the way. They guide the simplex method. In Chapter 11, we will see
how they do that.
It will be demonstrated in Proposition 10.2 (on page 334) that every basis
for the column space of a matrix has the same number of columns. Thus,
every basic tableau for a linear program has the same number (possibly zero)
of trite rows. A linear program is said to satisfy the Full Rank proviso if any
Chapter 4: Eric V. Denardo 137
basic tableau for its Form 1 representation has a basic variable for each row.
Proposition 10.2 implies that the Full Rank proviso is satisfied if and only if
every basic tableau has one basic variable for each row.
System (1) has a basic variable for each row, so Problem A satisfies the
Full Rank proviso. If a linear program satisfies the Full Rank proviso, its equa-
tions must be consistent, and no basic tableau has a trite row.
A definition
For linear programs that satisfy the Full Rank proviso, each basis pre-
scribes a set of shadow prices, one per constraint. Their definition is high-
lighted below.
Evidently, each shadow price is a rate of change of the objective value with
respect to the constraint’s right-hand-side (RHS) value. (In math-speak, each
shadow price is a partial derivative.)
For the final basis, whose basic solution is in rows 22-25 of Table 4.2, the
shadow price for the 2nd constraint will now be computed. That constraint’s
138 Linear Programming and Generalizations
RHS value in the original linear program value equals 7. Let us ask ourselves:
What would happen to this basic solution if the RHS value of the 2nd con-
straint were changed from 7 to 7â•›+â•›δ? Table 4.4, below, will help us to answer
this question. Table 4.4 differs from the initial tableau (rows 2-7 of Table 4.1)
in that the dashed line records the locations of the “=” signs and in that the
variable δ appears on the right-hand-side of each equation with a coefficient
of 1 in the 2nd constraint and with coefficients of 0 in the other constraints. Ef-
fectively, the RHS value of the 2nd constraint has been changed from 7 to 7â•›+â•›δ.
x y s1 s2 s3 s4 –z
Table 4.5.↜渀 The current tableau after the same two pivots.
----- -------- ---------
x y s1 s2 s3 s4 –z RHS δ
0 0 0 –9/4 0 –1/4 1 –18 –9/4
0 0 1 –3/4 0 1/4 0 3 –3/4
1 0 0 3/4 0 –1/4 0 3 3/4
0 0 0 –1/2 1 –1/2 0 1 –1/2
0 1 0 1/4 0 1/4 0 4 1/4
Casting the basic solution to Table 4.5 in the format of a dictionary pro-
duces system (8), below. Equation (8.0) shows that the rate of change of the
Chapter 4: Eric V. Denardo 139
objective value with respect to the RHS value of the 2nd constraint equals 9/4.
Thus, the shadow price of the 2nd constraint equals 9/4 or 2.25.
(8.0) z = 18 + (9/4)δ
(8.1) s1 = 3 − (3/4)δ
(8.2) x = 3 + (3/4)δ
(8.3) s3 = 1 − (1/2)δ
(8.4) y = 4 + (1/4)δ
System (8) prescribes the values of the basic variables in terms of the
change δ in the right-hand side of the 2nd constraint of Problem A. The range
of a shadow price is the interval in its RHS value for which the basic solution
remains feasible. It’s clear from equations (8.1) through (8.4) that the basic
variables stay nonnegative for the values of δ that satisfy the inequalities
s1 = 3 − (3/4)δ ≥ 0,
x = 3 + (3/4)δ ≥ 0,
s3 = 1 − (1/2)δ ≥ 0,
y = 4 + (1/4)δ ≥ 0.
−4 ≤ δ ≤ 2.
The largest value of δ for which the perturbed basic solution remains
feasible is called the allowable increase. The negative of the smallest value of
δ for which the perturbed basic solution remains feasible is called the allow-
able decrease. In this case, the allowable increase equals 2 and the allowable
decrease equals 4.
140 Linear Programming and Generalizations
A break-even price
Evidently, if the RHS value of the 2nd constraint can be increased at a per-
unit cost p below 2.25 (which equals 9/4), it is profitable to increase it by as
many as 2 units, perhaps more. Similarly, if the RHS value of the 2nd constraint
can be decreased at a per-unit revenue p above 2.25, it is profitable to decrease
it by as many as 4 units, perhaps more.
Economic insight
It’s often the case that the RHS values of a linear program represent levels
of resources that can be adjusted upward or downward. When this occurs, the
shadow prices give the break-even value of small changes in resource levels –
they suggest where it is profitable to invest, and where it is profitable do divest.
The term, shadow price, reflects the fact that these break-even prices are
endogenous (determined within the model), rather than by external market
forces.
In any basic tableau, the shadow price of each “≤” constraint equals (−1)
times the reduced cost of that constraint’s slack variable.
In Table 4.5, for instance, the shadow prices for the four constraints are 0,
9/4, 0 and 1/4, respectively.
Except for a factor of (–1), the same property holds for each “≥” con-
straint.
Chapter 4: Eric V. Denardo 141
In any basic tableau, the shadow price of each “≥” constraint equals the
reduced cost of that constraint’s surplus variable.
Graphical illustration
(9) −x + 3y = 9 and x + y = 7 + δ.
This reconfirms that the shadow price of the 2nd constraint equals 9/4.
142 Linear Programming and Generalizations
y
objective vector
9
x+y≤9
8
3
–x + 3y ≤ 9
7
x+y≤7
6 2
5 x+y≤3
4
2y ≤ 9
3
2 feasible region
x≥0 1
0 x
0 1 2 3 4 5 6 7 8 9
For Problem A, consider the effect of adding δ2 units to the RHS of the
2nd constraint and adding δ4 units to the RHS of the 4th constraint. Let us
ask ourselves: What effect would this have on the basic solution for the basis
in Table 4.5? Inserting δ4 on the RHS of Table 4.4 with a coefficient of +1
in the 4th constraint and repeating the above argument (the variables s4 and
δ4 have identical columns of coefficients) indicates that the basic solution
becomes
Chapter 4: Eric V. Denardo 143
3 − (3/4)δ2 + (1/4)δ4 ≥ 0.
In Chapter 3, it was noted that the set of ordered pairs (δ2 , δ4 ) that sat-
isfy a particular linear inequality, such as the above, is a convex set. It was also
observed that the intersection of convex sets is convex. In particular, the set
of pairs (δ2 , δ4 ) for which the basic solution remains feasible (nonnegative)
is convex. In brief:
Note also that perturbing the RHS values of the original tableau af-
fects only the RHS values of the current tableau. It has no effect on the
coefficients of the decision variables in any of the equations. In particular,
these perturbations have no effect on the reduced costs (top-row coef-
ficients). If the reduced costs satisfy the optimality conditions before the
perturbation occurs, they continue to satisfy it after perturbation occurs.
It is emphasized:
144 Linear Programming and Generalizations
In Chapter 5, we will see that the shadow prices are central to a key idea in
economics, namely, the “opportunity cost” of doing something new. In Chap-
ter 12, the shadow prices will emerge as the decision variables in a “dual”
linear program.
Every computer code that implements the simplex method finds and re-
ports a basic solution that is optimal. Most of these codes also report a shadow
price for each constraint, along with an allowable increase and an allowable
decrease for each RHS value.
If the Full Rank proviso is violated, not all of the constraints can have
shadow prices. These computer codes report them anyhow! What these codes
are actually reporting are values of the basis’s “multipliers” (short for Lagrange
multipliers). In Chapter 11, it will be shown that these “multipliers” coincide
with the shadow prices when they exist and, even if the shadow prices do not
exist, the multipliers account correctly for the marginal benefit of perturbing
the RHS values in any way that keeps the linear program feasible.
8. Review
Listed below are the most important of the properties of the simplex
method.
• The simplex method pivots from one basic feasible tableau to another.
Chapter 4: Eric V. Denardo 145
• In each basic feasible tableau, the reduced cost of each nonbasic vari-
able equals the amount by which the basic solution’s objective value
changes if that nonbasic variable is set equal to 1 and if the values of
the basic variables are adjusted to preserve a solution to the equation
system.
• If the RHS value of the pivot row is positive, the pivot is nondegenerate.
Each nondegenerate simplex pivot improves the basic solution’s objec-
tive value.
• If the RHS value of the pivot row is zero, the pivot is degenerate. Each
degenerate pivot changes the basis, but causes no change in the basic
solution or in its objective value.
• A linear program satisfies the Full Rank proviso if any basis has as many
basic variables as there are constraints in the linear program’s Form 1
representation.
• If the Full Rank proviso is satisfied, each basic feasible tableau has these
properties:
146 Linear Programming and Generalizations
–╇The shadow price of each constraint equals the rate of change of the
basic solution’s objective value with respect to the constraint’s RHS
value.
–╇If only a single RHS value is changed, the shadow price applies to
increases as large as the allowable increase and to decreases as large
as the allowable decrease.
• Rule #1 can cause the simplex method to cycle, and the ambiguity in
Rule #1 can be resolved in a way that precludes cycling, thereby guar-
anteeing finite termination.
• If the Full Rank proviso is violated, each basis still has “multipliers” that
correctly account for the marginal value of any perturbation of the RHS
values that keeps the linear program feasible.
Not a word has appeared in this chapter about the speed of the simplex
method. For an algorithm to be useful, it must be fast. The simplex method
is blazingly fast on nearly every practical problem. But examples have been
discovered on which it is horrendously slow. Why that is so has remained a
bit of a mystery for over a half century. Chapter 6 touches lightly on the speed
of the simplex method.
Chapter 4: Eric V. Denardo 147
2. Rule #1 picks the most positive entering variable for a simplex pivot on a
maximization problem. State a simplex pivot rule that makes the largest
possible improvement in the basic solution’s objective value. Use Problem
A to illustrate this rule.
(a) The coefficient of y in equation (1.1) equals zero. How is this fact re-
flected in Figure 4.3? Does a similar interpretation apply to the coef-
ficient of x in equation (1.3)?
(b) With x as the entering variable, no ratio was computed for equa-
tion (1.4). If this ratio had been computed, it would have equaled
9/(–1)â•›=â•›–9. Use Figure 4.3 to interpret this number.
(c) True or false: Problem A’ has a feasible basis whose nonbasic variables
are x and s4 .
6. (graphical interpretation) True or false: for Problem A’, every set that in-
cludes –z and all but two of the variables x, y and s1 through s4 is a basis.
– x + y ≤ 1,
x + y ≤ 4,
x – y ≤ 2,
x≥0, y ≥ 0.
(a) Solve this linear program by executing simplex pivots on a spread-
sheet.
148 Linear Programming and Generalizations
(b) Solve this linear program graphically, and use your graph to trace the
progress of the simplex method.
â•› A – B ≤ 1,
– A + B ≤ 1.
(a) Plot this linear program’s feasible region. Does it have any extreme
points?
(b) Does this linear program have an optimal solution? If so, name one.
(c) Apply the simplex method to this linear program. What happens?
â•› x â•›≤ 4,
â•›– x + y â•›≤ 2,
2x + 3y â•› ≤ 12,
x≥0, y ≥ 0.
(b) Execute a feasible pivot that finds a second optimal solution to this
linear program.
(c) Solve this linear program graphically, and use your graph to trace the
progress of the simplex method.
(d) How many optimal solutions does this linear program have? What are
they?
10. For the linear program that appears below, construct a basic feasible sys-
tem, state its basis, and state its basic solution.
Chapter 4: Eric V. Denardo 149
â•…â•…â•…â•…â•… x + y – z = 16,
â•›y +â•›z â•›≤ 12,
╅╅╅╅╅╅╅╇╛2y –â•›z ≥ – 10,
x ≥ 0, y ≥ 0, z ≥ 0.
(a) True or false: Problem A’ has a feasible basis whose nonbasic variables
are x and s2 .
(b) True or false: Problem A’ has a feasible basis whose nonbasic variables
are x and s3 .
11. (an unbounded linear program) Draw the feasible region for Problem B’. Ap-
ply the simplex method to Problem B’, selecting y (and not x) as the entering
variable for the first pivot. What happens? Interpret your result graphically.
(c) List the bases and basic solutions that were encountered. Did a degen-
erate pivot occur?
13. (degeneracy in 3-space) This problem concerns the linear program: Maxi-
mize {xâ•›+â•›1.5yâ•›+â•›z} subject to the constraints x + y ≤ 1, y + z ≤ 1, x ≥ 0,
y ≥ 0, z ≥ 0.
(a) Use the simplex pivots with Rule #1 to solve this linear program on a
spreadsheet. Did a degenerate pivot occur?
(b) Plot this linear program’s feasible region. Explain why a degenerate
pivot must occur.
(c) True or false: If a degenerate pivot occurs, the linear program must
have a redundant constraint.
150 Linear Programming and Generalizations
(a) Use the simplex pivots with Rule #1 to solve this linear program on a
spreadsheet. Did a degenerate pivot occur?
(b) True or false: The simplex method stops when it encounters an opti-
mal solution.
16. Consider a basic feasible tableau that is nondegenerate, so that its basic
solution equates all variables to positive values, with the possible excep-
tion of –z. Complete the following sentence and justify it: A feasible pivot
on this tableau will result in a degenerate tableau if and only if a tie occurs
for_______.
17. True or false: For a linear program in Form 1, feasible pivots are the only
pivots that keep the basic solution feasible.
18. (redundant constraints) Suppose that you need to learn whether or not the
ith constraint in a linear program is redundant.
(a) Suppose the ith constraint is a “≤” inequality. How could you find out
whether or not this constraint is redundant? Hint: use a linear pro-
gram.
(b) Suppose the ith constraint is an equation. Hint: use part (a), twice.
20. (bases and shadow prices) This problem refers to Table 4.1.
(a) For the basis solution in rows 2-7, find the shadow price for each con-
straint.
Chapter 4: Eric V. Denardo 151
(b) For the basic solution in rows 11-16, find the shadow price for each
constraint.
21. Adapt Table 4.4 and Table 4.5 to compute the shadow price, the allowable
increase, and the allowable decrease for the optimal basis of the RHS val-
ue of the constraint – xâ•›+â•›3y ≤ 9. Which previously nonbinding constraint
becomes binding at the allowable increase? At the allowable decrease?
22. On the plane, plot the set S that consists of all pairs (δ2 , δ4 ) for which
the basic solution to system (12) remains feasible. For each point on the
boundary of the set S that you have plotted, indicate which constraint(s)
become binding.
23. Suppose every RHS value in Problem A is multiplied by the same positive
constant, for instance, by 10.5. What happens to the optimal basis? To the
optimal basic solution? To the optimal value? To the optimal tableau? Why?
25. True or false: When the simplex method is executed, a variable can:
(a) Leave the basis at a pivot and enter at the next pivot. Hint: If it entered,
to which extreme point would it lead?
(b) Enter at a pivot and leave at the next pivot. Hint: Maximize {2yâ•›+â•›x},
subject to the constraints 3y + x ≤ 3, x ≥ 0, y ≥ 0.
(a) The basic solution to this tableau is the unique optimal solution.
(b) The basic solution to this tableau is optimal, but is not the unique
optimal solution.
(b) Prove that deleting B and the equation for which it is basic can have
no effect either on the feasibility of this linear program or on its opti-
mal value.
Chapter 5: Analyzing Linear Programs
1. Preview
This chapter also addresses the fact that a linear program – like any math-
ematical model – is but an approximation to the situation that is under study.
The information that accompanies the optimal solution to a linear program
can help you to determine whether or not the approximation is a reasonable
one.
Three sections of this chapter are starred because they can be read inde-
pendently of each other. One of these starred sections provides a glimpse of
duality.
This example has a long history. An early precursor appears in the article by Robert
1╇
Contribution
When one is allocating this week’s production capacity, the variable cost
normally includes the material and energy that will be consumed during pro-
duction, and the fixed cost includes depreciation of existing structures, prop-
erty taxes, and other expenses that are unaffected by decisions about what to
produce this week.
The contribution of an action equals the revenue that it creates less its
variable cost. This usage abbreviates the accounting phrase, “contribution to-
ward the recovery of fixed costs.” Table 5.1 reports $840 as the contribution
of each Standard model vehicle. This means that $840 equals the sales price
of a Standard model vehicle less the variable cost of manufacturing it. When
profit is used in this book, what is meant is contribution.
Maximizing contribution
The manager of the ATV plant seeks the mix of activities that maximizes
the rate at which contribution is earned, measured in dollars per week. At a
first glance, the Luxury model vehicle seems to be the most profitable. It has
the largest contribution. Each type of vehicle consumes a total of 4 hours of
capacity in the Engine and Body shops, where congestion is likely to occur.
But we will see that no Luxury model vehicles should be manufactured, and
we will come to understand why that is so.
Let us formulate the ATV problem for solution via linear programming.
Its decision variables are the rates at which to produce the three types of ve-
hicles, which are given the names:
156 Linear Programming and Generalizations
Evidently, mnemonics (memory aids) are being used; the labels S, F and
L abbreviate the production rates for Standard, Fancy and Luxury model ve-
hicles.
Inequality constraints
The ATV problem places eight constraints on the values taken by the
decision variables. Three of these constraints reflect the fact that the produc-
tion quantities cannot be negative. These three are S ≥ 0, F ≥ 0, and L ≥ 0.
The remaining five constraints keep the capacity of each shop from being
over-utilized. The top line of Table 5.1 shows that producing at rates S, F, and
L vehicles per week consumes the capacity of the Engine shop at the rate of
3Sâ•›+â•›2Fâ•›+â•›1L hours per week, so the constraint
3S + 2F + 1L ≤ 120
keeps the number of hours consumed in the Engine shop from exceeding its
weekly capacity. The expression, {840Sâ•›+â•›1120Fâ•›+â•›1200L}, measures the rate at
which profit is earned. The complete linear program is:
Engine: 3S + 2F + 1L ≤ 120,
Body: 1S + 2F + 3L ≤ 80,
Standard Finishing: 2S ≤ 96,
Fancy Finishing: ╅╇╛3F ≤ 102,
Luxury Finishing: ╅╅╅╅╅╛╛╛╛╛2L ≤ 40,
S ≥ 0, F ≥ 0, L ≥ 0.
Chapter 5: Eric V. Denardo 157
Integer-valued variables?
A spreadsheet
–╇Cells B9, C9 and D9 are reserved for the values of these decision
variables, each of which has been set equal to 1, temporarily.
–╇Rows 5 through 8 contain comparable data for the other four shops.
• Column F contains “<=” signs. These are memory aids; they remind us
that the quantities to their left must not exceed the RHS values to their
right.
It remains for Solver to select values in cells B9, C9 and D9 that maximize
the value in cell E3 while enforcing the constraints of Program 1.
A standard format
Table 5.2 presents the data for the ATV problem in a standard format,
which consists of:
• One row for the labels of the decision variables (row 2 in this case).
• One row for the values of the decision variables (row 9 in this case).
• One row for the contribution of each decision variable (row 3).
• One column for the coefficients of each decision variable, one column
for the sumproduct functions that measure the consumption of each
resource, one column for the RHS values, and one (optional) column
that records the sense of each constraint.
This is the first of two sections that describe slightly different ways to
compute the optimal solution to the ATV problem. This section is focused
Chapter 5: Eric V. Denardo 159
on Solver, which comes with Excel. The next section is focused on Premium
Solver for Education, which is on the disc that accompanies this book.
Figure 5.1 displays a Solver dialog box, which has been filled out. This
dialog box identifies E3 as the cell whose value we wish to maximize, it speci-
fies cells B9:D9 as the changing cells, and it imposes constraints that keep
the quantities in cells B9:D9 nonnegative and keep the quantities in cells E4
through E8 from exceeding the quantities in cells G4 through G8, respec-
tively.
Chapter 2 tells how to fill out this dialog box. As was indicated in Chapter
2, the Solver dialog box for Excel 2010 differs slightly from the above, but is
filled out in a similar way.
Binding constraints
In Table 5.3, the shaded cells identify these binding constraints. It will
soon be argued that it is optimal to keep these constraints binding even if the
model’s data are somewhat inaccurate.
Chapter 5: Eric V. Denardo 161
A sensitivity report
The Solver Results dialog box (see Table 5.3) has a window containing
the word “sensitivity.” Clicking on it creates a sheet containing a Sensitivity
Report that is reproduced as Table 5.4.
• The shadow price for a constraint equals the rate of change of the basic
solution’s objective value with respect to the RHS value of that con-
straint. The basic solution remains feasible (and hence optimal) for in-
creases in its RHS value up to the Allowable Increase and for decreases
up to the Allowable Decrease.
• The reduced cost of each basic variable equals zero, and the reduced
cost of each nonbasic variable equals the amount by which the optimal
value changes if that variable is set equal to 1 and the values of the basic
variables are adjusted accordingly.
In particular:
• The capacity of the Engine shop has a break-even value of 140 $/hour,
and this value applies to increases of up to 56 hs/wk and to decreases up
to 16 hr/wk. Hence, an increase of up to 56 hours per week of Engine
shop capacity is profitable if it can be obtained at a price below 140 dol-
lars per hour. And a decrease in Engine shop capacity of up to 16 hours
per week is profitable if it be put to an alternative use that is worth more
than 140 dollars per hour.
You forgot?
Sooner or later, nearly everyone who uses Solver will forget to check off
Assume Linear Model before solving a linear program. If you forget, the “en-
gine” that solves your linear program will not be the simplex method, but a
more general algorithm. It computes the correct shadow prices but calls them
Lagrange multipliers, it computes the correct reduced costs, but calls them
reduced gradients, and it omits the Allowable Increases and Allowable De-
creases because it presumes the problem is nonlinear.
Premium Solver for Education has added features and fewer bugs than do
the earlier versions of Solver. If you have a choice, use the Premium version.
Chapter 2 tells how to install and activate it. After it is activated, Premium
Solver will appear on the Add-Ins tab of the Excel? File menu.
Chapter 5: Eric V. Denardo 163
To illustrate the use of the Premium Solver dialog box, we arrange for
it to solve the ATV problem. The first step is to replicate the spreadsheet in
Table 5.3. Next, click on the Add-Ins tab on the File menu. An icon labeled
Premium Solver will appear at the left, just below the File tab. Click on it. A
Solver Parameters dialog box will appear. To make it look like that in Fig-
ure 5.2, follow the procedure that is described in Chapter 2. After you suc-
ceed, click on Solve. In a flash, a solution will appear, along with the usual box
that accords you the opportunity to obtain a sensitivity report.
Solver and Premium Solver report reduced costs and shadow prices as
they are defined in Chapter 4. Some computer packages use different conven-
tions as to the signs (but not the magnitudes) of the reduced costs and the
shadow prices. If you are using a different software package to solve linear
programs, you will need to figure out what sign conventions it employs. An
easy way to do that is described below.
A maximization problem
To see what sign conventions a particular computer package uses for max-
imization problems, you can ask it to solve a simple linear program, such as
164 Linear Programming and Generalizations
3x + 3y ≤ 6,
x ≥ 0 ,â•… y ≥ 0.
Clearly, the optimal solution to Example 1 is xâ•›=â•›0 and yâ•›=â•›2, and its opti-
mal value equals 8. It is equally clear that:
â•›3x + 3y ≥ 6,
â•› x ≥ 0,â•… y ≥ 0.
The optimal solution to Example 2 is xâ•›=â•›2 and yâ•›=â•›0, and its optimal value
equals 4. Evidently:
Uncertain data
This model’s data are uncertain because they cannot be measured pre-
cisely and because they can fluctuate in unpredictable ways. In the ATV
model, it is presumed that, in an “representative” week, 120 machine hours
are available in the Engine shop; 120 equals the number of machine hours
during which the Engine shop is open for business less allowances for routine
maintenance, machine breakdowns, shortages of vital parts, absences of key
workers, power failures, and other unforeseen events. The actual number of
machine hours available in a particular week could be larger or smaller than
120, depending on how things turned out that week.
Aggregation
Linearization
straint presumes linear interactions among the three types of vehicles that are
produced there. The actual interactions are more complicated and are some-
what nonlinear. For example, this constraint accounts crudely for the set-up
times that are needed to change from the production of one model to another.
The ATV example is aggregated and simplified. It has to be. Imagine how
intractable. this model would become if it incorporated all of the complexi-
ties and details just mentioned. Yet, there is merit in starting with a simple
and aggregated model. It will be relatively easy to build and debug. And if it
is artfully built, its simplicity will cause the main insights to stand out starkly.
Robustness
Illustration
• Make Standard model vehicles at the rate of 20 per week, make Fancy
model vehicles at the rate of 30 per week and make no Luxury model
vehicles.
• Keep the Engine and Body shops busy making Standard and Fancy
model vehicles, and make no Luxury model vehicles.
If the model’s data were exact (and that never occurs), both descriptions
of the optimal solution would be correct. If the model’s data are close, the lat-
ter is correct because it keeps the binding constraints binding.
Sketch of a proof
• Each basis for the LP’s equation system contains one variable per equa-
tion. (In other words, the Full Rank proviso is satisfied.)
• The linear program has only one optimal solution, and this optimal so-
lution is nondegenerate. (It sets each basic variable that is constrained
to be nonnegative to a positive value.)
Coupling these observations with the fact that the inverse of a matrix is a
continuous function of its data would prove the theorem.
168 Linear Programming and Generalizations
It will soon be seen that three concepts are very closely linked.
Context
These three concepts are described in the context of a linear program that
has been cast in Form 1 – with equality constraints and nonnegative decision
variables. In such a linear program, each decision variable is now said to rep-
resent an activity. Each constraint (other than the nonnegativity constraints
on the variables) measures the consumption of a resource and requires its
consumption to equal its availability (RHS value). Each basis is now said to
engage in those activities (decision variables) that the basis includes. The val-
ue assigned to each decision variable in a basic solution is now said to be the
level of the activity that it represents.
Shadow prices and marginal benefit are familiar from Chapter 4, but rela-
tive opportunity cost was not discussed there. Like the other two terms, relative
opportunity cost is defined in the context of a particular basis. The relative op-
portunity cost of each activity equals the reduction in contribution that occurs
the levels of the activities in which the basis is engaged are altered so as to free up
(make available) the resources needed to set the level of that activity equal to 1.
Shadow prices, relative opportunity costs and marginal benefit are de-
fined for every basis, not merely for the optimal basis. To illustrate these con-
cepts – and the relationship between them – we focus on the basis (and basic
solution) that is optimal for the ATV problem. Table 5.4 reports its shadow
prices. For convenient reference, these shadow prices are recorded in Ta-
ble 5.5, with a label and unit of measure of each.
Chapter 5: Eric V. Denardo 169
Let us recall that these shadow prices are break-even prices. For instance,
a change of δ in the RHS of the Engine shop capacity constraint causes a
change of 140 δ in the basic solution’s objective value. These break-even pric-
es apply to simultaneous changes in several RHS values.
Table 5.5 presents the shadow prices for the optimal basis. With refer-
ence to that basis, the relative opportunity cost of making one Luxury model
vehicle is now computed. Making one Luxury model vehicle requires 1 hour
in the Engine shop, 3 hours in the Body shop, and 2 hours in the Luxury Fin-
ishing shop. The shadow prices apply to simultaneous changes in several RHS
values, and the prices in Table 5.5 show that:
The marginal profit of any activity equals its contribution less the relative
opportunity cost of freeing up the resources needed to accomplish that activ-
ity. In particular,
Equation (2) tells us nothing new because Table 5.4 reports –200 as the
reduced cost of L, namely, as the change in profit if the basic solution is per-
turbed by setting Lâ•›=â•›1 and adjusting the values of the basic variables accord-
ingly.
Equation (2) tells us nothing new, but equation (1) does. It indicates why
the Luxury model vehicle is unprofitable. Making one Luxury model vehicle
requires 3 hours in the Body shop, which has a break-even price of $420/hour,
and (3) × (420) = $1, 260.
260 This (alone) exceeds the contribution of the Luxu-
ry model vehicle. In this example and in general:
To learn why the optimal solution to a linear program is what it is, use
the shadow prices to parse the relative opportunity cost of each activity
in which it does not engage.
The Luxury model vehicle would become profitable if its relative oppor-
tunity cost could be reduced below $1,200, and equation (1) shows that this
would occur if the time it required in the Body shop could be reduced below
2 11/21 hours.
Making one Nifty reduces profit by approximately $80. Nifties are not
profitable. Their relative opportunity cost shows that they would become
slightly profitable. if their manufacturing time in the Body shop could be re-
duced by 0.2 hours.
Still in the context of the optimal plan for the ATV facility, let’s compute
the relative opportunity cost of making one Standard model vehicle. To do
so, we must free up the resources that it requires, which are 3 hours in the
Engine shop (at a cost of $140 per hour), 1 hour in the Body shop (at a cost
of $420 per hour) and 2 hours in the Standard finishing shop (at a cost of $0
per hour), so that:
Please pause to verify that the relative opportunity cost of one Fancy
model vehicle equals $1,120. This illustrates a point that holds in general and
is highlighted below:
Consider any basis for a linear program. The contribution of each basic
variable equals its relative opportunity cost.
The above has been justified on economic grounds. It also follows from
the fact that the reduced cost of each basic variable equals zero.
172 Linear Programming and Generalizations
That’s five linear equations in five unknowns. The lower three equations
set SFâ•›=â•›FFâ•›=â•›LFâ•›=â•›0. This reduces the upper two equations to 3Eâ•›+â•›1Bâ•›=â•›840 and
1Eâ•›+â•›3Bâ•›=â•›1200; their solution is Eâ•›=â•›165 and Bâ•›=â•›345.
By the way, the shadow price that this basis assigns to a particular con-
straint could have been computed by adding δ to its RHS value and seeing
what happens to the basic solution and finding the change in its objective
value. For the ATV example, this would have required solution of six lin-
ear equations (not 5). And it would have given us only one of the shadow
prices.
No shadow price?
The ATV problem satisfies the Full Rank proviso because each constraint
in its Form-1 representation has a slack variable. This guarantees that the
equation system has a solution and that it continues to have a solution if a
RHS value is perturbed, hence that each basis assigns a shadow price to each
constraint.
Multipliers
An illustration
The 2nd constraint in Program 2 is twice the 1st constraint. If the RHS
value of either of these constraints was perturbed, the linear program would
become infeasible. Neither constraint can have a shadow price. Solver and
Premium Solver report “shadow prices” anyhow.
Multipliers, by hand
What these software packages are actually reporting are values of the “multi-
pliers.” As noted above, the values of the multipliers y1 , y2 and y3 are such that
the relative opportunity cost of each basic variable equals its contribution. For
the basis that includes x1 and x3 and excludes x2 , the multipliers must satisfy:
x1 is basic ⇒ 1y1 + 2y2 + 3y3 = 4,
x3 is basic ⇒ 3y1 + 6y2 + 1y3 = 5.
174 Linear Programming and Generalizations
Premium Solver has been used to solve Program 2. The sensitivity report
in Table 5.6 records its optimal solution and multipliers, which are
This is the same basis and the same set of multipliers that are computed
above.
Sneak preview
The opportunity cost of doing something is the benefit one can obtain
from the best alternative use of the resources needed to do that thing.
Paul Samuelson
ing the afternoon to picking raspberries. His best alternative use of the time
and effort he would spend picking raspberries is in picking strawberries. Cru-
soe anticipates that spending the afternoon picking strawberries or raspber-
ries will be equally pleasurable. The opportunity cost of picking raspberries
is the value that Crusoe places on the strawberries he might have picked that
afternoon.
A difficulty
A puzzle
Which is it?”
Fewer than 22% of the roughly 200 professional economists who respond-
ed to this question got the correct answer. That is pretty dismal performance.
Cost When They See One? A Dismal Performance from the Dismal Science,” Contri-
butions to Economic Analysis & Policy: Vol. 4, Issue 1, Article 7, 2005.
Chapter 5: Eric V. Denardo 177
If every one of them had chosen amongst the four choices at random (a pure
guess), a statistic this low would occur with a probability that is below 0.2.
Extra work
–╇Then, for each activity that is excluded from the program, use these
shadow prices to compute the relative opportunity cost of the activity.
–╇For each activity, find the best alternative use of the bundle of re-
sources it requires. (This requires solution of one optimization prob-
lem per activity.)
Recap
The relative opportunity cost focuses the decision maker on the marginal
benefit of an action – this being the benefit (contribution) obtained from the
action less the cost of freeing up the resources needed to make it possible. The
178 Linear Programming and Generalizations
Virtually all of the ideas that have appeared so far in this book are due
to George B. Dantzig. Not all of the terminology is due to him. In his classic
text3, Dantzig used the term relative cost instead of “reduced cost.” Relative
cost reflects the fact that it is relative to the current basis. In place of “shadow
price,” he used the terms price and multiplier, the latter as an abbreviation
of Lagrange multiplier. Dantzig understood that the shadow prices exist if
and only if the Full Rank proviso is satisfied. He fully understood the role of
multipliers in marginal analysis and in the “revised” simplex method. Con-
sider this:
• Dantzig’s simplex method has remained the principal tool for finding
an optimal allocation of resources ever since he devised it.
A perplexing decision
George B. Dantzig, Linear programming and extensions, R-366-PR, The RAND Cor-
3╇
poration, August, 1963 and Princeton University Press, Princeton, NJ, 1963.
Chapter 5: Eric V. Denardo 179
out peer as concerns the optimal allocation of resources. Since that time, no
one has approached his stature in this field.
This is the first of three starred sections that are starred because they
are independent of each other. Here, the ATV problem is used to glimpse a
topic that is known as duality. Let’s begin by recalling the labels of the shadow
prices – E for Engine shop, B for Body shop, SF for Standard Finishing shop,
and so forth. Table 5.5 reports the values that the optimal solution assigns to
the shadow prices, namely,
E = 140, B = 420, SF = 0, FF = 0, LF = 0.
These shadow prices are break-even prices, and their unit of measure is
$/hour.
The labels E, B, SF, FF and LF will be used to describe the decision vari-
ables in a second linear program. Think of yourself as an outsider who wishes
to rent the ATV facility for one week. Imagine that you face the situation in:
Problem B (renting the ATV facility).╇ The ATV company has agreed to rent
its ATV facility to you for one week according to the following terms:
• You must offer them a price for each unit of capacity of each shop.
• You must set each price high enough that they have no economic mo-
tive to withhold any capacity of any shop from you.
What prices should you set, and how much must you spend to rent the
facility for one week?
The ATV company can earn $50,400 by operating this facility for one
week. You must set your prices high enough that they have no motive to with-
hold any capacity from you. Intuitively, it seems clear that you will need to pay
at least $50,400 to rent their entire capacity. But must you spend more than
$50,400? And what prices should you offer? To answer these questions, we
will build a linear program.
180 Linear Programming and Generalizations
Decision variables
The decision variables in this linear program are the prices that you will
offer. By agreement, you must offer five prices, one per shop. These prices are
labeled:
E╛ ╇ = the price ($/hour) you offer for each unit of Engine shop capacity.
B╛╇ = the price ($/hour) you offer for each unit of Body shop capacity.
SF = the price ($/hour) you offer for each unit of Standard Finishing shop
capacity.
FF â•›= the price ($/hour) you offer for each unit of Fancy Finishing shop
capacity.
LF â•›= the price ($/hour) you offer for each unit of Luxury Finishing shop
capacity.
Let us compute the cost you will incur for renting the entire capacity of
the ATV facility. The Engine shop has a capacity of 120 hours, and you must
pay E dollars for each hour you rent. The cost to you of renting the entire
capacity of the Engine shop is 120E. The cost of renting the entire capacity of
the Body shop capacity is 80B. And so forth. The total cost that you will pay
to rent every unit of every shop’s capacity is given by
You wish to minimize this expression, which is your rental bill, subject to
constraints that keep the ATV company from withholding any capacity from
you.
The ATV company need not make full use of the capacity of any of its
shops. That fact constrains the prices that you can offer. For instance, the
capacity constraint on the Engine shop is the inequality,
3S + 2F + 1L ≤ 120.
Chapter 5: Eric V. Denardo 181
Can you offer a price E that is negative? No. If you did, the ATV company
would not rent you any of the capacity of its Engine shop. Instead, it would
leave those resources idle. You must offer a price E that is nonnegative. The
decision variable E must satisfy the constraint E ≥ 0.
Each shop’s capacity constraint is a “≤” inequality. For this reason, each
of the prices that you offer must be nonnegative. In other words, the decision
variables must satisfy the constraints,
E ≥ 0, B ≥ 0, SF ≥ 0, FF ≥ 0, LF ≥ 0.
Producing vehicles
The ATV facility can be used to manufacture vehicles. Your prices must
be high enough that manufacturing each type of vehicle becomes unprofit-
able. The price of the bundle of resources needed to produce each vehicle
must be at least as large as its contribution.
Let us begin with the Standard model vehicle. Column B of Table 5.2
shows that the company would earn $840 for each Standard model vehicle
that it made, that making this vehicle would require 3 hours in the Engine
shop, 1 hour in the Body shop, and 2 hours in the Standard Finishing shop.
Thus, it becomes unprofitable to make any Standard model vehicles if the
prices you offer satisfy
S: S: 3E + 1B + 2SF ≥ 840.
F: F: 2E + 2B + 3FF ≥ 1120.
In the same way, the data in column D of Table 5.2 shows the Luxury
model vehicle becomes unprofitable if the prices you offer satisfy
L: L: 1E + 3B + 2LF ≥ 1200.
The constraints and objective of a linear program that rents the ATV
manufacturing facility have now been presented. Assembling them produces
182 Linear Programming and Generalizations
Program 3 calculates the prices that minimize the cost of renting the fa-
cility for one week, subject to constraints that make it unprofitable for the
ATV company to withhold any capacity from you, the renter. From Solver, we
could learn that the optimal solution to this linear program is
E = 140, B = 420, SF = 0, FF = 0, LF = 0,
that its optimal value is 50,400 $/wk, and the shadow prices of its three con-
straints are
S = 20, F = 30, L = 0.
Program 1 and Program 3 have the same optimal value, and the shadow
prices of each form an optimal solution to the other!
Duality
•╇The other linear program is feasible and bounded, and both linear
programs have the same optimal value.
A surprise?
Did duality surprise you? If so, you are in very good company. It sur-
prised George B. Dantzig too. In retrospect, it’s eminently reasonable. To see
why, we note that the optimal solution to Program 1 and its shadow prices
have these properties:
• These shadow prices are such that no vehicle’s contribution exceeds its
relative opportunity cost, so they satisfy the “≥” constraints of Program 3.
From Table 5.4, we see that the shadow price on Engine shop capacity is
140 $/hr, with an Allowable Increase of 56 and an Allowable Decrease of 16.
This price applies for capacity levels in the range between 104 hours (because
104â•›=â•›120 – 16) and 176 hours (because 176â•›=â•›120â•›+â•›56).
We can use Solver to find optimal solutions to Program 1 for Engine shop
capacities that are just below 104 and just above 176, find the range and shad-
ow price in each case, and repeat. Figure 5.3 plots the result. This figure shows
that the slope decreases with quantity. This is no accident. A linear program
184 Linear Programming and Generalizations
contribution
$ 60,000
$ 50,000
slope = 0
$ 40,000
slope = 140
$ 30,000
slope = 165
slope = 240
$ 20,000
slope = 560
$ 10,000
slope = 1200 Engine
$0 shop
0 20 40 76 104 176 capacity
The current shadow prices are the most favorable; larger increases will
be less profitable, and larger decreases will be more costly.
The example in Chapter 4 had only two decision variables, so its geom-
etry could be visualized on the plane. The ATV problem has three decision
variables, which are S, F and L, so a geometric view of it requires three-di-
Chapter 5: Eric V. Denardo 185
mensional (or solid) geometry. Solid geometry has been familiar since birth,
even if it is omitted from typical high-school geometry courses.
Cartesian coordinates
F
(0, 34, 0) (12, 34, 0)
(0, 34, 4) (20, 30, 0)
(0, 0, 0) S
The feasible region for the ATV problem is polyhedron that has 10 verti-
ces (extreme points), 15 edges, and 7 faces. One constraint is binding on each
face, two on each edge, and three at each vertex. Two vertices are adjacent if
an edge connects them.
When the simplex method is applied to the ATV example, each pivot
shifts it from a vertex to an adjacent vertex whose objective value is improved.
It stops pivoting after reaching vertex (20, 30, 0).
Higher dimensions
Plane geometry deals with only two variables, solid geometry with three.
Linear programs can easily have dozens of decision variables, or hundreds.
Luckily, results that hold for plane geometry and for solid geometry tend to
remain valid when there are many variables. That is why geometry is relevant
to linear programs.
12. Review
This chapter has shown how to formulate a linear program for solution
by Solver and by Premium Solver for Education. A focal point of this chapter
has been the interpretation of the information accompanies the optimal solu-
tion. We have seen:
• How the shadow prices determine the relative opportunity costs of the
basic and nonbasic variables.
Chapter 5: Eric V. Denardo 187
• How the relative opportunity costs help us to understand why the opti-
mal solution is what it is.
Material in later chapters has been glimpsed. In Chapter 11, shadow pric-
es, relative opportunity cost, and marginal profit will be used in to guide the
“revised” simplex method as it pivots. Chapter 12 is focused on duality and
its uses. In Chapter 14, duality will be used to construct a simple (stylized)
model production and consumption in an economy in general equilibrium.
Nonlinear programs will be studied in Chapter 20, where it is seen that the
natural generalization of decreasing marginal return produces nonlinear pro-
grams that are relatively easy to solve.
1. For the ATV problem, Table 5.4 (on page 161) reports an Allowable De-
crease on the objective coefficient of L of ∞. That is no accident. Why?
2. For the ATV problem, Table 5.4 (on page 161) reports a shadow price of
140 for the Engine shop constraint and an Allowable Decrease of 16 in
this constraint’s right-hand-side value. Thus, renting 4 hours of Engine
shop for one week decreases contribution by $560 because 560â•›=â•›4 × 140.
Without re-running the linear program, show how the optimal solution
changes when the Engine shop capacity is decreased by 4. Hint: The Per-
turbation Theorem reduces this problem to solving two equations in two
unknowns.
188 Linear Programming and Generalizations
3. Eliminate from the ATV problem the Luxury model vehicles. The linear
program that results has only two decision variables, so its feasible region
is a portion of the plane.
(d) Show, graphically, that its optimal solution sets Sâ•›=â•›20 and Fâ•›=â•›30, so
that its optimal value equals 50,400.
(e) Set aside the capacity needed to make one Luxury model vehicle. Re-
solve the linear program graphically. Show that making one Luxury
model vehicle decreases contribution by 200.
4. Suppose, in the ATV problem, that the contribution of the Standard mod-
el vehicle is $900 apiece for the first 12 made per week and $640 apiece for
production above that level.
(a) Revise Program 1 to account for this diseconomy of scale, and solve it.
(b) You can figure out what the optimal solution would be without doing
Part (a). How? Support your answer.
5. Consider a company that can use overtime labor at an hourly wage rate
that is 50% in excess of regular time labor cost. Does this represent an
economy of scale? A diseconomy of scale? Will a profit-maximizing linear
program have an unintended option? If so, what will it be? Will this unin-
tended option be selected by optimization, or will it be ruled out?
(a) The optimal solution would be multiplied by _______, and the opti-
mal value would be multiplied by _______.
Chapter 5: Eric V. Denardo 189
(c) There was nothing special about the factor 0.75 because ________.
8. The sensitivity report seems to omit the shadow prices of the nonnegativ-
ity constraints. True or false:
10. This problem refers to the survey by Paul J. Ferraro and Laura J. Taylor
that is cited in Section 8 of this chapter.
(a) With the economists’ definition of opportunity cost, which of the four
answers is correct?
(c) Suppose you had planned to attend the Dylan concert when someone
offers you a free ticket to the Clapton concert. What can you say of
the relative opportunity cost of seeing the Clapton concert?
190 Linear Programming and Generalizations
11. This problem refers to the Robinson Crusoe example that is discussed in
Section 8. Suppose Crusoe has a third alternative. In addition to spending
the afternoon picking strawberries or strawberries, he could spend it loll-
ing on the beach.
(a) Suppose he would rather loll on the beach than pick strawberries.
Carefully describe:
(b) Suppose he planned to pick raspberries when the sun came out, at
which time it occurred to him that he might enjoy an afternoon on
the beach. Describe the relative opportunity cost of an afternoon on
the beach.
12. Write down linear programs that have each of these properties:
(e) Its feasible region is unbounded, and it has multiple optima, none of
which occur at an extreme point.
14. In Table 5.6, the Allowable Increase and Allowable Decrease for rows 5
and 6 are zero because Program 2 becomes infeasible if the RHS value of
either of the first two constraints is perturbed. These constraints do not
have shadow prices. Table 5.6 reports that row 7 does have a shadow price,
and it reports an Allowable Increase and Allowable Decrease for its RHS
Chapter 5: Eric V. Denardo 191
value. Why does this row have a shadow price? What accounts for the
range on this shadow price?
15. Consider a constraint in a linear program that has no shadow price. Does
this constraint have a multiplier? What can be said about the Allowable
Increase and the Allowable Decrease of that constraint’s RHS value?
16. With the Engine shop capacity fixed at 120 hours per week, use Solver to
compute the optimal value of Program 1 for all values of the Body shop
capacity. Plot the analog of Figure 5.3. Do you observe decreasing mar-
ginal return?
17. With Figure 5.4 in view, have Solver or Premium Solver use the simplex
method to solve Program 1, but use the Options tab to have it show the
results of each iteration. Record the sequence of basic solutions that it fol-
lowed. Did it pivot from extreme point to extreme point? Did each pivot
occur along an edge?
18. (A farmer) A 1,200 acre farm includes a well that has a capacity of 2,000
acre-feet of water per year. (One acre-foot is one acre covered to a depth
of one foot.) This farm can be used to raise wheat, alfalfa, and beef. Wheat
can be sold at $550 a ton and beef at $1,300 a ton. Alfalfa can be bought or
sold at the market price of $220 per ton. Each ton of wheat that the farmer
produces requires one acre of land, $50 of labor, and 1.5 acre-feet of water.
Each ton of alfalfa that she produces requires 1/3 acre of land, $40 of labor
and 0.6 acre-feet of water. Each ton of beef she produces requires 0.8 acres
of land, $50 of labor, 2 acre-feet of water, and 2.5 tons of alfalfa. She can
neither buy nor sell water. She wishes to operate her farm in a way that
maximizes its annual profit. Below are the data in a spreadsheet formula-
tion, the solution that Solver has found, and a Sensitivity Report.
192 Linear Programming and Generalizations
(a) Write down the linear program. Define each variable. Give each vari-
able’s unit of measure. Explain the objective function and each con-
straint. Explain why the constraint AS ≥ 0 is absent. What is the unit
of measure of the objective? What is the unit of measure of each con-
straint?
(b) State the optimal solution in a way that can executed when the data
are inexact.
(d) What would have to happen to the price of wheat in order for her to
change her production mix?
(e) What would have to happen to the price of alfalfa for her to change
her production mix?
Note: Parts (f) through (i) refer to the original problem and are inde-
pendent of each other.
(f) The government has offered to let her deposit some acreage in the
“land bank.” She would be paid to produce nothing on those acres. Is
she interested? Why?
(g) The farmer is considering soybeans as a new crop. The market price
for soybeans is $800 per ton. Each ton of soybeans requires 2 acres of
land, 1.8 acre feet of water and $60 of labor. Without re-running the
Chapter 5: Eric V. Denardo 193
(h) A neighbor has a 400 acre farm with a well whose capacity is 500
acre-feet per year. The neighbor wants to retire to the city and to rent
his entire farm for $120,000 per year. Should she rent it? If so, what
should she do with it?
(b) Solve this linear program on a spreadsheet. Describe its optimal solu-
tion in a way that can be implemented when its data are inexact.
(c) What is the value to the company of the EPA’s relaxing the constraint
on particulate emission by one ounce per week? What is the value to
the company of the EPA’s relaxing the constraint on Chemical emis-
sions by one ounce per week?
(d) (an emissions trade-off) By how much should the company be willing
to reduce its weekly emission of chemicals if the EPA would allow it
to emit one additional ounce of particulates each week?
194 Linear Programming and Generalizations
(e) (an emissions tax) The EPA is considering the control of emissions
through taxation. Suppose that the government imposes weekly tax
rates of P dollars per ounce of particulate emissions and C dollars per
ounce of chemical emission. Find tax rates, P and C, that keep the
company’s pollutants at or below the current levels and minimize the
company’s tax bill. Hint: With the constraints on emissions deleted,
the feasible region becomes a triangle, so the tax rates must be suffi-
ciently large to make the extreme point(s) that cause excess pollution
to become undesirable.
(f) By how much does the taxation scheme in part (e) reduce profit?
Chapter 6: The Simplex Method, Part 2
1. Preview
• That the simplex method can “cycle” (fail to terminate finitely) and that
it can be kept from doing so.
• That the simplex method readily accommodates variables that are not
required to be nonnegative.
Also discussed here is the speed of the simplex method. Decades after
its discovery and in spite of the best efforts of scores of brilliant researchers,
the simplex method remains the method of choice for solving large linear
programs.
2. Phase I
(1.3) â•›– 2p – 3q ≤ 0,
(1.4) ╛╛ p ≥ 0, q ≥ 0, r ≥ 0.
Step 1 of Phase I
The 1st step of Phase I is to cast the linear program in Form 1, preserving
its sense of optimization. Executing this step on Problem A rewrites it as
Chapter 6: Eric V. Denardo 197
Step 2
Rows 2-6 of Table 6.1 mirror system (2). Rows 4 and 5 lack basic vari-
ables. A choice exists as to the elements on which to pivot. Table 6.1 exhibits
the result of pivoting on the coefficient of s1 in row 4 and then on the coef-
ficient of p in row 11. These pivots produce the basic tableau in rows 14-18.
This tableau’s basic solution sets pâ•›=â•›–10 and s3â•›=â•›–20. If this solution were
feasible, Phase I would be complete. It is not feasible, so Phase I continues.
Step 3
The 3rd step is to insert on the left-hand side of the equation system an
artificial variable α with a coefficient of –1 in each equation whose RHS
value has the wrong sign and with a coefficient of 0 in each of the remaining
equations. Displayed in rows 20-24 of Table 6.2 is the result of executing Step
3 on Program 1.
198 Linear Programming and Generalizations
In system (3), setting qâ•›=â•›0, râ•›=â•›0 and αâ•›≥â•›20 equates the variables s1, p and
s3 to nonnegative values. Moreover, a pivot on the coefficient of α in the equa-
tion for which s3 is basic will remove s3 from the basis and will produce a basic
solution in which αâ•›=â•›20. This motivates the next step.
Step 4
Step 4 is to select equation whose RHS value is most negative and pivot
upon the coefficient of α in that equation. When applied to the tableau in
rows 20-24 of Table 6.2, this pivot occurs on the coefficient of α in row 24.
This pivot produces the basic tableau in rows 26-30. That tableau’s basic solu-
tion sets s1â•›=â•›4, pâ•›=â•›10 and αâ•›=â•›20, exactly as predicted from system (3)
Step 5
What remains is to drive α down toward zero, while keeping the basic
variables (other than –z) nonnegative. This will be accomplished by a slight
adaptation of the simplex method. To see how to pivot, we write the equations
represented by rows 26-30 in dictionary format, as:
The goal is to decrease the value of α, which is the basic variable for equa-
tion (4.3). The nonbasic variables q and r have negative coefficients in equa-
tion (4.3), so setting either of them positive decreases α.
In a Phase I simplex pivot for Form 1, the entering variable and pivot
element are found as follows:
•╇The entering variable can be any nonbasic variable that has a posi-
tive coefficient in the row for which α is basic.
•╇The pivot row is selected by the usual ratios, which keep the basic
solution feasible and keep –z basic.
•╇But if the row for which α is basic ties for the smallest ratio, pivot
on that row.
To reduce the ambiguity in this pivot rule, let’s select as the entering vari-
able a nonbasic variable that has the most positive coefficient in the row for
which α is basic. Table 6.3 displays the Phase I simplex pivots that result.
Rows 26-30 of Table 6.3 indicate that for the first of these pivots, q is the
entering variable (its coefficient in row 30 is most positive), and row 29 has
the smallest ratio, so q enters the basis and p departs. Rows 35-38 result from
that pivot.
Rows 34-38 of Table 6.3 indicate that for the second pivot, r is the enter-
ing variable (its coefficient in row 38 is most positive), and α is the departing
variable because the row for which α is basic ties for the smallest ratio.
Rows 40-44 display the basic tableau that results from that pivot. The
variable α has become nonbasic. The numbers in cells H42-H44 are non-
Chapter 6: Eric V. Denardo 201
negative, so this tableau’s basic solution equates the basic variables q, r and
s1 to nonnegative values. Deleting α and its column of coefficients deleted
produces a basic feasible tableau for Program 1.
Step 6 of Phase I
The 6th and final step is to delete α and its column of coefficients. This
step produces a basic feasible tableau with which to begin Phase II. Applying
this step to rows 40-44 of Table 6.3 casts Program 1 as the linear program:
No entering variable?
One possibility has not yet been accounted for. Phase I pivots can result
in a basic tableau whose basic solution sets αâ•›>â•›0 but in which no nonbasic
variable has a positive coefficient in the row for which α is basic. If this oc-
curs, no entering variable for a Phase I simplex pivot can be selected. What
then?
The basic solution to this equation system has αâ•›=â•›4.615, and the variables
p, r and s3 are constrained to be nonnegative, so equation (6) demonstrates
that no feasible solution can have α < 4.615. The artificial variable α cannot be
reduced below 4.615, so the linear program is infeasible.
Recap – infeasible LP
Recap – feasible LP
Now consider a linear program that is feasible. Neither of the above con-
ditions can occur. If Gauss-Jordan elimination (Step 2) produces a feasible
basis, Phase II is initiated immediately. If not, an artificial variable α is in-
serted, and a pivot produces a basic solution that is feasible, except that it
Chapter 6: Eric V. Denardo 203
Commentary
Let’s suppose that certain variables are likely to be part of an optimal ba-
sis. Phase I can be organized for a fast start by pivoting into the initial basis
as many as possible of these variables.
3. Cycling
Does the simplex method terminate after finitely many pivots? The an-
swer is a qualified “yes.” If no care is taken in the choice of the entering vari-
able and the pivot row, the simplex method can keep on pivoting forever.
If care is taken, the simplex method is guaranteed to be finite. This section
describes the difficulty that can arise and shows how to avoid it.
The difficulty
• Each nondegenerate simplex pivot changes the basis, changes the basic
solution, and improves its objective value.
• Each degenerate pivot changes the basis, but does not change any RHS
values, hence causes no change in the basic solution or in the basic so-
lution’s objective value.
previously. Also, since there are finitely many bases, so only finitely many
nondegenerate simplex pivots can occur prior to termination.
Whether or not the simplex method cycles depends on how the ambigui-
ty in its pivot rule is resolved. The entering variable can be any variable whose
reduced cost is positive in a maximization problem, negative in a minimiza-
tion problem. The pivot row can be any row whose ratio is smallest.
Rule A
• The pivot row has the lowest ratio. Ties, if any, are broken by picking
the row whose basic variable is listed farthest to the left.
A cycle
Rule A can cycle. In fact, when Rule A is applied to the linear program
in Table 6.4, it does cycle. After six degenerate pivots, the tableau in rows 3-6
reappears.
An anti-cycling rule
Abraham Charnes was the first to publish a rule that precludes cycling.
The key to his paper, published in 19521, was to pivot as though the RHS
values were perturbed in a way that breaks ties. Starting with a basic feasible
tableau (either in Phase I or in Phase II), imagine that the RHS value of the
1st non-trite constraint is increased by a very small positive number ε, that
the RHS value of the 2nd non-trite constraint is increased by ε 2 , and so forth.
Standard results in linear algebra make it possible to demonstrate that, for
all sufficiently small positive values of ε, there can be no tie for the smallest
ratio. Consequently, each basic feasible solution to the perturbed problem
equates each basic variable (with the possible exception of –z) to a positive
value. In the perturbed problem, each simplex pivot is nondegenerate. This
guarantees that the simplex method cannot cycle. Termination must occur
after finitely many pivots.
The perturbation argument that Charnes pioneered has had a great many
uses in optimization theory. From a computational viewpoint, perturbation is
unwieldy, however. Integrating it into a well-designed computer code for the
simplex method requires extra computation that slows down the algorithm.
A simple cycle-breaker
• The pivot row has the smallest ratio. Ties are broken by picking the row
whose basic variable is listed farthest to the left.
Rule B is often called Bland’s rule, in his honor. Proving that Bland’s rule
precludes cycles is a bit involved. By contrast, incorporating it in an efficient
computer code is easy, and it adds only slightly to the computational burden.
Bland’s rule can be invoked after encountering a large number of consecutive
degenerate pivots.
Initially, it was not clear whether the simplex method could cycle if no
special care was taken to break ties for the entering variable and the pivot row.
George Dantzig asked Alan Hoffman to figure this out. In 1951, Hoffman
found an example in which Rule A cycles. The data in Hoffman’s example
entail the elementary trigonometric functions (sin ϕ, cos2 ϕφ and so forth). In
Hoffman’s memoirs3, he reports:
2╇
Robert G. Bland, “New finite pivot rules for the simplex method, Mathematics of
Operations Research, V. 2, pp. 103-107, 1977.
3╇
Page 171 of Selected Papers of Alan Hoffman with Commentary, edited by Charles
Micchelli, World Scientific, Rver Edge, NJ.
Chapter 6: Eric V. Denardo 207
Charnes was the first to publish an anti-cycling rule, but he may not have
been the first to devise one. In his 1963 text, George Dantzig4 wrote,
“Long before Hoffman discovered his example, simple devices were pro-
posed to avoid degeneracy. The main problem was to devise a way to avoid
degeneracy with as little extra work as possible. The first proposal along
these lines was presented by the author in the fall of 1950 …. Later, A. Or-
den, P. Wolfe and the author published (in 1954) a proof of this method
based on the concept of lexicographic ordering ….”
Perturbation and lexicographic ordering are two sides of the same coin;
they lead to the same computational procedure, and it is a bit unwieldy.
Form 2
In Problem B, the decision variables d, e and f are free; they can take any
values.
Getting started
The tableau in rows 12-20 of Table 6.5 results from pivoting on the coef-
ficients of d, e and f in rows 4, 5 and 6, respectively. This tableau is basic. Its
basic solution is feasible because d, e and f are allowed to take any values.
Chapter 6: Eric V. Denardo 209
Once a free variable becomes basic, the RHS value of the equation for
which it is basic can have any value, positive, negative or zero. To keep a
free variable basic, compute no ratio for the row for which it is basic. To
keep d, e and f basic for the equations represented by rows 14, 15 and 16 of
Table 6.5, we’ve placed “none” in cells N14, N15 and N16. In this example
and in general:
After a free variable becomes basic, compute no ratio for the equation
for which it is basic. This keeps the free variable basic, allowing it to
have any sign in the basic solution that results from each simplex pivot.
Rows 13-20 of Table 6.5 are a basic feasible tableau with which to initiate
Phase II, and its first pivot occurs on the coefficient of c in row 18. Pivoting con-
tinues until the optimality condition or the unboundedness condition occurs.
Problem B fails to illustrate one situation that can arise: In a basic feasible
tableau for a linear program that has been written in Form 2, a free vari-
210 Linear Programming and Generalizations
• In either case, compute no ratio for any row whose basic variable is free.
Needless work
5. Speed
Typical behavior
The best codes of the simplex method quickly solve practical linear pro-
grams having m and n in the thousands or tens of thousands. No one re-
ally understands why the simplex method is as fast as it is. On carefully-con-
Chapter 6: Eric V. Denardo 211
structed examples (one of which appears as Problem 5), the simplex method
is exceedingly slow. Any attempt to argue that the simplex method is fast “on
average” must randomize in a way that bad examples occur with miniscule
probability.
moreover, that the quality of the fit is quite good. Expression (7) is strikingly
close to (mâ•›+â•›n)/2.
Atypical behavior
The simplex method does not solve all problems quickly. In their 1972 pa-
per, Klee and Minty7 showed how to construct examples having m equations
and 2 m decision variables for which Rule A requires 2mâ•›–â•›1 pivots. (Problem
5 presents their example for the case mâ•›=â•›3.) Even at the (blazing) speed of one
million pivots per second, it would take roughly as long as the universe has
existed for Rule A to solve a Klee-Minty example with mâ•›=â•›100.
A conundrum
5╇
Vanderbei, Robert J., Linear Programming: Foundations and Extensions, Kluwer
Academic Publishers, Boston, Mass., 1997.
6╇
Gay, D. “Electronic mail distribution of linear programming test problems,” Math-
ematical Programming Society COAL Newsletter, V. 13, pp 10-12, 1985.
7╇
V. Klee and G. J. Minty, “How good is the simplex algorithm?” In O. Shisha, editor,
Inequalities III, pp. 159-175, Academic Press, New York, NY, 1972.
212 Linear Programming and Generalizations
Spielman and Shang-Huia Tang that has won both the Gödel and the Fulker-
son prize8.
Interior-point methods
8╇
Spielman, D and S.-H. Teng, “Smoothed analysis of algorithms: Why the simplex
method usually takes polynomial time,” Journal of the ACM, V. 51, pp. 385-463
(2004).
9╇
L. G. Kachian, “A polynomial algorithm in linear programming,” Soviet Mathemat-
ics Doklady, V. 20, pp 191-194 (1979).
10╇
N. Karmarkar, “A new polynomial-time algorithm for linear programming,” Pro-
ceedings of the 16th annual symposium on Theory of Computing, ACM New York,
pp 302-311 (1979).
Chapter 6: Eric V. Denardo 213
AT&T weighs in
A business unit
11╇
Fiacco, A. V. and G. McCormick, Nonlinear programming: sequential unconstrained
minimization techniques,” John Wiley & Sons, New York, 1968, reprinted as Classics
in applied mathematics volume 4, SIAM, Philadelphia, Pa., 1990.
12╇
Dikin, I. I.. “Iterative solution of problems of linear and quadratic programming,”
Soviet Math. Doklady, V. 8, pp. 674-675, 1967.
214 Linear Programming and Generalizations
Seminal work
What’s best?
For extremely large linear programs, the best of the interior-point method
might run a bit faster than the simplex method. The simplex method enjoys
an important advantage, nonetheless. In Chapter 13, we will see how to solve
an integer program by solving a sequence of linear programs. The simplex
13╇
Renegar, J., “A polynomial-time algorithm, based on Newton’s method for linear
programming,” Mathematical Programming, V. 40, pp 59-93, 1988
√
14╇
Ye, Yinyu, Michael J. Todd and Shinji Mizuno, “On O( n L) iteration homogeneous
and self-dual linear programming algorithm,” Mathematics of Operations Research,
V. 19, pp. 53-67, 1994.
Chapter 6: Eric V. Denardo 215
method is far better suited to this purpose because it finds an optimal solu-
tion that is an extreme point; interior-point methods find an extreme point
only if the optimum solution is unique.
6. Review
The simplex method can cycle, and cycles can be avoided. Bland’s method
for avoiding cycles is especially easy to implement. Even so, the perturbation
method of Charnes (equivalently, the lexicographic method of Dantzig) has
proved to be a useful analytic tool in a number of settings.
Decision variables that are not constrained in sign are easy to accommo-
date within the simplex method. Once a free variable is made basic, it is kept
basic by computing no ratio for the equation for which it is basic.
Modern interior-point methods may run a bit faster than the simplex
method on enormous problems, but the simplex method remains the method
of choice, especially when integer-valued solutions are sought.
1. (Phase I) In Step 2 of Phase I, would any harm be done by giving the arti-
ficial variable α a coefficient of –1 in every equation other than the one for
which –z is basic?
216 Linear Programming and Generalizations
2. (Phase I) For the tableau in rows 35-39 of Table 6.3, rows 37 and 38 tie for
the smallest ratio. Execute a pivot on the coefficient of r in row 37. Does
this result in a basis that includes α and whose basic solution sets αâ•›=â•›0? If
so, indicate how to remove α from the basis and construct a basic feasible
tableau with which to initiate Phase II.
4. (Phases I and II) Consider this linear program: Maximize {2xâ•›+â•›6y}, subject
to the constraints
╇╛╛╛2x – 5y ≤ –3,
╇╛╛4x – 2y + 2z ≤ –2,
╅╇ 1x + 2y â•›≤ 4,
x ≥ 0, y ≥ 0, z ≥ 0.
(a) For this example, execute the simplex method with Rule A. (You will
need seven pivots.)
(b) For each extreme point encountered in part (a), record the triplet (x1,
x2, x3,).
Chapter 6: Eric V. Denardo 217
(c) Plot the triplets you recorded in part (b). Identify the region of which
they are the extreme points. Does it resemble a deformation of the unit
cube? Could you have gotten from the initial extreme point to the final
extreme point with a one simplex pivot?
(d) What do you suppose the comparable example is for the case mâ•›=â•›2?
Have you solved it?
(e) Write down but do not solve the comparable example for mâ•›=â•›4.
8. In Rule B, ties are broken by picking the variable that is farthest to the left.
Would it work equally well to pick the variable that is farthest to the right?
9. The idea that motivates Charnes’s perturbation scheme is to resolve the am-
biguity in the variable that will leave the basis by perturbing the RHS values
by miniscule amounts, but in a nonlinear way. The tableau that appears be-
low reproduces rows 2-6 of Table 6.4, with the dashed line representing the
“=” signs and with the quantity ε j added to the jth constraint, for jâ•›=â•›1, 2, 3.
(a) Execute Charnes’s pivot rule (for maximization) on this tableau, se-
lecting the nonbasic variable whose reduced cost is most positive as
the entering variable.
(b) Identify the first pivot at which Charnes’s rule selects a different pivot
element than does Rule A.
(c) Complete and justify the sentence: If a tie were to occur for the smallest
ratio when Charnes’s pivot rule is used, two rows would need to have
coefficients of ε 1 , ε 2 , and ε 3 that are _________, and that cannot oc-
cur because elementary row operations keep ______ rows ______.
218 Linear Programming and Generalizations
10. Cycling can occur in Phase I. Cycling in Phase I can be precluded by Rule
B or by Charnes’s perturbation scheme. At what of the six steps of Phase
I would Charnes perturb the RHS values? Which RHS values would he
perturb?
11. Consider a linear program that is written in Form 1 and is feasible and
bounded. By citing (but not re-proving) results in this chapter, demon-
strate that this linear program has a basic feasible solution that is optimal.
12. (free variables) This problem concerns the maximization problem that is
described by rows 12-20 of Table 6.5, in which d, e and f are free.
(a) On a spreadsheet, execute the simplex method with Rule A, but com-
puting no ratios for the rows whose basic variables are free.
(b) Did any of the free variables switch sign? If so, what would have oc-
curred if this problem had been forced into Form 1 prior to using
Rule A? Remark: Part (b) requires no computation.
13. (free variables) The tactic by which free variables are handled in Section 4
of this chapter is to make them basic and keep them basic. Here’s an alter-
native:
(i) After making a free variable basic, set aside this variable, and set aside
the equation for which it just became basic. (This reduces by one the
number of rows and the number of columns.)
(ii) At the end, determine the values taken by the free variables from the
values found for the other variables.
Does this work? If it does work, why does it work? And how would you
determine the “values taken by the free variables.”
14. (extreme points and free variables) A feasible solution to a linear program
is an extreme point of the feasible region if that feasible solution is not
a convex combination of two other feasible solutions. Consider a linear
program that is written in Form 2. Suppose this linear program is feasible
and bounded. Is it possible that no extreme point is an optimal solution?
Hint: can a feasible region have no extreme points?
Part III–Selected Applications
This chapter is built upon 10 examples. When taken together, these ex-
amples suggest the range of uses of linear programs and their generalizations.
These examples include linear programs, integer programs, and nonlinear
programs. They illustrate the role of optimization in operations management
and in economic analysis. Uncertainty plays a key role in several of them.
Also discussed in this chapter are the ways in which Solver and Premium
Solver can be used to solve problems that are not linear.
Described in this chapter are “network flow” models and the uses to
which they can be put. If the “fixed” flows such a model are integer-valued,
the simplex method is shown to find an integer-valued optimal solution.
Chapter 7: A Survey of Optimization Problems
1. Preview
Three sections of this chapter are starred. The starred sections delve into
probabilistic modeling. These starred sections present all of the “elementary”
probability that they employ, but readers who are new to that subject may find
those sections to be challenging.
A tailored spreadsheet
A linear program
The functions in cells E18 and F18 compute the shipping and pro-
duction costs. Solver has been asked to minimize the quantity in cell G18,
which is the total cost. Its changing cells are the shipping quantities in cells
D12:G14. Its constraints are H12:H14 ≤ H5:H7 (production quantities cannot
exceed production capacities), D15:H15 = D9:H9 (demands must be met)
and D12:G14 ≥ 0 (shipping quantities must be nonnegative). Table 7.1 reports
the optimal solution to this linear program.
A coincidence?
Figure 7.1 has 7 nodes, one for each field and one for each refinery. The
node for field U accounts for the production in that field and for its shipment
to the four refineries. The node for refinery 1 accounts for the demand at its
refinery and the ways in which this demand can be satisfied. The flow into
node U cannot exceed 250, which is the capacity of field 1, and the flow out of
node 1 must equal 200, which is the demand at refinery 1.
Chapter 7: Eric V. Denardo 225
= 200
1
≤ 250
U
= 300
2
≤ 400
V
= 250
3
≤ 350
W
= 150
4
Problem 7.B. (Olde England).╇ In an early era, developing nations shifted their
economies from agriculture toward manufacturing. Old England had three
principal technologies, which were the production of food, yarn and clothes.
It traded the inputs and outputs of these technologies with other countries.
In particular, it exported the excess (if any) of yarn production over internal
demand.
The Premier asked you to determine the production mix that would
maximize the net value of exports for the coming year. Your first step was
to accumulate the “net output” data that appear in cells B4:D10 of Table 7.2.
Columns B records the net output for food production; evidently, producing
each unit of food requires that Olde England import £0.50 worth of goods
(e.g., fertilizer), consume 0.2 units of food (e.g., fodder to feed to animals),
consume 0.5 units of labor, and use 0.9 units of land. Column C records the
net outputs for yarn production; producing each unit of yarn requires that
Olde England import £1.25 worth of goods, consume 1 unit of labor, and use
1.5 units of land. Column D records the net outputs for clothes production;
producing each unit of clothes requires the nation to import £5.00 worth of
goods, consume 1 unit of yarn, and consume 4 units of labor.
Cells J5:J7 record the levels of internal consumption of food, yarn and
clothes, respectively; in the coming year, Olde England will consume 11.5
Chapter 7: Eric V. Denardo 227
million units of food, 0.6 million units of yarn and 1.2 million units of clothes.
Cells J9:J12 record the nation’s capacities, which are 65 million units of labor
and 27 million units of land, as well as the capability to produce yarn at the
rate of 10.2 million units per year and clothes at the rate of 11 million units
per year.
Row 4 records the world market prices of £3 per unit for food, £10 per
unit for yarn and £16 per unit for clothes. The amounts that Olde England
imports or exports will have negligible effect on these prices.
Decision variables
This activity analysis has two types of decision variables. The symbols FP,
YP and CP stand for the quantity of food, yarn and clothes to produce in the
coming year. The symbols FE, YE and CE stand for the net exports of food,
yarn and clothes during the coming year. The unit of measure of each of these
quantities is millions of units per year. The production quantities FP, YP and
CP must be nonnegative, of course. The net export quantities FE, YE and CE
can have any sign; setting FEâ•›=â•›−1.5 accounts for importing 1.5 million units
of food next year, for instance.
A linear program
The linear program whose data appear in Table 7.2 maximizes the net
value of exports. Column H contains the usual sumproduct functions. Cell
H4 measures the contribution (value of net exports). Rows 5-7 account for
the uses of food, yarn and clothes. Rows 9-10 account for the uses of land and
228 Linear Programming and Generalizations
labor. Rows 11 accounts for the loom capacity, and row 12 accounts for the
clothes-making capacity.
Evidently, the net trade balance is maximized by making full use of the
land, full use of the capacity to weave yarn, and full use of the capacity to pro-
duce clothes. Clothes are exported. The nation produces most, but not all, of
the food and yarn it requires.
Activity analyses like this one make it easy to respond to a variety of “what
if ” questions. Here are a few: What would occur if Olde England decided that
it ought to be self-sufficient as concerns food? Would it pay to increase the
capacity to produce yarn? What would occur if the market price of clothes
decreased by 20%?
The phrase “activity analysis” was first used by Tjalling Koopmans; its ini-
tial appearance is in the title1 of the proceedings of a famous conference that
he organized shortly after George Dantzig developed the simplex method.
Well before that time (indeed, well before any digital computers existed) Was-
sily Leontief (1905-1999) built large input-output models of the American
economy and used them to answer “what if ” questions. Leontief received the
Nobel Prize in 1973 “for the development of the input-output method and for
its application to important economic problems.” As Leontief had observed,
an activity analysis is the natural way in which to describe the production
side of a model of an economy that is in general equilibrium. One such model
appears in Chapter 14.
The functions in row 8 of this table compute the mean (expected) rate of
return on each asset; these are 5%, 3%, and 4%, respectively.
A portfolio
The function in cell G11 computes the expectation E(R) of the return on
this portfolio. The functions in cells H4 through H6 compute the difference
Râ•›−â•›E(R) between the return R and its expectation if states a, b and c occur.
The function in cell H11 computes Var(R) because the variance equals the
expectation of the squared difference between the outcome and the mean.
Efficiency
Problem 7.C, part (a). ╇ For the data in Table 7.3, find the minimum-variance
portfolio whose expected rate return rate is at least 3%.
It is not difficult to show (we omit this) that Var(R) is a convex quadratic
function of the fractions invested in the various assets. For that reason, mini-
Chapter 7: Eric V. Denardo 231
mizing Var(R) subject to a constraint that keeps E(R) from falling below a
prescribed bound is a garden-variety (easily solved) nonlinear program.
The GRG nonlinear code has been used to minimize the variance in the
return (cell H9) with the fractions invested in the three assets (cells D9:F9) as
the changing cells, subject to constraints that keep the fractions nonnegative,
keep their total equal to 1, and keep the mean return (cell G9) at least as large
as the number in cell C9. This portfolio invests roughly 47% in asset 2 and
roughly 53% in asset 3. It achieves a mean return rate of 3.53%. The standard
deviation in its rate of return is roughly 0.005. Evidently, if an investor seeks
a higher mean rate of return than 3.53%, she or he must accept more risk (a
higher variance, equivalently, a higher standard deviation).
The set of all pairs [E(R), Var(R)] for efficient portfolios is called the
efficient frontier. If a rational decision maker accepts E(R) as the measure of
desirability and Var(R) as the measure of risk, that person chooses a portfolio
on the efficient frontier. If a portfolio is not on the efficient frontier, some
other portfolio is preferable.
Problem 7.C, part (b). ╇ For the data in Table 7.3, find the portfolios that are
on the efficient frontier.
232 Linear Programming and Generalizations
No asset returns more than 5%, so placing a value greater than 0.05 in
cell C9 guarantees infeasibility. To find a family of portfolios that are on the
efficient frontier, one can repeat the calculation whose result is exhibited in
Table 7.5 with the number in cell C9 equal to a variety of values between 0.03
and 0.05. There is a technical difficulty, however.
Suppose we solve the NLP with 0.034 in cell C9, then change that num-
ber to 0.038, and then solve again. The new solution replaces the only one.
This difficulty has been anticipated. Row 9 contains all of the information we
might want to keep from a particular run. Before making the 2nd run, “Copy”
row 9 onto the Clipboard and then use the Paste Special command to put only
its “Values” in row 14. After changing the entry in cell C9 and re-optimizing,
use the Paste Special command to put the new “Values” in row 15. And so
forth. Reported in Table 7.6 is the result of a calculation done with values of
C9 between 0.03 and 0.05 in increments of 0.004.
Piecewise linearity
These portfolios exhibit piecewise linearity. As the mean rate of return in-
creases from 3.53% to 4.34%, the portfolio varies linearly. When the mean rate
of return reaches 4.34%, the fraction invested in asset 3 decreases to 0. As the
rate of return increases from 4.34% to 5%, the portfolio again varies linearly,
with f3 = 0 in this interval. Evidently, as the mean return rate increases, the
optimal portfolio “pivots” from one extreme point to another. This is the sort
of behavior that one expects in the optimal solution to a linear program. One is
led to wonder whether this nonlinear program is mimicking a linear program.
Chapter 7: Eric V. Denardo 233
Suppose you wish to solve the portfolio optimization with cell C9 (the
lower bound on the mean return) equal to the 11 equally-spaced values 0.03,
0.032, 0.034, …, 0.05. To do so, follow this protocol:
234 Linear Programming and Generalizations
• Next, return to the Model tab on the dialog box to the right of Fig-
ure 7.2 Then click on the row containing the variables, cells D9:F9 in
this case. Make sure that the Monitor Value of these cells is set equal to
True. (If it is set equal to False, switch it.)
• Finally, either click on the green triangle to the right of the dialog
box that is displayed to the right of Figure 7.2 or click on Optimize
in the drop-down menu to the left of Figure 7.2 Either action causes
Premium Solver to solve the 11 optimization problems that you have
specified.
You can then scroll through the solutions to these optimization problems
by clicking on the window in a ribbon that currently reads “Opt. 11.” You can
also create a chart by clicking Charts on the drop-down menu.
The ribbon
Measures of risk
These two measures of risk share a defect; Var(R) and MAD(R) place
large penalties on outcomes that are far better than the mean. It might make
still better sense to minimize the expectation of the amount by which the
mean exceeds the outcome, i.e., to accept E[(µ − R)+ ] as the measure of risk.
The ideas and results in this section were developed by Harry Markow-
itz while he was a Ph. D. student at the University of Chicago. He published a
landmark paper in 1952, and he shared in the 1990 Nobel Prize in Economics,
which was awarded for “pioneering work in the theory of financial economics.”
Problem 7.D.╇ This problem appends to the ATV problem in Chapter 5 the
possibility of leasing tools that improve efficiency and thereby lower manu-
facturing costs. Tools α and β facilitate more efficient manufacture of Fancy
and Luxury model vehicles, respectively. Leasing tool α costs $1,800 per week,
and this tool reduces the cost of manufacturing each Fancy model vehicle by
$120. Similarly, leasing tool β costs $3,000 per week, and that tool reduces the
cost of producing each Luxury model vehicle by $300. The goal remains un-
changed; it is to operate the ATV plant in a way that maximizes contribution.
What production rates accomplish this?
Binary variables
An integer program
Throughout this text – and throughout much of the literature – the term
integer program is used to describe an optimization problem that would be a
linear program if requirement that some or all of its decision variables be in-
teger-valued were deleted. An integer program can have no quadratic terms,
for instance. It might be more precise to describe this type of optimization
problem as an “integer linear program,” but that usage never took root. Two
different methods for solving integer programs are discussed in Chapter 14.
Both of these methods solve a sequence – often surprisingly short – of linear
programs.
Break-even values
Binary variables will be used to model the leasing of these tools. Equating
the binary variable a to 1 corresponds to leasing tool α. Equating the binary
variable b to 1 corresponds to leasing tool β. Our goal is to formulate Problem
7.D as an optimization problem that differs from a linear program only in that
the variables a and b are binary.
The binary variable b accounts in a similar way for leasing the tool that
reduces the cost of producing Luxury model vehicles.
A spreadsheet
After you formulate your integer program, but before you click on the
Solver button:
No shadow prices?
First, consider the case in which all of the decision variables must be
integer-valued. In this case, shadow prices cannot exist because perturbing
a RHS value by a small amount causes the optimization problem to become
infeasible.
Next, consider the case in which only some of the decision variables must
be integer-valued. In this case, perturbing a RHS value may preserve feasibil-
ity, but it may cause an abrupt change in the objective value. When that oc-
curs, the shadow price cannot exist.
Problem 7.D illustrates this phenomenon. It is not hard to show that the
feasible solution Sâ•›=â•›35, Fâ•›=â•›0 and Lâ•›=â•›15 is a local maximum. Perturbing this
solution by setting Lâ•›=â•›1 decreases the objective value by $50, for instance. If
the GRG code encounters this feasible solution, it will stop; it has found a lo-
cal maximum that is not a global maximum.
The data in the “traveling salesperson problem” are the number of cities
that the salesperson is to visit and the travel times from city to city. A tour oc-
curs if the salesperson starts at one of these cities and visits each of the other
cities exactly once prior to returning to the city at which he or she began. The
length of the tour is the sum of the times it takes to travel from each city to
the next. The traveling salesperson problem is that of finding a tour whose
length is smallest. The traveling salesperson problem may sound a bit con-
trived, but it arises in a variety of contexts, including
Problem 7.E (scheduling jobs).╇ Five different jobs must be done on a sin-
gle machine. The needed to perform each job is independent of the job that
preceded it, but the time needed to reset the machine to perform each job
does vary with the job that preceded it. Rows 3 to 9 of Table 7.8 specifies the
times needed to reset the machine to accomplish each of the five jobs. “Job 0”
marks the start, and “job 6” marks the finish. Each reset time is given in min-
utes. This table shows, for instance, that doing job 1 first entails a 3-minute
setup and that doing job 4 immediately after job 1 entails a 17-minute reset
time. Reset times of 100 minutes represent job sequences that are not allowed.
The goal is to perform all five jobs in the shortest possible time, equivalently,
to minimize the sum of the times needed to set up the machine to perform
the five jobs.
Chapter 7: Eric V. Denardo 241
This subsection describes a solution method that uses the Standard Evo-
lutionary Solver, which exists only in Premium Solver. If you do not have ac-
cess to Premium Solver, please skip to the next subsection.
242 Linear Programming and Generalizations
The traveling salesperson problem has been widely studied, and sever-
al different methods of solution have been found to work well even when
the number n of cities is fairly large. One of these methods is based on the
“assignment problem.” A network flow model is called an assignment prob-
lem if it has 2 m nodes and m2 directed arcs with these properties:
• The network has m “supply” nodes, with a fixed flow of 1 into each sup-
ply node.
• The network has m “demand” nodes, with a fixed flow of 1 out of each
demand node.
• It has a directed arc pointing from each supply node to each demand
node. The flows on these arcs are nonnegative.
• Each cell in the array D12:I17 contains the shipping quantity from the
“supply node” in its row to the “demand node” in its column.
Solver had been asked to find the least-cost assignment. This assignment
ships one unit out of each supply node and one unit into each demand node.
The solution to this assignment problem is not reported in Table 7.9. With x(i, j)
as the flow from source node i to demand node j, the least-cost assignment
sets
Subtours
This optimal solution identifies the job sequences 0-2-1-4-6 and 3-5-3.
Neither of these is a tour. These job sequences correspond to subtours because
neither of them includes all of the jobs (cities in case of a traveling salesperson
problem).
An optimal solution
We could have imposed the constraint that eliminates the other subtour.
That constraint is x(0, 2)â•›+â•›x(2, 1)â•›+â•›x(1, 4)â•›+â•›x(4, 6)â•›≤â•›3.
This section discusses a subject with which every college student is famil-
iar. This section is starred because readers who have not studied elementary
probability may find it to be challenging.
Problem 7.F. ╇ You are the Dean of Admissions at a liberal arts college that
has a strong academic tradition and has several vibrant sports programs. You
seek a freshman class of 510 persons. An agreement has been reached with the
head coach of each of several sports. These agreements allow each coach to
admit a limited number of academically-qualified applicants who that coach
seeks to recruit for his or her team. The coaches have selected a total of 280
such persons. From past data, you estimate that each of these 280 people will
join the entering class with probability of 0.75, independent of the others.
Your college has no dearth of qualified applicants. From past experience, you
estimate that each qualified person you accept who has not been selected (and
courted) by a coach will join the entering class with probability of 0.6. Your
provost is willing to risk one chance in 20 of having an entering class that
is larger than the target of 510. How many offers should you make to non-
athletes? What is the expectation of the number of students who will join the
freshman class?
Chapter 7: Eric V. Denardo 245
In particular, the number A of athletes who will join the class has the bi-
nomial distribution with parameters nâ•›=â•›280 and pâ•›=â•›0.75. Thus, the mean and
variance of A are given by
A normal approximation
A spreadsheet
The spreadsheet in Table 7.10 evaluates the yield from the pool of athletes
and non-athletes. Cell C4 contains the number of offers to make to non-ath-
letes. This number could have been required to be integer-valued, but doing
so would make little difference. The functions in cells F3 and G3 compute
the mean and variance of the yield from the athletes. The functions in cells
F4 and G4 compute the mean and variance of the yield from the others. The
functions in cells C8, C9 and C10 compute the mean, variance and standard
deviation of the class size C. The function in cell C12 computes the probabil-
ity that C does not exceed the target of 510.
Solver has been asked to find the number in cell C4 such that C12â•›=â•›C13.
Evidently, you should offer admission to approximately 465 non-athletes.
How’s that?
Fine tuning
For example, the probability that the class size does not exceed 510 is well
approximated by the probability that the normally distributed random vari-
able C does not exceed 510.5. A slightly more precise answer to the problem
you face as the Director of Admissions can be found by making these changes
to the spreadsheet in Table 7.10:
If you make these changes, you will find that they result in a near-imper-
ceptible change in the number of non-athletes to whom admission is to be
offered.
The function in cell C14 requires explanation. The positive part (x)+ of the
number x is defined by (x)+â•›=â•›max{0, x}. Interpret (x)+ as the larger of x and 0.
When D denotes a random variable and q is a number (Dâ•›−â•›q)+ is the random
variable whose value equals the amount, if any, by which D exceeds q.
This section is starred because readers who have not had a course in
“elementary” probability may find it to be challenging. In many of the United
States, electric utilities are allowed to produce the power required by their
customers, and they are allowed to purchase power from other utilities. Prob-
lem 7.G, below, concerns a utility that is in such a state.1
Problem 7.G (a power plant)╇ You are the chief engineer for a utility company.
Your utility must satisfy the entire demand for electricity in the district it serves.
The rate D at which electricity is demanded by customers in your district is un-
certain (random), and it varies with the time of day and with the season. It is
convenient to measure this demand rate, D, in units of electricity per year, rather
than units per second or per hour. The load curve specifies for each value of t
the fraction F(t) of the year during which D does not exceed t. This load curve
is known. The distribution of D is approximately normal with a mean of 1250
thousand units per year and a standard deviation of 200 thousand units per year.
Your utility has no way to store electricity. It can produce electricity efficiently
with “base load” plant or less efficiently with “peak load” plant. It can also pur-
chase electricity from neighboring utilities that have spare capacity. The “trans-
fer” price at which this occurs has been set – tentatively – at 6.20 dollars per unit
of electricity. Of this transfer price, only the fuel cost is paid to the utility provid-
ing the power; the rest accrues to the state. The transfer price is intended to be
Connecticut is not such a state, and its utility rates in 2009 are exceeded only by
1╇
Hawaii’s.
Chapter 7: Eric V. Denardo 249
high enough to motivate each utility to satisfy at least 98% of its annual power
requirement from its own production. The relevant costs are recorded in Ta-
ble 7.11. Annualized capital costs are incurred whether or not the plant is being
used to generate electricity. Fuel costs are incurred only for fuel that is consumed.
Your goal is to design the plant that minimizes the expected annualized
cost of supplying power to your customers. What is that cost? How much of
each type of plant should your utility possess? Will your utility produce at
least 98% of the power that its customers consume?
The plant
Base load plant is cheaper to operate (see Table 7.11), so you will not use
any peak-load plant unless your base-load plant is operating at capacity. For
the same reason, you will not purchase any electricity from other utilities un-
less your base-load and peak-load capacities are fully utilized. This leads to
the introduction of two decision variables:
The variables q1 and q2 are measured in units of electricity per year. From
Table 7.11, we see that base-load and peak-load plant have annualized capital
costs of 2.00 dollars per unit of capacity and 1.30 dollars per unit of capacity,
respectively. The annualized cost C of the plant is given by
C = 2.00 q1 + 1.30 (q2 − q1 ) ,
The electricity
The random variable (Dâ•›−â•›q2)+ equals the annualized rate at which elec-
tricity is purchased from other utilities, this being the excess of D over the to-
tal capacity of the base-load and peak-load plant. This electricity costs $6.20
per unit, so its expected annual cost equals