Sie sind auf Seite 1von 158

Decision Making (Part 2)

Study Material

i
C ONTENTS

Contents iii

1 Formulating and Solving Linear Programs 1


1.1 An Example of a Furniture Manufacturing Unit . . . . . . . . . . 1
1.2 Formulation of Mathematical Programs . . . . . . . . . . . . . . 3
1.3 Properties of Linear Programs . . . . . . . . . . . . . . . . . . . . 11
1.4 Some Situations Encountered During Modeling . . . . . . . . . 16
1.5 Solving Linear Programs . . . . . . . . . . . . . . . . . . . . . . . 32
1.6 Additional Terminology . . . . . . . . . . . . . . . . . . . . . . . . 39
Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43

2 Post-Optimality Analysis in Linear Programs 51


2.1 Another Furniture Example . . . . . . . . . . . . . . . . . . . . . 51
2.2 Shadow Prices and The Dual Program . . . . . . . . . . . . . . . 55
2.3 How to Construct the Dual Mechanically . . . . . . . . . . . . . 63
2.4 Complementary Slackness Conditions . . . . . . . . . . . . . . . 72
2.5 Reduced Costs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
2.6 Sensitivity Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . 78
2.7 Post-Optimality Analysis Using Microsoft® Excel Solver . . . . . 85
Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88

3 Applications of Mathematical Programming in Networks 95


3.1 What is a Network? . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
3.2 Representing Network Flow Problems as Linear Programs . . . 101
3.3 Formulating Non-Standard Representations . . . . . . . . . . . 105
3.4 Common Network Flow Problems . . . . . . . . . . . . . . . . . 112
3.5 Representing Networks in Microsoft® Excel Solver . . . . . . . . 139
3.6 Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144

iii
CHAPTER
1
F ORMULATING AND S OLVING L INEAR
P ROGRAMS

1.1 An Example of a Furniture Manufacturing Unit


Imagine that you own a small furniture manufacturing unit in Ahmedabad.
Your unit manufactures plain wooden tables and simple wooden chairs. You
have 15 employees in your unit, and you pay them monthly wages of Rs.5,000
each. You pay a rent of Rs.100,000 per month for the premises that you rent.
You receive a fixed quantity of wood at your unit every day, according to a long
term contract that you have signed. If you manufacture only tables on a given
day, then the wood is enough to manufacture 400 tables, and if you decide
to manufacture only chairs, then it is enough to manufacture 700 chairs. The
employees in your unit can manufacture 500 tables on any given day if they
manufacture only tables, and 600 chairs a day if they manufacture only chairs.
The market can take up to 300 tables a day but you can sell as many chairs
as you can produce. The contribution1 that each table brings to the profit is
Rs.70 per unit, while a chair generates a contribution of Rs.50 per unit. Your
aim is to produce an appropriate number of tables and chairs to maximize
your daily total contribution.
In order to decide the mix of tables and chairs that you produce each day,
you need to analyze the problem carefully. One line of argument can be that
1
The contribution to profit of an item is defined as the excess of the revenue over the
variable manufacturing cost for the item.

1
2 CHAPTER 1. FORMULATING LINEAR PROGRAMS

since a table generates more contribution than a chair, the unit should man-
ufacture as many tables as the market can absorb (i.e. 300 tables), and then
use the remaining your resources to manufacture chairs. Another line of ar-
gument can be that since chairs require less resources than tables, the unit
should manufacture only chairs. In that way the total contribution will be
higher, even though the contribution per unit is less. You need to decide
which of the two considerations, if either, is a most profitable option.
Let us analyze the first option. The unit’s stock of wood is sufficient to
manufacture a maximum of 400 tables per day and its labor resources are suf-
ficient to manufacture a maximum of 500 tables. However, the market can
absorb only 300 tables. So after manufacturing 300 tables, the unit can use
its remaining resources to manufacture 175 chairs. See that this is within the
capacity of your employees. Let us call this Mix A. At the given contribution
rates, this mix of products yields a daily contribution of Rs.(300×70+175×50)
= Rs.29,750.00 and completely uses up the wood available to you each day.
Next, let us analyze the second option. The unit’s stock of wood is suffi-
cient to manufacture a maximum of 700 chairs per day, and its labor capacity
is sufficient to manufacture a maximum of 600 chairs. So as per this consider-
ation, the unit should manufacture 600 chairs. This would exhaust the labor
capacity available to the unit, and hence tables will not be manufactured. Let
us call this product mix Mix B. This product mix would generate a contribu-
tion of Rs. (600 × 50) = Rs. 30,000.00. Hence the positive effect of trading off
the higher production rates of chairs against the higher contribution of tables
yields a higher contribution in this situation.
The question now is whether Mix B is the best mix available to you. While
manufacturing according to Mix B, ypu see that you have used up your la-
bor resources, but have a seventh of your stock of wood unused at the end of
each day. (You had stock to manufacture 700 chairs but you only manufac-
tured 600 chairs.) So, can you use your resources more efficiently? Starting off
with Mix B, let us assume that you manufacture one less chair. This frees up
1/600-th of your labor capacity, which along with your excess stock of wood
allows you to manufacture 5/6-th of a table. This change in product mix leads
to an excess utilization of (5/6) × (1/400) − (1/700) = 11/16800-th of your stock
of wood, and leads to an increase in contribution worth Rs.((5 × 70)/6 − 50) =
Rs.8.33. This shows that Mix B is not the best possible mix and you can obtain
a better mix by substituting a chair with 5/6-th of a table. So the next natu-
ral question is: How much of such substitutions can you make? Obviously,
the substitution did not change the total amount of labor resources that you
utilized, but uses 11/16800-th more of your daily stock of wood than that you
used for Mix B. You have 1/7-th of your daily stock in excess, so that you could
reduce the number of chairs that you produce by (1/7)/(11/16800) = 2400/11
1.2. FORMULATION OF MATHEMATICAL PROGRAMS 3

and produce (5/6) × (2400/11) = 2000/11 tables. This leads to a product mix
with 2000/11 (i.e., 181 9/11) tables and 4200/11 (i.e., 381 9/11) chairs which
generates a contribution of Rs.31,818.18 per day. It is easy to check in a simi-
lar way that no further trade-offs between the number of tables and chairs you
produce will increase the contribution generated. So manufacturing 181 9/11
tables and 381 9/11 chairs is a best, i.e., optimal daily product mix for your
unit.

EE One counter-intuitive decision that we made in the previous paragraph is


to manufacture 181 9/11 tables. Clearly, 9/11th of a table does not have com-
mercial value. However, such decisions are routinely reported in linear pro-
gramming problems and justified as follows. This schedule is a daily schedule,
and will usually be followed for several days together. 9/11th of a table each
day for 11 days yield 9 tables, which can be sold for commercial value. Usu-
ally, when the numbers involved are large, as they are in this case, rounding
off fractions are normally all right to do. However, if the numbers involved are
small, typically 5 or less, we need to be careful when rounding off fractions. In
addition it will be clear later (see Chapter ??), that adding restrictions which
force integrality on decision variables in a linear programming problem often
makes them much more difficult to solve. Such restrictions are avoided unless
absolutely necessary.

Notice that while taking decisions, we do not consider the wages you pay
to the unit’s employees, nor do we consider the rent you pay. This is because
these are not “relevant costs”, i.e., costs directly related to the production of
What are
tables and chairs. The cost of wood that you obtain from the lumber com-
relevant costs?
pany is also not relevant, since both the quantity and price of wood that you
receive is fixed through a long term contract, and does not change with your
product mix. In this example, all relevant costs are taken into account while
computing the contributions from tables and chairs.

1.2 Formulation of Mathematical Programs


In the last section we saw that the construction of optimal product mixes
using ad-hoc arguments is quite complicated, even for simple problems. It
would be impossible to follow such processes if there are a larger number of
products and restrictions, which is usually the case in practice. Fortunately,
there are well-developed methods to deal with such problems. In this section,
we will see how we can represent the problems in a universally accepted man-
ner — called a mathematical programming formulation, and in the last two
4 CHAPTER 1. FORMULATING LINEAR PROGRAMS

sections of this chapter we will briefly outline a tool to solve these problems.
A mathematical programming formulation for a practical problem con-
sists of three parts.
Mathematical
In the first part, we identify decisions that are to be taken in the decision
programming
making schenario and code them using variables called “decision variables”.
terminology.
Notice that when we talk about making decisions, we talk about things that we
are allowed to change. A vector of the decision variables represents a generic
solution to the problem. Assigning values to the decision variables in a solu-
tion yields particular solutions to the problem. In our example, we can code
the decision regarding the number of tables and chairs you produce daily with
decision variables T and C , and a product mix (T,C ) as a solution to the prob-
lem. The units in which we measure our decision variables need to be clear to
us.
In the second part, we specify a function that evaluates solutions. This
function of the decision variables is called an “objective function”. We also
specify the nature of the best (i.e., optimal) solution to the problem in terms
of the objective function by specifying whether we want to maximize or min-
imize the objective function. This specification is called the objective of the
mathematical program.
In the third and final part of the formulation we define “constraints” that
restrict the options we have for solutions to be considered in the problem.
Each constraint is an inequality or an equation in the decision variables in-
troduced in the first part, and in the mathematical program, they represent
restrictions on the decision variables brought about by the nature of the prob-
lem. Examples of constraints in our problem are the restrictions on availabil-
ity of wood and labor, and the market capacity for absorbing tables that we
produce. It is conventional to represent constraints as inequalities or equa-
tions, whose left hand side consists of a function of the decision variables and
whose right hand side is a constant.
A solution is called “feasible”, if the values assigned to the decision vari-
ables in that solution are such that all constraints in the model are satisfied,
otherwise it is called “infeasible”. A constraint that holds as an equality at a
given solution is said to be “tight” at that solution. Constraints that are not
tight are said to have a “slack” or “surplus” depending on whether their left
hand side is less than or greater than their right hand side at that solution.
“Solving a mathematical program” refers to the process of finding a feasible
solution to mathematical program that maximizes (or minimizes, as the case
may be) the given objective function. A solution for which the value of the ob-
jective function is the best possible among feasible solutions (i.e., the largest
for maximization problems and smallest for minimization problems) is called
an “optimal solution”. A mathematical programming problem in which the
What is a linear
program?
1.2. FORMULATION OF MATHEMATICAL PROGRAMS 5

objective function and all the constraints are linear is called a “linear pro-
gramming problem”. Linear programming problems are widely studied, since
they occur widely in practice, and have very nice properties which allows us
to solve them very efficiently.
The problem described in Section 1.1 can be expressed as a linear pro-
gramming model. The decision that you need to make in the problem is to
determine the number of tables and chairs that you to manufacture every day
in your unit. Let us represent that decision in terms of two variables: T de-
noting the number of tables that you want to manufacture each day, and C
denoting the number of chairs. These two variables are the decision variables
in this model.The vector (T,C ) is a generic solution to the problem. The con-
tribution from a solution is given by the objective function z = 70T +50C , and
the objective of model is to maximize the value of z. There are several con-
straining factors that restrict your manufacturing possibilities.

• First, the stock of wood available each day is enough to manufacture ei-
ther 400 tables or 700 chairs. This means that each table uses up 1/400th
of your daily stock of wood, and each chair uses up 1/700th of it. Thus,
if you manufacture T tables and C chairs, you use up T /400 + C /700
part of your daily stock of wood. This obviously cannot exceed the stock
of wood you have for a day, so that you are constrained to obey the in-
equality T /400 +C /700 ≤ 1.

• Similar considerations restrict you to the inequality T /500 + C /600 ≤ 1


while considering the daily capability of the employees you have.

• The market demand restricts you to producing at most 300 tables each
day, hence your manufacturing plan has to obey the restriction T ≤ 300.

• Lastly, you must ensure that neither T nor C assumes negative values.
These constraints are called non-negativity constraints. While they look
trivial, they are important in a mathematical program, since the model
that we are describing is a mathematical construct and will not be linked
to the physical problem as far as the solving agent (e.g., a computer pro-
gram) is concerned.

The linear program corresponding to the example thus looks like Figure 1.1.
Two other examples of creating linear programming models for practical
problems are given below.

Example 1.1: A manufacturer manufacturers tin cans. Each can has a cylin-
drical main body shaped out of a rectangular piece of sheet metal, and two
6 CHAPTER 1. FORMULATING LINEAR PROGRAMS

Decision Variables

T : number of tables produced by the unit per day; and


C : number of chairs produced by the unit per day.

Model (Objective function and constraints)

Maximize
Contribution z =70T + 50C
Subject to
T /400 +C /700 ≤ 1 (Stock of wood)
T /500 +C /600 ≤ 1 (Labor capacity)
T ≤ 300 (Market restriction on tables)
T, C ≥0 (Non-negativity)

Figure 1.1: Linear programming formulation for the example in Section 1.1

circular pieces that form the two ends of the can. He manufacturers the main
body and ends by stamping out sheets of metal. He gets metal sheets in three
sizes, A, B, and C. The numbers of rectangular and circular pieces that can be
obtained from each sheet of the three sizes are:

Number of Number of
rectangular circular
Size pieces pieces
A 2 8
B 3 6
C 3 3

Each week, the manufacturer receives a supply of 300 sheets of size A, 150
sheets of size B, and 250 sheets of size C. Each sheet requires 5 minutes to
stamp out. Once the stamped out pieces are obtained, assembling the pieces
into cans require 3 minutes per can. The manufacturer can sell as many cans
as he can produce. Any excess rectangular or circular pieces produced can be
kept in inventory. Cans sell at Rs. 4 per can. With a working week of 40 hours,
the manufacturer wants to determine his optimal production plan so that he
can maximize his weekly revenues.
1.2. FORMULATION OF MATHEMATICAL PROGRAMS 7

The Model: The output of our model for the production plan should tell the
manufacturer how many sheets of each size he should stamp out every week.
So we define the following decision variables:

x A : number of sheets of size A that are to be stamped out each week;


xB : number of sheets of size B that are to be stamped out each week; and
xC : number of sheets of size C that are to be stamped out each week.

The following variables can also be defined in order to make the formulation
more readable.

R: number of rectangular pieces that are generated each week;


C : number of circular pieces that are generated each week; and
K : number of cans that are produced each week.

The objective of the model is to maximize revenue. In terms of our decision


variables it can be written as

Maximize 4K .

Next we define the constraints of the model.


The weekly supply of sheets of size A, B, and C are 300, 250, and 150 re-
spectively. These enforce the following constraints in the model:

x A ≤ 300,
xB ≤ 150, and
xC ≤ 250.

The number of cans that can be produced each week cannot exceed the
number of rectangular pieces stamped out each week or half the number of
circular pieces stamped out each week. Hence we have the following con-
straints:

K − R ≤ 0, and
2K −C ≤ 0.

The numbers of rectangular and circular pieces produced depend on the num-
bers of sheets of sizes A, B, and C that are used every week. These relations are
represented by the following constraints:

R − 2x A − 3xB − 3xC = 0, and


C − 8x A − 6xB − 3xC = 0.
8 CHAPTER 1. FORMULATING LINEAR PROGRAMS

The manufacturing setup has a 40 hour working week, so that manufacturing


operations can be carried out for a maximum of 2400 minutes. Given the time
required to stamp out sheets and to assemble cans, the time constraint can be
represented as follows:

5x A + 5xB + 5xC + 3K ≤ 2400.

In addition all the decision variables defined in this example need to be non-
negative.
Since any excess of rectangular or circular pieces are kept in the inventory,
we do not bother about it in the model. Of course, in practice, one would
consider the inventory of rectangular and circular pieces from the previous
month while deciding on the production plan.
Combining all this, the linear programming model to solve the manufac-
turer’s problem is given in Figure 1.2.

The Solution: Solving the model, the following optimal solution is obtained:
z = 2042.7, x A = 10.1, xB = 150, xC = 13.5, K = 510.7, and C = 1021.4. In the
context of the example, this means that the manufacturer should procure and
stamp 10.1 size A sheets, 150 size B sheets, and 13.5 size C sheets each week
on average. This would provide him with 510.7 rectangular pieces and 1021.4
circular pieces per week on average, which can be made into 510.7 cans per
week on average, which sell for Rs. 2042.70. No extra rectangular or circular
pieces are produced in the process.

Note that the number of decision variables that we have used in the formu-
lation in Example 1.1 above is larger than what is strictly required. For model
maintenance purposes, it is better to use more decision variables and keep
the program readable, rather than use fewer decision variables and make the
program compact but undecipherable.2
Also note that even though the number of sheets stamped, the number of
components, and the number of cans produced need to be integers in prac-
tice, the formulation only requires them to be non-negative. This is because
fractional values for these variables can be explained easily; the suggestion to
produce K = 510.7 cans per week in an optimal solution translates to produc-
2
If you are using Microsoft Excel Solver, it allows you to define and solve models with up to
200 variables. With Premier Solver add-in from Frontline Systems, models with 2000 variables
can be solved efficiently. Solvers associated with GAMS, AMPL, etc. can handle millions of
variables.
1.2. FORMULATION OF MATHEMATICAL PROGRAMS 9

Decision Variables

x A : number of sheets of size A that are to be stamped out each week;


x B : number of sheets of size B that are to be stamped out each week;
xC : number of sheets of size C that are to be stamped out each week;
R: number of rectangular pieces that are generated each week;
C : number of circular pieces that are generated each week; and
K : number of cans that are produced each week.

Model (Objective function and constraints)

Maximize
Contribution z =3K
Subject to
xA ≤ 300 (Availability of size A sheets)
xB ≤ 150 (Availability of size B sheets)
xC ≤ 250 (Availability of size C sheets)
K −R ≤0 (Rectangular pieces in cans)
2K −C ≤0 (Circular pieces in cans)
R − 2x A − 3x B − 3xC =0 (Stamping out of rectangular pieces)
C − 8x A − 6x B − 3xC =0 (Stamping out of circular pieces)
5x A + 5x B + 5xC + 3K ≤ 2400 (Time constraint)
x A , x B , xC , R, C , K ≥0 (Non-negativity)

Figure 1.2: Linear programming formulation for Example 1.1

ing a total of 5107 cans in ten weeks. It can also be rounded down to 510 cans
per week for a good enough solution.

Example 1.2: A small bank offers three types of loans: housing loans at 8.50%
interest, education loans at 13.75% interest rates, and loans to senior citizens
at 12.25% interest. Further, it needs to adhere to certain policy restrictions.
These restrictions require the bank to ensure that

Condition 1: housing loans make up between 25% and 60% of the total loan
amount disbursed; and
Condition 2: the amount of loans disbursed to senior citizens should be at
least one third of the total amount disbursed as loans.
10 CHAPTER 1. FORMULATING LINEAR PROGRAMS

In a particular year, its lending capacity is Rs.25,000,000. The bank would like
to disburse loans so as to maximize its earnings from interest paid.

The Model: Our model should help the bank to find the amounts that it can
loan out under each of the three types of loans. Thus we define three decision
variables:

H: millions loaned out as housing loans;


E : millions loaned out as education loans; and
S: millions loaned out as loans to senior citizens.

The objective of the bank is to maximize revenue from interests, i.e., to

Maximize 0.085H + 0.1375E + 0.1225S.

The lending capacity of the bank is Rs.25,000,000. This results in the con-
straint

H + E + S ≤ 25.

We do not write this as an equality constraint. The reason for this is that
Rs.25,000,000 is the lending capacity, and we do not want the bank to lend
the full amount if the conditions turn out to be unfavorable.
The first condition imposed by the bank’s policy requires the housing loans
to be between 25% and 60% of the total loan amount. This can be ensured by
including the constraints

H ≥ 0.25(H + E + S), i.e., 0.75H − 0.25E − 0.25S ≥ 0,

and

H ≤ 0.6(H + E + S), i.e., 0.4H − 0.6E − 0.6S ≤ 0.

The second condition ensures that loans to senior citizens should be at least
one third of the total loans disbursed, i.e.
S 1
≥ .
H +E +S 3
This constraint is not linear; however, it can be converted by cross-multiplication
to the linear constraint 3S ≥ H +E +S which can be simplified to H +E −2S ≤ 0.
Of course, the amounts H, E , and S need to be non-negative.
Thus, the linear programming model that the bank needs to formulate to
plan its loan disbursement policy is the one shown in Figure 1.3.
1.3. PROPERTIES OF LINEAR PROGRAMS 11

Decision Variables

H : millions loaned out as housing loans;


E : millions loaned out as education loans; and
S: millions loaned out as loans to senior citizens.

Model (Objective function and constraints)

Maximize
Revenue z =0.085H + 0.1375E + 0.1225S
Subject to
H +E +S ≤ 25 (Lending capacity constraint)
0.75H − 0.25E − 0.25S ≥ 0 (Condition 1)
0.4H − 0.6E − 0.6S ≤ 0 (Condition 1)
H + E − 2S ≤ 0 (Condition 2)
H, E, S ≥ 0 (Non-negativity)

Figure 1.3: Linear programming formulation for Example 1.2

The Solution: The optimal solution to the problem is: z = 2.98, H = 6.25,
E = 10.42, and S = 8.33. Notice that since housing loans yield the lowest rate
of interest, they have been put at the minimum permitted level, i.e., 25% by
the bank. Among the other two, loans to senior citizens yields less interest.
Hence they have been kept at their minimum possible level, i.e., 1/3rd of the
total allocation.

1.3 Properties of Linear Programs


In the last section, we mentioned that linear programs have certain nice prop-
erties that allow us to solve them quite efficiently. In this section, we will elab-
orate on some of those properties. A reader interested in other properties of
linear programs is advised to look up books by Papadimitriou and Steiglitz3 or
by Bazaraa, Jarvis, and Sherali4.
3
C.H. Papdimitriou and K. Steiglitz, Combinatorial Optimization: Algorithms and Com-
plexity, Prentice-Hall Inc., Engelwood Cliffs, N.J., 1982.
4
M.S. Bazaraa, J.J. Jarvis, and H.D. Sherali, Linear Programming and Network Flows (2nd
edition), John Wiley & Sons, New York, 1990.
12 CHAPTER 1. FORMULATING LINEAR PROGRAMS

We begin by stating the obvious fact that a solution to a linear program can
be expressed as a vector of the values attained by the decision variables in the
solution. For example, if we represent solutions in the example in Section 1.1
using a vector whose first component represents the number of tables manu-
factured and the second component represents the number of chairs manu-
factured, then Mix A would be represented by the vector (300, 175). This kind
of representation allows us to represent feasible solutions to linear programs
with two decision variables on an X-Y plot, thus allowing a geometrical solu-
tion method for such problems. We will see this method in Section 1.5.
Let us look at the representation of the set of feasible solutions, commonly
called the “feasible region”, to linear programs. It will be easy to visualize the
set in problems with two decision variables; so we will choose the problem
Section 1.1 as an illustration. We depict the two decision variables along two
axes on a plane, the horizontal axis representing the variable T , and the ver-
tical axes representing the variable C . Note that it is also perfectly all right
to represent C on the horizontal axis and T on the vertical axis. The non-
negativity constraints restrict us to the first quadrant. Plotting the other in-
equalities in the set of constraints mentioned in the previous section yields
the set of feasible solutions shown in Figure 1.4, in which the shaded region
denotes the set of feasible solutions to the problem, and the lines mark the
boundaries of each of the constraints.
C

800

Wood Availability
600

Market Capacity

400

Feasible
200 Solutions

Labor Capability

–100 100 200 300 400 500 T

Figure 1.4: The set of feasible solutions to the example problem


1.3. PROPERTIES OF LINEAR PROGRAMS 13

The set of feasible solutions is a “convex” set. Mathematically, this means


Feasible
that for any pair (T1 ,C 1 ) and (T2 ,C 2 ) of feasible solutions, all solutions of the
solutions form a
form (αT1 + (1 − α)T2 , αC 1 + (1 − α)C 2 ) are also feasible, when 0 ≤ α ≤ 1. Solu-
convex set.
tions of the form (αT1 + (1 − α)T2, αC 1 + (1 − α)C 2) lie on a straight line joining
(T1 ,C 1 ) and (T2 ,C 2 ), and where the solution is on that line is decided by the
value of α. α = 1 implies that the solution is at the point (T1 ,C 1 ) and α = 0 im-
plies that the solution is at the point (T2 ,C 2 ). Then a set being convex means
that if we draw a straight line segment between any two feasible solutions,
then the whole line segment would lie in the feasible region. In addition to
being convex, the feasible set is also a polyhedron, i.e., a figure bounded by
lines in two dimensions (see Figure 1.4), planes in three dimensions and hy-
perplanes in more than three dimensions.

EE The fact that the set of feasible solutions for a linear program is convex
is quite easy to prove. Let X (1) = (x1(1) , x2(1) , . . . , xn(1) ) and X (2) = (x1(2) , x2(2) , . . . , xn(2) )
be two feasible solutions to a linear program. Let a solution Y = (y 1 , y 2 , . . . , y n )
such that y i = αxi(1) + (1 − α)xi(2) for 1 ≤ i ≤ n, be infeasible for some α0 ∈ [0, 1].
Since Y is infeasible, it must violate at least one constraint. Without loss of
generality, assume that one of the constraints violated is of the form p 1 x1 +
p 2 x2 + · · · + p n xn ≤ q. (Satisfy yourself that this is completely general.) So

p 1 y 1 + p 2 y 2 + · · · + p n y n > q. (1.1)

Replacing each y i with α0 xi(1) +(1−α0 )xi(2) and rearranging the terms, (1.1) can
be rewritten as

α0 (p 1 x1(1) +p 2 x2(1) +· · ·+p n xn(1) )+(1−α0 )(p 1 x1(2) +p 2 x2(2) +· · ·+p n xn(2) ) > q. (1.2)

The expression (1.2) cannot be valid, since X (1) and X (2) being feasible implies
that both p 1 x1(1) + p 2 x2(1) + · · · + p n xn(1) and p 1 x1(2) + p 2 x2(2) + · · · + p n xn(2) are indi-
vidually less than or equal to q, and 0 ≤ α0 ≤ 1 implies that both α0 and (1−α0 )
are non-negative. So the left hand side of (1.1) cannot exceed α0 q + (1 − α0)q,
i.e., q. Hence Y must be feasible. Since X (1) and X (2) are arbitrary feasible solu-
tion, this shows that the set of feasible solutions for linear programs is convex.

The fact that the set of feasible solutions is convex, and that the objective
function is linear allows us to narrow down our search for an optimal solu-
tion tremendously. To illustrate this, we return to our example about man-
ufacturing furniture. Figure 1.5 shows the set of solutions for which the ob-
jective function values are 15,000 (the lower bold line) and the set for which
the objective function values are 25,000 (the upper bold line). These sets (i.e.,
14 CHAPTER 1. FORMULATING LINEAR PROGRAMS

800

600

400
z=25000

200
z=15000

–100 0 100 200 300 400 500 T

Figure 1.5: Solutions with same objective function values for the example
problem

parallel lines) are obtained by setting z, i.e. 70T + 50C to 15,000 and 25,000
respectively.
Except the case when we are optimizing a constant, we can show that a
point in the interior of the feasible region i.e., not on the boundary of the
feasible region, cannot represent an optimal solution. If we are optimizing
a constant, then all feasible solutions are optimal. A point being in the inte-
rior of the feasible region means that, starting at that point, we can move in
any direction for at least a very small distance and still remain inside the fea-
sible region. Now, since the objective function is linear, there always exists a
direction of improvement of the objective function at any point, and this di-
rection is perpendicular, or more correctly, normal to the lines (or planes, or
hyperplanes) representing the sets of solutions with the same objective func-
tion values. For example, refer to Figure 1.6. Consider the solution T = 100,
C = 200, (represented by the point A in the figure) as a solution in the in-
terior of the feasible region. The objective function value of this solution is
Rs.17,000. The bold line in the figure represents the set of solutions for which
the objective function value is Rs.17,000. The direction of improvement is
shown by the arrow in the figure. Since A lies in the interior of the feasible re-
A point in the
gion, we can move along the direction of improvement to some point B which
interior of the
has a better objective function value, and is also feasible. The existence of a
feasible region
cannot be
optimal.
1.3. PROPERTIES OF LINEAR PROGRAMS 15

800

600

Direction of
400 improvement

200
A

–100 0 100 200 300 400 500 T

Figure 1.6: Direction of improvement for the example problem

better feasible solution proves that A cannot be optimal.


This fact seems obvious when we consider the practical situation. Suppose
we suggest that you manufacture 100 tables and 200 chairs. For this produc-
tion plan you are using up 100/400 + 200/700 = 15/28th portion of your daily
stock of wood, and 100/500 +200/600 = 8/15th of your labor capability. In ad-
dition, the market can absorb more tables and chairs. Since some portion of
all your resources are free due to this plan, and the market can absorb more
of your products, surely you can do better than the current plan.
We cannot use the same argument for solutions on the boundary of the
feasible region, since for such solutions, it is possible that any movement
along the direction of improvement would be impossible and would render
a solution infeasible. Thus, we can restrict our search for optimal solutions
to the boundary of the feasible region in a linear program. However, we can
do even better! Consider a linear program with two decision variables, X and
Y , and a maximization objective. Each solution at the boundary of the fea-
sible region is either a corner point solution, or a convex combination of two
adjacent corner point solutions. Consider a solution point (x, y) that is a con-
vex combination of two adjacent corner points, say (x1 , y 1 ) and (x2 , y 2 ). This
means that there exists an α0 ∈ [0, 1] such that x = α0 x1 + (1 − α0 )x2 and y =
α0 y 1 +(1−α0)y 2 . Geometrically, this also means that (x, y) is on the boundary
of the feasible region. Let the objective function for the problem be cx + d y.
16 CHAPTER 1. FORMULATING LINEAR PROGRAMS

Without any loss of generality, assume that cx1 + d y 1 ≥ cx2 + d y 2 , i.e., (x1 , y 1 )
is a better solution than (x2 , y 2 ) for a maximization problem. The objective
function value at the point (x, y) is given by the expression cx + d y.
Now note that

cx + d y =c(α0 x1 + (1 − α0 )x2 ) + d (α0 y 1 + (1 − α0 )y 2 )


=α0 (cx1 + d y 1 ) + (1 − α0 )(cx2 + d y 2 )
≤α0 (cx1 + d y 1 ) + (1 − α0 )(cx1 + d y 1 ), by our assumption
=cx1 + d y 1 .

This means that the corner point solution (x1 , y 1 ) is not worse than the
solution (x, y). Observe that if we had assumed that cx1 +d y 1 ≤ cx2 +d y 2 , then
a similar argument would have shown that the corner point solution (x2 , y 2 ) is
not worse than the solution (x, y). So we see that for linear programs with two
decision variables, we only need to evaluate corner point solutions to obtain
an optimal solution.
Similar arguments follow through for linear programs with more than two
decision variables, so that we obtain what is perhaps the most attractive prop-
erty of linear programming problems: If a linear programming problem has
one optimal solution, then the optimal solution is a corner point solution. If
there are more than one optima, then there are an infinite number of them,
but at least one of them is a corner point solution. In other words, if there is an
One of the
optimal solution that is not a corner point, then at least one adjacent corner
optimal
point also represents an optimal solution.
solutions to a
Based on this property, instead of looking at an infinite number of feasible
linear program is
solutions in search of an optimal solution; we can restrict ourselves to corner
a corner point
point solutions only, which are at least countably finite.
solution.

EE The arguments in the last three pages can be compressed greatly, and ex-
pressed more precisely using linear algebra. To see this, note that since the fea-
sible region is a polyhedron, each feasible solution can be expressed as a convex
combination of the corner point solutions. Since the objective function is linear,
the objective function value of any feasible solution cannot be better than the
best among the objective function values at all corner point solutions.

1.4 Some Situations Encountered During Modeling


Certain situations occur frequently in linear programming models, and there
are standard techniques to model them in linear programming models. In this
1.4. SELECTED SITUATIONS . . . 17

section, we deal with some of these situations. Needless to say, this list is not
exhaustive.

Modeling restrictions on composition


Often in a product mix formulation, it is stipulated that the proportion of one
or a set of products in the mix cannot exceed a particular percentage. Suppose
that a product mix has n components, C 1 through C n . Let us suppose that the
proportion by weight of C 1 should not exceed a fraction k, or 100k%. Let the
decision variables for the problem include variables x1 through xn denoting
the quantity of components C 1 through C n that make up the mix. Then the
constraint that the proportion of C 1 in the product does not exceed k is mod-
eled by the constraint
x1
≤ k,
x1 + x2 + · · · + xn

which can be linearized through cross-multiplication to

x1 − k(x1 + x2 + · · · + xn ) ≤ 0,

and further simplified to

(1 − k)x1 − k(x2 + · · · + xn ) ≤ 0.

One example of such a composition restriction has already been shown


before (in Example 1.2; see policy condition 2 mentioned therein). Another
example of such a restriction is given in Example 1.3.

Example 1.3: An aluminium mine has two shafts from which bauxite ore is
extracted. The company working the mine can extract 3000 tons of ore from
the first shaft and 5000 tons of ore from the second shaft each month. The
first shaft yields ore with 50% impurity, and the second shaft yields ore with
75% impurity. The impurities in the ore are removed by sending them through
a cleaning process. The cleaning process is equipped to handle 7000 tons of
ore. However, the process can handle ores with a maximum of 55% impurity.5
The company would like to maximize the amount of impurity-free ore that it
can produce.
5
The portion under emphasis in each of the examples indicates the condition that is of
interest in the section.
18 CHAPTER 1. FORMULATING LINEAR PROGRAMS

The Model: The model developed for this problem needs to output the am-
ount of ore to extract from each of the mines. For this, we define the following
decision variables:

x1 : tons of ore extracted from the first shaft each month; and
x2 : tons of ore extracted from the second shaft each month.

The objective of the company is to maximize the amount of impurity-free ore


that it can produce each month. Mathematically stated therefore, their objec-
tive is to
Maximize 0.5x1 + 0.25x2 .
Mining capacity restrictions imply the following constraints in the company’s
model:
x1 ≤ 3000, and
x2 ≤ 5000.
The capacity restriction for the cleaning process enforces the constraint:
x1 + x2 ≤ 7000.
The cleaning process can handle a maximum level of 55% impurity. Assuming
that impurity percentages mix linearly, this implies the constraint:
0.5x1 + 0.75x2
≤ 0.55.
x1 + x2
By cross-multiplying terms, this constraint reduces to
0.05x1 − 0.2x2 ≥ 0.
The amounts x1 and x2 of ores extracted must be non-negative.
Thus, the linear programming model that the company need to formulate
and solve in order to decide how to maximize their impurity-free ore produc-
tion is shown in Figure 1.7.

The Solution: The optimal solution to the model is the following: z = 1687.5,
x1 = 3000, x2 = 750. This means that the company can produce 1687.5 tons of
impurity-free ore each month. For this, they mine 3000 tons of impure ore
from Shaft 1 and 750 tons of impure ore from Shaft 2. Observe that even
though the company can mine 4250 more tons of ore from Shaft 2, and can
clean 3250 more tons of ore through their cleaning process, the high levels of
impurity in the ores prevent the company from fully utilizing their mining and
cleaning capacity.
1.4. SELECTED SITUATIONS . . . 19

Decision Variables

x 1 : tons of ore extracted from the first shaft each month; and
x 2 : tons of ore extracted from the second shaft each month.

Model (Objective function and constraints)

Maximize
Impurity-free ore z =0.5x 1 + 0.25x 2
Subject to
x1 ≤ 3000 (Extraction capacity from Shaft 1)
x2 ≤ 5000 (Extraction capacity from Shaft 2)
x1 + x2 ≤ 7000 (Cleaning process capacity)
0.05x 1 − 0.2x 2 ≥ 0 (Cleaning process quality restriction)
x1, x2 ≥0 (Non-negativity)

Figure 1.7: Linear programming formulation for Example 1.3

Modeling penalties
In delivery setups, one is often committed to supplying a certain quantity of
a product, failing which, one is required to pay a penalty proportional to the
shortfall. What makes it interesting in modeling such a situation is that the
penalty amount is not a linear function of the quantity supplied; ifthe supplier
supplies more than the quantity committed, she does not pay any “negative
penalty”. As an illustration, the amount of penalty p paid by a supplier at
various levels of delivery x when the stipulated minimum quantity of delivery
is 5 units, and the penalty is Rs. 10 per unit of shortfall is graphically shown in
Figure 1.8.
If the quantity assured is a and the penalty paid for not meeting the stipu-
lation is c per unit of shortfall, then the amount of penalty to be paid when the
production is x units is max(0, c(a − x)). This is not a linear function, although
it is piecewise linear. We can model this as a linear program in the follow-
ing manner. We define a non-negative variable p denoting the the amount
of penalty to be paid for a given supply quantity. In our model we add the
following constraints that make p a lower bound on the penalty to be paid.

p − c(a − x) ≥ 0, and
p ≥ 0.
20 CHAPTER 1. FORMULATING LINEAR PROGRAMS

50

40

30

20

10

0 1 2 3 4 5 6 7 x

Figure 1.8: A plot of the penalty function

We also add a term in the objective function that minimizes the value of p.
When the supply level is at x ≥ a, then the penalty constraint ensures that
p is not less than a negative value c(a − x). However, the non-negativity con-
straint on p ensures that p ≥ 0. So in this case, the penalty constraint is su-
perfluous, and the objective function, which tries to minimize the value of p
sets it to zero. When the supply level is at x < a, then p ≥ c(a − x) > 0. In this
case the non-negativity condition on p is superfluous. The objective function,
which tries to minimize the value of p sets it to the value c(a − x) as desired.

Example 1.4: The state cooperative society buys raw milk from local farmers
and converts it to toned milk and butter, which are then either sent to meet
contractual requirements or are sold in the open market. The society is under
obligation to buy any raw milk brought to it by farmers at a price of Rs.2 per
liter. On average, 1200 liters of raw milk is brought to the society every day.
One liter of raw milk produces 0.95 liters of toned milk. The same liter of raw
milk can be used to produce 100g of butter. Toned milk and butter sell for
Rs.5 per liter and Rs.50 per kilo in the open market. The society is under con-
tractual obligation to supply 600 liters of toned milk to an organization. If the
society is unable to supply the organization with its quota of toned milk, then
it is penalized at the rate of Rs. 6 per liter of shortfall. The society needs to plan
its daily toned milk and butter production in order to maximize its revenues
net of any penalties paid.

The Model: Since the cooperative has no choice but to buy all the raw milk
it receives, the decision the model needs to suggest the allocation of raw milk
1.4. SELECTED SITUATIONS . . . 21

into the production of the two products — toned milk and butter. For this, we
define the following decision variables:

M t : liters of raw milk used each day to produce toned milk; and
Mb : liters of raw milk used each day to produce butter.

The amount of toned milk produced each day is thus be 0.95M t , and the
amount of butter produced is 0.1Mb .
According to the problem description, 1200 liters of milk is available each
day on average. So we specify the following constraint in our model:

M t + Mb ≤ 1200.

Notice that we do not use an equality here, since we want to allow the option
of letting raw milk go waste if it is profitable to do so.
Next, given the allocation of M t liters for production of toned milk, and
Mb liters for production of butter, we compute the penalty that the cooperative
needs to pay to the organization. Let us define the variable

T s : shortfall in liters in the supply of toned milk from the cooperative to the
organization, i.e., T s = max{0, 600 − 0.95M t }.

From the discussion in this section, T s is fixed using the constraints

T s − (600 − 0.95M t ) ≥ 0 and


T s ≥ 0.

The penalty that the cooperative needs to pay the organization is 6T s . The ob-
jective function minimizes the the penalty paid, and so we do not add the con-
straint T s ≤ 600 that would be required otherwise.
The amounts of toned milk and butter that the society sells in the open
market is 0.95M t − 600 + T s and 0.1M t respectively. The penalty it pays to the
organization is 6T s . Its objective is to maximize its net revenue, i.e., to

Maximize 5(0.95M t − 600 + T s ) + 50(0.1Mb ) − 6T s ,

which simplifies to

Maximize 4.75M t + 5Mb − T s .

The complete model that the society needs to solve to find out its production
plan is given in Figure 1.9.
22 CHAPTER 1. FORMULATING LINEAR PROGRAMS

Decision Variables

M t : liters of raw milk used each day to produce toned milk;


M b : liters of raw milk used each day to produce butter; and
T s : shortfall in liters in the supply of toned milk from the cooperative to the orga-
nization.

Model (Objective function and constraints)

Maximize
Net revenue z =4.75M t + 5M b − T s
Subject to
M t + Mb ≤ 1200 (Raw milk availability)
T s + 0.95M t ≥ 600 (Shortfall in supply to the organization)
M t , Mb , Ts ≥ 0 (Non-negativity)

Figure 1.9: Linear programming formulation for Example 1.4

The Solution: The optimal solution to the model is: z = 5842.10, M t = 631.6,
Mb = 568.4, and T s = 0. So at the prices of toned milk and butter mentioned in
the problem the cooperative society would earn a net revenue of Rs.5842.10
per day on average, produce just enough toned milk to satisfy its contractual
obligations, and sell 0.1 × 568.4 = 56.84 kilos of butter in the open market.

Modeling soft constraints


A constraint is said to be “hard” if it must be obeyed by a feasible solution. For
What are hard
example, saying that the constraint
and soft
constraints?
c1 x1 + · · · + cn xn = p

is hard means that for any feasible solution x† = (x1† , x2† , . . . , xn† ), the value of
c1 x1† + · · · + cn xn† has to equal p. This is the normal expectation from a con-
straint. However, if p is just a desired value for c1 x1 + · · · + cn xn , then we can
formulate the condition as a “soft” constraint, and allow, but discourage devi-
ations of the value of c1 x1 + · · · + cn xn from p.
This is done by defining additional decision variables δ+ denoting a posi-
tive deviation, and δ− denoting a negative deviation, and specifying the con-
1.4. SELECTED SITUATIONS . . . 23

straint as

c1 x1 + · · · + cn xn − δ+ + δ− = p.

The deviations are then discouraged by penalizing them in the objective func-
tion; if the objective function is to be maximized, then a term k(δ+ +δ− ), k > 0,
is subtracted from it, and if the objective function is to be minimized then the
term is added to it. The value of k is chosen to signify the amount of penal-
ization, a very low value will allow a feasible solution to ignore this constraint,
while a high value of k will turn it into a hard constraint.
If the soft constraint is an inequality rather than an equality, then only one
of the deviation variables is meaningful. For example, if the constraint is of
the form

c1 x1 + · · · + cn xn ≤ p,

then the negative deviation variable δ− has no role to play, since negative devi-
ations are anyway allowed by the constraint. The soft constraint correspond-
ing to this constraint is

c1 x1 + · · · + cn xn − δ+ ≤ p.

Similarly, the soft constraint corresponding to a constraint of the form

c1 x1 + · · · + cn xn ≥ p

has no use of the deviation variable δ+ , and is of the form

c1 x1 + · · · + cn xn + δ− ≥ p.

Note that since the objective minimizes the value of k(δ+ + δ− ), the values of
δ+ and δ− cannot both be strictly positive in an optimal solution to the model.
Example 5 illustrates the use of soft constraints.

Example 1.5: A media planner is planning a media campaign for a new car.
The media vehicles that she is willing to consider are television, newspaper,
and billboards. She has the following data about the awareness generated by
advertisements in each of the vehicles in the relevant target segment:

Increase in awareness
Media Vehicle per million spent
Television advertisement 1.45%
Newspaper advertisement 0.75%
Billboard advertisement 1.75%
24 CHAPTER 1. FORMULATING LINEAR PROGRAMS

The car manufacturing company has stipulated that not more than 30% of
the allocated budget should be used for billboard advertisements, and at least
25% should be used for newspaper advertisements. They would also like the
allocation on television advertisements to be roughly twice the allocation on
billboard advertisements. The media planner has a budget of Rs.10,000,000
and wants to maximize the increase in awareness possible.

The Model: The media planner’s decision is to allocate the available re-
sources to the three media vehicles. Therefore, the decision variables in our
model are:

T : millions used for television advertisements;


N : millions used for newspaper advertisements; and
B: millions used for advertisements on billboards.

The budget allocated for the whole campaign is Rs.10,000,000; therefore

T + N + B ≤ 10.

Billboard advertisements are required to have at most 30% of the budget allo-
cated (not the budget used) to them, while newspaper advertisements should
make up at least 25% of the budget. These conditions give rise to the following
two constraints:

B ≤3 and
N ≥ 2.5.

If the manufacturing company wanted the allocation on television advertise-


ments to be exactly double the allocation on billboard advertisements, they
would have specified the condition

T − 2B = 0.

However, since they are willing to accept minor deviations, these deviations can
be factored in using the following two additional variables:

δ+ : excess in television advertisements compared to twice the money used for


billboard advertisements; and

δ : shortfall in television advertisements compared to twice the money used
for billboard advertisements.
1.4. SELECTED SITUATIONS . . . 25

Decision Variables

T : millions used for television advertisements;


N : millions used for newspaper advertisements;
B : millions used for advertisements on billboards;
δ+ : excess in television advertisements compared to twice the money used for
billboard advertisements; and
δ− : shortfall in television advertisements compared to twice the money used for
billboard advertisements.

Model (Objective function and constraints)

Maximize
Increase in awareness z =0.0145T + 0.0075N + 0.0175B − k(δ+ + δ− )
Subject to
T +N +B ≤ 10 (Budget constraint)
B ≤3 (Upper limit for billboard advertisement
N ≥ 2.5 (Lower limit for newspaper advertisement)
+ −
T − 2B − δ + δ =0 (Maintaining the rough ratio of allocations)
+ −
T, N , B, δ , δ ≥0 (Non-negativity)

Figure 1.10: Linear programming formulation for Example 1.5

The constraint then becomes

T − 2B − δ+ + δ− = 0.

The media planner’s objective is to maximize the increase in awareness while


discouraging deviations of the ratio between television advertisement and bill-
board advertisement from 2. So the objective in her model would be to

Maximize 0.0145T + 0.0075N + 0.0175B − k(δ+ + δ− ).

The value of k would be chosen to reflect how much deviation would be toler-
ated.
Hence the model that the media planner needs to solve to arrive at the
allocation of budget is shown in Figure 1.10.

The Solution: The optimal solution in this case depends on the value of k.
In this simple problem, for all values of k less than 0.001, the optimal solution
26 CHAPTER 1. FORMULATING LINEAR PROGRAMS

is to use Rs. 4,500,000 for television advertising, Rs. 3,000,000 for billboard ad-
vertising, and Rs. 2,500,000 for advertising in the newspapers. However, if the
value of k is 0.001 or more, then the allocation changes. In this situation, the
optimal solution is to use Rs. 5,000,000 for television advertising, Rs. 2,500,000
each for billboard advertising and newspapers. Thus higher values of k force
the soft constaints to be satisfied exactly.

Modeling situations with multiple objectives


The models that we have seen so far handle only one objective. However in
many practical situations, different stakeholders have different objectives that
they want to optimize. We can handle multiple objectives if we know the rela-
tive importance of these objectives.
Assume that we have n decision variables,x1 , . . . , xn , and a set of constraints
in a model. Suppose that there are two objectives, represented by functions
c1 x1 + · · · cn xn and d 1 x1 + · · · d n xn , and both of these require to be maximized.
Also assume that the first objective is more important than the second one.
One way to find a good solution to this problem is to maximize a weighted
sum of the objectives, i.e., to

Maximize k(c1 x1 + · · · cn xn ) + (d 1 x1 + · · · d n xn ),

where the weight k, (k > 1) represents the the relative importance of the first
objective with respect to the second. A high value of k implies that the first
objective is much more important than the second objective, while a low value
of k implies that it is only marginally more important.
A drawback of this method is that it is often difficult to quantify the im-
portance of one objective in relation to another, especially when objectives
are measured in different units. The solution we get critically depends on the
value of k.
Another way of handling multiple objectives is based on a hierarchical ap-
proach. The idea is to optimize on the most important criterion, and if there
is a tie, to use a less important criterion to break it. To illustrate, let us again
assume that we have two objectives, represented by functions c1 x1 + · · · cn xn
and d 1 x1 +· · · d n xn , and both of these require to be maximized. Let the first ob-
jective be more important to us. We first choose the more important objective
and optimize it ignoring the second objective. Let the optimal objective func-
tion value for the first objective in this case be z c . Subsequently we optimize
the second objective while adding the constraint

c1 x1 + · · · cn xn = zc
1.4. SELECTED SITUATIONS . . . 27

to the original set of constraints. The solution that we get from this stage is
the solution that our model outputs. This method ensures that achieving the
second objective can in no way affect the level of achievement of the first ob-
jective.
A variation of this approach is also seen in practice, especially when the
optimal solution to a high priority objective is unique. In this variation the
constraint added to the later stage includes a concession on the value of the
first objective. As an illustration, the constraint that would get added to the
second stage in our setup will be

c1 x1 + · · · cn xn ≥ (i − α)z c ,

where α is a pre-defined value less than unity. This means that we are allowing
a concession of α to the optimal value of the first objective to obtain a better
optimal value to the second.
It should be obvious that more than two objectives can be modeled using
both these formulation techniques.

Example 1.6: An organization sells two types of lunch packets at very low
prices. A Class-A lunch packet sells for Rs.6.00, and a Class-B lunch packet
sells for Rs.4.00. The organization buys Class-A packets from its suppliers at
Rs.4.80 per packet, and Class-B packets at Rs.3.20 per packet. Its budget for
buying food is Rs.1000 per day on average. To be sustainable, it has a primary
objective to generate as much surplus as possible from selling the packets. The
organization also wants to supply as many Class-A lunch packets as possible.
The organization wants to determine the mix of Class-A and Class-B lunch
packets that it should buy from its suppliers.

The Model: The organization needs to determine the number of each class
of lunch packets that it needs to buy every day. So it needs to define the fol-
lowing decision variables:

x A : number of Class-A lunch packets to procure each day; and


xB : number of Class-B lunch packets to procure each day.

The surplus from each class-A lunch packet is Rs.1.20, while that from each
Class-B lunch packet is Rs.0.80. So the two objective functions that the orga-
nization wants to maximize are

Objective 1: z 1 = 1.20x A + 0.80xB ; and


Objective 2: z 2 = x A .
28 CHAPTER 1. FORMULATING LINEAR PROGRAMS

Decision Variables

x A : number of Class-A lunch packets to procure each day; and


x B : number of Class-B lunch packets to procure each day.

Model (Objective function and constraints)

Maximize
Combined objective z =k(1.20x A + 0.80x B ) + (x A )
Subject to
4.8x A + 3.2x B ≤ 1000 (Budget constraint)
x A , xB ≥0 (Non-negativity)

Figure 1.11: First formulation for Example 1.6

The organization has a daily procurement budget of Rs.1000. This restricts x A


and xB by the relation

4.8x A + 3.2xB ≤ 1000.

Now let us demonstrate the two ways in which the two objectives are con-
sidered in the model.
In the first method, let us decide to assign a weight of k (k > 1) to Objective 1
in order to show that it is more important than the second objective. In this
case, the objective of the organization’s model is

Maximize k(1.20x A + 0.8xB ) + (x A ).

Obviously, x A and xB are non-negative.


This formulation is shown in Figure 1.11.
In the second method, in the first stage, we first maximize Objective 1 sub-
ject to the budget and non-negativity constraints. This is shown as the first
stage model in Figure 1.12. The optimal objective function value for this linear
program is 250. So in this method, we add the constraint

1.20x A + 0.80xB = 250

to the budget and non-negativity constraint and then maximize the second ob-
jective. This is shown as the second stage model in Figure 1.12.
1.4. SELECTED SITUATIONS . . . 29

Decision Variables

x A : number of Class-A lunch packets to procure each day; and


x B : number of Class-B lunch packets to procure each day.

First Stage Model (Objective function and constraints)

Maximize
First objective z 1 =1.20x A + 0.80x B
Subject to
4.8x A + 3.2x B ≤ 1000 (Budget constraint)
x A , xB ≥0 (Non-negativity)

Second Stage Model (Objective function and constraints)

Maximize
Second objective z 2 =x A
Subject to
4.8x A + 3.2x B ≤ 1000 (Budget constraint)
1.20x A + 0.80x B = 250 (Satisfying Objective 1 level)
x A , xB ≥0 (Non-negativity)

Figure 1.12: Second formulation for Example 1.6

The Solutions: In the first formulation, regardless of the value of k, the op-
timal solution is x A = 233.33 and xB = 0. In other words, this formulation al-
ways suggests that, on average, the organization buys 233.33 Class-A packets
and no Class-B packets.
In the first stage of the second formulation, there are an infinite num-
ber of optimal solution. All convex combinations of the solutions (x A , xB ) =
(233.33, 0) and (x A , xB ) = (0, 312.5) are optimal for the first stage model.
In the second stage model, the optimal solution would be the one among
the optimal solutions from the first stage with the largest value of x A , i.e., the
solution (x A , xB ) = (233.33, 0). The search will be restricted among the optimal
solutions of the first stage because of the constraint 1.20x A + 0.80xB = 250.
30 CHAPTER 1. FORMULATING LINEAR PROGRAMS

Modeling min-max and max-min objectives


Consider the following modeling scenario. Let a linear programming formu-
lation have n decision variables, x1 , . . . , xn , a set of constraints that define the
feasible region, and two functions, c1 x1 + · · · + cn xn and d 1 x1 + · · · + d n xn . As-
sume that our objective is to choose values of the decision variables such that
the larger of the two functions is the smallest possible. This kind of objective
is called a min-max objective. Although the maximum of two linear functions
What is a
is not a linear function, this situation can be modeled as a linear program.
min-max
To do this, we define a decision variable v , and constrain it to be not smaller
objective?
than the function values of both the objective function values at any feasible
solution with the constraints
c1 x1 + · · · + cn xn ≤ v, and
d 1 x1 + · · · + d n xn ≤ v,
We then minimize the value of v through the objective function. Notice that v
itself is not non-negative; as it may achieve negative values depending on the
objective functions.
Next let us examine another kind of bottleneck objective. Assume that
we have a linear programming formulation with n decision variables, x1 , . . . ,
xn , a set of constraints that define the feasible region, two functions, c1 x1 +
· · · + cn xn and d 1 x1 + · · · + d n xn , and we want to choose values of the decision
variables such that the smaller of the two functions is as large as possible. This
kind of objective is called a max-min objective. The technique for modeling
What is a
this is similar to the one above; we define a decision variable w, and constrain
max-min
it not to be larger than both the objective function values with the constraints
objective?
c1 x1 + · · · + cn xn ≥ w, and
d 1 x1 + · · · + d n xn ≥ w,
We then trying to maximize the value of w through the objective function.
Here too, w is not declared to be non-negative.

EE Although it is possible to maximize the minimum value attained by a set


of functions, and to minimize the maximum value attained by a set of func-
tions through linear programming, this technique is incapable of maximizing
the the maximum value attained by a set of functions, or to minimize the min-
imum value attained by a set of functions. Go ahead, wonder why this is so.

Example 1.7: Chotamota Construction Company (CCC) has two small ware-
houses at Ambapur and Belapur, which need to supply cement to two build-
1.4. SELECTED SITUATIONS . . . 31

ing sites at Palampur and Rampur. The warehouses at Ambapur and Belapur
have 10 truckloads of cement and 4 truckloads of cement in stock. Palampur
requires 6 truckloads of cement, while Rampur requires 8 truckloads. Each
building site has one truck to transport cement, and can send that truck to
either of the two warehouses. The times taken for round trips from the ware-
houses to the building sites are:

Palampur Rampur
Ambapur 6 hours 5 hours
Belapur 7 hours 8 hours

CCC must decide on how many truckloads to supply to each building site
from each warehouse so that the time required to satisfy all the demands is the
minimum possible.

The Model: CCC needs to decide how many truckloads of cement to send
from each warehouse to each building site. So our model has the following
decision variables:

x AP : truckloads of cement to send from Ambapur to Palampur;


x AR : truckloads of cement to send from Ambapur to Rampur;
xBP : truckloads of cement to send from Belapur to Palampur; and
xBR : truckloads of cement to send from Belapur to Rampur.

Notice that the sum of the demands at the two locations exactly equal the
sum of the stocks at the two warehouses. So the demands would be met ex-
actly, and the amounts of cement sent from each of the two warehouses would
exactly equal their stocks.
Since the demands of both the building locations have to be met, we have
the following constraints in our model:

x AP + xBP = 6 (for Palampur),


x AR + xBR = 8 (for Rampur).

Also, since the full cement stock at both the warehouses have to be sent
out, we have the following constraints in our model:

x AP + x AR = 10 (for Ambapur),
xBP + xBR = 4 (for Belapur).

The building site at Palampur has only one truck. So, the time taken to
deliver its requirement of cement is

TP = 6x AP + 7xBP .
32 CHAPTER 1. FORMULATING LINEAR PROGRAMS

Similarly the time taken to supply the cement requirement of Rampur is

TR = 5x AR + 8xBR .

We need the following decision variable to indicate the time required to meet
all demands:

v : time taken to meet all demands at the two building sites.

Clearly,

v = max(TP , TR ),

and the objective of our model would be to

Minimize v

As per the discussion in this section, v is related to TP and TR by the following


constraints:

6x AP + 7xBP − v ≤ 0, for TP , and5x AR + 8xBR − v ≤ 0, for TR .

The model that we construct for CCC thus is the one shown in Figure 1.13.
Notice that we do not impose a non-negativity constraint on v in the model.

The Solution: The optimal solution to the model is the following: v = 40,
x AP = 2, x AR = 8, xBP = 4, and xBR = 0. This means that the delivery would
be complete in 40 hours, with the warehouse at Ambapur supplying 2 truck-
loads of cement to the building site at Palampur and 8 truckloads of cement
to the building site at Rampur, and the warehouse at Belapur supplying all its
4 truckloads of cement to the site at Palampur.

1.5 Solving Linear Programs


There are two different approaches to solve linear programs; the graphical
approach and the approach using computer software like Microsoft® Excel
Solver, Premium Solver, LINDO, LINGO, GAMS, AMPL, etc. While all these
softwares implement complicated algorithms solving linear programs, our in-
terest is not in the algorithms, but the significance of the results that they re-
turn.
We first look at the graphical approach to solve linear programs. This ap-
The graphical
proach is mostly pedagogical, and can be used only for linear programs with
approach to
solving linear
programs.
1.5. SOLVING LINEAR PROGRAMS 33

Decision Variables

x AP : truckloads of cement to send from Ambapur to Palampur;


x AR : truckloads of cement to send from Ambapur to Rampur;
x B P : truckloads of cement to send from Belapur to Palampur;
x B R : truckloads of cement to send from Belapur to Rampur; and
v: time taken to meet all demands at the two building sites.

Model (Objective function and constraints)

Minimize
Delivery time z =v
Subject to
x AP + x B P = 6 (Demand at Palampur)
x AR + x B R = 8 (Demand at Rampur)
x AP + x AR = 10 (Stock at Ambapur)
xB P + xB R = 4 (Stock at Belapur)
6x AP + 7x B P − v ≤ 0 (linking v to TP )
5x AR + 8x B R − v ≤ 0 (linking v to TR )
x AP , x AR , x B P , x B R ≥ 0 (Non-negativity)

Figure 1.13: Linear programming formulation for Example 1.7

two decision variables. It is based on the fact that the feasible region of a linear
program with two decision variables can be depicted to scale on paper, and
that at least one optimal solution of any linear program is at a corner point.
Two closely related graphical methods are known, and we will describe both
of them in the following paragraphs.
In the first method, we draw the feasible region for the linear program, and
note down the solutions corresponding to the corner points. We then com-
pute the values of the objective function for all the corner point solutions and
output the solution for which the objective function value is the best (i.e., the
maximum for maximization problems, and the minimum for minimization
problems) as an optimal solution.
Consider for example, the problem described in Section 1.1. The feasible
region for the problem is shown in Figure 1.14. The solutions correspond-
ing to the corner points of the feasible region, and the objective function val-
ues at each corner point solution are shown in Table 1.1. Since our objec-
34 CHAPTER 1. FORMULATING LINEAR PROGRAMS

800

P
600

400 Q

200 R

S
–100 O 100 200 300 400 500 T

Figure 1.14: Feasible region of the problem in Section 1.1 with corners labeled

Table 1.1: Corner points in Figure 1.14 and their properties

Corner Solution Objective function


Point T C value
O 0 0 Rs. 0.00
P 0 600 Rs. 30,000.00
9 9
Q 181 11 381 11 Rs. 31,818.18
R 300 200 Rs. 31,000.00
S 300 0 Rs. 21,000.00

tive is to maximize contribution, we choose the optimal solution as the one


corresponding to point Q, i.e., a daily production plan to produce 181 9/11
tables and 381 9/11 chairs. The optimal daily contribution from this plan is
Rs. 31,818.18.
Evaluating all basic feasible solutions is tedious, especially when there are
many constraints, so an alternate graphical method is sometimes used. In this
method, we draw the feasible region of the linear program as usual. Then we
find a feasible objective function value c (usually from any feasible solution)
to start the method, and draw a line with the equation z = c, where z is the
objective function of the linear program. We also obtain the direction of im-
provement of the objective function. In case of the problem in the example
1.5. SOLVING LINEAR PROGRAMS 35

in Section 1.1, when c = 17, 000, the diagram at this stage looks like Figure 1.6
on page 15. We then slide the line z = c parallel to the original line along the
direction of improvement until it just touches the feasible region. This situa-
tion depicted in Figure 1.15. The solution corresponding to the corner point

800

600

400

200

–100 0 100 200 300 400 500 T

Figure 1.15: Illustration of the graphical method

at which the line now touches the feasible region is an optimal solution. We
leave it to the reader to figure out whether the line can touch more than one
corner point at this stage, and if it does, what inferences can be drawn from it.
As mentioned earlier, both variants of the graphical method work when a
linear program has two decision variables. However most problems that oc-
cur in practice are much larger; often with thousands to millions of decision
variables. Clearly graphical methods do not work in such situations. There,
one uses computer algorithms to obtain optimal solutions. Traditional algo-
rithms, like the simplex method work by jumping from corner point to corner
point until an optimal solution is found. Newer methods, like interior point or
barrier methods work on slightly different principles. The exact descriptions
of these algorithms are beyond the scope of this book. So for the remainder of
this section, we will use Microsoft® Excel to solve linear programs.
Linear programs can be solved in Microsoft® Excel using its Solver add-
6 Using Microsoft®
in. Before invoking Solver, we need to create a worksheet with data that
Excel Solver.
6
Solver is not normally included in the default installation of Microsoft Office; to check
36 CHAPTER 1. FORMULATING LINEAR PROGRAMS

Solver can use. For our example from Section 1.1, we can set up the work-
sheet as shown in Figure 1.16. Two cells B2 and C2 have been used to store
the final values of the decision variables T and C. In cells B3 and C3, we have
entered the contribution per table and chair respectively. The cell C4 has a
formula for the the objective function value (i.e., contribution) of the solu-
tion represented by the cells B2 and C2. This is computed using the formula
‘=SUMPRODUCT(B2:C2,B3:C3)’. We next enter the constraints in the work-
sheet. It is always a good idea to label each constraint. In our case, rows 7, 8,

Figure 1.16: The Microsoft® Excel sheet set up before calling Solver

and 9 contain the constraints for wood availability, labor capacity, and market
capacity for tables respectively. We have entered the function corresponding
to the left hand side of the constraints in column E, marked LHS, and writ-
ten the formula alongside. We next enter the values on the right hand side of
the constraints in column D, marked RHS. Normally we would have the LHS
column appear before the RHS column. We break from convention here so
that we can write down the SUMPRODUCT function used in the formulae for
if it is loaded on your computer, open Microsoft Excel and check the drop down menu under
Tools. If Solver does not appear in the menu, then you have to separately install it. To do so,
go to Tools→Add-ins. . . , check the box next to Solver Add-in and click OK. Solver should load
and appear on the drop down menu under Tools the next time you look for it. (You may need
the Microsoft® Office CD during the installation process.)
1.5. SOLVING LINEAR PROGRAMS 37

LHS for illustrative purposes only. Notice that we have not yet entered the
non-negativity constraints in our model.
We are now ready to invoke Solver by choosing the Tools menu and choos-
ing the Solver option. Solver opens a dialog box labeled Solver Parameters
similar to the one shown in Figure 1.17. We first input the cell reference at

Figure 1.17: Microsoft® Excel Solver parameters

which the objective function value is computed (in our case, cell $C$4), and
click the radio button below it to specify that we want to maximize the objec-
tive function. As is clear from the figure, the other choices that Solver allows
you are to minimize an objective function, or to find a solution that sets the
objective function to a pre-specified value. Next, in the box labeled “By chang-
ing cells”, we specify the cells in which the decision variables of the model are
stored. Finally, we add constraints to the model by clicking on the “Add” but-
ton and adding the constraints.

EE Notice that by default, the variables have been marked non-negative. If


this is not desired, we must uncheck the checkbox below the “Subject to the Con-
38 CHAPTER 1. FORMULATING LINEAR PROGRAMS

straints” box.

Next we must specify to Solver that we want to solve a linear program. By


default Solver expects the model to be non-linear and suggests that we use
“GRG Nonlinear” as the solution method. We indicate the model to be linear
by changing the method to “Simplex LP”. Once this is done, Solver has all in-
puts it needs to solve the model. So we go back to the Solution Parameters
screen by clicking “Solve” at the bottom of the Solver Parameters screen.
On clicking the “Solve” button, Solver solves the model, and shows a solu-
tion status dialog box, labeled Solver Results (see Figure 1.18). This says that
Solver has found an optimal solution. Once this dialog box is seen, there is
nothing further to be done, and the Solver Results dialog box can be removed
by clicking on the “OK” button on this box.

Figure 1.18: Microsoft® Excel solution dialog box after running Solver

When the Solver Results dialog box is removed, the values of the decision
variables and the optimal solution obtained by Solver appear in the appro-
priate cells (in our case, cells B2, C2 and C4 respectively). After the solution
process is over, the worksheet looks like Figure 1.19. Notice that the solution
shown in the worksheet is the same as the one that was arrived at in the intro-
ductory section.

EE The report in the Solver Results dialog box is inconspicuous and often
ignored, but needs to be checked every time a linear program is solved using
1.6. ADDITIONAL TERMINOLOGY 39

Figure 1.19: The Microsoft® Excel sheet with the solution

Solver. If the model does not have a finite optimal solution (i.e., is unbounded)
or has no feasible solution (i.e., infeasible), the cells containing the decision
variables and the objective function value in the worksheet would have inter-
mediate values assigned to them by Solver. It is not necessary that these values
correspond to the best solution that Solver found (i.e., the least infeasible solu-
tion). Ignoring the message in the Solver Results dialog box can mislead the
modeler in such cases.

1.6 Additional Terminology


This chapter introduces linear programming problems, their properties, and
some approaches to solve them. However, while introducing the subject at
this level, we did not need to introduce several terms that are quite commonly
used in connection to linear programming. In this section, we informally de-
scribe some of these terms (in lexicographic order).

Basic variables: Consider the problem discussed in Section 1.1. In this prob-
lem, there are two decision variables, and three constraints (excluding
the non-negativity constraints). There are several corner point solu-
tions in this problem, and at each corner point solution, some decision
40 CHAPTER 1. FORMULATING LINEAR PROGRAMS

variables assume values which are not at their lower bounds (which is
zero in this case) or at their upper bounds (which is infinite in this case).
These decision variables are said to be basic variables corresponding to
the particular corner point.
For example, at the corner point solution marked Q in Figure 1.15 on
page 35, both T and C assume non-zero values. So T and C are both
basic variables corresponding to the corner point solution at Q. At the
corner point solution marked P, only C assumes a non-zero value, while
T assumes a zero value, i.e., it is at its lower bound. So C is a basic vari-
able and T is a non-basic variable corresponding to the corner point
solution at P.

Binding and Non-Binding Constraints: A constraint that is satisfied exactly,


i.e., holds as an equality at a solution is said to be binding at that par-
ticular solution. Otherwise a constraint is said to be non-binding at
that solution. For example, in Figure 1.15, at the solution marked by
the point Q, the constraints on the availability of wood and the capac-
ity of the labor force are the only constraints that are binding. For the
point marked S, the constraint on the market demand for tables and the
non-negativity constraint of the decision variable C are the only binding
constraint. All constraints are non-binding for a solution in the interior
of the feasible region.

Degenerate solution: In a linear program with n decision variables, n lin-


early independent constraints are sufficient to define a corner point so-
lution. However, it may so happen that, including non-negativity con-
straints, more than n constraints pass through a corner point. Such cor-
ner points are then called degenerate. For example, consider the follow-
ing linear program.
Decision Variables
X 1, X 2: Two decision variables.
1.6. ADDITIONAL TERMINOLOGY 41

Model (Objective function and constraints)

Maximize
z =x1 + x2
Subject to
x1 ≤ 1 (Constraint 1)
x2 ≤ 1 (Constraint 2)
x1 + x2 ≤ 2 (Constraint 3)
x1 , x2 ≥ 0 (Non-negativity)

In this program, there are two decision variables, x1 and x2 , and all three
constraints pass through the corner point (1, 1). (Draw the feasible re-
gion to convince yourself of this fact). The point (1, 1) is therefore a de-
generate solution in this program. Given a linear program with a degen-
erate solution, it is always possible to remove a constraint which does
not affect the feasible region. However, the constraint to be removed
needs to be chosen with care. For example, removing constraint 2 in the
program above changes the feasible region, while constraint 3 is clearly
redundant. In practice it is hard to identify which constraint is redun-
dant.

Infeasible linear program: An infeasible linear program is one in which there


are no feasible solutions. This happens when one set of constraints pre-
clude another set of constraints in the linear program. An example of an
infeasible linear program is
Decision Variables
X 1, X 2: Two decision variables.

Model (Objective function and constraints)

Maximize
z =x1 + x2
Subject to
x1 + x2 ≤ 2 (Constraint 1)
x1 + x2 ≥ 4 (Constraint 2)
x1 , x2 ≥ 0 (Non-negativity)

Draw the constraints to satisfy yourself that this program is infeasible.


42 CHAPTER 1. FORMULATING LINEAR PROGRAMS

Redundant Constraints: In a mathematical program, there may be constraints


whose removal does not change the feasible region. Such constraints
are called redundant constraints.
For illustration, in the example given in Section 1.1, let there be an addi-
tional market constraint that not more than 1000 chairs can be sold on
any given day. It is easy to see that the constraint would not affect the
feasible region for the linear program in any way. This constraint would
then be called redundant.

Relaxation of a mathematical program: A model is said to be relaxed if one


or more constraints are removed from the model. A relaxation of a model
enlarges the set of solutions that are feasible for the model. Hence the
solution to the relaxation is “better” (i.e., larger for maximization prob-
lems and smaller for minimization problems), or at least, “no worse”
than the original solution.

Unbounded linear program: An unbounded linear program is one in which


the set of constraints are unable to stop an objective function from at-
taining arbitrarily high values in a maximization problem, and from at-
taining arbitrarily low values in a minimization problem. An example of
an unbounded linear program with maximization objective is
Decision Variables
X 1, X 2: Two decision variables.

Model (Objective function and constraints)

Maximize
z =x1 + x2
Subject to
2x1 + x2 ≥ 5 (Constraint 1)
x1 + x2 ≥ 4 (Constraint 2)
x1 , x2 ≥ 0 (Non-negativity)

Graph the constraints to satisfy yourself that this program is unbounded


above.
PROBLEMS 43

Problems
Problem 1.1: A paint manufacturer manufactures two types of paint, Regular
and Premium. To manufacture these paints, he mixes three components, a
base, a pigment, and some adhesive. Each liter of Regular paint has 950ml of
base, 40ml of pigment, and 10ml of adhesive. Each liter of Premium paint has
930ml of base, 55ml of pigment, and 15ml of adhesive. Regular paint sells at
Rs. 150 a liter, and Premium paint sells at Rs. 180 a liter.
The manufacturer obtains the components from two suppliers. He has
signed a yearly contract with the first supplier valued at Rs. 2,00,000, to sup-
ply him with 4000 liters of base and 340 liters of pigment each day. He has
also signed a yearly contract with the second supplier, valued at Rs. 1,50,000
to supply him with 3500 liters of base and 100 liters of adhesive each day.
The manufacturing unit is staffed by ten permanent employees each earning
Rs. 10,000 per month, in addition to a bonus of Rs. 0.50 for every liter of Regu-
lar paint produced, and Rs. 0.80 for every liter of Premium paint produced.
The manufacturer wants to find out how much Regular and Premium paint
he should produce each day in order to maximize the contribution to profits.

a. What costs are relevant to the manufacturer’s product mix decision?

b. What combinations of production of Regular and Premium paints is feasi-


ble for the manufacturer?

c. What would be the best product mix from the manufacturer’s point of
view?

d. If the company employees were given a free hand at deciding the product
mix, what product mix would they suggest? How does this product mix
compare with the product mix you obtained in part (c)?

[Answer(s): (c) 6398.67 liters of Regular and 1528.24 liters of Premium (d) 0
liters of Regular and 6181.82 liters of Premium ]

Problem 1.2: A cafeteria serves one among three meals, Meal A, Meal B, and
Meal C to all students in a school each day for lunch. Each student gets one
serving of the meal of the day. One serving of Meal A contains 30g of protein,
65g of carbohydrates, 25mg of minerals, and 55g of fat. One serving of Meal B
contains 45g of protein, 40g of carbohydrates, 20mg of minerals, and 45g of
fat. One seving of Meal C contains 40g of protein, 35g of carbohydrates, 25mg
of minerals, and 45g of fat.
44 CHAPTER 1. FORMULATING LINEAR PROGRAMS

The school dietitian has suggested that from each meal serving, students
should obtain on average at least 40g each of proteins and carbohydrates, be-
tween 22 and 30mg of minerals, and at most 50g of fat. One serving of Meal A,
Meal B, and Meal C costs the cafeteria Rs. 20, Rs. 35 per meal, and Rs. 40 re-
spectively. The school management wants to know the minimum price that it
can set for meals in its fee structure.

a. Describe different combinations of the meals (i.e., percentages of times


Meal A, Meal B, and Meal C should be served) that would satisfy the dieti-
tian?

b. What is the minimum price that can be set for the meal plan?

c. Are any of the conditions that you specified in part (a) redundant?

d. Can you solve this problem using only two decision variables?

[Answer(s): (b) Rs. 31. ]

Problem 1.3: A textile manufacturing unit manufactures two types of cloths,


suiting and shirting. Suiting is sold in the market at Rs. 100 per meter and
shirting at Rs. 80 per meter. Both types of cloth are made from two different
types of yarns, heavy and light. One meter of suiting requires 100g of heavy
yarn and 30g of light yarn, while one meter of shirting requires 10g of heavy
yarn and 80gms of light yarn. Heavy yarn costs Rs. 150 per kilo and light yarn
costs Rs. 280 per kilo.
The unit has 20 looms that work 20 days a month on average. Each loom
can manufacture 150 meters of suiting in a day if it only produces suiting, and
180 meters of shirting if it only produces shirting.
The unit employs 28 permanent employees to work the looms (one em-
ployee per loom). The rate of absenteeism is 10 man-days per month, on av-
erage. The employees are paid Rs. 40,000 per month.

a. Formulate the constraints for the manufacturing unit mathematically.

b. What equation describes the set of feasible compositions of products that


generate a monthly contribution of Rs. 12,00,000 to the unit’s profits?

c. What is the best monthly production plan for the unit?

[Answer(s): (c) Produce 60,000 m of suiting only ]


PROBLEMS 45

Problem 1.4: OilComp Ltd. has put out a tender for 50,000 barrels of petrol,
30,000 barrels of kerosene, and 25,000 barrels of lube oil. Your company thinks
that it can bid for this tender.
Your company procures two types of crude, called Crude A and Crude
B, and refines them into the desired products. Each barrel of Crude A costs
Rs. 750 and yields 20% by volume of petrol, 10% by volume of kerosene, and
50% by volume of lube oil. Each barrel of Crude B costs Rs. 1000, and yields
40% by volume of petrol, 30% by volume of kerosene, and 20% by volume of
lube oil. You are confident that any excess of petrol, kerosene, and lube oil
that you produce will be sold in the market at Rs. 500 a barrel, Rs. 400 a bar-
rel, and Rs. 100 a barrel respectively. Due to existing regulations, you cannot
procure more than 100,000 barrels of Crude A and more than 80,000 barrels of
Crude B during this period. Answer the following questions independent of
each other.
a. Formulate a linear programming model that will allow you to decide on
the minimum price you should bid for the OilComp tender.

b. Suppose that OilComp revises its tender. According to the new tender, the
requirements are for 30,000 barrels of petrol, 50,000 barrels of kerosene,
and 25,000 barrels of lube oil. OilComp allows you to revise/cancel your
bid after these changes. What should you do?

c. Ignore the change in the tender mentioned in part (b). The price of crude
oil has just increased. Now Crude A costs Rs. 900 per barrel, and Crude B
costs Rs. 1200 per barrel. However, the market prices of petrol and kerosene
have also increased by Rs. 100 per barrel and Rs. 50 per barrel respectively.
The price of lube oil has remained the same. How do these changes alter
your bid?
[Answer(s): (a) Rs. 142,700,000 (c) Rs. 172,050,000 ]

Problem 1.5: The VegOil company buys two grades of raw vegetable oils VEG1
and VEG2, blends and processes them into three intermediate products, Reg-
ular, High, and Super; and supplies them to another company, OilSel. The
vegetable oils that VegOil obtain have the following active components.

Component VEG1 VEG2


Polyunsaturated fatty acid (PUFA) 60% 55%
Monounsaturated fatty acid (MUFA) 25% 20%
Saturated fatty acid (SFA) 12% 18%
Others 3% 7%
Total 100% 100%
46 CHAPTER 1. FORMULATING LINEAR PROGRAMS

VEG1 costs Rs. 160 a barrel, and VEG2 costs Rs. 170 a barrel.
Quality restrictions on the three intermediate products are stringent. While
Regular oil can have as high as 80% of unsaturated fatty acids (both PUFA and
MUFA), High oil can have a maximum of 78% and Super oil can have a maxi-
mum of 75%. Regular oil must have at least 13% of SFA, while High oil needs
to have at least 15% SFA. For this problem, assume that fatty acids blend lin-
early. VegOil has a contract with OilSel to supply them 400 barrels of Regular
oil, 250 barrels of High oil, and 500 barrels of Super oil every day.

a. How much money does VegOil need to spend every day on procuring VEG1
and VEG2 to supply the contracted quantities of Regular, High, and Super
oils to OilSel?

b. Suppose the contract also states that if VegOil supplies less than the con-
tracted amount of the various oils, they would pay a penalty of Rs. 168 for
each barrel of shortfall. Under this new condition, what is the cheapest
way in which VegOil can deal with OilSel?

[Answer(s): (a) Rs. 192,750 (b) Rs. 191,750; do not supply Super. ]

 Problem 1.6: When a customer asks a bank for a loan, the bank checks to see
if the customer is a good risk for the loan. In order to check this, the bank
runs a check and computes a probability of repayment (called PR). They also
guess a probability of doing business with the customer in future (called PBF).
These probabilities are converted to a continuous scale from 0 through 10 by
multiplying the probabilities by 10. The loan approval decision is based on a
careful appraisal of these scores.
The PR and PBF scores and loan approval decisions in the last 15 applica-
tions are the following. These decisions were based on the experience of an
officer granting the loans.

Req. id PR PBF Approved? Req. id PR PBF Approved?


132 4.9 0.1 No 133 5.3 0.9 No
134 7.1 1.7 Yes 135 3.4 0.7 No
136 7.9 4.1 Yes 137 3.7 6.6 Yes
138 4.7 4.4 Yes 139 5.5 4.4 Yes
140 1.5 4.6 No 141 0.4 4.3 No
142 7.7 6.7 Yes 143 2.6 6.1 Yes
144 1.8 0.0 No 145 2.7 6.4 Yes
146 3.7 2.1 No
PROBLEMS 47

The bank manager now feels that the approval process can be automated. She
wants a single score that is a weighted sum of the PR and PBF scores, and
would approve the loan if and only if this score exceeds a threshold.

a. Based on the fifteen data points that you have, can you suggest a weighing
of the PR and PBF scores and a convenient threshold that would agree with
the last 15 decisions?

b. What weighing of the scores and threshold will give your model the best
discriminating power?

[Answer(s): (a) 0.1133 PR + 0.1158 PBF = 1 (b) 0.1327 PR + 0.1363 PBF = 1 ]

Problem 1.7: A company that manufactures and sells consumer durables has
noted that the sales of premium television sets can be predicted from general 
satisfaction levels of the public at large. At the end of each month, the research
department provides the company an indicator for the next months satisfac-
tion levels. This indicator is a number between 0 and 100, A high value of the
indicator indicates a higher sales level for the next month. The values of the
indicator for the last twelve months and the numbers of premium television
sets sold during the same months are given in the table below.

Month Indicator Sales


1 61 266
2 52 123
3 74 353
4 66 298
5 79 260
6 59 261
7 61 235
8 88 309
9 62 278
10 76 247
11 87 288
12 60 210

The management of the company believe that the sales of any given month is
a linear function of the indicator for that month, and want to derive the func-
tion based on the data available. They realize that when they come up with
an equation, there would be a difference between the number of sets actually
sold in a given month and the number of sets that their model would predict
for that month. They figure that a good fit would be a model which minimized
48 CHAPTER 1. FORMULATING LINEAR PROGRAMS

the sum of the deviations between the actual and predicted numbers over all
twelve months. (Notice that the deviation would be non-negative regardless
of whether the prediction exceeded or fell short of the actual sales.)

a. Construct a linear programming model to output the linear function that


the management is looking for. Based on the data, what linear function
would your model output?

b. A method called OLS curve fitting minimizes the square of the deviations
between the actual and estimated sales. OLS curve fitting returns the fol-
lowing equation

sales = 56.721 + 2.966 × indicator.

Compare this equation with the equation you obtain in part (a), and com-
ment on the two.

c. The statistics department of the company sent a memo stating that the
sales figure for month 2 is incorrect, and should read 163 instead of 123.
The OLS equation with the changed data is

sales = 90.474 + 2.524 × indicator.

What is the corresponding equation that you obtain from your model from
part (a).

d. Another method of finding a good fit is to ensure that the maximum de-
viation between the actual and predicted numbers is as small as possible.
Construct a linear model that achieves this objective. Ignore the change in
data mentioned in part (c).

e. Comment on the sensitivity of the three models to changes in data.

[Answer(s): (a) S = 204.1071 + 0.9643 I (c) No change (d) S = 0 + 3.7778 I ]

Problem 1.8: A company has embarked on a new project which is to last three
months. The requirements for researchers for the project in each of the three
months is given below.

Month 1 2 3
Requirement 20 10 30
PROBLEMS 49

The Human Resources department of the company has been entrusted with
the hiring and firing decisions of researchers for the project.
Each researcher working on the project needs to be paid Rs. 20,000 per
month. The cost of hiring a researcher (including search and training costs) is
Rs. 15,000 per person. There is no cost associated with letting a researcher go
(firing) when she is no longer required for the project.

a. The company indicates that the project cannot be under-staffed. What is


the most cost effective staffing policy in this case?

b. The company relaxes the condition on under-staffing in part (a). However,


they note that over-staffing costs the company an additional Rs. 35,000
per person per month over and above the excess salary costs, and under-
staffing costs the company Rs. 40,000 per person per month. In addition
they realize that the cost of letting a researcher go is actually Rs. 15,000 per
person. What are the best staffing decisions in this case?

[Answer(s): (a) Cost Rs. 1,800,000 (b) Cost Rs. 2,400,000 ]

Problem 1.9: A management school is located some distance outside the


nearest town. Ninety students in the school want to visit a factory (also out-

side the town) to collect data for a project.
The students plan to go in four batches, 15 students at 10AM, 35 students
at 1PM, 10 students at 4PM, and the remaining 30 students at 7PM. The time
required to take the students by car from the school to the factory, wait for
their data collection to be over, and then bring them back to the school is 90
minutes.The school authorities have paid Rs. 5000 to Amar Travels, a car rental
company in the town to arrange cars for the trips.
The manager at Amar Travels can spare a maximum of seven cars for the
students at any given time. Each car is capable of carrying five students. These
cars normally make a profit of Rs. 30 per hour on average ferrying people
within the town. The cars would require fuel worth Rs. 25 to make the half-
hour trip from the company garage to the school, and Rs. 25 to make the half-
hour trip back.
Answer the following questions independent of each other unless speci-
fied.

a. Assume that no student is to be kept waiting at the pick-up point. How


should the manager at Amar Travels deploy cars so as to complete this
project at minimum cost?
50 CHAPTER 1. FORMULATING LINEAR PROGRAMS

b. Suppose that the contract stipulates that every time a student is at the
pick-up point at the stipulated hour, and is not picked up due to a lack
of available cars, the student is to be treated to refreshments worth Rs. 15
for the wait until the next pick-up three hours later. Under this stipulation,
how should the manager deploy cars? For this question assume that Amar
Travels has only six cars available.

[Answer(s): (a) Cost Rs. 2005 (b) Cost Rs.2010 ]


CHAPTER
2
P OST-O PTIMALITY A NALYSIS IN
L INEAR P ROGRAMS

2.1 Another Furniture Example


Consider a manufacturing setup very similar to the setup described in Sec-
tion 1.1. You are still a manufacturer of tables and chairs in Ahmedabad. You
receive enough of wood at your unit every day to manufacture 400 tables if you
manufacture only tables, or 700 chairs if you are manufacture only chairs. The
employees in your unit can manufacture 500 tables on any given day if they
manufacture only tables, and 600 chairs a day if they manufacture only chairs.
Each table that you produce needs to be fitted with a reading lamp. Your ven-
dor supplies you with 300 reading lamps each day on a long term contract.
The contribution to profit from each table is Rs. 70 and that from each chair
is Rs. 50. Your aim is to maximize the total contribution from your unit.1 Your
daily production plan is obtained by solving the linear programming model
shown in Figure 2.1. Your optimal production plan is to manufacture 181 9/11
tables and 381 9/11 chairs every day, on average.
Now suppose that a rival company wants to buy your resources, and asks
you to quote a price for each of your resources. Note that the rival company
may use your resources in whatever way it may see fit. It is not interested in
1
We make these changes with respect to the example in Section 1.1 so that the changed
problem leads to more meaningful interpretations of the concepts that we introduce in this
chapter.

51
52 CHAPTER 2. POST-OPTIMALITY ANALYSIS

Decision Variables

T : number of tables produced by the unit per day; and


C : number of chairs produced by the unit per day.

Model (Objective function and constraints)

Maximize
Contribution z =70T + 50C
Subject to
T /400 +C /700 ≤ 1 (Stock of wood)
T /500 +C /600 ≤ 1 (Labor capacity)
T ≤ 300 (Stock of reading lamps)
T, C ≥0 (Non-negativity)

Figure 2.1: Linear programming formulation for the example in Section 2.1

your business or markets. Let us assume that this company has full and cor-
rect information about your production capabilities, your inventory, and the
contributions that you obtain from each table and each chair. This scenario
occurs when the acquirer is a dominant player and the target is in a weak po-
sition.
An intuitive approach to determining prices is the following. Let us try to
Warning: This
determine the price of your labor capabilities. We know that with your labor
approach is not
working at full capacity, you make a contribution of Rs. 31,818.18 per day. Now
guaranteed to
let us reduce the labor capacity by 20%. The labor capacity constraint in the
work!
model in Figure 2.1 becomes

T /500 +C /600 ≤ 1.0 − 0.2 = 0.8

while the other constraints remain unchanged. If we solve this changed model,
then we get an optimal contribution of Rs. 27,000.00. This implies that 20% of
your labor force is capable of generating a contribution of Rs. (31, 818.18 −
27, 000.00) = Rs. 4818.18, which in turn implies that the price of your labor re-
source is Rs. 4818.18/0.2 = Rs. 24,090.91. We could follow a similar process for
computing the prices of your daily stock of wood and reading lamps.
There is a problem with this approach. Let us say that we reduce, not 20%
of the labor capacity, but only 10% of it. In that case, the labor capacity con-
2.1. ANOTHER EXAMPLE . . . 53

straint in the model of Figure 2.1 changes to

T /500 +C /600 ≤ 1.0 − 0.1 = 0.9,

and the optimal contribution from this changed model is Rs. 29,909.09. From
this data, the price of your labor capacity turns out to be Rs. (31, 818.18 −
29, 909.09)/0.1 = Rs. 19,090.91, which is different from the figure of Rs. 24,090.91
that we had earlier.
Let us understand why this difference occurs. Figure 2.2 shows a portion
of the feasible region for the original problem. Q marks the corner point so-
C
Q

Lamp Availability
350

Labor Capability
300

250

200

Wood Availability
150

100
150 200 250 300 T

Figure 2.2: The original feasible region and optimum

lution which is optimal for the linear program in Figure 2.1. Notice that labor
capacity and wood availability are binding for this solution. When the labor
capacity reduces by 10%, the labor capacity constraint shifts and the optimal
solution also changes (see the point Q’ in Figure 2.3). The change is purely
due to the reduced labor capacity, and wood availability and labor capacity
still determine the optimal product mix. Therefore, the loss of contribution in
this case is solely due to the reduction in labor capacity, and the price of la-
bor computed by reducing labor capacity by 10% (i.e., Rs. 19,090.91) is a true
measure of the price of labor at the optimal solution of the original problem.
However, if the labor capacity is reduced by 20%, the feasible region looks
like Figure 2.4. The optimal corner point solution in this case is the point Q”
in this figure. Notice, that with the labor capacity reduced to this level, there
is not enough labor to fully use the wood available, and the number of read-
ing lamps available becomes important. Therefore, the price that we obtained
by reducing the labor capacity by 20% was not the true price of labor capac-
ity at the optimal solution because it included the effect of the new binding
constraint.
54 CHAPTER 2. POST-OPTIMALITY ANALYSIS

350

300

250

200 Q’

150

100
150 200 250 300 T

Figure 2.3: The feasible region and optimum with the labor capacity reduced
by 10%

350

300

250

200

150

Q’’

100
150 200 250 300 T

Figure 2.4: The feasible region and optimum with 20% of labor capacity sold
off

EE Since we improve our chances of getting the correct price of a resource by


making small increments, we are really trying to find out the change in con-
tribution through a sufficiently small change in the resource level. Thus these
prices are marginal prices. A natural question is whether, without solving the
original problem, we can suggest any quantity of reduction in the availabil-
ity of a resource through which we can guarantee that we will obtain the true
prices of the resource by following the method described above. Unfortunately,
the answer is ‘no’. In the worst case, when an optimal solution is degenerate,
there may not exist any positive amount of reduction which would work. Also,
2.2. SHADOW PRICES AND THE DUAL PROGRAM 55

the option of using extremely small increments to compute the prices is not ad-
visable, if a computer is used to compute shadow prices. Computers are finite
precision machines, and dividing very small quantities by very small quantities
leads to large rounding errors.

We therefore need a method of finding shadow prices for different con-


straints in a linear program, which has two important features:

1. the method should be guaranteed to work on all linear programs, and


should not ask the user to supply details like sufficiently small incre-
ments for the value on the right hand side of the constraint; and
2. the shadow prices it outputs should match the shadow prices obtained
from the intuitive method described in this section, had the modeler
supplied appropriately small increments for the value on the right hand
side of the constraint. We insist on this criterion because, apart from the
fact that the intuitive method fails for problems in which the step size is
inappropriately stated, it is a sensible method of obtaining the price of
a resource.

We describe such an approach in the next section.

2.2 Shadow Prices and The Dual Program


Since the rival company has all the information about your manufacturing
setup that it needs, let us try to develop a model to decide the prices of your
resources from the rival company’s point of view. We define the following vari-
ables for prices that it should be willing to pay for your resources:

p w : price for the daily stock of wood;


p l : price for the daily labor capacity; and
p r : price of a reading lamp.

We call these prices “shadow prices”. They are marginal prices of the re-
What are shadow
sources.
prices?
Notice that each of the three resources are never used in isolation. So for
example, wood can be used in three different ways: (1) it can be used to man-
ufacture a table, (2) it can be used to manufacture a chair, or (3) it can lie
unused. If it is used to manufacture a table, then it is part of a bundle con-
sisting of 1/400-th of the daily stock of wood, 1/500-th of the daily availability
of labor, and 1 reading lamp. This bundle generates Rs.70 in contribution for
your company. So you will sell this bundle to the rival company instead of
56 CHAPTER 2. POST-OPTIMALITY ANALYSIS

producing tables only if the price you get for the bundle is not less than Rs.70.
In other words, you will insist that

p w /400 + p l /500 + p r ≥ 70.

If the wood was used to manufacture a chair, it will be part of a bundle consist-
ing of 1/700-th of the daily stock of wood and 1/600-th of the daily availability
of labor. This bundle of resources generates a contribution of Rs.50. So you
will sell this bundle to the rival company instead of producing chairs only if

p w /700 + p l /600 ≥ 50.

If it was lying unused, you would settle for any non-negative price for the
wood, i.e., you will insist that

p w ≥ 0.

Labor similarly has three uses; it could be used as (1) a part of a bundle
consisting of 1/400-th of the daily stock of wood, 1/500-th of the daily avail-
ability of labor, and 1 reading lamp required to produce a table, or (2) a part of
a bundle consisting of 1/700-th of the daily stock of wood and 1/600-th of the
daily availability of labor required to produce a chair, or (3) it may be unused.
Using an argument similar to the one above, any price that you will agree for
labor would have to satisfy the conditions

p w /400 + p l /500 + p r ≥ 70,


p w /700 + p l /600 ≥ 50, and
p l ≥ 0.

Using a similar argument, you will agree to sell off reading lamps only if
the following conditions were satisfied.

p w /400 + p l /500 + p r ≥ 70,


p w /700 + p l /600 ≥ 50, and
p r ≥ 0.

Thus any set of non-negative prices satisfying the conditions for pricing of
bundles used for manufacturing tables and chairs will be fine with you.
Now your rival would want to minimize the amount of money that they
pay you. Remember, that the prices are marginal prices, so the rival will want
to minimize the price they pay for a very small fraction, say ε part of your
resources. The price of this fraction is ε(p w + p l + 300p r ) which your rival
2.2. SHADOW PRICES AND THE DUAL PROGRAM 57

Decision Variables

p w : price for the daily stock of wood;


p l : price for the daily labor capacity; and
p r : price for the daily stock of reading lamps.

Model (Objective function and constraints)

Minimize
Amount payable z =p w + p l + 300p r
Subject to
p w /400 + p l /500 + p r ≥ 70 (For tables)
p w /700 + p l /600 ≥ 50 (For chairs)
pw , pl , pr ≥ 0 (Non-negativity)

Figure 2.5: Linear programming model developed by the company buying out
your resources

wants to minimize. Now since ε is a constant, this is equivalent to minimiz-


ing p w + p l + 300p r . Thus the rival company obtains the linear programming
model shown in Figure 2.5. Notice that solving this program allows the com-
pany to ascertain the prices of all three resources at once.
The optimal solution to this model is z = 31, 818.18, p w = 12, 727.27, p l =
19, 090.91, and p r = 0. Check that it meets both the criteria that we set our-
selves on page 55. Also notice that the value of the objective function of the
optimal solution to this problem is the same as the contribution from your
optimal product mix.
The total payout of Rs. 31,818.18 by the rival company is the same as the
total contribution that you would make by manufacturing and selling tables
and chairs. Since this is the least that you expect from the resource sale, the
rival company cannot pay any less.

EE We have defined shadow prices here as the price per unit at which the
manufacturer is willing to sell an infinitesimal portion of the resource being
priced. While determining the amount of resource to sell, we ensure that the
change does not alter the set of constraints that are binding at the optimal so-
lution. This is not the only interpretation of shadow prices. We can also define
shadow price as the price per unit that the manufacturer needs to pay to buy an
58 CHAPTER 2. POST-OPTIMALITY ANALYSIS

infinitesimal portion of the resource being priced. These two prices are equal
when the optimal solution is not degenerate. Otherwise there is a problem.
Consider our example in Section 2.1. Here the optimal solution is not de-
generate, since for this two variable problem, only two constraints are binding
at this point. We can easily check that the maximum price you pay to have 1%
more wood is exactly the same as the minimum price that you are willing to
quote for selling 1% of your stock of wood.
In the same problem context, let us say that on average you receive 181 9/11
lamps each day rather than 300. Even in this changed scenario, your optimal
product mix remains unaltered, i.e., each day you produce 181 9/11 tables and
381 9/11 chairs. Assume now that you want to sell some reading lamps. If you
sell reading lamps, then your production plan becomes infeasible, and the op-
timal product mix in such a case would bring less contribution than earlier.
Hence the shadow price of selling reading lamps is non-zero. (It is actually
Rs. 10.00 per reading lamp.) Next assume that you are planning to buy some
reading lamps. If you buy any reading lamps, your original optimal solution
remains unchanged, since the wood and labor availability restrict you from
manufacturing a better mix of tables and chairs. Since your contribution will
not increase with your buying new lamps, you will not be willing to pay any-
thing for buying new reading lamps. Hence the shadow price of buying reading
lamps is zero, which is different from the shadow price we computed earlier.
Different linear program solution packages differ in the way they interpret
Caveat emptor!!
shadow prices. So we need to read the documentation before we interpret the
shadow prices provided in the output of a linear programming solution pack-
age. Some packages output the price of selling an infinitesimal quantity of the
resource, while others output the price of buying that quantity of resource.

The pair of linear programs shown in Figure 2.1 and Figure 2.5 are called
a primal-dual pair, and each of the programs is called a dual of each other.
Either of the two can be called a primal problem, and once a problem has
What are primal
been labeled a primal problem, the other problem in the pair automatically
and dual
becomes its dual.
problems?
The following example describing what is commonly referred to as the diet
problem and its dual illustrates a well-known primal-dual pair of linear pro-
grams.

Example 2.1: An army officer is assigned the task of buying meat, bread, and
fruit in sufficient quantity to feed a garrison. The primary aim of the officer
is to ensure that each person in the garrison has sufficient amount of protein,
carbohydrate, and fat in his diet. A portion of meat costs Rs. 25 and provides
half the daily requirement of protein, one tenth the daily requirement of car-
2.2. SHADOW PRICES AND THE DUAL PROGRAM 59

bohydrates, and one third the daily requirement of fat for a person. A portion
of bread costs Rs. 10 and provides one tenth the daily requirement of pro-
tein and fat, and half the daily requirement of carbohydrates for a person. A
portion of fruit costs Rs. 15 and only provides a quarter of a person’s daily re-
quirement of carbohydrates. The officer wants to minimize the cost of food
for the garrison.
At the same time, a pharmaceutical company is planning to sell nutritional
supplements to the garrison. These supplements come as protein pills, car-
bohydrate pills, and fat pills. Each of the pills contain enough nutrition to
supplement a day’s requirement for a person. The company wants to find out
the maximum price that it can charge for each of these pills from the army
officer.
These two problems together form a primal-dual pair. First consider the
army officer’s problem. He would solve his problem if he finds the minimum
cost at which he can provide a day’s quota of nutrients to one member of the
garrison. If the army officer develops a linear program to solve his problem,
then this program would have decision variables for the number of portions
of meat, fruit and bread that he should buy for each person in the garrison;
and would minimize the cost of buying food portions subject to constraints
which ensure that the person’s daily requirements of protein, carbohydrate,
and fat are met. Such a linear program is given in Figure 2.6.
Next consider the pharmaceutical company’s problem. It wants to maxi-
mize the revenues that it would get by selling the pills to the army officer. So
the linear program that it would solve would have decision variables for the
minimum prices that it would like to quote for the pills, and would maximize
its revenue from supplying one of each type of pills to each member of the gar-
rison subject to the constraint that the price of obtaining the nutrients in one
portion of each type of food does not exceed the price that the army officer
pays for that portion. Hence its model would be the one shown in Figure 2.7.
These two models form a primal-dual pair. Each of the models is a dual of
the other one.

The following points are valid for every primal-dual pair of linear programs.

1. If a primal and a dual problem both admit optimal solutions with finite
Strong law of
objective function values, then the objective function value of an op-
duality.
timal solution to the primal equals the objective function value of an
optimal solution to the dual. This is called the strong law of duality. If
holds even if there are multiple optimal solutions to either of the primal
and dual problems. This is because, even though there may be multi-
60 CHAPTER 2. POST-OPTIMALITY ANALYSIS

Decision Variables

m: number of portions of meat to be bought for each person;


b: number of portions of bread to be bought for each person; and
f : number of portions of fruit to be bought for each person.

Model (Objective function and constraints)

Minimize
Cost per person z =25m + 10b + 15 f
Subject to
m/2 + b/10 ≥ 1 (Protein requirement)
m/10 + b/2 + f /4 ≥ 1 (Carbohydrate requirement)
m/3 + b/10 ≥ 1 (Fat requirement)
m, f , b ≥ 0 (Non-negativity)

Figure 2.6: The army officer’s linear programming model

Decision Variables

p p : price of a protein supplement pill;


p c : price of a carbohydrate supplement pill; and
p f : price of a fat supplement pill.

Model (Objective function and constraints)

Maximize
Revenues r =p p + p c + p f
Subject to
p p /2 + p c /10 + p f /3 ≤ 25 (For a portion of meat)
p p /10 + p c /2 + p f /10 ≤ 10 (For a portion of bread)
p c /4 ≤ 15 (For a portion of fruit)
pp , pc , p f ≥ 0 (Non-negativity)

Figure 2.7: The pharmaceutical company’s linear programming model


2.2. SHADOW PRICES AND THE DUAL PROGRAM 61

ple optimal solutions to either of the problems, the objective function


values of each of the optimal solutions would be identical.

2. If the primal problem has an optimal solution with a finite objective


function value, then the dual necessarily has an optimal solution with a
finite objective function value. If the primal is unbounded, the dual is
infeasible, and vice versa. Both the primal and the dual problems may
be infeasible.

3. In addition to the strong law of duality, there is a weak law of duality.


Weak law of
This law states that if the primal problem has a maximization objec-
duality.
tive, then the objective function value of every solution to the primal
problem will be at most as large as the objective function value of any
solution to the dual problem. If the primal has a minimization objec-
tive, then the objective function value of every solution to the primal
problem will be at least as large as the objective function value of any
solution to the dual problem. Notice that although the strong law holds
only for optimal solutions, the weak law holds for all feasible solutions.

4. The shadow prices of all the resources are obtained simultaneously when
using this approach.

5. The shadow price of a particular resource depends not only on the ob-
jective function and the stock of the resource, but also on the stocks of
other resources.

6. The shadow price of a resource remains constant as long as the set of


constraints that are binding for the optimal solution remains unchanged.
In case there is any change in this set, shadow prices may change, and
should be recomputed.

Let us look at the models in Figures 2.1 and 2.5 that form a primal-dual
pair. Ignoring the non-negativity constraints in both the programs, we see
that the coefficients on the right-hand sides of the constraints in each of the
problems form the coefficients of the objective function of the other. We also
note that the matrix of the coefficients of the variables on the left hand side
of both the programs are simply transposes of each other. These observations
are handy when we want to construct the dual to any linear program without
looking at the economic interpretation behind it, as we shall see in the next
section.

EE There is another way to motivate the dual of a linear program that looks
62 CHAPTER 2. POST-OPTIMALITY ANALYSIS

at a mathematical viewpoint of obtaining “good” bounds on the objective func-


tion value of an optimal solution to the primal problem. It also explains why
the shadow prices are also referred to as “multipliers”. Consider the furniture
problem in Section 2.1 again.
Without actually solving the problem, how can we guess an upper bound
to the largest contribution that we can achieve for the linear program in Fig-
ure 2.1? The constraint on the availability of wood is 1/400T + 1/700C ≤ 1.
Multiplying this with 35000, we obtain the constraint
87.5T + 50C ≤ 35000.
Clearly, such a multiplication does not alter the constraint in any way. Since T
and C are both non-negative, 87.5T + 50C ≥ 70T + 50C , which implies that the
value of the objective function cannot exceed 35000 inside the feasible region. If
we do a similar operation on the labor capacity constraint, i.e., multiply it with
35000, we obtain the constraint
70T + 58.33C ≤ 35000.
So here too, we conclude that the value of the objective function cannot exceed
35000 inside the feasible region.
For the constraint on reading lamps, the multiplier is infinite since the co-
efficient of C in this constraint is zero. This leads us to a trivial conclusion that
the maximum value of the objective function within the feasible region cannot
exceed ∞.
Collectively, the three conclusions above means that the upper bound to the
objective function value over the feasible region is smallest of the three bounds,
i.e., min(35000, 35000, ∞) or Rs. 35,000.
We can do better than this bound. If we simply add the two constraints
on wood availability and labor capacity, we obtain the constraint 11/2800T +
11/3000C ≤ 2. (Draw this constraint along with the other constraints in the
example to convince yourself that it does not change the feasible region for the
problem.) Multiplying this new constraint with 16153.85, we obtain the con-
straint
72.69T + 50C ≤ 32307.69,
which provides us an upper bound for the largest value of the objective function
over the feasible region of Rs. 32,307.69, which is better that what we have found
so far.
How do we combine the constraints in the linear program to generate an
inequality which would yield the best, i.e., smallest upper bound to the maxi-
mum value that the objective function can achieve over the feasible region? To
answer this question, let us formulate another linear programming model.
2.3. HOW TO CONSTRUCT THE DUAL MECHANICALLY 63

We define non-negative variables W , L, and R (called multipliers) with


which to multiply the three constraints on wood, labor, and reading lamps, so
that we get the constraint of our choice, which is

W (T /400 +C /700) + L(T /500 +C /600) + R(T ) ≤ W + L + 300R

or equivalently, after rearranging the terms,

(W /400 + L/500 + R)T + (W /700 + L/600)C ≤ W + L + 300R. (2.1)

Note that W , L, or R cannot be negative, since they would then invert the
inequalities. Our objective in this program is to make the value of the right
hand side of the inequality (2.1) as small as possible. So we would like to

Minimize W + L + 300R.

For the right hand side of (2.1) to be an upper bound, the coefficients of
T and C on the left hand side of (2.1) should at least be equal to 70 and 50
respectively. We ensure this with the following constraints:

1/400W + 1/500L + R ≥ 70 and


1/700W + 1/600L ≥ 50.

Thus, our model for determining the multipliers for the three constraints which
would minimize the value of the right hand side of the combined constraint is
the linear program shown in Figure 2.8.
Notice that this program is identical to the program that we have in Fig-
ure 2.5 with p w , p l , and p r replaced with W , L, and R.

Every linear program has a unique dual linear program associated with it.
In the next section we will show how to construct the dual in the general case.

2.3 How to Construct the Dual Mechanically


Linear programs can be of various types; they can have either a maximization
objective or a minimization objective, the constraints can either be equali-
ties, or greater than or equal to type or less than or equal to type, and the
decision variables can be non-negative or non-positive or unrestricted. In or-
der to state rules for constructing duals blindly, we restrict ourselves to lin-
ear programs of one standard form. The standard form (also called canonical
form) that we use has a maximization objective, less than or equal to type
What is the
standard form of
linear programs
that we consider?
64 CHAPTER 2. POST-OPTIMALITY ANALYSIS

Decision Variables

W : multiplier for the wood availability constraint;


L: multiplier for the labor capacity constraint; and
R: multiplier for the reading lamp constraint.

Model (Objective function and constraints)

Minimize
Amount payable z =W + L + 300R
Subject to
W /400 + L/500 + R ≥ 70 (For tables)
W /700 + L/600 ≥ 50 (For chairs)
W, L, R ≥ 0 (Non-negativity)

Figure 2.8: Linear programming model to obtain optimal values of the multi-
pliers for the constraints

constraints, and non-negative decision variables. As we will see later in this


section, all linear programs can be expressed in this standard form.2
Assume that we have the following linear program (which we call primal)
with n variables and m constraints in standard form. The decision variables
have no particular interpretation here, so we drop the variable declaration
section in our program.

Maximize
z = c1 x1 + c2 x2 + · · · + cn xn
Subject to
a 11 x 1 + a 12 x 2 + · · · + a 1 j x j + · · · + a 1n x n ≤ b 1
a 21 x 1 + a 22 x 2 + · · · + a 2 j x j + · · · + a 2n x n ≤ b 2
.. .. ..
. . .
ai 1 x1 + ai 2 x2 + · · · + ai j x j + · · · + ai n xn ≤ bi
.. .. ..
. . .
a m1 x 1 + a m2 x 2 + · · · + a m j x j + · · · + a mn x n ≤ b m
x1 , x2 , . . . , xn ≥ 0
2
Other standard forms are possible, and different texts use different standard forms.
However, all standard forms can be converted to each other quite easily.
2.3. HOW TO CONSTRUCT THE DUAL MECHANICALLY 65

Then we can construct the dual of this program using the following three
Getting a dual
steps.
program from a
Step 1: For each constraint in the primal, we define a non-negative dual vari- standard primal
able. The dual variable associated with the i th constraint is called v i . program.
There will be m such variables in the dual.

Step 2: For each variable in the primal, we write a constraint in the dual. The
dual constraint corresponding to the j th variable in the primal is

a1j v 1 + a2j v 2 + · · · + ai j v j + · · · + am j v m ≥ c j .

There are n such constraints in the dual.

Step 3: Using the right hand sides of the primal constraints, we construct the
dual objective function

b1 v 1 + b2 v 2 + · · · + bi v i + · · · + bm v m .

We set the objective to minimize this objective function.

Using these three steps described above, the dual of the linear program
shown above is the following.

Minimize
w = b1 v 1 + b2 v 2 + · · · + bi v i + · · · + bm v m
Subject to
a 11 v 1 + a 21 v 2 + · · · + a i 1 v i + · · · + a m1 v m ≥ c 1
a 12 v 1 + a 22 v 2 + · · · + a i 2 v i + · · · + a m2 v m ≥ c 2
.. .. ..
. . .
a1 j v 1 + a2 j v 2 + · · · + ai j v i + · · · + am j v m ≥ c j
.. .. ..
. . .
a 1n v 1 + a 2n v 2 + · · · + a i n v i + · · · + a mn v m ≥ c n
v 1, v 2, . . . , v m ≥ 0

Applying the same three steps to this dual program, we can obtain its dual.
If we do so, we will see that it is identical to the primal program. We formally
state this fact as follows.

The dual of the dual of a primal linear programming problem is


Primal-dual
the primal problem itself.
relationship
66 CHAPTER 2. POST-OPTIMALITY ANALYSIS

This statement justifies our earlier assertion that there is nothing sacrosanct
about the primal problem: if one designates the dual as the primal problem,
then the primal problem becomes the dual.
Let us now illustrate the process of writing the dual of a linear program in
standard form with an example.

Example 2.2: Suppose we want to write the dual of the following linear pro-
gram:
Maximize
z = 2x 1 − 3x 2 − x 4
Subject to
3x 1 − 2x 3 + x 4 ≤ 9
2x 1 − x 2 − 4x 4 ≤ −5
4x 2 + 7x 3 ≤ 6
x1, x2 , x3 , x4 ≥ 0
In this linear program, certain terms are missing from both the objective
function as well as from the left hand sides of the constraints. In such sit-
uations, it is good to rewrite the model with these terms included with zero
coefficients. Once we do this, the model becomes:
Maximize
z = 2x 1 − 3x 2 + 0x 3 − x 4
Subject to
3x 1 + 0x 2 − 2x 3 + x 4 ≤ 9
2x 1 − x 2 + 0x 3 − 4x 4 ≤ −5
0x 1 + 4x 2 + 7x 3 + 0x 4 ≤ 6
x1, x2 , x3 , x4 ≥ 0
Once we have the primal problem in this form, it is easy to apply the three
rules stated earlier in this section to obtain the dual program as:
Minimize
w = 9v 1 − 5v 2 + 6v 3
Subject to
3v 1 + 2v 2 + 0v 3 ≥ 2
0v 1 − v 2 + 4v 3 ≥ −3
− 2v 1 + 0v 2 + 7v 3 ≥ 0
v 1 − 4v 2 + 0v 3 ≥ −1
v 1, v 2, v 3 ≥ 0
2.3. HOW TO CONSTRUCT THE DUAL MECHANICALLY 67

Now we can remove the zero coefficient terms from the dual formulation, and
report it as:

Minimize
w = 9v 1 − 5v 2 + 6v 3
Subject to
3v 1 + 2v 2 ≥ 2
− v 2 + 4v 3 ≥ −3
− 2v 1 + 7v 3 ≥ 0
v 1 − 4v 2 ≥ −1
v 1, v 2, v 3 ≥ 0

Let us now consider primal linear programs which are not in the standard
Handling
form. We will demonstrate how we can transform such programs into linear
non-standard
programs in the standard form. Once they are in the standard form, we can
primal linear
construct their dual programs using the three rules that we have stated earlier
programs.
in this section.
There are five ways in which linear programs can deviate from the stan-
dard form. We list these five cases below, and describe methods to convert
such deviations into standard form.

Case 1: A variable x in the primal is non-positive: We define a new variable


x ′ in the primal formulation such that x ′ = −x. Obviously x ′ is non-
negative. Then we replace each occurrence of x in the primal con-
straints with −x ′ .

Case 2: A variable x in the primal is unrestricted: We define two non-nega-


tive variables x ′ and x ′′ and replace each occurrence of x with x ′ −
x ′′ . This works since the difference of two non-negative variables is
unrestricted in sign.
Notice that every constraint which included a term involving x in-
cludes two terms after the substitution, one containing x ′ and the
other involving x ′′ . The coefficients of these terms are always equal
in magnitude and opposite in sign. If the objective function originally
included a term involving x, after the substitution it also contains two
terms, one involving x ′ and the other involving x ′′ whose coefficients
have equal magnitudes and opposite signs. When we construct the
dual of the linear program, we will have two constraints, one for x ′
and the other for x ′′ . Each of the terms in the first constraint will
have a coefficient whose magnitude equals that of the coefficient of
68 CHAPTER 2. POST-OPTIMALITY ANALYSIS

the corresponding term in the second constraint, but whose signs are
different. This means that the two constraints would look like the fol-
lowing:

a1 v 1 + a2 v 2 + · · · + am v m ≥ c and
−a1 v 1 − a2 v 2 − · · · − am v m ≥ −c.

These two constraints taken together imply the equality

a1 v 1 + a2 v 2 + · · · + am v m = c.

We can use this fact to skip the step of replacing an unrestricted vari-
able with two non-negative variables and directly make use of the
following rule:

If a variable in the primal problem is unrestricted in sign,


the constraint in the dual program corresponding to this
variable is an equality constraint.

Case 3: A constraint is of the greater than or equal to form: In this case we


multiply the constraint by −1. This works because
a ≥ b if and only if −a ≤ −b.

Case 4: A constraint holds as an equality: Let the constraint be

a1 x1 + a2 x2 + · · · + an xn = b

We rewrite it as two constraints:

a1 x1 + a2 x2 + · · · + an xn ≤ b and
a1 x1 + a2 x2 + · · · + an xn ≥ b,

and convert the second constraint to standard form by multiplying it


with −1 as described in Case 3. Thus the equality constraint is written
in standard form as the following pair of constraints:

a1 x1 + a2 x2 + · · · + an xn ≤ b and
−a1 x1 − a2 x2 − · · · − an xn ≤ −b.

Notice that the coefficient in each term in the first constraint is equal
in magnitude and opposite in sign to the coefficient in the corre-
sponding term in the second constraint, including the right hand
sides. Let v i and v i +1 be the dual variables associated with these
2.3. HOW TO CONSTRUCT THE DUAL MECHANICALLY 69

two constraints when we are writing the dual for this program. In
the dual, the term involving b in the objective function would then
b(v i − v i +1 ). Similarly, in each of the n constraints in the dual, the
terms involving v i and v i +1 would be of the form a j (v i −v i +1 ). There-
fore, in the dual, we can replace the non-negative variables v i and
v i +1 with a single unrestricted variable v = v i − v i +1 .
Thus, similar to case 2, we can skip the step of splitting the equality
constraint into two inequalities, and use the following rule:

When a primal constraint is an equality the dual variable


associated with this constraint is unrestricted in sign. The
equality constraint is then treated as if it was in the stan-
dard form.

Case 5: The objective function is of a minimization form: In this case, we


multiply the objective function with −1 and maximize the modified
objective function. This works because the minimum value of a func-
tion f (·) always equals the maximum value of the function − f (·).

We now illustrate the process of writing the dual of a linear program that is
not in standard form.

Example 2.3: Suppose we want to write the dual of the following linear pro-
gram:

Minimize
z = 2x 1 + 3x 2 + 5x 3
Subject to
3x 1 + 2x 2 + 4x 3 ≥ 5
x 1 + 5x 2 + 9x 3 ≤ 19
2x 1 + 6x 2 + 5x 3 = 14
x1 ≥ 0
x2 ≤ 0
x3 unrestricted

We first convert this program into standard form. Notice that x2 is a non-
positive variable, so we will replace it in the program with −x2′ where x2′ is
a non-negative variable, as discussed in Case 1. Also notice that x3 is unre-
stricted in sign. So following the method described in Case 2, we replace it
with (x3′ − x3′′ ) where x3′ and x3′′ are both non-negative. The first constraint is of
70 CHAPTER 2. POST-OPTIMALITY ANALYSIS

a greater than or equal to type, so we replace it with the equivalent constraint

−3x1 − 2x2 − 4x3 ≤ −5

as described in Case 3. Using our newly defined variables we rewrite this con-
straint as

−3x1 + 2x2′ − 4x3′ + 4x3′′ ≤ −5.

The third constraint is an equality, so we replace it with constraints

2x1 + 6x2 + 5x3 ≤ 14 and


−2x1 − 6x2 − 5x3 ≤ −14

as described in Case 4. Using the non-negative variables we have defined we


rewrite these constraints as

2x1 − 6x2′ + 5x3′ − 5x3′′ ≤ 14 and


−2x1 + 6x2′ − 5x3′ + 5x3′′ ≤ −14.

The objective is of a minimization type, so we standardize it by writing it as

Maximize − 2x1 + 3x2′ − 5x3′ + 5x3′′ .

as described in Case 5.
So the linear program in this example, when converted to standard form
is the following:

Maximize
z = −2x 1 + 3x 2′ − 5x 3′ + 5x 3′′
Subject to
− 3x 1 + 2x 2′ − 4x 3′ + 4x 3′′ ≤ − 5
x 1 − 5x 2′ + 9x 3′ − 9x 3′′ ≤ 19
2x 1 − 6x 2′ + 5x 3′ − 5x 3′′ ≤ 14
− 2x 1 + 6x 2′ − 5x 3′ + 5x 3′′ ≤ −14
x 1 , x 2′ , x 3′ , x 3′′ ≥ 0

Since this linear program is in standard form, its dual program is easy to con-
struct. We define dual variables v 1, . . . , v 4 corresponding to the four constraints
in the primal in standard form, and derive dual constraints corresponding to
2.3. HOW TO CONSTRUCT THE DUAL MECHANICALLY 71

each of the primal variables. This dual program is the following:

Minimize
w = −5v 1 + 19v 2 + 14v 3 − 14v 4
Subject to
− 3v 1 + v 2 + 2v 3 − 2v 4 ≥ −2
2v 1 − 5v 2 − 6v 3 + 6v 4 ≥ 3
− 4v 1 + 9v 2 + 5v 3 − 5v 4 ≥ −5
4v 1 − 9v 2 − 5v 3 + 5v 4 ≥ 5
v 1, v 2, v 3, v 4 ≥ 0

Notice that the third and the fourth constraint can be combined to form the
constraint

4v 1 − 9v 2 − 5v 3 + 5v 4 = 5.

Recall that these two constraints arose from the primal variables x3′ and x3′′ ,
which in turn arose from the unrestricted variable x3 in the original primal
formulation. Thus, in the end, we find that the constraint in the dual cor-
responding to the unrestricted variable in the primal program is an equality
constraint. This illustrates the rule that we stated while discussing Case 2 on
page 68.
Since the coefficients of v 3 and v 4 in the objective function and in all the
constraints are equal in magnitude and opposite in sign, we can combine the
two terms in the objective function and in each of the constraints involving
v 3 and v 4 to a single term involving (v 3 − v 4 ), and then replace (v 3 − v 4 ) with
an unrestricted variable v . Recall that these variables arose from the two con-
straints that were obtained by splitting an equality constraint. So as we dis-
cussed in Case 4 on page 69, an equality constraint in the primal program
leads to an unrestricted variable in the dual program.
So the dual of the primal problem in this example is the following:

Minimize
w = −5v 1 + 19v 2 + 14v
Subject to
− 3v 1 + v 2 + 2v≥ −2
2x 1 − 5v 2 − 6v ≥ 3
4x 1 − 9v 2 − 5v = 5
v 1, v 2 ≥ 0
v unrestricted
72 CHAPTER 2. POST-OPTIMALITY ANALYSIS

2.4 Complementary Slackness Conditions


At the optimal solution to the linear programming problem described in Sec-
tion 2.1, we found that your stock of wood and your labor capacity are fully
utilized, while you have excess stock of reading lamps. We express this by
saying that your reading lamp constraint has a slack at the optimal solution,
Definition of
which means that this constraint does not hold as an equality at that solution.
slack
The difference between the number of reading lamps that you have and the
number of reading lamps that you use, i.e., (300−181 9/11) = 118 2/11 is called
the slack for the reading lamp constraint at the optimal solution.
Recall that the shadow prices of the three resources, that we found by solv-
ing the dual program in Figure 2.5 are Rs. 12727.27, Rs. 19090.91, and Rs. 0.00
for wood, labor, and reading lamps, respectively. Notice that the shadow prices
corresponding to the resources that had no slack are non-zero, while the sha-
dow price corresponding to the resource that had a slack is zero. This is quite
intuitive; for a resource that is being used up completely during production,
you would suffer a loss of contribution if you gave away even a little of the
resource, and would not give it away for free, while if some part of a resource
is not being used during production, then you could part with the unutilized
amount for free. This relation between the slack of a resource at an optimal
solution and its shadow price is formally expressed in terms of the comple-
mentary slackness conditions as follows.

Let a linear programming problem be feasible and have an op-


Complementary
timal solution (x1⋆ , x2⋆ , . . . , xn⋆ ). Let (v 1⋆ , v 2⋆ , . . . , v m

) be an optimal
slackness
solution to the dual of this problem. Then the following results
conditions.
hold.

1. If the i th constraint in the primal is not binding (i.e. has a


non-zero slack), then v i⋆ = 0.
2. If v i⋆ > 0 in the dual, then the i th constraint in the primal
problem is binding.

In other words, if the s i is the slack on the i th constraint in the


primal, and v i is the dual variable associated with this constraint,
then

s i × v i⋆ = 0.

Although the statement of the complementary slackness conditions ap-


pears quite simple, the following points are worth noting:
2.4. COMPLEMENTARY SLACKNESS CONDITIONS 73

1. They are valid only when the primal problem is feasible and has an op-
timal solution. If the primal problem is infeasible, then it does not have
an optimal solution. In this case, computing the slack of any constraint
at an optimal solution is meaningless, and the complementary slack-
ness theorem cannot be applied. If the primal problem is unbounded,
i.e., is feasible but does not have a finite optimum, the dual problem is
infeasible, and does not have an optimal solution. So complementary
slackness cannot be applied.

2. They are valid only for optimal solutions. If a primal solution is a cor-
ner point solution that is not optimal, the dual solution obtained by ap-
plying complementary slackness conditions would result in a solution
that is not feasible for the dual program. This observation leads to an
elegant way of checking whether a corner point solution to a linear pro-
gram is indeed optimal.

3. The implications in the complementary slackness theorem are one-


This is important
sided. Even though a non-binding primal constraint implies that the
and slightly
corresponding dual variable is zero, a zero dual variable does not imply
tricky.
a non-binding primal constraint. Similarly, even though a positive dual
variable implies a binding constraint, a binding constraint does not im-
ply a non-zero dual variable. If the optimal solution is degenerate, it
can lead to situations in which the slack on a primal constraint and the
value of the dual variable associated with it are both zero at their respec-
tive optima.

We now illustrate how complementary slackness conditions can be used


to check whether a corner point solution is indeed optimal (This was men-
tioned in the second point above).

Example 2.4: Consider the problem situation given in Section 2.1. Assume
that someone claims that the product mix of 300 tables and 175 chairs is opti-
mal. We will use complementary slackness conditions to refute this claim.
Observe first that the proposed mix is a corner point solution, since at this
solution the wood and reading lamp availability constraints are tight.
Next we will assume that this mix is optimal, so that complementary slack-
ness conditions apply to this solution. Let us then use complementary slack-
ness conditions then to predict some results for the optimal solution to the
dual program shown in Figure 2.5.

1. The slacks for the wood and reading lamp availability constraints are
both zeros, so we cannot say anything about the values of p w and p r
74 CHAPTER 2. POST-OPTIMALITY ANALYSIS

in an optimal solution to the dual. However, since the slack for the la-
bor capacity constraint is positive (its value is 13/120), complementary
slackness conditions allow us to say that the value of p l in an optimal
solution to the dual is zero.

2. Since the dual of the dual program is the primal program, the dual vari-
ables associated with the two constraints in the dual program of Fig-
ure 2.5 are T and C respectively. Since the optimal values of T and C are
both non-zero, we can conclude from complementary slackness condi-
tions that the slacks associated with both the dual constraints are zeros
at the dual optimal solution. Hence at the optimal solution, both the
dual constraints hold as equalities.

Thus the optimal solution (p w , p l⋆ , p r⋆ ) to the dual problem can be character-
ized as follows

p l⋆ = 0,

pw /400 + p r⋆ = 70,

pw /700 = 50, and
⋆ ⋆
pw , pr ≥ 0.

This characterization does not admit a solution. So we have a situation in


which the primal problem is feasible and has a finite optimum, but the dual
problem is infeasible. This is simply not possible according to the laws of du-
ality. Hence we can conclude that our original assumption was invalid, and
the mix of 300 tables and 175 chairs is not optimal.

Example 2.5: We will now show that complementary slackness conditions


indeed verify an optimal solution to a linear program. Let us consider the mix
of 181 9/11 tables and 381 9/11 chairs. We will show that this leads to a feasible
dual solution based on the complementary slackness principles. Assuming
that this solution is optimal, we use complementary slackness conditions to
arrive at the following conditions:

1. p r = 0; and

2. both the constraints in the dual hold as equalities at the optimal solu-
tion to the dual.
2.5. REDUCED COSTS 75

This leads us to the following characterization of an optimal solution



(p w , p l⋆ , p r⋆ ) to the dual problem:

p r⋆ = 0,

pw /400 + p l⋆ /500 = 70,

pw /700 + p l⋆ /600 = 50, and

pw , p l⋆ ≥ 0.

This characterization admits the feasible solution, (12727.27, 19090.91, 0). So


our assumption about the optimality of the mix of 181 9/11 tables and 381 9/11
chairs is true. This solution has an objective function value of 12727.27 +
19090.91+300×0 = 31818.18, which is identical to the objective function value
of the primal solution that we are assuming to be optimal. Therefore, by the
strong law of duality, our assumption is correct, i.e., the mix of 181 9/11 tables
and 381 9/11 chairs is indeed optimal.

2.5 Reduced Costs


Let us look at the diet problem in Example 2.1 on page 58. The linear pro-
gram to solve the army officer’s problem is shown in Figure 2.6 on page 60. On
solving this problem, we find the optimal strategy of the officer is to buy 2.55
portions of meat, 1.49 portions of bread and no fruits for each person in the
garrison every day. The cost of this diet is Rs. 78.73 per person. The reason for
not buying fruits is clear; they are too costly for the amount of nutrients that
they provide.
A natural question that arises is the following: By what amount should the
What is reduced
cost of fruits be reduced so that it becomes viable to buy them in an optimal
cost?
solution? The answer to this question is a quantity called the reduced cost of
the variable f in the linear program in Figure 2.6. Formally stated,

The reduced cost of a decision variable in a linear program is the


quantity by which the coefficient of that variable in the objective
function in the linear program needs to be reduced so that the
decision variable may assume a non-zero value in some optimal
solution to the program.

Obviously, if a decision variable is at a non-zero level in an optimal solu-


tion, its objective function coefficient does not have to be reduced at all to
include it in an optimal solution. Hence all variables whose values are not
zero in an optimal solution have zero reduced cost.
76 CHAPTER 2. POST-OPTIMALITY ANALYSIS

If the optimal solution is unique3 then reduced cost of variables with zero
values in the optimal solution would have different signs depending on whe-
ther the linear program has a minimization objective or a maximization ob-
jective. If a variable has a zero value in a unique optimal solution in a linear
program with minimization objective, then its objective function coefficient
is too big, and needs to be reduced by a strictly positive amount for it to be
at a non-zero value in an optimal solution. So reduced costs of non-basic
variables in a linear program with a unique optimal solution to a minimiza-
tion problem are strictly positive. On the other hand, in a linear program with
maximization objective which has a unique optimal solution, a decision vari-
able has zero value if its coefficient in the objective function is too small. In
such cases the coefficient of this variable in the objective function needs to be
increased by a strictly positive amount for it to attain a non-zero value in an
optimal solution. An increase can be considered to be a decrease by a nega-
tive quantity, so that the reduced cost of a decision variable with zero value in
a unique optimal solution to a linear program with maximization objective is
strictly negative.
If there are multiple optimal solution for a linear program, then it is pos-
sible for both the value of a decision variable and its reduced cost to be zeros.
For example, in a linear program with two non-negative decision variables x1
and x2 , a objective of minimizing x1 + x2 , and a single constraint x1 + x2 ≥ 1,
an optimal solution is (x1 , x2 ) = (1, 0), but the reduced cost of x2 is zero, since
(x1 , x2 ) = (0, 1) is also optimal. To summarize,

1. the reduced costs of decision variables in a linear program with mini-


mization objective are non-negative, while those for decision variables
in a linear program with maximization objective are non-positive;

2. the reduced costs of all decision variables that have a non-zero value in
an optimal solution to a linear program are zeros; and

3. in linear programs with degenerate optimal solutions, it is possible for


both the value of a decision variable and its reduced cost to be zeros.

EE If points 2 and 3 in the summary look very much like complementary


slackness conditions, it is for a good reason. The reduced cost of a variable is
nothing but the slack on the associated constraint in its dual program, with
appropriate sign.

3
Note that if the optimal solution to the primal problem is unique, then the optimal solu-
tion to the dual problem is non-degenerate.
2.5. REDUCED COSTS 77

Computing the reduced cost of an decision variable in a linear program is


quite straight-forward. To see this, let us continue using the linear problem in
Example 2.1. As we saw earlier in this section, the army officer will not procure
any of fruit in an optimal plan. We can check that the optimal solution to the
problem is unique. So the reduced cost for fruits is non-zero.
In order to find the value of the reduced cost, we first solve the dual of the
linear program, i.e., the program shown in Figure 2.7 on page 60. The values
of the decision variables at the optimal solution to this program is p p = 0,
p c = 5.32, and p f = 73.4. One portion of fruit provides a quarter of a person’s
daily requirement of carbohydrates, and so is worth only Rs. 5.32/4 = Rs. 1.33.
Hence, the cost of a portion of fruit has to be reduced by Rs. (15.00 − 1.33) =
Rs. 13.67 for it to be considered in an optimal solution to the army officer’s
problem. So the reduced cost for the variable f is Rs. 13.67.
The following example illustrates the calculation of reduced costs in a lin-
ear program with maximization objective.

Example 2.6: A company can make three types of mixtures, called mix A,
mix B, and mix C. Each 60g packet of mix A contains 30g of peanuts, 20g of
raisins, and 10g of cashews, and contributes Rs. 4 to profits. Each 60g packet
of mix B contains 20g of peanuts, 30g of raisins, and 10g of cashews, and con-
tributes Rs. 6 to profits. Each 60g packet of mix C contains 20g of peanuts,
10g of raisins and 30g of cashews, and contributes Rs. 5 to profits. The com-
pany can make and seal a total of 2000 packets each day. It gets a daily supply
of 34 kilos of peanuts, 74 kilos of raisins, and 51 kilos of cashews through a
long term contract. Its objective is to maximize its contribution to profits.
Based on a consultant’s advise, the company concentrates on mix B packets
only, and makes 1700 packets each day, which generates a daily contribution
of Rs. 10,200. The company now want to find out what changes if any in the
contributions of mixes A and C would lead to a more balanced product mix.

The Consultant’s Model: It is straight-forward to reconstruct the consul-


tant’s model. It she used decision variables x A , xB , and xC to denote the num-
bers of packets of mix A, mix B, and mix C to be produced each day, her linear
programming model would be the one shown in Figure 2.9.
Solving this model we find that an optimal solution to it is indeed x A =
xC = 0, xB = 1700, with an objective function value of Rs. 10,200. Solving
the dual of this problem, we find that the only non-zero shadow price cor-
responds to the constraint on the stock of cashews and is Rs. 0.30 .
78 CHAPTER 2. POST-OPTIMALITY ANALYSIS

Decision Variables

x A : number of packets of mix A to produce each day;


x B : number of packets of mix B to produce each day; and
xC : number of packets of mix C to produce each day.

Model (Objective function and constraints)

Maximize
Contribution z =4x A + 6x B + 5xC
Subject to
30x A + 20x B + 20xC ≤ 34000 (Stock of peanuts)
20x A + 30x B + 10xC ≤ 74000 (Stock of raisins)
10x A + 10x B + 30xC ≤ 51000 (Stock of cashews)
x A + x B + xC ≤ 2000 (Packaging capacity)
x A , x B , xC ≥0 (Non-negativity)

Figure 2.9: The consultant’s model

Our Solution to the Company’s Problem: The company basically wants to


find out the reduced costs for mixes A and C. We can compute them by using
the shadow prices obtained by solving the dual of the consultant’s model.
For mix A, the contribution obtained per packet is Rs. 4.00, while the worth
of the resources going into each packet is Rs. (0.3 × 30 + 0.00 × 20 + 0.00 × 10 +
0.00 × 1) = Rs. 9.00. Therefore the reduced cost for x A is Rs. (4.00 − 9.00) =
− Rs. 5.00. So the price of each mix A packet needs to be increased by Rs. 5.00
for it to be considered in an optimal product mix.
For mix C, the contribution obtained per packet is Rs. 5.00, while the worth
of the resources going into each packet is Rs. (0.03 ×20 +0.00 ×30 +0.05 ×10 +
0.00 × 1) = Rs. 6.00. Therefore the reduced cost for xC is Rs. (5.00 − 6.00) =
– Rs. 1.00. So the price of each mix C packet needs to be increased by Rs. 1.00
for it to be considered in an optimal product mix.

2.6 Sensitivity Analysis


Our post-optimality analysis has so far concentrated on finding shadow prices
in linear programs. Another kind of analysis answers the question of finding
2.6. SENSITIVITY ANALYSIS 79

the maximum amount by which we can change any of the coefficients in a


linear program such that the constraints that determine an optimal solution
before the change still remain the same. This is known as sensitivity anal-
ysis. The range of values within which the optimal solution is determined
What is
by the same set of binding constraints is called the tolerance range, and the
sensitivity
maximum increase and decrease that are allowed for the coefficient to remain
analysis?
within the tolerance range are called the upper and lower tolerances respec-
tively.

EE Note that while doing sensitivity analysis, we allow only one of the prob-
lem coefficients to change, while others are maintained at their original values.
If more than one coefficient change, then the analysis becomes complicated,
and is beyond the scope of this book.

Coefficients of linear programming models can be classified into three


classes:

1. coefficients in the objective function;


2. values on the right hand side of the constraints; and
3. coefficients in the left hand side of the constraints.

In the remaining portion of this section, we will illustrate the process of carry-
ing out sensitivity analysis for all these three classes of coefficients. To do so,
we will use the model that we have developed for the problem in Section 2.1,
i.e., for the linear program in Figure 2.1 on page 52.

Sensitivity analysis for objective function coefficients


Assume that in the linear program in Figure 2.1, the coefficient of T in the ob-
jective function changes from 70 to 80 to 87 1/2 to 100. The effect of these
changes is shown in Figure 2.10. The feasible region is shaded in each case,
and the objective function line through the optimal solution is shown using
the thicker line. Notice that the feasible region remains unchanged in all the
four cases, since the constraints do not change. Increasing the coefficient of T
in the objective function rotates the objective function line clockwise, so that
when T = 80, the objective function line through the optimal solution is much
closer to the wood availability constraint than when T = 70. When T = 87 1/2,
the objective function line through the optimal solution coincides with the
wood availability constraint. If the coefficient of T is increased any further,
then the objective function line through the same point passes through the
interior of the feasible region; so that the solution that was previously optimal
no longer remains optimal. At these values of the coefficient of T the adjacent
80 CHAPTER 2. POST-OPTIMALITY ANALYSIS

C C

Wood availability
600 600

Lamp availability

400 400

200 200
Labor capacity

–100 0 100 200 300 400 500 T –100 0 100 200 300 400 500 T

T = 70 in objective function T = 80 in objective function

C C

600 600

400 400

200 200

–100 0 100 200 300 400 500 T –100 0 100 200 300 400 500 T

T = 87 1/2 in objective function T = 100 in objective function


Figure 2.10: Effect of changing the objective function in a linear program

corner point becomes optimal as is seen in the case where the coefficient of T
is 100 in Figure 2.10. The labor capacity constraint no longer determines the
position of the optimal solution, but the constraint on the availability of read-
ing lamps does. So we can conclude that the coefficient of T can be increased
by a maximum of 87 1/2 − 70 = 17 1/2 without affecting the set of constraints
that determine the optimal solution. So the upper tolerance of the coefficient
of T in the objective function is 17 1/2 units.
If the coefficient of T in the objective function is reduced, then the objec-
tive function line rotates in the counter-clockwise direction. Using an analysis
very similar to that above, we can conclude that the maximum allowable de-
crease in the coefficient of T before the set of constraints determining the op-
timal solution changes is 10 units, when the objective function line through
the optimal solution coincides with the labor capacity constraint. If the de-
crease in the coefficient of T is by more than 10 units, then the labor capac-
ity constraint and the C-axis corresponding to the non-negativity constraint
C ≥ 0 determine the position of the optimal solution. Hence the lower toler-
2.6. SENSITIVITY ANALYSIS 81

ance for this coefficient is 10 units.


The tolerance range for the coefficient of T in the objective function is the
interval [80 − 10, 80 + 7 1/2], i.e., [70, 87 1/2].
A similar analysis of the effect of changing the coefficient of C would show
that its upper tolerance is 8 1/3 units, its lower tolerance is 10 units, and its
tolerance range is the interval [40, 58 1/3].
Note that within the allowable range for the objective function coefficients,
the optimal solution, i.e., the numbers of tables and chairs to be produced
each day did not change, although the contribution to profits from the same
product mix changed with changing objective functions.

Sensitivity analysis for values on the right hand side of the con-
straints
Assume that the right hand side of the wood availability constraint in the pro-
gram in Figure 2.1 changes from 1 to 1 1/20 to 1 13/140 to 1 3/20. The effect
of these changes is shown in Figure 2.11. Notice that the slope of the objective
function line remains unchanged, since the coefficients in the objective func-
tion are not changed. However, the feasible region increases in size because
of this change.
As the right hand side of the wood availability constraint increases from
1 to 1 1/20, it moves toward the top right corner parallel to the original con-
straint line, and the optimal solution changes, favoring the production of more
tables and fewer chairs. When the right hand side of the constraint increases
to 1 13/140, the wood availability constraint passes through the intersection
of the labor capacity constraint and the reading lamp availability constraint.
At this point the optimal solution to the problem is degenerate. When the
right hand side of the wood availability constraint increases beyond 1 13/140,
to 1 3/20 for example, we see that the wood availability constraint becomes
redundant, and it no longer determines the optimal solution. We see this phe-
nomenon in the bottom left diagram in Figure 2.11. This implies that, if the
the constraints on labor capacity and reading lamp availability remain un-
changed, it does not make sense for you as the manufacturer to increase your
daily stock of wood by more than 13/140th of the current stock. If the daily
wood availability reduces, then the wood availability constraint moves toward
the bottom left parallel to the original constraint line. If the right hand side re-
duces by more than 1/7, then the labor capacity constraint is no longer one of
the constraints that determine the optimal solution. Thus the upper tolerance
for the right hand side of the wood availability constraint is 13/140, the lower
tolerance is 1/7, and the tolerance range for this value is [1 − 1/7, 1 + 13/140],
i.e., [6/7, 1 13/140].
82 CHAPTER 2. POST-OPTIMALITY ANALYSIS

C C

Wood availability
600 600

Lamp availability

400 400

200 200
Labor capacity

–100 0 100 200 300 400 500 T –100 0 100 200 300 400 500 T

RHS = 1 in the RHS = 1 1/20 in the


wood availability constraint wood availability constraint

C C

600 600

400 400

200 200

–100 0 100 200 300 400 500 T –100 0 100 200 300 400 500 T

RHS = 1 13/140 in the RHS = 1 3/20 in the


wood availability constraint wood availability constraint
Figure 2.11: Effect of changing the right hand side of the wood availability
constraint in the linear program of Figure 2.1

We can do a similar analysis for the right hand side of the labor availability
constraint to show that its upper tolerance is 1/6, and its lower tolerance is
13/120. This of course means that the labor capacity constraint and the wood
availability constraint continue to determine the optimal solution as long as
the labor availability constraint remains within 107/120th of the current avail-
ability and 7/6th of the current availability, while all other constraints in the
problem remain unaltered.
Note that although the set of binding constraints do not change within the
allowable limits of the right hand sides of the constraints, the optimal product
mix changes when the value on the right hand side of a constraint changes.
This is in contrast to the situation when the objective function coefficients
changes.
2.6. SENSITIVITY ANALYSIS 83

Sensitivity analysis for coefficients in the left hand side of the


constraints
Finally let us look at the effect of changing the coefficient of C in the left hand
side of the wood availability constraint in the linear program in Figure 2.1. As-
sume that the coefficient of C in the left hand side of the wood availability con-
straint increases from the current value of 1/700 to 1/625 to 1/600 to 1/575.
The shapes of the feasible region and the objective function lines through the
optimal solution in the four situations are shown in Figure 2.12. We see that

C C

Wood availability
600 600

Lamp availability

400 400

200 200
Labor capacity

–100 0 100 200 300 400 500 T –100 0 100 200 300 400 500 T

Coefficient of C in the wood Coefficient of C in the wood


availability constraint is 1/700 availability constraint is 1/625

C C

600 600

400 400

200 200

–100 0 100 200 300 400 500 T –100 0 100 200 300 400 500 T

Coefficient of C in the wood Coefficient of C in the wood


availability constraint is 1/600 availability constraint is 1/575
Figure 2.12: Effect of changing the coefficient of C in the left hand side of the
wood availability constraint in the linear program in Figure 2.1

as this coefficient increases, the wood availability constraint rotates counter-


clockwise, pivoting around the point at which the constraint meets the T axis.
As it rotates, the optimal corner point solution shifts toward the C axis. We
can observe this in the diagram on the top right of Figure 2.12 in which the
84 CHAPTER 2. POST-OPTIMALITY ANALYSIS

coefficient of C is 1/625. When the coefficient becomes 1/600, the wood avail-
ability constraint meets the C axis at the point where the labor capacity con-
straint meets it. At this point, the optimal solution becomes degenerate. This
is shown in the bottom left diagram of Figure 2.12. If the coefficient of C in the
wood availability constraint increases further, then the labor capacity con-
straint becomes redundant, and no longer determines the optimal product
mix; see the bottom right diagram of Figure 2.12. Hence the maximum allow-
able increase in the coefficient of C in the wood availability constraint is 1/600
– 1/700 = 1/4200, which means that the upper tolerance for this coefficient is
1/4200.
If the coefficient of C decreases, the wood availability constraint rotates
in a clockwise direction pivoting around the point where it meets the T axis.
When the amount of decrease is by more than 3/5600, it becomes redundant
and the labor capacity and reading lamp availability constraint determine the
optimal product mix. Hence the lower tolerance for this coefficient is 3/5600.
Here too, although the binding constraints do not change within the al-
lowable limits, the optimal product mix changes when one of the coefficient
on the left hand side of a constraint changes. This is again in contrast to the
situation when the objective function coefficients changes.
The discussion above shows us how to perform sensitivity analysis by the
graphical method for linear programs with two decision variables. Sensitiv-
ity analysis for coefficients of linear programs with more than two decision
variables is quite complex, and is beyond our scope. Fortunately, many com-
monly encountered linear program solution software, including Microsoft®
Excel Solver, provide most of these values in their output.
The following points are worth noting when we perform sensitivity analy-
sis, and interpret the results from it.

1. Sensitivity analysis works under the assumption that only the coeffi-
cient under consideration is changed and all other coefficients are held
constant at their initial values. Therefore it is incapable of analyzing the
effect of simultaneous changes in more than one program coefficients.

2. When one of the coefficients of a linear programming problem changes,


the optimal solution or its objective function value or both can change.
The only thing that will remain unchanged if the coefficient is within the
tolerance range is the set of constraints that are binding at the optimal
solution.

3. The measurement units of the decision variables in the constraints of


the model are important when interpreting post-optimality results. For
example, we can rewrite the wood availability constraint in the original
2.7. POST-OPTIMALITY ANALYSIS USING MICROSOFT® EXCEL SOLVER 85

problem of Section 2.1 as 7T + 4C ≤ 4200. If represented in this form,


the tolerances computed would be different from the tolerance limits
that we obtained earlier in this section. However, we must realize that
the values of tolerances computed in the earlier model were in units of
‘a day’s stock of wood’, while the tolerances computed with the scaled
constraint are in units of ‘1/4200th of a day’s stock of wood’. The numer-
ical values of the tolerances in the latter case would therefore be exactly
4200 times those in the original model.

2.7 Post-Optimality Analysis Using Microsoft® Excel


Solver
In the previous sections, we have shown how to obtain shadow prices, and
reduced costs by solving the dual of a linear program. We have also shown
how to obtain tolerances using a graphical approach. However, most com-
mon solution softwares output shadow prices as a by-product of solving the
primal linear program. Microsoft® Excel Solver also displays them if asked to.
To let Microsoft® Excel Solver display shadow prices, reduced costs and toler-
ances, we need to click on the “Sensitivity” option in the Reports section of the
Solver Results dialog box, as shown in Figure 2.13, before clicking on the “OK”
button. Solver then opens a new worksheet and outputs the post-optimality

Figure 2.13: Solver Results dialog box for sensitivity analysis


86 CHAPTER 2. POST-OPTIMALITY ANALYSIS

analysis results on that sheet. It calls this worksheet the Sensitivity Report.
As an illustration, we have shown the sensitivity report corresponding to the
problem in Section 2.1 in Figure 2.14.
The sensitivity report in Microsoft® Excel Solver has two tables, one la-
beled “Adjustable Cells” dealing with the objective function coefficients, and
the other labeled “Constraints” dealing with values on the right hand side
of the constraint (in)equalities. The first table has seven columns. The first
and second columns describe the position of the decision variable (called ad-
justable cell in Solver parlance) and its name, and the third column specifies
its value in the optimal solution. The fourth column reports the reduced cost
of the coefficient of that decision variable in the objective function. Notice
that in Figure 2.14 the reduced costs of the coefficients of both the decision
variables are zero, since both the decision variables assume non-zero values
in the optimal solution to that problem. The fifth column shows the coeffi-
cients of the decision variables in the objective function in the model. The
last two columns of the table provides the upper and lower tolerance values
for the coefficient of the decision variables in the objective function. See that
the values for the coefficient of T in the original problem, derived on page 80
are the ones shown in Figure 2.14.
The second table in the sensitivity report deals with the constraints. This
table also has seven columns, and as in the previous case, the first three col-
umns define each inequality, and the value the left hand side of the inequality
assumes in the optimal solution to the problem. The fourth column shows the
shadow price for each constraint. In Microsoft® Excel Solver, the shadow price
What shadow
output in the sensitivity report is the rate of increase in the objective function
price does
value when the right hand side of the constraint is increased marginally. It
Microsoft® Excel
is independent of whether the objective is of a maximization type or a mini-
Solver output?
mization type, or whether the constraint is of greater-than type, less-than type
or even an equality. The shadow price in the sensitivity report should thus be
interpreted appropriately. The last two columns in the table show the upper
and lower tolerances for the values on the right hand side of the constraints.
Microsoft® Excel Solver calls them “Allowable Increase” and “Allowable De-
crease” respectively. Notice that the tolerances for the wood availability con-
straint quoted here match the values we obtained on page 81 through graphi-
cal analysis.

EE Notice, that Microsoft® Excel Solver does not output sensitivity analysis
results for the coefficients on the left hand side of the constraint (in)equalities.
However, more advanced linear programming solvers output these values too.
2.7. POST-OPTIMALITY ANALYSIS USING MICROSOFT® EXCEL SOLVER 87
Microsoft Excel 11.0 Sensitivity Report
Worksheet: [Furniture.xls]Sheet1
Report Created: 4/14/2006 4:33:48 PM

Adjustable Cells
Final Reduced Objective Allowable Allowable
Cell Name Value Cost Coefficient Increase Decrease
$B$2 Amount Table 181.8181818 0 70 17.5 10
$C$2 Amount Chair 381.8181818 0 50 8.333333333 10

Constraints
Final Shadow Constraint Allowable Allowable
Cell Name Value Price R.H. Side Increase Decrease
$E$7 Wood Av. LHS 1 12727.27273 1 0.092857143 0.142857143
$E$8 Labor Cap. LHS 1 19090.90909 1 0.166666667 0.108333333
$E$9 Mkt. Cap. Table LHS 181.8181818 0 300 1E+30 118.1818182

Figure 2.14: Solver sensitivity report for the problem in Section 2.1
88 CHAPTER 2. POST-OPTIMALITY ANALYSIS

Problems
Problem 2.1: Formulate the dual of the following linear program
Maximize 20x1 + 30x2 + 25x3 + 40x4
Subject to:

5x1 + 3x2 − 5x3 + 3x4 ≤ 25


9x1 − 4x2 + 8x3 − 4x4 ≥ 10
2x1 − 7x2 − 6x3 + 5x4 = 15
x1 , x2 ≥ 0,
x3 unrestricted,
x4 ≤ 0.

Problem 2.2: Consider the following linear program:


Maximize 20x1 + 30x2
Subject to

5x1 + 3x2 ≤ 15
2x1 + 5x2 ≤ 10
x1 , x2 ≥0

a. Represent the problem graphically. Find the optimal solution to it.

b. Construct the dual of this problem.

c. Represent the dual graphically and find its optimal solution. Check whe-
ther the objective function value of the optimal solution to the primal
equals the objective function value of the optimal solution to the dual.

After each of the changes mentioned in the following parts, plot the fea-
sible regions of the primal and dual programs. Also plot their objective func-
tions through their optimal solutions. Superimpose these figures on the cor-
responding figures for the original problems.

d. Change the coefficient of x1 in the objective function of the primal to 15


and subsequently to 10.

e. Change the right hand side of the second constraint of the primal to 20.

f. Change the coefficient of x1 in the second constraint of the primal to 3 and


subsequently to 4.
PROBLEMS 89

Problem 2.3: As a small tea seller, you blend three different types of tea into
four mixtures that are popular with your customers. Of this the first type of
tea adds color to the tea, the second adds aroma, and the third (which is the
cheapest type) is used primarily to make up volumes. The four mixtures sell
at Rs.100/kg, Rs.125/kg, Rs.175/kg, and Rs.235/kg respectively. The amounts
(in gms) of the three types of tea that go into each kg of each mixture is given
in the table below.

Mix 1 Mix 2 Mix 3 Mix 4


Type 1 200 200 600 400
Type 2 200 400 200 600
Type 3 600 400 200 0

You can sell as much tea that you can blend each day.
Now, at the end of the day, you receive the information that you would
have 20 kg of the first type of tea, 25 kg of the second type of tea, and 70 kg
of the third type of tea available to you for blending tomorrow. You need to
decide on the amounts of each blend that you need to produce. Using only
the graphical method to solve linear programs, can you compute tomorrow’s
blending plan?
[Answer(s): 50 kg of Mix 1 and 25 kg of Mix 2. ]

Problem 2.4: A linear programming problem has four non-negative variables


u, v, w, and x, five constraints, and a maximization objective. The constraints
are the following.

6u − 2v − 4w − 1x ≤ 21 (Constraint 1)
− 1u − 2v − 1w + 1x ≤ 12 (Constraint 2)
− 5u + 1v + 9w − 1x ≤ 28 (Constraint 3)
6u + 0v + 4w + 1x ≤ 15 (Constraint 4)
2u + 8v + 3w − 5x ≤ 23 (Constraint 5)

The Sensitivity Report obtained from Microsoft Excel on solving this prob-
lem has the following content. The contents of some of the cells have been
replaced with ***.
90 CHAPTER 2. POST-OPTIMALITY ANALYSIS

Adjustable Cells
Final Reduced Objective Allowable Allowable
Cell Name Value Cost Coefficient Increase Decrease
$B$2 u *** -19 *** 19 1.00E+30
$C$2 v *** 0 *** 1.00E+30 3
$D$2 w *** -10.625 *** 10.625 1.00E+30
$E$2 x *** 0 *** 1.00E+30 2.65625

Constraints
Final Shadow Constraint Allowable Allowable
Cell Name Value Price R.H. Side Increase Decrease
$F$5 Constraint 1 *** 0 21 1.00E+30 60.5
$F$6 Constraint 2 *** 0 12 1.00E+30 21.5
$F$7 Constraint 3 *** 0 28 1.00E+30 30.75
$F$8 Constraint 4 *** 3.875 15 1.00E+30 15
$F$9 Constraint 5 *** 0.375 23 246 86

Based on this report, answer the following questions.

a. What is the maximum value that the objective function of the original
problem can reach for a feasible solution?

b. Which of the five constraints hold as equalities in an optimal solution? Jus-


tify your answer.

c. Using complementary slackness conditions only, which of the five con-


straints can you guarantee will hold as strict inequalities in an optimal so-
lution? (This means that the left hand side of the constraint is less than
but not equal to the right hand side for the optimal solution.) Justify your
answer.

d. By how much does the optimal objective function value increase if the
right hand side of the Constraint 4 is increased from 15 to 20?

e. Which one among z = 4u + 2v + 3w + 3x and z = 5u + 3v + 6w + 2x, do you


think could be the objective function of the original problem? Justify your
choice.

[Answer(s): (a) 66.75 (d) 19.375 ]

Problem 2.5: Refer to the paint manufacturer’s decision situation in Prob-


lem 1.1. Generate a Sensitivity Report for this problem. Based on the report,
answer the following questions.
PROBLEMS 91

a. Assume that you have the option of selling off a portion of your daily stock
of pigment. What price would you charge for it? How much pigment
would you be willing to sell off at this price?

b. Assume that you have the option of buying more pigment. What price
would you pay per liter of pigment bought? How much would you buy at
this price?

[Answer(s): (a) Rs. 1897.01/l, 24.21 l (b) Rs. 1897.01/l, 39.8 l ]

Problem 2.6: This question is based on the problems given at the end of
Chapter 1. You need to answer the problem that each part refers to before
you can attempt these parts.

a. Consider Problem 1.5. Suppose that you are negotiating the possibility of
increasing the maximum allowable percentage of unsaturated fatty acids
in Super. What would be the maximum price that you would be willing
to pay for effecting this increase? Ignore any penalty clause for this part.
Would the method that you apply in this case generalize to all sorts of
blending problems?

b. Consider part (b) of Problem 1.6. The bank wants to re-evaluate a small
set of decisions that they have taken historically. This re-evaluation is to
ensure that the model that they have come up using their linear program-
ming technique is indeed the model with the best discrimination. Which
loan requests should they re-evaluate?

[Answer(s): (a) Rs. 500 (b) Requests 133, 134, and 140 ]

Problem 2.7: Apples & Peaches (A&P) Canners have three apple and peach-
based products in the market: Choice peach halves, Whole peach nectarines,
and Cooking apples. Choice peach halves and Whole peach nectarines are
both made from the nectarine fruit, a particular type of peach that originated
out of China. A&P has ample supply of the fruits, and can sell as many cases
of the three products as it can produce. A case of Choice peach halves has 4
kilos of fruit, a case of Whole peach nectarine has 3 kilos of fruit, and a case of
Cooking apples has 6 kilos of fruit.
Handling fruits at A&P Canners involve three steps; first the fruits are clean-
ed in the cleaning shed; then they are processed according to specific require-
ments for the products in the processing shed, and finally they are packed in
the packing shed. Each kilo of nectarines requires 3 minutes to clean, while
92 CHAPTER 2. POST-OPTIMALITY ANALYSIS

each kilo of apples needs 2 minutes to clean in the cleaning shed. Process-
ing each kilo of nectarines for Choice peach halves and Whole peach nec-
tarines takes 2 minutes and 2.5 minutes respectively, while processing apples
for Cooking apples takes 1 minute per kilo of apples. The packing activity is
enough to pack 50 cases of any of the products in a given day. For the purpose
of this problem, a typical working day has 8 hours, i.e., 480 minutes. The con-
tributions of the three products to profits are
Choice peach halves: $ 10 per case;
Whole peach nectarines: $ 15 per case; and
Cooking apples: $ 5 per case.
A&P want a product mix that maximizes their contribution. Develop a lin-
ear programming model for them.

a. What is the maximum rate at which they should be willing to pay for extra
capacity in their cleaning shed in $ /minute of cleaning capacity units?
b. What is the maximum rate at which they should be willing to pay for ex-
tra capacity in their processing shed in $ /minute of processing capacity
units?
c. What is the maximum rate at which they should be willing to pay for extra
capacity in their packing shed in $ /minute of packing capacity units?

[Answer(s): (a) $ 0.00/min (b) $ 0.00/min (c) $ 1.5625/min ]

 Problem 2.8: The VegOil company buys two grades of raw vegetable oils
VEG1 and VEG2, blends and processes them into two intermediate products,
Regular and Super; and supplies them to another company, OilSel. The veg-
etable oils that VegOil obtain have the following active components.

VEG1 VEG2
Unsaturated Fatty Acids 85% 75%
Saturated Fatty Acids 12% 18%

VEG1 costs Rs.150 a barrel, and VEG2 costs Rs.170 a barrel.


Quality restrictions on the intermediate products are the following. Reg-
ular oil can have a maximum of 80% of unsaturated fatty acids, and Super oil
can have a maximum of 83%. Regular and Super oils must have at least 15% of
saturated fatty acids. Assume that fatty acids blend linearly. VegOil has a con-
tract with OilSel to supply 250 barrels of Regular oil and 300 barrels of Super oil
every day which VegOil intends to honor. They have developed the following
linear programming model to minimize their costs:
PROBLEMS 93

Decision Variables

V 1: number of barrels of VEG1 to procure each day;


V 2: number of barrels of VEG2 to procure each day;
V 1R: number of barrels of VEG1 used to manufacture Regular oil each day;
V 1S: number of barrels of VEG1 used to manufacture Super oil each day;
V 2R: number of barrels of VEG2 used to manufacture Regular oil each day;
V 2S: number of barrels of VEG2 used to manufacture Super oil each day;
R: number of barrels of Regular oil to produce each day; and
S: number of barrels of Super oil to produce each day.

Model (Objective function and constraints)

Maximize
Contribution z = − 150V 1 − 170V 2
Subject to
VEG1 Balance: V 1 − V 1R − V 1S = 0
VEG2 Balance: V 2 − V 2R − V 2S = 0
Regular oil Balance: V 1R + V 2R − R = 0
Super oil Balance: V 1S + V 2S − S = 0
Regular oil Contract: −R ≤ −250
Super oil Contract: −S ≤ −300
Unsat. Fatty Acid–Regular: 0.85V 1R + 0.75V 2R − 0.8R ≤ 0
Unsat. Fatty Acid–Super: 0.85V 1S + 0.75V 2S − 0.83S ≤ 0
Sat. Fatty Acid–Regular: −0.12V 1R − 0.18V 2R + 0.15R ≤ 0
Sat. Fatty Acid–Super: −0.12V 1S − 0.18V 2S + 0.15S ≤ 0
Non-negativity: V 1,V 2,V 1R,V 1S,V 2R,V 2S, R, S ≥ 0

Solving the model using Microsoft® Excel Solver, they obtain the Sensitiv-
ity report shown on the next page. We have removed some of the entries in the
report and replaced them with letters from A through H, or with ***. Without
using Microsoft Excel Solver, predict the numerical values of the entries that
have been replaced with the letters A, B, C, D, E, F, G, and H?
94 CHAPTER 2. POST-OPTIMALITY ANALYSIS

Adjustible Cells
Final Reduced Objective Allowable Allowable
Name Value Cost Coefficient Increase Decrease
V1 *** A –150 320 20
V2 *** *** –170 20 1.00E+30
V1R 125 *** 0 320 20
V1S 150 *** 0 320 20
V2R 125 *** 0 20 1.00E+30
V2S 150 *** 0 20 1.00E+30
R *** *** 0 160 1.00E+30
S *** *** 0 160 1.00E+30

Constraints
Final Shadow Constraint Allowable Allowable
Name Value Price R.H. Side Increase Decrease
VEG1 Balance *** B 0 1.00E+30 275
VEG2 Balance *** C 0 1.00E+30 275
Regular oil Balance *** *** 0 16.66 0
Super oil Balance *** D 0 8.57 50
Regular oil Contract *** *** –250 250 1.00E+30
Super oil Contract *** E –300 300 1.00E+30
Unsat. Fatty Acid – Regular *** *** 0 0 12.5
Unsat. Fatty Acid – Super F G 0 1.00E+30 9
Sat. Fatty Acid – Regular *** *** 0 1.00E+30 0
Sat. Fatty Acid – Super *** H 0 5.4 9

[Answer(s): A = 0, B = −150, C = −170, D = −110, E = 160, F = −9, G = 0, H = 1000/3 ]


CHAPTER
3
A PPLICATIONS OF M ATHEMATICAL
P ROGRAMMING IN N ETWORKS

3.1 What is a Network?


Consider the plan of a residential area given in Figure 3.1. This plan is drawn

K C

G D

J E

F B

250m

Figure 3.1: Layout of a residential area

95
96 CHAPTER 3. NETWORKS

to scale. The gray colored areas represent housing complexes, and the white
colored areas represent roads. We are interested in the interconnections be-
tween ten points in the area, marked A, . . . , K in the area.
The network of roads in Figure 3.1 can be expressed schematically using
the diagram in Figure 3.2. The circles labeled from A through K in Figure 3.2

C K

H
D

A B G

F E

Figure 3.2: A graph representation of the layout in Figure 3.1

denote the points from A through K in Figure 3.1, and the lines represent di-
rect road connections between pairs of points. Notice that in this representa-
tion, we are not concerned about geographical accuracy, rather, we are con-
cerned only about representing the connections between the nine points ac-
curately. We call such representations graphs. The labeled circles are referred
What is a graph?
to as nodes or vertices, and the lines between pairs of nodes are called edges or
links. Formally stated, a graph G = (V, E ) is an ordered pair of a set of nodes V ,
and a set of edges E , where each element in E connects two nodes in V . The
labels on the nodes are required to be unique.
Sometimes, we may be interested not only about the interconnections be-
tween the points, but also about the distances between them. In such cases,
we add numbers next to the edges to denote the the distance between the
points that the edge connects. For example, in Figure 3.3, for each edge in the
graph of Figure 3.2, we have marked the distances in the layout between the
two nodes that the edge connects. These numbers are called the lengths, or
in appropriate situations, costs of the edges. Lengths and costs are interpreta-
tions of weights on edges. When our purpose through the edges is to compute
distances between points, we refer to the weights as lengths. When edges rep-
resent possible conduits through which material or information flows, then
3.1. WHAT IS A NETWORK? 97

500
C K
1400
300
1100 H
D
500

A 300 B G
500 200

500
1100 J

300 800
F E

Figure 3.3: A weighted graph representation of the layout in Figure 3.1

weights on edges are called costs, and are interpreted as the amount of re-
sources required to send one unit of material or information along the con-
duit. A graph with weights attached to edges is called a weighted graph.
What is a
Let us now make a modification in the plan shown in Figure 3.1. Assume
weighted graph?
that all the road segments in this plan have been converted to one-way roads.
The direction of traffic along the road segments are as shown in Figure 3.4.
The representations in Figures 3.2 and 3.3 are no longer adequate in repre-
senting this changed scenario, because the edges in those representations do
not tell us which direction of traversal along the corresponding road segment
is allowed, and which direction is forbidden. Thus we introduce the concept
of directed edges or arcs in our representations. An arc is represented by an
What is an arc?
arrow connecting two nodes. The node which is adjacent to the arrow-head
is called the head of the arc, and the other node is called its tail. Traversal is
allowed from the tail of the arc to the head but not the other way around. A
graph in which all connections between nodes are arcs (i.e., graphs with arcs
but no edges) are called directed graphs or digraphs. The layout in Figure 3.4
What is a
is represented in Figure 3.5 as a weighted digraph.
digraph?
Next let us introduce another complication in the layout. Assume that all
the road segments in the area are still one-way, but the road segments from
points D to G and from E to J can handle a maximum of 5 cars per hour, while
the road segment from A to C through B can handle 20 cars per hour. All other
road segments can handle 10 cars per hour. If we have to include this infor-
mation in our schematic diagram, then the weights on each of the arcs in Fig-
ure 3.5 no longer remains a single number, but becomes an ordered pair. The
98 CHAPTER 3. NETWORKS

K C

G D

J E

F B

250m

Figure 3.4: Layout of the area with one-way roads

500
C K
1400
300
1100 H
D
500

A 300 B G
500 200

500
1100 J

300 800
F E

Figure 3.5: A weighted digraph representation of the layout of Figure 3.4

first number of the pair denotes the length of the segment, while the second
number denotes its capacity. The representation then looks like Figure 3.6.
Such a weighted digraph in which the weights on arcs are ordered pairs, the
first element of which represents the length of an arc and the second element
represents its capacity is called a network. In other words, a network is a col-
What is a
network?
3.1. WHAT IS A NETWORK? 99

(500,10)
C K
(1400,10)
(300,10)
(1100,20) H
D
(500,5)

A (300,20) B G
(500,10) (200,10)

(500,10) (1100,10) J

F (300,10) E (800,5)

Figure 3.6: A network representation of the layout

lection of nodes and arcs connecting the nodes. Arcs have lengths (or costs)
and capacities associated with them, while nodes only have unique labels. It
is not necessary that both lengths (or costs) and capacities of arcs are of in-
terest for all networks. If one of them is not, then it can be dropped from the
representation.
We now introduce some frequently occurring terminology regarding net-
works — source and destination nodes, flows along the network, paths in the
network, and cycles. In a problem defined on a network, we either want to find
a way of reaching from a point in the network to another, or we want to send
some material from one point in the network to another. Both these prob-
lems can be converted to the problem of sending material from one point of
the network to another. This flow of material is referred to as flow in the net-
What is flow?
work. The node in the network representing the point from which we want the
start is called the source node, while the node corresponding to the point that
What are source
we want to reach is called the destination node. For example, if we want to go
and destination
from point A to point C in the layout in Figure 3.4, then node A in the network
nodes?
in Figure 3.6 is the source node, while the point C in the same network is the
destination node. Ways to reach a destination node from a source node are
called paths in the network. For example in Figure 3.6, if A is the source node
What are paths
and C is the destination node, we may describe a path as going from A to B to
and cycles?
C, or from A through B, F, E, D, and K, in that order, and then to C. These paths
are communicated by mentioning the nodes from the source to the destina-
tion in the order of their traversal. So the first path is represented as ABC and
the second one as ABFEDKC. A path for which the source node is the same
100 CHAPTER 3. NETWORKS

as the destination node is called a cycle. There are no cycles in the network
in Figure 3.6, but if the direction of travel allowed from B to C in the layout
in Figure 3.4 is reversed, it would lead to the cycle BFEDCKB. The length of a
path or a cycle (or in appropriate situations, its cost) is the sum of the lengths
(or costs respectively) of all the arcs in it.
Networks can be used to represent a wide variety of problems, many of
which are not concerned with physical layouts. In Example 3.1 we show the
representation of a manpower planning scenario in the form of a network.

Example 3.1: A small project is being planned by a department in a software


firm. The project is to be completed in two months, and it is estimated that
two persons would need to work on the project each month. The department
has two options to staff this project. They could either borrow employees from
other departments, at a cost of Rs. 35,000 per employee per month including
employee salary, which they have to pay, or they could hire people from the
market for a maximum tenure of two months, and pay them at the rate of
Rs. 20,000 per person per month. However, there is a search cost of Rs. 10,000
per person for hiring people from the market. Over-staffing or hiring and fir-
ing persons in the middle of a month is not allowed.
We can represent the problem of hiring people from the market as the net-
work in Figure 3.7. The nodes in the network represent combinations of time
and staffing levels. Node S represents the start node for the project when the
first staffing decision is made, and node T represents the destination node af-
ter the last person associated with the project, if any, has been let go. Nodes A,
B, G, and H represent states in the project at different times when no person
hired from the market is assigned to the project, nodes C, D, I, and J repre-
sent states where one such person is assigned, and nodes E, F, K, and L rep-
resent states where two such persons are assigned to the project. Nodes A, C,
and E represent numbers of people hired from the market at the beginning of
the first month, while nodes B, D, and F represent numbers at the end of the
first month. Nodes G, I, and K, and nodes H, J, and L represent corresponding
numbers at the beginning and the end of the second month respectively. Thus
for example, node D represents the state of the project in which there is one
person assigned from the market to the project at the end of the first month.
The arcs represent the act of moving from one state of the project to an-
other. Their costs (shown in Rs. ’000 units) represent the cost of moving from
the state represented by the tail of the arc to the state represented by the head
of the arc. For example, the arc from B to K has a cost of Rs. 20,000, represent-
ing the cost of hiring two persons from the market for the second month of the
project. Similarly, the arc from C to D represents the cost to the department
for paying one person hired from the market and one person borrowed from
3.2. REPRESENTING NETWORK FLOW PROBLEMS AS LINEAR PROGRAMS
101

40 40 Both from
E F K L
market
10

20 55 55 One from
C D I J
market
20
10

10
70 70 None from
S A B G H T market

Month 1 Month 2
outlay outlay

Figure 3.7: Manpower planning problem represented as a network

another department. This cost is Rs. (20, 000 + 35, 000) = Rs. 55,000. Zero cost
arcs are shown as broken lines in the representation to eliminate clutter. We
have dropped arc capacities from our representation since they are not mean-
ingful in this problem context.

In a realistic manpower planning problem, one would have to factor in


over-staffing and under-staffing considerations, firing costs, longer project
durations, skill levels, etc. This makes the network too complicated to gen-
erate by hand, but the principle behind generating them remains the same.
Such large networks are normally generated algorithmically.
A large class of network problems is that of network flow problems, in
which we input a quantity of flow into a pre-specified node in the network,
and expect a quantity of flow from another pre-specified node in the network.
These problems are very naturally represented as mathematical programs. In
the next section, we show how networks can be defined in mathematical pro-
grams through constraints.

3.2 Representing Network Flow Problems as Linear


Programs
Network flow problems are defined very naturally in a mathematical program-
ming framework. In these problems, flows enter the network through some
source nodes, get routed along the arcs of the network, and then flow out of
the network through some destination nodes. We assume that we are dealing
with balanced problems, in which the total inflow into the network equals the
total outflow out of the network. Network problems that are not balanced can
102 CHAPTER 3. NETWORKS

be easily balanced using dummy nodes as we will see in Section 3.4.


Let us assume that we are dealing with a network defined on a set V =
{1, 2, . . . , n} of nodes. The set of arcs of the network is denoted by A. Each arc
is of the form (i , j ), where i , j ∈ N . The capacity of an arc (i , j ) is u i j , and its
cost is ci j .
In network flow problem formulations, we define one non-negative de-
cision variable for each arc in the network representing the quantity of flow
along that arc in the network. For example the flow on the arc (i , j ) is repre-
sented by the decision variable xi j . We define two sets of constraints that de-
scribe the network to the mathematical program. The first set of constraints
is the set of capacity constraints. They simply state that the flow along an arc
What are
cannot exceed its capacity. For arc (i , j ) ∈ A for example, the capacity con-
capacity
straint is of the form
constraints?

xi j ≤ ui j .

If an arc in the network does not have a finite capacity, then its capacity con-
straint is of the form

xi j ≤ ∞.

Such a constraint is always redundant, and is therefore never included in the


formulation.
The second set of constraints is the set of node balance constraints. These
What are node
ensure that the total flow into a node is exactly equal to the total flow out of
balance
the node. These flows include the external flow into the source nodes and
constraints?
out of the destination node. In other words these constraints ensure that no
flow gets added to or removed from a network except for the flow sent into the
source nodes by the modeler, and the flow taken out at the destination nodes.
Consider for example, a node k ∈ V of the network, and let the arcs connected
to this node be as shown in Figure 3.8. The costs and capacities of the arcs are
immaterial for these constraints and have not been shown.
As per our convention, x pk , x qk , and xr k denote the flows into node k,
while xks and xkt denote flows out of node k. Then the node balance con-
straint for node k is given by

x pk + x qk + xr k = xks + xkt .

Rearranging the terms to obtain a constant on the right hand side of the con-
straint, we get

x pk + x qk + xr k − xks − xkt = 0. (3.1)


3.2. REPRESENTING NETWORK FLOW PROBLEMS AS LINEAR PROGRAMS
103

… p
s …

… q k

t …
… r

Figure 3.8: A part of a network

Notice that node balance constraints in networks are necessarily equality con-
straints.

EE The final form of the constraint shown above is of the form

Total inflow into node k − Total outflow out of node k = 0.

This could also have been written in the form

Total outflow out of node k − Total inflow into node k = 0,

which for node k in the network of Figure 3.8 would take the form

xks + xkt − x pk − x qk − xr k = 0.

These two forms are equivalent, but in order to maintain readability of the
model, it is better to follow one of these two conventions for all node balance
constraints in a formulation.

The form of the node balance constraint changes slightly if the node is a
source node or a destination node. For example, if node k in the network of
Figure 3.8 is a source node with an inflow of f units, then equation (3.1) would
be written as

x pk + x qk + xr k − xks − xkt = − f .

If it was a destination node with an outflow of f units, then equation (3.1)


would be written as

x pk + x qk + xr k − xks − xkt = f .
104 CHAPTER 3. NETWORKS

The following example illustrates the process of defining a network in a


mathematical program.

Example 3.2: Consider the layout in Figure 3.4 on page 98. A car rental com-
pany has its office at point A in this layout. It has received a requisition for 20
vehicles to be sent to point H within an hour, and wants to find out how to
route the vehicles to H from A.
The network representation of the layout is shown in Figure 3.6 on page 99.
In order to find a routing for the vehicles, we need to solve a network flow
problem, where a unit of flow represents a vehicle. Nodes A and H in this
network represents the source node and destination nodes respectively. The
inflow into A and the outflow out of H are both 20 units.
To describe this network in a mathematical program, we define decision
variables denoting flows on all the arcs in the network. Hence we have the
following decision variables:

x AB : Flow on arc (A,B);


xBC : Flow on arc (B,C);
..
.
x J H : Flow on arc (J,H).

There are 12 such decision variables representing the 12 arcs in the network.
Next we define the capacity constraints. As mentioned earlier, these con-
straints ensure that the flow on an arc does not exceed its capacity. For exam-
ple, the capacity on arc (A,B) is 20 units. Hence the capacity constraint for this
arc is represented by the constraint

x AB ≤ 20.

There are 12 such capacity constraints in our model corresponding to the 12


arcs in the network.
Node A is the source node in the network. It has no incoming arcs, and the
only arc going out from it is the arc (A,B). The inflow into A is 20 units. Hence
its node balance constraint looks like

−x AB = −20.

Node H is the destination node. It has two incoming arcs, and no arc going
out from it. The outflow from node H is 20 units. Hence its node balance
constraint looks like

x J H + xK H = 20.
3.3. FORMULATING NON-STANDARD REPRESENTATIONS 105

We can construct the node balance constraints for the other eight nodes of
the network in a similar manner. For example, node D has one incoming arc,
(E,D), and two outgoing arcs, (D,G) and (D,K). Hence its node balance con-
straint looks like

xE D − xDG − xDK = 0.

Finally, since flows on arcs cannot be negative, we have non-negativity


constraints for all the 12 arcs in the network.
Combining these constraints, the description of the network in Figure 3.6
in a mathematical programming model is as shown in Figure 3.9.

3.3 Formulating Non-Standard Representations


On page 98, when we had defined networks, we defined them as directed
graphs whose arcs have costs and capacities, and whose nodes possess no
property except having unique labels. In practical situations however, this
definition of networks often appears too restrictive for many problems that
can be modeled as graphs. Fortunately, many such situations can be handled
by suitably modifying the intuitive graph formulations. We describe two such
situations in this section.

Formulating mixed graphs as networks


A natural representation of many practical situations is a graph in which some
of the connections between nodes are arcs, while some others are edges. For
example, any city layout has some road segments that are designated as one-
way, while in other segments traffic is allowed to flow in both directions. These
graphs which have both arcs and edges are called mixed graphs. Undirected
What are mixed
graphs and directed graphs can be considered as special cases of such mixed
graphs?
graphs. We can construct networks out of mixed graphs in which each con-
nection has a length and a capacity by converting all edges in the graph to
arcs.
Consider an edge between two nodes, A and B in a mixed graph, with
Replacing edges
length l and capacity u. Since this edge allows traversal in both directions,
by arcs.
we will replace it with a pair of arcs, AB, from A to B, and BA from B to A. Since
the length of the edge is the same regardless of the direction of traversal, both
the arcs AB and BA have length l . The assignment of capacities to the arcs is
trickier and depends on the situation being modeled as a network. The fol-
106 CHAPTER 3. NETWORKS

Decision Variables

x AB : Flow on arc (A,B);


x BC : Flow on arc (B,C);
..
.
x J H : Flow on arc (J,H).

Constraints

x AB ≤ 20 (Capacity constraint on (A,B))


x BC ≤ 20 (Capacity constraint on (B,C))
xB F ≤ 10 (Capacity constraint on (B,F))
x DG ≤ 5 (Capacity constraint on (D,G))
x DK ≤ 10 (Capacity constraint on (D,K))
x ED ≤ 10 (Capacity constraint on (E,D))
xE J ≤ 5 (Capacity constraint on (E,J))
xF E ≤ 10 (Capacity constraint on (F,E))
xF J ≤ 10 (Capacity constraint on (F,J))
xJH ≤ 10 (Capacity constraint on (J,H))
x KC ≤ 10 (Capacity constraint on (K,C))
xK H ≤ 10 (Capacity constraint on (K,H))

− x AB = −20 (Node balance at A)


x AB − x BC − x B F = 0 (Node balance at B)
x BC + x KC = 0 (Node balance at C)
x ED − x DG − x DK = 0 (Node balance at D)
x F E − x ED − x E J = 0 (Node balance at E)
xB F − xF E − xF J = 0 (Node balance at F)
x DG = 0 (Node balance at G)
x J H + xK H = 20 (Node balance at H)
xE J + xF J − x J H = 0 (Node balance at J)
x DK − x KC − x K H = 0 (Node balance at K)

x AB , x BC , x B F , x DG ,
x DK , x ED , x E J , x F E ,
x F J , x J H , x KC , x K H ≥ 0 (Non-negativity)

Figure 3.9: Mathematical programming description of the network in Fig-


ure 3.6
3.3. FORMULATING NON-STANDARD REPRESENTATIONS 107

lowing two examples show how the assignment of capacities to such arcs vary
depending on the problem situation.

Example 3.3: An area has four locations of interest labeled A, B, C, and D.


Two of these locations, B and D, have tourism offices, while the other two, A
and C, have good connections to other places. Hence tourists arrive at A and
C, and travel to B and D from there. A and C receive tourists at the rate of 10
bus-loads per hour and 6 bus-loads per hour respectively. Tourists going from
A to B or from C to D need to cross a bridge between points P and Q. The road
from A to P can carry 15 bus-loads per hour, and the roads from C to Q, P to
D, and Q to B can carry 8, 7 and 19 bus-loads per hour respectively. The bridge
between P and Q can carry 14 bus-loads per hour.1 B and D are both capable
of handing 8 bus-loads of tourists every hour. The layout of the area and the
mixed graph representation of the area are shown in Figure 3.10. The mixed

A D
A D

15 7
P
P

14

Q Q

8 19

C B C B
Layout of an area Its mixed graph representation
Figure 3.10: A road and bridge network

graph representation shows the capacities of the various arcs and edges. Their
lengths are immaterial here, and have not been shown in Figure 3.10.
The only issue in creating a network out of the mixed graph is the handling
of the edge between P and Q. As discussed in this section, we replace the edge
by two arcs, PQ representing the flow from P to Q, and QP, representing the flow
from Q to P, as shown in Figure 3.11. The maximum flow on each of PQ and QP
1
As in Chapter 1, the portion under emphasis indicates the condition that is of interest in
the section.
108 CHAPTER 3. NETWORKS

A D

15 7

14

8 19

C B

Figure 3.11: A network representation of the layout in Figure 3.10

cannot exceed the capacity of the bridge. However, there is a stronger relation
between the two; their sum cannot exceed 14. Therefore, if we represent the flow
on each arc (i , j ) by xi j , the capacity constraint on edge PQ is

xPQ + xQP ≤ 14.

The mathematical programming description of the network model of the lay-


out is given in Figure 3.12.

Example 3.4: A bank has two branches, labeled A and B, in a rural location
that is not very well-connected to the main branch. These branches handle
demands from farmers in the area. Farmers can both deposit and demand
large sums of money, and each branch’s reserves may not be sufficient to dis-
burse all demands on a particular day. Hence the two branches can borrow
from each other to tide over temporary cash flow problems. However, the
bank has stipulated that the two branches cannot have a net daily transaction
of more than Rs. 100,000.
A mixed graph representation of the situation is shown in Figure 3.13. No-
tice that there are no costs associated with any of the transactions, and there
are no capacity restrictions except for the inter-branch transaction limit. The
usual way of dealing with an edge in a mixed graph is to replace it with a pair
of arcs. We do this to convert the mixed graph of Figure 3.13 to the network of
Figure 3.14.
3.3. FORMULATING NON-STANDARD REPRESENTATIONS 109

Decision Variables

x AP : Flow on arc (A,P);


xCQ : Flow on arc (C,Q);
xP D : Flow on arc (P,D);
xQB : Flow on arc (Q,B);
x PQ : Flow on arc (P,Q); and
xQP : Flow on arc (Q,P).

Constraints

x AP ≤ 15 (Capacity constraint on (A,P))


xCQ ≤ 8 (Capacity constraint on (C,Q))
xP D ≤ 7 (Capacity constraint on (P,D))
xQB ≤ 19 (Capacity constraint on (Q,B))
x PQ + xQP ≤ 14 (Capacity constraint on edge [P,Q])

− x AP = −10 (Node balance at A)


xQB = 8 (Node balance at B)
− xCQ = − 6 (Node balance at C)
xP D = 8 (Node balance at D)
x AP + xQP − x P D − x PQ = 0 (Node balance at P)
xCQ + x PQ − xQB − xQP = 0 (Node balance at Q)

x AP , xCQ , x P D , xQB ,
x PQ , xQP ≥ 0 (Non-negativity)

Figure 3.12: Mathematical programming description of the network in Fig-


ure 3.11

We next handle the issue of assigning capacity restrictions on the new arcs
introduced. As usual, let non-negative decision variables xi j denote the money
flow from branch i to branch j . Notice that the bank’s stipulation does not limit
the amount of money sent from one branch to another. They only stipulate an
upper limit to the net daily transaction amount. Therefore, the individual arcs
(A,B) and (B,A) have no capacity constraints associated with them. However,
since the net daily transaction cannot exceed Rs. 100,000, x AB and xB A needs to
110 CHAPTER 3. NETWORKS

Ai Bi

100000
A B

Ao Bo

Figure 3.13: A mixed graph representation of the bank branched problem

Ai Bi

A 100000 B

Ao Bo

Figure 3.14: A network representation of the bank branched problem

obey the restriction

|x AB − xB A | ≤ 100000.

This is not a linear constraint, but we can linearize it by replacing it with the
following two constraints:

x AB − xB A ≤ 100000, and
xB A − x AB ≤ 100000.

This pair of constraints acts as the capacity constraints on (A,B) and (B,A). We
leave the complete description of the network model as an exercise to the
reader.

Representations where nodes have costs and capacities


In our definition of networks in Section 3.1, we had mentioned that nodes in a
network have labels only, and these labels are unique. However, in some prac-
tical problems, an intuitive graph model of the problem situation demands
that the nodes have costs and capacities associated with them. Sometimes,
in such representations, nodes are also required to allow flows in some direc-
tions but not in others. All these situations can be handled by splitting the
node into a group of nodes, and connecting the nodes in this group using arcs
3.3. FORMULATING NON-STANDARD REPRESENTATIONS 111

that model the costs, capacities, and directional properties of the nodes. The
following example illustrates the way in which this is done.

Example 3.5: Dhabalpur is a tourist destination. The railway station nearest


to Dhabalpur is at Solpur. After getting down from the train at Solpur, tourists
get into cars and drive to Dhabalpur. There is a road that goes from Solpur to
Dhabalpur through Adampur. The fuel cost to go from Solpur to Adampur is
Rs. 4 per car, and the road from Solpur to Adampur can handle a maximum
of 150 cars per hour. From Adampur, the road is narrower and badly main-
tained. It can handle a maximum of 40 cars per hour and it costs Rs. 6 per car
to go from Adampur to Dhabalpur. There is an alternate route from Solpur
to Dhabalpur through a town called Belapur. The road from Solpur to Bela-
pur can handle a maximum of 70 cars per hour, and it costs Rs. 3 per car to
make the trip. The road from Belapur to Dhabalpur can handle a maximum
of 150 cars per hour, and fuel cost to traverse it is Rs. 2 per car. There is a road
from Adampur to Belapur, which costs a car Rs. 1 for fuel, and can handle a
maximum of 100 cars per hour. A toll booth at the entrance to Belapur charges
Rs. 4 per car. It can handle a maximum of 120 cars per hour. Assuming cost
conscious travelers, development authorities would like to predict the load
on the different road segments given that, as per available records, 200 cars
are booked by tourists at Solpur each hour to visit Dhabalpur on average. We
can represent the road network between the four towns as the graph in Fig-
ure 3.15. In the graph, A, B, S, and D represent Adampur, Belapur, Solpur and
Dhabalpur respectively.

A
(4,150) (6,40)

S (1,100) D

(3,70) (2,150)
B
(4,120)

Figure 3.15: A graph representation of the road network

The costs and capacities of the road connections and the toll booth at Be-
lapur are marked in the figure. Due to the toll booth at Belapur, node B in
Figure 3.15 has a cost and a capacity. To convert this graph into a network, we
therefore represent node B as two nodes Bi and Bo with an arc connecting Bi to
112 CHAPTER 3. NETWORKS

Bo . This arc represents the toll booth, so it has a cost of Rs. 5 per car passing
through it, and a capacity of 120 cars per hour. After this change the road net-
work looks like the network in Figure 3.16. Using mathematical programming,

A
(4,150) (6,40)

S (1,100) D

(3,70) (2,150)
(4,120)
Bi Bo

Figure 3.16: A network representation of the road network

this network is described as shown in Figure 3.17.

3.4 Common Network Flow Problems


Network flow problems in general are concerned with sending flow from a
pre-specified set of source nodes in a network, to a pre-specified set of desti-
nation nodes. Although there are many network flow problems, we will con-
sider three such problems that arise very often in practice. The questions that
these problems seek answers for are the following:

1. If we want to send a specified quantity of flow from a set of source nodes


to a set of destination nodes along a network, what routes should the
flow take, and what is the cost involved? This is called the minimum
cost flow problem.
2. What is the maximum amount of flow that we can transmit from a set
of source nodes to a set of destination nodes along a network? This is
known as the maximum flow problem. While solving this problem, we
ignore the costs associated with the arcs.
3. If we want to send a unit of flow from a pre-specified source node to a
pre-specified destination node along a network, then which is the cheap-
est route that the flow should take, and what is the cost of that route? Al-
ternatively stated, what is the cheapest path from the source node to the
destination node? This problem is known as the shortest path problem.
We ignore arc capacities while solving this problem.
3.4. COMMON NETWORK FLOW PROBLEMS 113

Decision Variables

x S A : Flow on arc (S,A);


x SB i : Flow on arc (S,Bi );
x AB i : Flow on arc (A,Bi );
x AD : Flow on arc (A,D);
x B i B o : Flow on arc (Bi ,Bo ); and
x B o D : Flow on arc (Bo ,D).

Constraints

xS A ≤ 150 (Capacity constraint on (S,A))


x SB i ≤ 70 (Capacity constraint on (S,Bi ))
x AB i ≤ 100 (Capacity constraint on (A,Bi ))
x AD ≤ 40 (Capacity constraint on (A,D))
xBi Bo ≤ 120 (Capacity constraint on (Bi ,Bo ))
xBo D ≤ 150 (Capacity constraint on (Bo ,D))

− x S A − x SB i = −200 (Node balance at S)


x S A − x AB i − x AD = 0 (Node balance at A)
x SB i + x AB i − x B i B o = 0 (Node balance at Bi )
xBi Bo − xBo D = 0 (Node balance at Bo )
x AD + x B o D = 200 (Node balance at D)

x S A , x SB i , x AB i , x AD ,
xBi Bo , xBo D ≥ 0 (Non-negativity)

Figure 3.17: Mathematical programming description of the network in Fig-


ure 3.16

The minimum cost flow problem


In an instance of the minimum cost flow problem, we are given a network
defined by the set V of nodes and the set A of arcs. Each of the arcs (i , j ) ∈
A has a cost ci j that is incurred to send one unit of flow from i to j , and a
capacity u i j denoting the maximum amount of flow that can be sent from i
to j along that arc. We are also given a set of source nodes with the inflows
into each of them, and a set of destination nodes with the outflows out of
each of them. The sum of the inflows into the source nodes equal the sum of
114 CHAPTER 3. NETWORKS

the outflows out of the destination nodes. Our objective is to route the flows
from the source nodes to the destination nodes along the network, so that
none of the arc capacities are violated, and the flows are sent from the source
nodes to the destination nodes at minimum cost. A solution to the problem
specifies the amount of flow along each of the arcs in the network, such that
the required amounts of flow go out of the source nodes into the network, and
the required amounts of flow reach the destination nodes.
This problem lends itself very naturally to be solved using linear program-
ming. To do so, we define one non-negative decision variable for each arc in
the network. This variable denotes the amount of flow along that arc in an
optimal solution to the problem. The total cost of sending flows along the
P
network is (i ,j )∈A ci j xi j , so that the objective of the linear program is to
X
Minimize ci j xi j .
(i ,j )∈A

The constraints in the model describe the network. So, as discussed on page 102,
we add capacity constraints, node balance constraints, and non-negativity
constraints to complete the formulation. The general form of a minimum cost
flow problem formulation is shown in Figure 3.18.
We illustrate the formulation process for a minimum cost flow problem in
the example below.

Example 3.6: Consider the network shown in Figure 3.19. As per our conven-
tion, for each arc, we mention the cost of the arc followed by its capacity. Let
A and B be the source nodes in the network, with inflows of 15 units and 10
units respectively. Let C and E be the destination nodes with outflows of 13
units and 12 units respectively. We would like to route the flows from A and
B to C and E on the network, without violating any of the arc capacities, and
such that the total cost of routing the flows is minimum.
To formulate this problem, we define the following non-negative variables:
x AB : Flow on arc (A,B);
x AC : Flow on arc (A,C);
xBC : Flow on arc (B,C);
xBD : Flow on arc (B,D);
xC D : Flow on arc (C,D);
xC E : Flow on arc (C,E); and
xDE : Flow on arc (D,E).
The total cost of sending flows along the network is 6x AB + 3x AC + 2xBC +
5xBD + 10xC D + 7xC E + 4xDE , so that the objective of the program is to
Minimize 6x AB + 3x AC + 2xBC + 5xBD + 10xC D + 7xC E + 4xDE .
3.4. COMMON NETWORK FLOW PROBLEMS 115

Decision Variables

x i j : Flow along arc (i , j ) for all arcs in the network.

Model (Objective function and constraints)

Minimize
X
m X
n
Total cost z = ci j xi j
i =1 j =1

Subject to
xi j ≤ c i j (Capacity constraint for arc (i , j ))
There is a capacity constraint corresponding to each arc
in the network

X
n X
n
xi j − x j k = − f s (Node balance constraint for a source
i =1 k=1
node s with inflow f s )
X
n X
n
xi j − xjk = f t (Node balance constraint for a destination
i =1 k=1
node t with outflow f t )
X
n X
n
xi j − xjk= 0 (Node balance constraint for node j which
i =1 k=1
is neither a source nor a destination)
There is a node balance constraint corresponding to each
node in the network

xi j ≥ 0 (Non-negativity)
There is a non-negativity constraint corresponding to each
arc in the network

Figure 3.18: Linear programming formulation of a minimum cost flow prob-


lem

The first set of constraints in the model is the set of capacity constraints.
As an example of capacity constraints, the one for the arc (A,B) is

x AB ≤ 15.

There are six more such constraints for each of the other arcs in the network.
116 CHAPTER 3. NETWORKS

Flow = 13

(3,10)
Flow = 15 A C (7,20)
(2,5)
(6,15) (10,9) E Flow = 12

(5,17) (4,18)
Flow = 10 B D

Figure 3.19: A five node network

The second set of constraints contains five node balance constraints, one
for each of the five nodes in the network. As an example, the node balance
constraint for node B is

x AB − xBC − xBD = −20.

The last set of constraints are the non-negativity constraints for the deci-
sion variables.
Combining all the above, a linear programming formulation for the mini-
mum cost flow problem described in this example is as shown in Figure 3.20.
An optimal solution to the problem is: z = 174, x AB = xBC = 5, x AC = xBD =
xDE = 10, xC E = 2, and xC D = 0. This means that it is optimal to route flows
as shown in Figure 3.21. The arcs marked as solid lines carry the flows written
next to them in the figure, while the arcs shown in broken lines do not carry
any flow. The total cost of this routing of flows is 174 units.

We have so far assumed that our minimum cost flow problems are bal-
anced, i.e., the sum of the inflows into the network equals the sum of outflows
from the network. This may not be true in general. Minimum cost flow prob-
lems in which the total inflow is not equal to the total outflow are called non-
balanced or unbalanced minimum cost flow problems. Such problems can
however be converted into balanced minimum cost flow problems by adding
dummy nodes to the network.
Consider for example that in the network in Figure 3.19, the inflows at A
and B are 15 units and 10 units, but the outflow at E is only 20 units. This
causes an imbalance where the total inflow exceeds the total outflow. In this
case, we balance the problem by adding a dummy node, say X, stipulating out-
flow at X as the difference between the sum of inflows and the sum of outflows,
and adding zero cost and infinite capacity arcs from both the source nodes to
the dummy node (see Figure 3.22; the new arcs are shown with broken lines).
3.4. COMMON NETWORK FLOW PROBLEMS 117

Decision Variables

x AB : Flow on arc (A,B);


x AC : Flow on arc (A,C);
x BC : Flow on arc (B,C);
xB D : Flow on arc (B,D);
xC D : Flow on arc (C,D);
xC E : Flow on arc (C,E); and
x DE : Flow on arc (D,E).

Model (Objective function and constraints)

Minimize
Flow cost z =6x AB + 3x AC + 2x BC + 5x B D + 10xC D + 7xC E + 4x DE
Subject to
x AB ≤ 15 (Capacity constraint on (A,B))
x AC ≤ 10 (Capacity constraint on (A,C))
x BC ≤ 5 (Capacity constraint on (B,C))
xB D ≤ 17 (Capacity constraint on (B,D))
xC D ≤ 9 (Capacity constraint on (C,D))
xC E ≤ 20 (Capacity constraint on (C,E))
x DE ≤ 18 (Capacity constraint on (D,E))

− x AB − x AC = −15 (Node balance at A)


x AB − x BC − x B D = −10 (Node balance at B)
x AC + x BC − xC D − xC E = 13 (Node balance at C)
x B D + xC D − x DE = 0 (Node balance at D)
xC E + x DE = 12 (Node balance at E)

x AB , x AC , x BC , x B D ,
xC D , xC E , x DE ≥ 0 (Non-negativity)

Figure 3.20: Linear programming formulation of the minimum cost flow prob-
lem of Example 3.6
118 CHAPTER 3. NETWORKS

Flow = 13

10
Flow = 15 A C
2

5 5 E Flow = 12

10 10
Flow = 10 B D

Figure 3.21: An optimal solution to the minimum cost flow problem in Exam-
ple 6

The outflow at node X is assumed to be (15+10)−20 = 5 units here. On solving

(3,10)
Flow = 15 A C (7,20)
(2,5)
Flow = 5 X (6,15) (10,9) E Flow = 20

(5,17) (4,18)
Flow = 10 B D

Figure 3.22: When inflow exceeds outflow in a network

the problem, at least one of the two arcs will have a non-zero flow. If an arc has
a non-zero flow f in an optimal solution, then it means that f units of flow are
not sent from the corresponding source node to the destination nodes.
Consider next that in the network in Figure 3.19, the inflows into A and
B are 15 units and 10 units, and the outflows at C and E are 18 units each.
This is a situation when the outflow from the destination nodes exceed the
inflow into the source nodes. In this case we add a dummy node, say X, to
the network, and connect it to both the destination nodes through arcs with
zero costs and infinite capacities (see Figure 3.23; the new arcs are shown with
broken lines). The inflow at node X is assumed to be (18 + 18) − (15 + 10) = 11
units. On solving the problem, at least one of the two arcs will have a non-zero
flow. If an arc has a non-zero flow f in an optimal solution, then it means that
f units of flow are not sent to the corresponding destination node from any of
the source nodes.
The transportation problem is a special case of the minimum cost flow
The
problem. A typical setup of this problem is as follows. A company has to sup-
transportation
ply its demand locations material from its supply locations. It has m supply
problem.
3.4. COMMON NETWORK FLOW PROBLEMS 119

Flow = 20
X Flow = 11
(3,10)
Flow = 15 A C (7,20)
(2,5)
(6,15) (10,9) E Flow = 20

(5,17) (4,18)
Flow = 10 B D

Figure 3.23: When outflow exceeds inflow in a network

locations labeled W1 , W2 , . . . , Wm where Wi has a stock of s i , and n demand


locations labeled D 1 , D 2 , . . . , D n where demand location D j has a demand of
d j . The sum of all stocks at the supply locations is assumed to be equal to the
sum of all demands at the demand locations. The cost of supplying one unit
of material from supply location Wi to demand location D j is ci j . The com-
pany needs to find out how much of material to supply each of the demand
locations from each of the supply locations such that the total cost of supply-
ing material is minimized. A conventional way of representing transportation
problems is through a table like the one shown here.

D1 D2 Dj Dn Stock
W1 c11 c12 ··· c1j ··· c1n s1
W2 c21 c22 ··· c2j ··· c2n s2
.. .. .. .. .. .. .. ..
. . . . . . . .
Wi ci 1 ci 2 ··· ci j ··· ci n si
.. .. .. .. .. .. .. ..
. . . . . . . .
Wm cm1 cm2 · · · cm j · · · cmn s1
Demand d 1 d2 · · · d j · · · dn

To represent this problem as a minimum cost flow problem, we define a


network with two sets of nodes, one set representing the supply locations and
the other set representing the demand locations. Each node in the first set has
an inflow equal to the stock at the corresponding supply location, while each
node in the second set has an outflow equal to the demand at corresponding
demand location. Each node in the first set is connected to every node in the
second set. The arc (Wi , D j ) represents the option of sending material from
Wi to D j . It has a cost of ci j , but has no capacity, since the transportation
problem described above does not limit us from sending any amount of ma-
terial from any supply location to any demand location, except indirectly by
120 CHAPTER 3. NETWORKS

imposing stocks and demand quantities. A representation of the network is


shown in Figure 3.24.

c11
Flow = s1 W1 D1 Flow = d1
c12 c21
c1n

c22
Flow = s2 W2 D2 Flow = d2

c2n
. .
. .
. .
cm1
cm2

cmn
Flow = sm Wm Dn Flow = dn

Figure 3.24: Network for a transportation problem

Networks like the one in Figure 3.24 are called complete bipartite networks.
In such networks, the set of nodes can be divided into two mutually exclusive
and collectively exhaustive sets, such that no arc exists between any two nodes
in the same set, and for any two nodes i and j where i belongs to the first set
and j belongs to the second set, there exists an arc from i to j , but not from j
to i .
Let us now look at the modeling of the transportation problem as a linear
program. As in any other network flow problem, we define one non-negative
decision variable xi j for each arc (i , j ) in the network, representing the amount
of material sent along that arc. The objective function is the total cost of trans-
P Pn
portation, which is c11 x11 + c12 x12 + · · · + cmn xmn , i.e., m
i =1 j =1 c i j x i j , so that
the objective in the model is to

X
m X
n
Minimize ci j xi j .
i =1 j =1

Since the arcs have no capacity restrictions, the capacity constraints normally
encountered in formulations of minimum cost flow problems are not seen
in formulations of transportation problems. We however include the node
3.4. COMMON NETWORK FLOW PROBLEMS 121

balance constraints. For node Wi , the node balance constraint is

X
n
− xi j = −s i ,
j =1

which is conventionally rewritten as

X
n
xi j = si .
j =1

These constraints are called supply constraints in a transportation problem.


For node D j in the network, the node balance constraint is

X
m
xi j = d j .
i =1

These constraints are called demand constraints in a transportation problem.


Of course, the decision variables xi j need to be declared non-negative.
The complete model for a transportation problem is thus as shown Fig-
ure 3.25.
We now illustrate the modeling of transportation problems through an ex-
ample.

Example 3.7: A logistics company needs to supply the demands for widgets
at three client locations C, D, and E from two warehouses located at A and B.
Warehouses A and B have 500 and 300 widgets in stock respectively. The client
requires 250 widgets at location C, 400 widgets at location D, and 150 widgets
at location E. A matrix of the costs of sending a widget from a warehouse to a
client locations is given below.

C D E
A Rs. 12 Rs. 5 Rs. 7
B Rs. 2 Rs. 16 Rs. 9

The company wants to develop a model to compute the distribution plan such
the transportation costs for the supply operation is minimized.
This is clearly a situation where we need to formulate a transportation
model. A network representation of the problem is shown in Figure 3.26. The
nodes A and B represent the warehouse locations, and the nodes C, D, and E
represent the client locations. We define non-negative decision variables x AC ,
xBC , x AD , xBD , x AE , and xBE to correspond to the flows from the warehouses
at A and B to the client locations at C, D, and E. The total transportation cost
122 CHAPTER 3. NETWORKS

Decision Variables

x 11 : Flow from W1 to D 1 ;
x 12 : Flow from W1 to D 2 ;
..
.
x mn : Flow from Wm to D n .

Model (Objective function and constraints)

Minimize
X
m X
n
Transportation cost z = ci j xi j
i =1 j =1

Subject to
Xn
x i j = s i (Supply constraint for node Wi )
j =1

There are m such constraints corresponding to nodes W1 , . . . ,Wm

X
m
x i j = d j (Demand constraint for node D j )
i =1
There are n such constraints corresponding to nodes D 1 , . . . , D m

xi j ≥ 0 (Non-negativity)
There are mn such constraints corresponding to i = 1, . . . , m and
j = 1, . . . , n

Figure 3.25: Linear programming formulation of a transportation problem

is given by the expression 12x AC + 5x AD + 7x AE + 2xBC + 16xBD + 9xBE , so that


the objective in our model is to

Minimize 12x AC + 5x AD + 7x AE + 2xBC + 16xBD + 9xBE .

Each warehouse has a supply constraint. For example, the supply constraint
for the warehouse at A is given by

x AC + x AD + x AE = 500.

Similarly, each client location has a demand constraint. The demand con-
straint for the client location at C is given by

x AC + xBC = 250.
3.4. COMMON NETWORK FLOW PROBLEMS 123

C Flow = 250
12
Flow = 500 A 5 2

16 D Flow = 400

Flow = 300 B 7
9

E Flow = 150

Warehouse Client

Figure 3.26: A network representation of the logistics problem described in


this section

All our decision variables also need to be non-negative.


Combining all the above, the linear programming formulation of the trans-
portation problem faced by the logistics company is the one shown in Fig-
ure 3.27.
An optimal solution to this problem is z = 3650, x AD = 400, x AE = 100,
xBC = 250, xBE = 50, and x AC = xBD = 0. This means that the logistics com-
pany should supply client location C exclusively from the warehouse at B, and
the client location D exclusively from the warehouse A. It should send 100
widgets to client location E from warehouse A, and the other 50 widgets from
warehouse B.

EE In balanced transportation problems with m supply points and n de-


mand points, a total of m+n−1 constraints are sufficient to describe the feasible
region. To see this, let us remove the supply constraint at A from the formulation
in Figure 3.27 and obtain it from the other constraints.
Since all the demands are satisfied in a balanced transportation problem,
we have

x AC + xBC + x AD + xBD + x AE + xBE = 250 + 400 + 150 = 800. (3.2)

The supply constraint at B and the demand constraints at C, D, and E are all
equalities. Adding them up, we get:
(xBC + xBD + xBE ) + (x AC + xBC ) + (x AD +xBD ) + (x AE + xBE )
= 300 + 250 + 400 + 150,
which when simplified yields

x AC + x AD + x AE + 2xBC + 2xBD + 2xBE = 1100. (3.3)


124 CHAPTER 3. NETWORKS

Decision Variables

x AC : Flow from warehouse at A to client location at C;


x AD : Flow from warehouse at A to client location at D;
x AE : Flow from warehouse at A to client location at E;
x BC : Flow from warehouse at B to client location at C;
xB D : Flow from warehouse at B to client location at D; and
xB E : Flow from warehouse at B to client location at E.

Model (Objective function and constraints)

Minimize
Transportation cost z =12x AC + 5x AD + 7x AE + 2x BC + 16x B D + 9x B E
Subject to
x AC + x AD + x AE = 500 (Supply constraint for warehouse A)
x BC + x B D + x B E = 300 (Supply constraint for warehouse B)

x AC + x BC = 250 (Demand constraint for client location C)


x AD + x B D = 250 (Demand constraint for client location D)
x AE + x B E = 250 (Demand constraint for client location E)

x AC , x AD , x AE ,
x BC , x B D , x B E ≥ 0 (Non-negativity)

Figure 3.27: Linear programming formulation of the transportation problem


faced by the logistics company

Multiplying (3.2) by 2 and subtracting (3.3) from it we obtain the equality

x AC + x AD + x AE = 500,

which is the node balance constraint at A.


Any of the other constraints can be replaced in an exactly similar manner.
A consequence of this is that for a balanced transportation problem with m
supply points and n demand points, a maximum of m+n−1 of the mn decision
variables can have non-zero values.

As with general minimum cost flow problems, we can also convert non-
balanced transportation problems into balanced problems by adding dummy
nodes, as was mentioned in the discussion on page 116. If the total supply
3.4. COMMON NETWORK FLOW PROBLEMS 125

capacity in a transportation problem exceeds the total demand, then we add


a dummy demand node, the demand at which is equal to the excess supply,
and connect it to all the supply nodes with zero cost arcs. If the total demand
exceeds the total supply, then we can create a dummy supply node, the supply
capacity of which equals the excess of the total demand over the total supply,
and then connect this node to all the demand nodes with zero cost arcs. We
illustrate an unbalanced transportation problem in the following example.

Example 3.8: Consider the problem faced by the logistics company that was
described in Example 3.7. Due to a sudden increase in the population at lo-
cation E, client location E now has a demand of 250 widgets instead of 150.
The costs of transporting widgets remain unchanged, as do the stocks at the
warehouses. Since the demand for widgets had increased but not its supply, it
is clear that some of the demands for widgets will not be met. The company
wants to find out how to distribute all the widgets in its stock to minimize cost
under the new demand scenario.
The total stock of widgets in the logistics company is 500+300 = 800, while
the total demand is 250 + 400 + 250 = 900. So there is an excess demand for
100 widgets. This imbalance can be taken care of by adding a dummy ware-
house with a stock of 100 widgets, and connecting it to all the demand nodes
by infinite capacity arcs with zero costs. Adding this warehouse balances the
problem. The network representation of the problem after the addition of
the dummy warehouse (node X), and connecting it to all demand locations
through infinite capacity zero cost arcs (shown with broken lines) is shown
in Figure 3.28. It is left to the reader to formulate the problem as a linear

C Flow = 250
12
Flow = 500 A X Flow = 100
5 2

16 D Flow = 400

Flow = 300 B 7
9

E Flow = 250

Warehouse Client

Figure 3.28: Balancing the unbalanced transportation network

program using decision variables xi j to represent flows from supply node i


to demand node j , solve it, and check that an optimal solution to the prob-
126 CHAPTER 3. NETWORKS

lem is z = 3650, x AD = 400, x AE = 100, xBC = 250, xBE = 50, x X E = 100, and
x AC = xBD = x XC = x X D = 0. This means that the optimal transportation plan
is identical to that in Example 3.7, and the new demand at client location E is
left unfulfiled.

Apart from the obvious application of routing material along physical net-
works, transportation problems also find managerial applications in design-
ing repair and maintenance schedules. We illustrate one such situation in the
example below.

Example 3.9: An airline company overhauls engines of their aircrafts at reg-


ular intervals. As a part of the overhaul, the maintenance shop removes a
component of the engine and sends it to their repair shop. The repair shop
requires one month to repair the component, so that a component sent to the
shop in the first month is repaired and sent back to the maintenance shop for
use in the third month or later. The cost of repairing a component in the repair
shop is Rs. 100. If the repair shop cannot supply a component to the mainte-
nance shop on time, then the maintenance shop buys the component from
the market at a price of Rs. 200 per component. In a particular month, the re-
pair shop has no stock of components at hand, and the maintenance shop has
been drawn up a maintenance schedule in which the number of aircraft en-
gines to be overhauled in the next four months are 5, 3, 7, and 2 respectively.
The airline company needs to find out the budget that it should allocate for
this maintenance activity during the next four months.
In order to model this problem as a transportation problem, we first need
to identify the supply and demand nodes in the network representing this
problem.
Identifying demand nodes is relatively simple; a demand node represents
the demand for the component in a given month. We label the four demand
nodes thus obtained as D1, D2, D3, and D4 representing the demand of the
component in months 1 through 4. Consequently the demands at these four
demand nodes are 5 units, 3 units, 7 units, and 2 units respectively.
Next we identify the supply nodes. One supply node is clearly the external
market, which we label E. Since the market can supply all the components that
the maintenance shop requires, we keep its supply capacity at (5+3+7+2) = 17
components. The repair shop cannot meet any demand for components in
the first two months, since it has no repaired components in stock and the re-
pair job itself takes one month. Therefore we can create two supply nodes R3
and R4 corresponding to the components that the repair shop is in a position
to supply the maintenance shop in the third and fourth months respectively.
The stocks at R3 and R4 are 5 units and 3 units respectively. Since the to-
3.4. COMMON NETWORK FLOW PROBLEMS 127

tal supply exceeds total demand, the problem is not balanced, and we add a
dummy demand node (labeled X) with demand of (17+5+3)−(5+3+7+2) = 8
units to balance it.
Finally we need to create arcs for the possible flows. E can supply all the
four demand nodes. So we create arcs from E to D1 through D4. The cost of
each of the arcs is Rs. 200, the market price of each component. R3 can supply
only the demands for the third and fourth month, i.e., D3 and D4; while R4
can supply only the demand for the fourth month, i.e., D4. The cost of each of
these arcs is Rs. 100, which is the cost of repairing a component in the repair
shop. As usual, all the arcs from the supply nodes to the dummy demand node
are zero cost arcs.

D1 Flow = 5
200

200
Flow = 17 E D2 Flow = 3

200

R3 100 D3
Flow = 5 Flow = 7
200
100

R4 100 D4 Flow = 2
Flow = 3

X Flow = 8

Figure 3.29: The network corresponding to the maintenance problem

The network corresponding to this transportation problem is given in Fig-


ure 3.29. The zero cost arcs have been shown using broken lines.
The tabular representation is given below. In the table, M represents a pro-
hibitively large cost, (say Rs. 9999) and is used to ensure that no flow occurs
between the corresponding source and destination nodes in an optimal solu-
tion.
128 CHAPTER 3. NETWORKS

D1 D2 D3 D4 X Capacity
E 200 200 200 200 0 17
R3 M M 100 100 0 5
R4 M M M 100 0 3
Demand 5 3 7 2 8

Given the network or the tabular format it is easy to formulation the problem
as a transportation problem. Check that the budget allocation required for an
optimal solution to the problem is Rs. 2700. In the optimal solution, the first
two month’s demands are met by the external market. Two of the units re-
quired for the third month are bought from the external market and five units
are supplied by the repair shop from the parts that were sent for repair in the
first month. The whole of the fourth month’s demand is met by parts sent to
the repair shop in the second month. At the end of the four months, the repair
shop has one unit ready for future use.

The maximum flow problem


In an instance of the maximum flow problem, we are given a network defined
by the set V of nodes and the set A of arcs. Each of the arcs (i , j ) ∈ A has
a capacity ci j denoting the maximum amount of flow that can be sent from
i to j along that arc. We are also given a source node s and a destination
node t in the network. Our objective is find the maximum amount of flow
that can be routed along the network from a given source node to a given
destination node so that none of the arc capacities are violated. A solution
to the maximum flow problem specifies the maximum amount of flow that
can be sent from the source node to the destination node without violating
any of the arc constraints, and the flows along each of the arcs in the network
when that amount of flow is routed along the network. Notice that the cost of
sending flows is not pertinent in a maximum flow problem.
We can model this problem as a linear program. There are two ways of
doing this.
In the first formulation, we augment the network with an arc from the des-
tination node t to the source node s. This arc has infinite capacity and is
called a back arc. Our objective is to set up a circulation in the augmented net-
What is a back
work that maximizes the flow along the back arc. To this end, we define non-
arc?
negative decision variables representing flows on all arcs in the augmented
network including the back arc, and define the augmented network in terms
of capacity constrants and node balance constraints. We then set up an ob-
jective to objective is to maximize the flow along the back arc. The linear pro-
3.4. COMMON NETWORK FLOW PROBLEMS 129

gramming formulation is as shown in Figure 3.30.

Decision Variables

x i j : Flow along arc (i , j ) for all arcs in the augmented network including
the back arc (t,s).

Model (Objective function and constraints)

Maximize
Flow along the back arc z =x t s
Subject to
xi j ≤ u i j (Capacity constraint for arc (i , j ))
There is a capacity constraint corresponding to each arc
in the network

X
n X
n
xi j − x j k = 0 (Node balance constraint for node j )
i =1 k=1
There is a node balance constraint corresponding to each
node in the network

xi j ≥ 0 (Non-negativity)
There is a non-negativity constraint corresponding to each
arc in the network

Figure 3.30: First linear programming formulation of the maximum flow prob-
lem

In a closely related formulation, we do not augment the network, but rep-


resent the amount of flow into the source node s and out of the destination
node t as a decision variable, say x. This is in addition to the non-negative
decision variables that we define to represent the amounts of flow along the
arcs in the network. The formulation then maximizes the value of x, given
the capacity constraints and the node balance constraints that define the net-
work. The linear programming formulation of this problem looks exactly like
the formulation in Figure 3.30 with x t s replaced by x.
The two formulations are closely related. In the first formulation the back
arc has infinite capacity, and therefore can handle any flow that the rest of the
network allows. Hence, if we maximize the flow along the back arc, this arc will
send in the maximum allowable flow into the source node, and take it away
130 CHAPTER 3. NETWORKS

at the destination node. But this is precisely what we achieve in the second
formulation by adding the decision variable x for inflow into the source node
(and outflow from the destination node), and maximizing its value. The first
formulation is more widely used in practice.
We will now illustrate the formulations using the following example.

Example 3.10: Consider the network shown in Figure 3.19 on page 116. Recall
that in this network the costs ci j and capacities s i j for each node (i , j ) are
shown as the pair (ci j , s i j ) next to the arc. Let us suppose that we want to find
out how much flow we can send from node A to node E along this network.
In the first formulation, we add a back arc from the destination node E to
the source node A. This augmented network is shown in Figure 3.31. We then

infinite

10
A C
20

15 5 9 E

17 18
B D

Figure 3.31: Network in Figure 3.19 with a back arc from E to A

define a non-negative decision variable xi j for each arc (i , j ) in the network


in Figure 3.31 including the back arc. The objective in this formulation is to
maximize flow along the back arc, i.e., to

Maximize xE A

The usual capacity constraints and node balance constraints define the net-
work in Figure 3.31. The capacity on the back arc is infinite, hence we do
not include any capacity constraint for this arc. The complete formulation is
shown in Figure3.33 on page 132.
For the second formulation we define a non-negative decision variable xi j
for each arc (i , j ) in the network. Further we define a non-negative decision
variable x denoting the external flow into the source node A and the exter-
nal flow out of the destination node E. Our objective in this formulation is to
maximize the external flow, i.e., to

Maximize x.
3.4. COMMON NETWORK FLOW PROBLEMS 131

The capacity constraints in the formulation ensure that the flow along any
arc does not exceed its capacity. For example, the capacity constraint corre-
sponding to arc (A,B) is

x AB ≤ 15.

The node balance constraints ensure that the total flow into each node equals
the total flow out of the node. For the source node A, this constraint thus is

x − x AB − x AC = 0.

For the destination node E, it is

xC E + xDE − x = 0.

For any other node, say node B, it is

x AB − xBC − xBD = 0.

Finally, non-negativity constraints force the decision variables not to take neg-
ative values in an optimal solution. Therefore, the second linear programming
formulation for the problem is the one shown in Figure 3.34 on page 133.
Notice that the two formulations are almost identical, the only difference
being that what appears as xE A in the first formulation appears as x in the
second.
An optimal solution to this problem is that a maximum of 25 units of flow
can be sent along the network from A to E. One possible routing for this flow is
shown in Figure 3.32. The arcs marked with solid lines carry the flows written

25

10
A C
10

15 E

15 15
B D

Figure 3.32: An optimal solution to the maximum flow problem in Exam-


ple 3.10

next to them, and the arcs marked with broken lines do not carry any flow in
132 CHAPTER 3. NETWORKS

Decision Variables

x AB : Flow on arc (A,B);


x AC : Flow on arc (A,C);
x BC : Flow on arc (B,C);
xB D : Flow on arc (B,D);
xC D : Flow on arc (C,D);
xC E : Flow on arc (C,E);
x DE : Flow on arc (D,E); and
xE A : Flow on back arc (E,A).

Model (Objective function and constraints)

Maximize
Flow on the back arc z =x E A
Subject to
x AB ≤ 15 (Capacity constraint on (A,B))
x AC ≤ 10 (Capacity constraint on (A,C))
x BC ≤ 5 (Capacity constraint on (B,C))
xB D ≤ 17 (Capacity constraint on (B,D))
xC D ≤ 9 (Capacity constraint on (C,D))
xC E ≤ 20 (Capacity constraint on (C,E))
x DE ≤ 18 (Capacity constraint on (D,E))

x E A − x AB − x AC = 0 (Node balance at A)
x AB − x BC − x B D = 0 (Node balance at B)
x AC + x BC − xC D − xC E = 0 (Node balance at C)
x B D + xC D − x DE = 0 (Node balance at D)
xC E + x DE − x E A = 0 (Node balance at E)

x AB , x AC , x BC , x B D ,
xC D , xC E , x DE , x E A ≥ 0 (Non-negativity)

Figure 3.33: First linear programming formulation of the maximum flow prob-
lem of Example 3.10
3.4. COMMON NETWORK FLOW PROBLEMS 133

Decision Variables

x AB : Flow on arc (A,B);


x AC : Flow on arc (A,C);
x BC : Flow on arc (B,C);
x B D : Flow on arc (B,D);
xC D : Flow on arc (C,D);
xC E : Flow on arc (C,E);
x DE : Flow on arc (D,E); and
x: External flow into A and out of E.

Model (Objective function and constraints)

Maximize
External flow into A z =x
Subject to
x AB ≤ 15 (Capacity constraint on (A,B))
x AC ≤ 10 (Capacity constraint on (A,C))
x BC ≤ 5 (Capacity constraint on (B,C))
xB D ≤ 17 (Capacity constraint on (B,D))
xC D ≤ 9 (Capacity constraint on (C,D))
xC E ≤ 20 (Capacity constraint on (C,E))
x DE ≤ 18 (Capacity constraint on (D,E))

x − x AB − x AC = 0 (Node balance at A)
x AB − x BC − x B D = 0 (Node balance at B)
x AC + x BC − xC D − xC E = 0 (Node balance at C)
x B D + xC D − x DE = 0 (Node balance at D)
xC E + x DE − x = 0 (Node balance at E)

x AB , x AC , x BC , x B D ,
xC D , xC E , x DE , x ≥ 0 (Non-negativity)

Figure 3.34: Second linear programming formulation of the maximum flow


problem of Example 3.10
134 CHAPTER 3. NETWORKS

this solution. Note that there are other possible ways of routing this flow.

EE The maximum flow along a network depends on the source and sink
nodes specified in the problem. For example, the maximum flow from A to E
along the network in Figure 3.19 is 25 units, while the maximum flow from B
to E along the same network is only 22 units.

A minor complication arises in maximum flow problems if there are more


than one source nodes and destination nodes. We can handle this by defin-
ing a dummy source node and a dummy destination node, connecting the
dummy source node to all the source nodes and all the destination nodes to
the dummy destination node using infinite capacity arcs, and then finding
the maximum flow possible from the dummy source node to the dummy des-
tination node along the augmented network. This is illustrated in the example
below.

Example 3.11: Consider the network shown in Figure 3.19 on page 116 once
more. Let us assume that we can use both nodes A and B as source nodes,
and both C and E as destination nodes. We would like to know the maximum
amount of flow that we can route along the network under these conditions.
Since there are more than one source and destination nodes, we first cre-
ate a dummy source node S and a dummy destination node T for the network.
We then connect S to the source nodes A and B using infinite capacity arcs. We
also connect the destination nodes C and E to T using infinite capacity arcs.
The network in Figure 3.19 augmented in this manner looks like the network
in in Figure 3.35.

T
infinite
10
A C infinite
infinite 20

S 15 5 9 E

infinite 17 18
B D

Figure 3.35: Augmented network used in Example 3.11

The maximum flow problem from S to T can now be solved using either of
the two linear programming formulations. Check that the maximum amount
3.4. COMMON NETWORK FLOW PROBLEMS 135

of flow that can be sent along this network is 32 units. The routing of flows is
shown in Figure 3.36. The arcs marked with solid lines carry the flows written

15

10
10 A C

17
5 E

22 17 17
B D

Figure 3.36: An optimal solution to the maximum flow problem in Exam-


ple 3.11

next to them, and the arcs marked with broken lines do not carry any flow in
this solution.

The shortest path problem


In an instance of the shortest path problem, we are given a network defined by
the set V of nodes and the set A of arcs. Each of the arcs (i , j ) ∈ A has a length
l i j . We are also given a source node s and a destination node t in the network.
Our objective is find the path of minimum length along the network from the
source node to the destination node. A solution to the shortest path problem
specifies this path. Notice that the capacities of the arcs are not meaningful in
this problem.
At first glance, this problem is one of picking out a subset of arcs from the
network such that the arcs picked form a path from the source node to the
destination node. If we want to formulate the problem in this way, then we
have to use binary variables for each arc in the network to model the decision
of picking or leaving that arc. This would imply that even for reasonably sized
networks, we would end up with an uncomfortably large number of binary
variables. Models with large numbers of binary variables can be very difficult
to solve in some situations, and hence we would prefer an alternate approach
that does not require the use of binary variables.
We therefore re-interpret the arc lengths as arc costs, and ignoring any arc
capacities mentioned in the network, attempt to send one unit of flow from
the source node to the destination node along the network at minimum cost.
136 CHAPTER 3. NETWORKS

It is easy to see that the flow would be along a minimum cost path, which
corresponds to the shortest path in the original problem. The formulation of
the problem when interpreted as a minimum cost flow problem is shown in
Figure 3.37.

Decision Variables

x i j : Flow along arc (i , j ) for all arcs in the network.

Model (Objective function and constraints)

Minimize
X
m X
n
Flow cost (i.e., path length) z = l i j xi j
i =1 j =1

Subject to
Xn X
n
xi s − x sk = −1 (Node balance constraint for source node s)
i =1 k=1
X n Xn
xi t − x t k = 1 (Node balance constraint for destination
i =1 k=1
node t )
X
n X
n
xi j − x j k = 0 (Node balance constraint for node j ∉ {s, t })
i =1 k=1
There is a node balance constraint corresponding to each
node in the network

xi j ≥ 0 (Non-negativity)
There is a non-negativity constraint corresponding to each
arc in the network

Figure 3.37: Linear programming formulation of a shortest path problem

We now illustrate the formulation process using the example below.

Example 3.12: Consider the layout in Figure 3.4 on page 98. Let us find the
shortest path from point A in this layout to point H. The network representa-
tion of this layout is given in Figure 3.6 on page 99. We will develop the linear
programming formulation described earlier in this section. Let us interpret
the lengths of the different road segments in Figure 3.4 as costs of the cor-
responding arcs in the network in Figure 3.6, and try to find the route that a
3.4. COMMON NETWORK FLOW PROBLEMS 137

unit flow from A to H will take in the network if we aim to minimize the cost
of sending it along the network. We ignore the capacities of the arcs in this
problem.
We define the following 12 non-negative decision variables in our model:

x AB : Flow on arc (A,B);


xBC : Flow on arc (B,C);
..
.
x J H : Flow on arc (J,H).

Our aim is to minimize the cost of transmitting the flow, hence we express
our objective as

Minimize 300x AB + 1100xBC + 500xBF + 1900xC H + 800xDC + 500xDG +


1700xDH + 500xE D + 800xE J + 300xF E + 1100xF J + 200x J H .

Since we ignore arc capacities in our formulation, the network is described by


node balance constraints only.
For the source node A, the node balance constraint is

−x AB = −1,

while for the destination node H it is

xC H + xDH + x J H = 1.

For other nodes, for example node F, the node balance constraint is

xBF − xF E − xF J = 0.

Finally, we impose non-negativity constraints on all the 12 decision variables.


The complete shortest path formulation for this example is shown in Fig-
ure 3.38.
Solving this model, we find that the objective function value of the optimal
solution is 2100, which implies that the length of the shortest path from A to
H in the layout in Figure 3.4 is 2.1 kilometers. x AB , xBF , xF E , xE J , and x J H each
assume a value of 1, and all other decision variables assume zero values. This
implies that the shortest route from A to H is the path ABFEJH.

While solving shortest path problems, it is possible to have solutions where


Handling
some of the decision variables assume fractional values. For example, another
optimal
optimal solution to the problem in Example 3.12 is: x AB = xBF = x J H = 1,
solutions with
xF E = xE J = 0.6, and xF J = 0.4. Such solutions signal the presence of multiple
fractional values.
138 CHAPTER 3. NETWORKS

Decision Variables

x AB : Flow on arc (A,B);


x BC : Flow on arc (B,C);
..
.
x J H : Flow on arc (J,H).

Model (Objective function and constraints)

Minimize
Total cost z =300x AB + 1100x BC + 500x B F + 1900xC H +
800x DC + 500x DG + 1700x D H + 500x ED +
800x E J + 300x F E + 1100x F J + 200x J H
Subject to
− x AB = −1 (Node balance at A)
x AB − x BC − x B F = 0 (Node balance at B)
x BC + x DC − xC H = 0 (Node balance at C)
x ED − x DC − x DG − x D H = 0 (Node balance at D)
x F E − x ED − x E J = 0 (Node balance at E)
xB F − xF E − xF J = 0 (Node balance at F)
x DG = 0 (Node balance at G)
xC H + x D H + x J H = 1 (Node balance at H)
xE J + xF J − x J H = 0 (Node balance at J)

x AB , x BC , x B F , xC H ,
x DC , x DG , x D H , x ED ,
xE J , xF E , xF J , x J H ≥ 0 (Non-negativity)

Figure 3.38: Linear programming formulation of the shortest path problem


for Example 3.12

shortest paths in the network. See for example, that along the path ABFEJH
suggested by the optimal solution obtained in Example 3.12, one can take the
route up to point F, and then instead of following FEJ, one could use the arc
(F,J) to reach J. Both FEJ and FJ are 1100 meters long, so that both the paths
ABFEJH and ABFJH are optimal. Now interpreting the lengths as costs, the
linear program is free to route the unit flow through the two paths at any
3.5. REPRESENTING NETWORKS IN MICROSOFT® EXCEL SOLVER 139

ratio between 0 and 1 that it pleases, without sacrificing optimality. In the


optimal solution output in Example 3.12, the program chose to send all the
flow through ABFEJH, while in the solution mentioned in this paragraph, it
chose to send 60% of the flow through ABFEJH and 40% through ABFJH. If a
linear programming solver returns an optimal solution in which some of the
decision variables have fractional values, then a shortest path is constructed
by choosing any feasible path from the source node to the destination node
containing only those arcs the decision variables corresponding to which had
non-zero values in the optimal solution. We leave it to the reader to see why
such paths would always exist and are optimal.

EE Although the existence of optimal solutions for shortest path problems


in which some decision variables have fractional values is an indicator of the
presence of multiple shortest paths, the absence of such decision variables does
not indicate that the shortest path in the network is unique. For example, the
optimal solution output in Example 3.12 did not have a decision variable with
fractional flow; however, the path that it suggested was not a unique shortest
path.

3.5 Representing Networks in Microsoft® Excel Solver


All the formulations described in this chapter can be input into Microsoft®
Excel and solved using Solver as was shown in Chapter 1. However, the spe-
cial structure of network problems allow us to represent these problem in a
more compact way. In this section, we will look at two such representations
of networks in Microsoft® Excel; the adjacency matrix representation and the
node arc incidence matrix representation.

Adjacency matrix representation of network problems


In an adjacency matrix representation, when we want to store a network de-
fined on n nodes, we define a n × n square matrix COST for storing arc costs,
and a n×n square matrix CAP for storing arc capacities. The element in the i th
row and j th column in COST stores the cost of the arc (i , j ) in the network if it
exists, and an appropriately high value otherwise. The element in the i th row
and j th column in CAP stores the capacity of the arc (i , j ) in the network if it
exists, and zero otherwise. For example, the adjacency matrix representation
of the network in Figure 3.19 is shown in Figure 3.39.
While implementing a network formulation in the adjacency matrix form,
the decision variables representing flows along the various arcs in the network
140 CHAPTER 3. NETWORKS

Figure 3.39: Adjacency matrix representation of the network in Figure 3.19

are also coded in a matrix form. We define a n × n square matrix called FLOW.
This matrix is shown in Figure 3.40. The element in the i th row and j th col-

Figure 3.40: Model in the adjacency matrix representation of the network in


Figure 3.19

umn of this matrix represents the flow on the arc (i , j ) in the network. Cells
G17 through G21 and B22 through F22 contain calculated values, whose pur-
3.5. REPRESENTING NETWORKS IN MICROSOFT® EXCEL SOLVER 141

pose will be explained later. This representation is quite commonly used in


network flow problems because of the following reasons.

1. It is easy to find the total inflow and outflow at each node. The total in-
flow into a node is done by summing up the values in the columns of
the FLOW matrix. For example, in Figure 3.40, cells G17 through G21
store the outflows from nodes A through E into the network, and cells
B22 through F22 store the inflows into nodes A through E from the net-
work. Once inflows and outflows are thus obtained, it is easy to write
down the node balance constraints at each node.
2. The relative positions of the various attributes of each arc are the same
in all three matrices. Hence computing objective functions and input-
ing capacity constraints become very easy. In case of cost minimization
problems on the network in Figure 3.19, the objective function is writ-
ten as
=SUMPRODUCT($B$2:$F$6, $B$17:$F$21),
and the capacity constraints are input as
$B$17:$F$21 ≤ $B$9:$F$13.

Node arc incidence matrix representation of network problems


There is a serious drawback of adjacency matrix representations of networks.
Consider the representation of the network in Figure 3.19 as shown in Fig-
ures 3.39 and 3.40. In order to represent the network with seven arcs, we de-
clared 25 decision variables in the representation. This means that the repre-
sentation was inefficient. This inefficiency increases as the network becomes
larger. For example, if we want to represent the network in Figure 3.6, we
would declare 81 decision variables when we need only 12. The node arc in-
cidence matrix representation does not suffer from such inefficiencies, and is
useful when the number of arcs present in the network is a small fraction of
the number of arcs possible among the nodes of the network.
Consider a network with n nodes and m arcs. To construct a node arc
incidence matrix, we first arbitrarily order the arcs from 1 to m. The node arc
incidence matrix NAIM for the network is a n × m matrix. The entry in the i th
row and kth column of the matrix has a value of 1 if the head of the kth arc is
at node i , a value of −1 if the tail of the kth arc is at node i , and a value of zero
otherwise.
In this representation, the arc costs are represented by a vector COST of
size m, where the kth entry denotes the capacity of the kth arc in the network.
Arc capacities are similarly represented by a vector CAP of size m, where the
142 CHAPTER 3. NETWORKS

kth entry denotes the capacity of the kth arc in the network. The node arc
representation of the network in Figure 3.19 is shown in Figure 3.41.

Figure 3.41: Node arc matrix representation of the network in Figure 3.19

The decision variables representing flows along the various arcs in the net-
work are declared as a vector FLOW of size m in this representation. As usual,
the kth entry in this vector denotes the flow along the kth arc. This is shown
in Figure 3.42. The net outflows at nodes A through E in the network in Fig-
ure 3.19 are calculated in cells I2 through I6 using the formula shown in those
cells in Figure 3.42. These are used to input the node balance constraints in
the network. The objective function for a cost minimization objective in the
network in Figure 3.19 is calculated as
=SUMPRODUCT($B$7:$H$7,$B$10:$H$10)
in this representation, and the capacity constraints are represented as
$B$10:$H$10 ≤ $B$8:$H$8.
3.5. REPRESENTING NETWORKS IN MICROSOFT® EXCEL SOLVER 143

Figure 3.42: Model in the node arc matrix representation of the network in
Figure 3.19
144 CHAPTER 3. NETWORKS

3.6 Problems
Problem 3.1: The road network between seven towns numbered 1 through 7
is given in the figure below. The numbers next to each link (representing road
connections) denote the length of the road in kilometers. Assume that it costs
Rs.4 per kilometer in fuel costs to travel on these roads.

3
2 3

10 9
5
B 7 7
4
1 4
A C
6 4
8
5 5 6

a. What is the minimum amount that the driver of a car must pay for fuel to
travel from city 1 to city 7 along this network?
b. Observe that your solution does not make use of the road between cities 2
and 3, even though this is the shortest link in the network. Why?
c. How does your answer in part (a) change if the road between cities 4 and
6 is declared one-way from city 6 to city 4?
d. The authorities have decided that they would put up a toll-booth either at
point A along the link between cities 1 and 4, or at point B along the link
between cities 3 and 6, or at point C along the link between cities 6 and 7.
At which of these three places can they expect to collect the maximum toll
fee per car?

Problem 3.2: GrabAll, a popular supermarket chain has three outlets in a


small town. These outlets are located at points A, H, and E in the network
given below. GrabAll has been interested in the application of the RFID tech-
nology, and wants to transmit all RFID data it generates to its systems depart-
ment, located at point K.
GrabAll approached the local telephone company with plans to lease ca-
pacity on existing cables laid down by the phone company for its data trans-
mission purposes. The manager of the telephone company laid out the map
3.6. PROBLEMS 145

of the city in front of the GrabAll representative. He said that the phone com-
pany had 11 access points in the region, marked A through K in the map above,
and showed the connectivity the phone company provided between them,
depicted by lines in the map. He further showed the manager of GrabAll the
data on the available capacity and cost in $1000 per gigabit of information
transferred per second (Gbps) for each of the connections. For instance, the
connection between A and B had 12 Gbps capacity that GrabAll could lease,
and it would cost GrabAll $4000 per Gbps per month.

J
(15, 4)
(25, 2)

(8, 10) E
(8, 12)
A B (9, 5)
(12, 4)
(5, 2) (12, 8)
(4, 15) (7, 5) D
(10, 3) H (2, 15)
C (7, 3)
(8, 7) I
(10, 2)
G (9, 2)
F (5, 3)
K (3, 1)

a. What is the cheapest way of sending data from the store at E to the systems
department?
b. Assuming that funds were not an issue, at what rate could the store at E
send data to the systems department?
c. Assuming that funds were not an issue, at what rate (in Gbps) could Gra-
bAll send data from all its stores to its systems department using the net-
work? How much would it cost?
d. If GrabAll had allocated $60,000 per month for data collection, what is the
maximum amount of data that it could hope to transmit from all three
outlets through the network?

Problem 3.3: The road map of a region is provided in the map below. The
circles in the map denote cities, while the lines denote highway connections
in the region. Goods can be carried on highways, but there is a stipulation of
the maximum load that can be carried in each highway segment in the region
in 100 tons per hour. For example, the highway segment between G and B can
carry a maximum of 1200 tons of goods per hour.
146 CHAPTER 3. NETWORKS

2
60
60

12 15
G B

7 8 10 10

60 5 20 6 10 60
F A C H

16 7 12 12
15
60 19 13 60
1 E D

a. Assuming that no other traffic is using the highway, compute the maxi-
mum weight of goods that can be transported from point 1 to point 2 using
the highway network.
b. Due to an accident, the route between A and C has been declared one-way
from C to A. Does this declaration affect your answer in part (a)?
c. There is a tollbooth set up in city D. This effectively means that not more
than 2000 tons can pass through city D per hour. How does this affect
your solution in part (a)? (Do not assume the one-way street condition of
part (b).)
d. What happens to the solution in part (a) if only 1500 tons can pass through
city D per hour?

Problem 3.4: The road network in a particular city is given in the figure be-
low. The points A through M denote important centers in the city, the links
denote direct road connections between the centers, and the numbers next
to the links denote the length of the road segment represented by the link in
kilometers.
A milk vending company has four bottling plants in locations A, B, C, and
D. The capacities of the plants are 2000 liters/day, 2500 liters/day, 1500 li-
ters/day, and 3500 liters/day respectively. The company needs to send milk
to outlets located at E, F, G, and H using the road network. The demands at
the four outlets are 1000 liters/day, 4000 liters/day, 2500 liters/day, and 2000
liters/day respectively. The milk is supplied in refrigerated trucks, and the
truckers charge Re.1 per kilogram per kilometer traveled in trucks.
3.6. PROBLEMS 147

B
3.0
2.5
1.0
I
A 3.0 2.0
F 1.0
2.0 2.5 H
1.0
1.5 K
0.7
2.0 G 2.5
4.0 E 1.8 2.2

3.5 1.5
C
J
2.5
2.0
2.5 M
D 2.0
L

a. Find a solution to the distribution problem, i.e., how should trucks move
from the four plants A, B, C, and D, to the four outlets E, F, G, and H, so that
the transportation cost is the minimum.
b. It is known that that the road segment between A and E would be under re-
pair, and hence would not be available for transportation purposes. What
is the cost implication of this unavailability?
c. Since milk is a perishable commodity, the company wants to make sure
that no truck travels a very large distance. How should the company model
this problem so that the maximum distance traveled by a truck is (i) 5 kilo-
meters, (ii) 5.5 kilometers? What are the routes used in a solution to these
problems? (Ignore the situation described in part (b) of the problem.)
d. It has been seen that unpleasant situations arise regarding the unloading
of trucks if trucks from different bottling plants deliver at the same out-
let. The company is willing to pay extra for transportation costs if such
unpleasant situations could be avoided. What would you advise the com-
pany in this regard?

Problem 3.5: ABC Enterprises supply widgets to PQR Incorporated. In a cer-


tain region, ABC has five warehouses, labeled W1 through W5, and PQR has
six demand locations, labeled D1 through D6. The cost of transporting a wid-
get from a warehouse to a demand point (in Rs. per box) is given in the table
below.
148 CHAPTER 3. NETWORKS

D1 D2 D3 D4 D5 D6
W1 19 20 15 14 30 30
W2 27 11 11 15 12 11
W3 16 22 15 17 29 11
W4 24 30 25 15 29 24
W5 27 15 23 20 21 19

The capacities of W1, W2, . . . , W5 are 600, 500, 700, 200, and 400 boxes per
month respectively, while the demand for widgets at the six demand points
D1, D2, . . . , D6 are 350, 250, 200, 250, 350, and 300 boxes per month respec-
tively.

a. What is the monthly transportation cost that ABC incur to supply the wid-
gets?
b. ABC feels that five warehouses are not required to meet PQR’s demand.
They want to reduce the number of warehouses they use to 3, while mak-
ing sure that PQR’s demands are met. What are the cost implications of
this decision?
c. A real-estate agent has approached ABC with a proposal to rent two ware-
houses (called, say, W6 and W7). W6 has a monthly capacity of 400 boxes
and would attract a monthly rent of Rs.2500, while W7 has a monthly ca-
pacity of 300 boxes and would attract a monthly rent of Rs.3500. If ABC
rented both warehouses, then the real estate agent is willing to consider
a 10% discount on the total rent. ABC has figured out the cost of trans-
porting a widget from a W6 and W7 to all demand points (in Rs. per box).
These data is given in the table below.

D1 D2 D3 D4 D5 D6
W6 10 32 25 33 11 32
W7 12 33 33 34 5 29

What decision should ABC take regarding these two warehouses? (Ignore
the discussion in part (b) of the problem.)

Problem 3.6: An agency deals with four currencies: Indian Rupees (INR),
Euros, British Pounds (GBP), and US Dollars (USD). On a particular day, the
exchange rates between these currencies (correct to the third decimal place)
were the following.
3.6. PROBLEMS 149

INR Euro GBP USD


INR 1.000 0.018 0.011 0.022
Euro 55.105 1.000 0.680 1.280
GBP 87.840 1.471 1.000 1.890
USD 46.480 0.781 0.529 1.000

Does there exist an arbitrage opportunity for the agency?

Problem 3.7: The figure below shows a railway network connecting five sta-
tions labeled 1 through 5. The numbers next to the links are the capacities (in

tons/day) of the respective rail links.

2
3
15
8
1 3 4 4 5

4
7
7
3

You have a factory at Station 5 which requires 20 tons of a raw material avail-
able at Station A. You buy the material at Station A, and transport it to Station
5 at your own cost through the railway network.

a. What is the maximum amount of material that you can send from Station
1 to Station 5 per day along this network? Answer this by formulating a
maximum flow problem on this network.
b. It is known that there is a pilferage problem along links 1–2, 2–5, and 3–5.
20% of all material sent through links 1–2 and 3–5 are pilfered, while 30%
of all material sent through link 2–5 are pilfered. Given this problem how
much material can Station 5 possibly receive from Station 1 per day?

Problem 3.8: Jeetu has been assigned the responsibility of choosing the of-
fice tennis team to play a rival organization’s team next Friday. There are six

regular players in Jeetu’s office: Ajay, Bijoy, Chandra, Deepak, Eshwar, and
150 CHAPTER 3. NETWORKS

Fazal. Of these, Jeetu needs to pick two players to play in two singles, and an-
other two players to play a doubles match.After careful consideration, Jeetu
has come up with four skills on which he wants to evaluate the players, fore-
hand play, backhand play, stamina, and team sense. On a scale of 1 to 10 (with
1 as the worst), he rates the six players thus.

Ajay Bijoy Chandra Deepak Eshwar Fazal


Forehand Play 8 7 6 8 4 4
Backhand Play 4 9 4 9 5 7
Stamina 5 8 5 6 6 8
Team Sense 7 7 8 6 5 7

Since he knows the members of the other organization’s team, Jeetu also has
devised an ideal skill level requirement for his team. The minimum skill levels
that he feels would be necessary for the matches are given in the following
table.

Singles 1 Singles 2 Doubles


Forehand Play 5 3 4
Backhand Play 4 5 4
Stamina 6 6 5
Team Sense 1 1 7

a. Formulate Jeetu’s team selection problem as a network flow problem.


b. What is the best team that Jeetu can choose from the six players in his
office?

 Problem 3.9: A company operating in a district provides route planning ser-


vices to five small towns in the district. Each of these towns have between
10 and 14 centers, and use the route planner to compute the quickest route
from one center in the town to another. The route planner has a map of the
towns, with information on the expected travel time between centers in min-
utes. Matrices describing inter-point travel within each of the five towns are
given below.
3.6. PROBLEMS 151

Town A A1 A2 A3 A4 A5 A6 A7 A8 A9 A10 A11 A12 A13


A1 14 12 20 15 15 15 20 12
A2 14 14 15 13 14 7 10 12 18
A3 18 14 14 18 8 5 7 13 10 12 6
A4 10 18 5 5 9 19 7 14 13 16
A5 18 20 10 20 20 8 20 17 18 5
A6 19 19 11 10 11 15 15 19 6
A7 6 12 12 16 12 8 18 9 5 16 5
A8 5 11 19 7 19 5 19 12 15
A9 10 12 18 12 5 7 18 8 8
A10 11 9 17 14 6 8 13 11 6 9 14
A11 16 8 19 12 9 16 18 16
A12 14 13 16 8 10 5 13 13 17 7 7
A13 9 13 20 6 16 7 12 20 18 18 12

Town B B1 B2 B3 B4 B5 B6 B7 B8 B9 B10 B11 B12 B13 B14


B1 14 20 5 13 18
B2 15 12 16 10 17 14 18
B3 18 19 20 14 13 11 20 14
B4 10 6 14 14 5 13 17 5
B5 17 15 9 19 14 15 7 8 9
B6 16 16 11 6 15 10
B7 8 9 19 9 11 20 9 9
B8 11 19 18 17 11
B9 11 20 8 20 7 10 6 15 16
B10 16 10 18 18 5
B11 15 19 20 5 12 8
B12 10 12 6 9 8 19 12 18 8
B13 20 16 17 5 6 6 10
B14 13 12 15 5 20 10

Town C C1 C2 C3 C4 C5 C6 C7 C8 C9 C10 C11 C12


C1 8 18 15 15 20 13 8 13
C2 7 7 20 18 10 10 7 11 14
C3 9 16 8 10 9 14 19 12
C4 11 14 9 10 8 5 12 15 19 17
C5 5 6 8 6 12 7 8 13 15 17 19
C6 7 12 8 10 18 6 11 12 9
C7 9 11 17 6 14 20 9 7 16
C8 5 9 6 19 13 12 7 11
C9 10 15 20 17 5 18 14
C10 11 19 13 16 19 17 11 17 14
C11 7 12 8 16 17 11
C12 14 11 14 18 12 18 7 16 5
152 CHAPTER 3. NETWORKS

Town D D1 D2 D3 D4 D5 D6 D7 D8 D9 D10 D11


D1 13 25 23 11 14 11 14 14 18
D2 15 24 11 18 21 22 14
D3 19 20 24 14 14 18 17
D4 21 17 20 22 15 20 14
D5 18 11 11 22 15 15 11 19
D6 13 10 20 12 15 24 15 20
D7 24 19 24 21 22 12
D8 25 22 21 14 12 16 13 17 25 22
D9 15 11 15 21 14 20 24 18
D10 23 10 11 25 11 12 21 10
D11 20 16 18 16 15 16 15

Town E E1 E2 E3 E4 E5 E6 E7 E8 E9 E10 E11 E12 E13


E1 5 25 18 17 21 5 15 9
E2 9 18 19 15 24 11 20 22
E3 18 14 10 22 18 6 11 5 22 20
E4 11 9 10 7 7 23 20 7 16 17 24 22
E5 5 22 19 14 25 21 11 20 10 24 21
E6 18 18 22 10 20 8 21 6 11
E7 22 5 23 5 10 16 18 16 24 14
E8 10 23 22 14 21 6 15 10
E9 8 19 6 14 11 14 7 25 15 13 11
E10 7 10 24 18 9 13 5 18 14 24
E11 15 21 14 9 25 20 9
E12 15 10 23 22 17 22 7 12 8 15 10
E13 21 10 14 19 6 13 5

The five towns are connected to each other by a highway system. Each
town has two connection points with each of the highways that pass next to
it. The highway system is depicted in Figure 3.43.
The distances between points in different towns along the highway is given
below.

Between Time Between Time


A2 and C3 35 B14 and D4 15
A2 and B7 20 B5 and E7 23
C8 and B13 17

The product manager of the company now wants to extend his product and
integrate the route planning of all five towns within one single software. This
software is to be implemented Microsoft® Excel using Solver as the optimizer.
(Note that Microsoft® Excel Solver can handle up to 200 decision variables
in a linear model.) Using it, a user should be able to input two centers, not
necessarily in the same town, and obtain a quickest route between the two.
3.6. PROBLEMS 153

A2 A3

C3
C
C8

B13 B7
B
B14 B5

D4 E7

D E
D5 E6

Figure 3.43: The highway system


154 CHAPTER 3. NETWORKS

a. What would be your design for the model behind the software? (We are
interested in the mathematical model, and not the interface.)
b. Using your model, find the quickest route between centers A8 and D7.
c. A driver wants to start from C9, pick up a passenger from E3 and reach the
airport located in D7. What is the minimum time in which she can do that?
What route needs to be followed?

Das könnte Ihnen auch gefallen