0% found this document useful (0 votes)
5 views21 pages

Introduction to Linear Programming

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views21 pages

Introduction to Linear Programming

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 21

Chapter 10

Introduction to Linear Programming

Linear programming is a methodology for solving linear optimization prob-


lems, in which one wants to optimize a linear objective function subject to con-
straints on its variables expressed in terms of linear equalities and/or inequal-
ities. Ever since the introduction of the simplex method by George Dantzig
in the late 1940s, linear programming has played a major role in shaping the
modern horizons of the field of optimization and its applications.

10.1 Formulating a Linear Programming Model


Example 10.1 Consider the following problem. Heavenly Pouch, Inc. pro-
duces two types of baby carriers, non-reversible and reversible. Each non-
reversible carrier sells for $23, requires 2 linear yards of a solid color fabric,
and costs $8 to manufacture. Each reversible carrier sells for $35, requires 2
linear yards of a printed fabric as well as 2 linear yards of a solid color fab-
ric, and costs $10 to manufacture. The company has 900 linear yards of solid
color fabrics and 600 linear yards of printed fabrics available for its new car-
rier collection. It can spend up to $4,000 on manufacturing the carriers. The
demand is such that all reversible carriers made are projected to sell, whereas
at most 350 non-reversible carriers can be sold. Heavenly Pouch is interested
in formulating a mathematical model that could be used to maximize its profit
(e.g., the difference of revenues and expenses) resulting from manufacturing
and selling the new carrier collection.

10.1.1 Defining the decision variables


We start formulating a model by defining decision variables , which are the
variables determining the outcome whose values we can control. Since Heav-
enly Pouch, Inc. needs to decide on how many non-reversible and reversible
carriers to manufacture, it is natural to define the decision variables as follows:

x1 = the number of non-reversible carriers to manufacture


x2 = the number of reversible carriers to manufacture.

211
212 Numerical Methods and Optimization: An Introduction

10.1.2 Formulating the objective function


The objective of Heavenly Pouch, Inc. is to maximize its profit, which is
the difference of the revenues and manufacturing costs. Since non-reversible
and reversible carriers sell for $23 and $35, respectively, the total revenue r
resulting from selling all the carriers manufactured is given by r = 23x1 +35x2 .
Similarly, the total cost c of manufacturing all the carriers is given by c =
8x1 +10x2 . Hence, the profit z can be expressed as the following linear function
of the decision variables x1 and x2 :

z = r − c = (23x1 + 35x2 ) − (8x1 + 10x2 ) = 15x1 + 25x2 .

10.1.3 Specifying the constraints


Constraints are used to make sure that our model does not accept combina-
tions of variable values that are physically impossible. For example, Heavenly
Pouch, Inc. cannot manufacture 300 non-reversible and 300 reversible carriers
simultaneously, since this would require 300×$8+300×$10=$5,400 in man-
ufacturing costs, which exceeds the given budget of $4,000. Constraints are
often associated with limited availability of various types of resources (such as
materials, time, space, money) or other considerations that restrict our choice
of decision variable values. From our problem’s statement we know that
• the company has only 900 linear yards of solid color fabrics available,
• at most 600 linear yards of printed fabrics can be used,
• the manufacturing budget is limited to $4,000, and
• at most 350 non-reversible carriers can be sold.
Based on the problem data and the above definition of the decision variables,
these considerations can be expressed using linear inequalities as follows. Since
2 linear yards of the solid fabrics is used for each non-reversible and reversible
carrier, the total amount of the solid fabrics used to manufacture x1 non-
reversible carriers and x2 reversible carriers is 2x1 + 2x2 , and we have 2x1 +
2x2 ≤ 900, or equivalently,
x1 + x2 ≤ 450 (solid color fabric constraint).
Since the printed fabrics are used only for reversible carriers (2 linear
yards/carrier), we have 2x2 ≤ 600, which is the same as
x2 ≤ 300 (printed fabric constraint).
Heavenly Pouch, Inc. spends $8/carrier and $10/carrier to manufacture a non-
reversible and reversible carrier, respectively, so we have 8x1 + 10x2 ≤ 4, 000,
or
4x1 + 5x2 ≤ 2, 000 (budget constraint).
Introduction to Linear Programming 213

Finally, since at most 350 non-reversible carriers can be sold, we have


x1 ≤ 350 (demand constraint).
In addition, we need to specify the nonnegativity constraints, which are not
explicitly stated in the problem description, but result from the definition of
the decision variables. Namely, since the variables x1 and x2 represent the
quantities of physical objects, their values must be nonnegative by definition:
x1 , x2 ≥ 0 (nonnegativity constraints).
Even though in some cases the nonnegativity constraints may not have any
impact on the optimal solution of the problem, they play an important role
in designing algorithms for linear programming, and thus must always be
mentioned whenever they hold.

10.1.4 The complete linear programming formulation


In summary, we obtain the following linear program (LP) that models the
considered problem:
maximize 15x1 + 25x2 (profit)
subject to (s.t.) x1 + x2 ≤ 450 (solid color fabric constraint)
x2 ≤ 300 (printed fabric constraint)
4x1 + 5x2 ≤ 2, 000 (budget constraint)
x1 ≤ 350 (demand constraint)
x 1 , x2 ≥ 0 (nonnegativity constraints).

10.2 Examples of LP Models


10.2.1 A diet problem
Example 10.2 Yiming aims to improve his diet. Based on a nutrition spe-
cialist recommendation, he wants his daily intake to contain at least 60 g of
protein, 800 mg of calcium, 75 mg of vitamin C, and 2,000 calories. He would
like his menu for the day to consist of five food types: almond butter, brown
rice, orange juice, salmon, and wheat bread. The serving size, cost per serving,
and nutrition information for each food type is provided in the table below.
Food type Cost Protein Calcium Vitamin C Calories
($) (g) (mg) (mg)
Almond butter (100 g) 2.90 15 270 1 600
Brown rice (200 g) 3.20 5 20 0 215
Orange juice (250 g) 0.50 2 25 106 110
Salmon (150 g) 4.50 39 23 0 280
Wheat bread (25 g) 0.30 3 35 0 66
Required ingestion – 60 800 75 2,000
214 Numerical Methods and Optimization: An Introduction

Formulate an LP that would allow Yiming to design the least expensive diet
that satisfies the above requirements.

Yiming has to decide how much of each of the food types should be included
in his diet. Therefore, it is natural to define a decision variable for the amount
of each food type consumed daily:

x1 = servings of almond butter eaten daily


x2 = servings of brown rice eaten daily
x3 = servings of orange juice drunk daily
x4 = servings of salmon eaten daily
x5 = servings of wheat bread eaten daily.

His objective is to minimize the cost, which can be easily written as a linear
function of decision variables as follows:

z = 2.9x1 + 3.2x2 + 0.5x3 + 4.5x4 + 0.3x5 .

The constraints express the minimum daily requirements for protein:

15x1 + 5x2 + 2x3 + 39x4 + 3x5 ≥ 60;

calcium:
270x1 + 20x2 + 25x3 + 23x4 + 35x5 ≥ 800;
vitamin C:
x1 + 106x3 ≥ 75;
and calories:

600x1 + 215x2 + 110x3 + 280x4 + 66x5 ≥ 2, 000.

In addition, all of the decision variables must be nonnegative. We obtain the


following LP:

minimize 2.9x1 + 3.2x2 + 0.5x3 + 4.5x4 + 0.3x5


subject to 15x1 + 5x2 + 2x3 + 39x4 + 3x5 ≥ 60
270x1 + 20x2 + 25x3 + 23x4 + 35x5 ≥ 800
x1 + 106x3 ≥ 75
600x1 + 215x2 + 110x3 + 280x4 + 66x5 ≥ 2, 000
x1 , x2 , x3 , x4 , x5 ≥ 0.

10.2.2 A resource allocation problem


Example 10.3 Jeff is considering 6 projects for potential investment for the
upcoming year. The required investment and end-of-year payout amounts are
described in the following table.
Introduction to Linear Programming 215

Project
1 2 3 4 5 6
Investment ($) 10,000 25,000 35,000 45,000 50,000 60,000
Payout ($) 12,000 30,000 41,000 55,000 65,000 77,000

Partial investment (i.e., financing only a fraction of the project instead of the
whole project) is allowed for each project, with the payout proportional to the
investment amount. For example, if Jeff decides to invest $5,000 in project 2,
the corresponding payout will be $30,000×($5,000/$25,000)=$6,000. Jeff has
$100,000 available for investment. Formulate an LP to maximize the end-of-
year payout resulting from the investment.

Let
xi = fraction of project i financed, i = 1, . . . , 6.
Then we have the following LP formulation:

maximize 1000(12x1 + 30x2 + 41x3 + 55x4 + 65x5 + 77x6 )


subject to 10x1 + 25x2 + 35x3 + 45x4 + 50x5 + 60x6 ≤ 100
x1 ≤ 1
x2 ≤ 1
x3 ≤ 1
x4 ≤ 1
x5 ≤ 1
x6 ≤ 1
x 1 , x 2 , x 3 , x 4 , x 5 , x6 ≥ 0.

10.2.3 A scheduling problem


Example 10.4 St. Tatiana Hospital uses a 12-hour shift schedule for its
nurses, with each nurse working either day shifts (7:00 am–7:00 pm) or night
shifts (7:00 pm–7:00 am). Each nurse works 3 consecutive day shifts or 3 con-
secutive night shifts and then has 4 days off. The hospital is aiming to design
a schedule for day-shift nurses that minimizes the total number of nurses em-
ployed. The minimum number of nurses required for each day shift during a
week is given in the following table:

Day of week/shift Nurses required


Monday (Mo) 16
Tuesday (Tu) 12
Wednesday (We) 18
Thursday (Th) 13
Friday (Fr) 15
Saturday (Sa) 9
Sunday (Su) 7
216 Numerical Methods and Optimization: An Introduction

In addition, it is required that at least half of the day-shift nurses have week-
ends (Saturday and Sunday) off. Formulate this problem as an LP.

Note that a nurse’s schedule can be defined by the first day of the three-day
working cycle. Thus, we can define the decision variables as follows:

x1 = the number of nurses working Mo-Tu-We schedule


x2 = the number of nurses working Tu-We-Th schedule
x3 = the number of nurses working We-Th-Fr schedule
x4 = the number of nurses working Th-Fr-Sa schedule
x5 = the number of nurses working Fr-Sa-Su schedule
x6 = the number of nurses working Sa-Su-Mo schedule
x7 = the number of nurses working Su-Mo-Tu schedule.

Then our objective is to minimize

z = x 1 + x2 + x3 + x4 + x5 + x6 + x7 .

To ensure the required number of nurses for Monday, the total number of
nurses that have Monday on their working schedule should be at least 16:

x1 + x6 + x7 ≥ 16.

The demand constraints for the remaining 6 days of the week are formulated
in the same fashion:

x1 + x2 + x7 ≥ 12 (Tuesday)
x1 + x2 + x3 ≥ 18 (Wednesday)
x2 + x3 + x4 ≥ 13 (Thursday)
x3 + x4 + x5 ≥ 15 (Friday)
x4 + x5 + x6 ≥9 (Saturday)
x5 + x6 + x7 ≥7 (Sunday).

Note that only the first three schedules do not involve working on week-
ends. Therefore, the requirement that at least half of the nurses have weekends
off can be expressed as

x1 + x2 + x3 1
≥ .
x1 + x2 + x3 + x4 + x5 + x6 + x7 2

Multiplying both sides of this inequality by 2(x1 + x2 + x3 + x4 + x5 + x6 + x7 ),


we obtain the following equivalent linear inequality:

x1 + x2 + x3 − x4 − x5 − x6 − x7 ≥ 0.
Introduction to Linear Programming 217

In summary, we obtain the following LP:

minimize x1 + x2 + x3 + x4 + x5 + x6 + x7
subject to x1 + x6 + x7 ≥ 16
x1 + x2 + x7 ≥ 12
x1 + x2 + x3 ≥ 18
x2 + x3 + x4 ≥ 13
x3 + x4 + x5 ≥ 15
x4 + x5 + x6 ≥ 9
x5 + x6 + x7 ≥ 7
x1 + x2 + x3 − x4 − x5 − x6 − x7 ≥ 0
x 1 , x2 , x3 , x4 , x5 , x6 , x7 ≥ 0.

This problem has multiple optimal solutions with z ∗ = 31. One of them is
given by

x∗1 = 11, x∗2 = 0, x∗3 = 10, x∗4 = 3, x∗5 = 2, x∗6 = 4, x∗7 = 1.

According to this schedule, only 10 out of 31 nurses will be scheduled to work


on weekends.

10.2.4 A mixing problem


Example 10.5 Painter Joe needs to complete a job that requires 50 gallons
of brown paint and 50 gallons of gray paint. The required shades of brown and
gray can be obtained my mixing the primary colors (red, yellow, and blue) in
the proportions given in the following table.

Color Red Yellow Blue


Brown 40% 30% 30%
Gray 30% 30% 40%

The same shades can be obtained by mixing secondary colors (orange, green,
and purple), each of which is based on mixing two out of three primary col-
ors in equal proportions (red/yellow for orange, yellow/blue for green, and
red/blue for purple). Joe currently has 20 gallons each of red, yellow, and blue
paint, and 10 gallons each of orange, green, and purple paint. If needed, he
can purchase any of the primary color paints for $20 per gallon, however he
would like to save by utilizing the existing paint supplies as much as possible.
Formulate an LP helping Joe to minimize his costs.

We will use index i ∈ {1, . . . , 6} for red, yellow, blue, orange, green, and
purple colors, respectively, and index j ∈ {1, 2} for brown and gray colors,
respectively. Then our decision variables can be defined as

xij = gallons of paint of color i used to obtain color j paint


218 Numerical Methods and Optimization: An Introduction

for i ∈ {1, . . . , 6}, j ∈ {1, 2},

xi = gallons of paint i purchased, i = 1, 2, 3.

Then our objective is to minimize

z = 20x1 + 20x2 + 20x3 .

Next we specify the constraints. The total amount of brown and gray paint
made must be at least 50 gallons each:

x11 + x21 + x31 + x41 + x51 + x61 ≥ 50,


x12 + x22 + x32 + x42 + x52 + x62 ≥ 50.

The amount of each paint used for mixing must not exceed its availability:

x11 + x12 ≤ 20 + x1
x21 + x22 ≤ 20 + x2
x31 + x32 ≤ 20 + x3
x41 + x42 ≤ 10
x51 + x52 ≤ 10
x61 + x62 ≤ 10.

To express the constraints ensuring that the mixing yields the right shade of
brown, note that only three out of six colors used for mixing contain red, and
the total amount of red paint (including that coming from orange and purple
paints) used in the brown mix is

x11 + 0.5x41 + 0.5x61 .

Hence, a constraint for the proportion of red color in the brown mix can be
written as follows:
x11 + 0.5x41 + 0.5x61
= 0.4.
x11 + x21 + x31 + x41 + x51 + x61
This equation can be easily expressed as a linear equality constraint:

0.6x11 − 0.4x21 − 0.4x31 + 0.1x41 − 0.4x51 + 0.1x61 = 0.

Similarly, the proportion of yellow and blue colors in the brown mix is given
by:
x21 + 0.5x41 + 0.5x51
= 0.3
x11 + x21 + x31 + x41 + x51 + x61
and
x31 + 0.5x51 + 0.5x61
= 0.3,
x11 + x21 + x31 + x41 + x51 + x61
which can be equivalently written as

−0.3x11 + 0.7x21 − 0.3x31 + 0.2x41 + 0.2x51 − 0.3x61 = 0


Introduction to Linear Programming 219

and
−0.3x11 − 0.3x21 + 0.7x31 − 0.3x41 + 0.2x51 + 0.2x61 = 0,

respectively. The constraints describing the proportion of each of the primary


colors in the gray paint mix can be derived analogously:

0.7x12 − 0.3x22 − 0.3x32 + 0.2x42 − 0.3x52 + 0.2x62 = 0 (red)


−0.3x12 + 0.7x22 − 0.3x32 + 0.2x42 + 0.2x52 − 0.3x62 = 0 (yellow)
−0.4x12 − 0.4x22 + 0.6x32 − 0.4x42 + 0.1x52 + 0.1x62 = 0 (blue).

Finally, note that the fact that 20(x1 + x2 + x3 ) is minimized will force each
of the variables x1 , x2 , and x3 to be 0 unless additional red, yellow, or blue
paint is required. The resulting formulation is given by

minimize 20x1 + 20x2 + 20x3


subject to 0.6x11 − 0.4x21 − 0.4x31 + 0.1x41 − 0.4x51 + 0.1x61 = 0
−0.3x11 + 0.7x21 − 0.3x31 + 0.2x41 + 0.2x51 − 0.3x61 = 0
−0.3x11 − 0.3x21 + 0.7x31 − 0.3x41 + 0.2x51 + 0.2x61 = 0
0.7x12 − 0.3x22 − 0.3x32 + 0.2x42 − 0.3x52 + 0.2x62 = 0
−0.3x12 + 0.7x22 − 0.3x32 + 0.2x42 + 0.2x52 − 0.3x62 = 0
−0.4x12 − 0.4x22 + 0.6x32 − 0.4x42 + 0.1x52 + 0.1x62 = 0
x11 + x21 + x31 + x41 + x51 + x61 ≥ 50
x12 + x22 + x32 + x42 + x52 + x62 ≥ 50
x11 + x12 − x1 ≤ 20
x21 + x22 − x2 ≤ 20
x31 + x32 − x3 ≤ 20
x41 + x42 ≤ 10
x51 + x52 ≤ 10
x61 + x62 ≤ 10
x11 , x12 , x21 , x22 , x31 , x32 , x41 , x42 , x51 , x52 , x61 , x62 , x1 , x2 , x3 ≥ 0.

10.2.5 A transportation problem


Example 10.6 A wholesale company specializing in one product has m ware-
houses Wi , i = 1, . . . , m serving n retail locations Rj , j = 1, . . . , n. Transport-
ing one unit of the product from Wi to Rj costs cij dollars, i = 1, . . . , m, j =
1, . . . , n. The company has si units of product available to ship from Wi , i =
1, . . . , m. To satisfy the demand, at least dj units of the product must be deliv-
ered to Rj . Formulate an LP to decide how many units of the product should
be shipped from each warehouse to each retail location so that the company’s
overall transportation costs are minimized.

The decision variables are

xij = the product quantity shipped from Wi to Rj , i = 1, . . . , m; j = 1, . . . , n.


220 Numerical Methods and Optimization: An Introduction

All variables must be nonnegative. The objective is to minimize the total cost
of transportation:
 m n
z= cij xij .
i=1 j=1

We need to make sure that the number of units shipped out of Wi does not
exceed si :
n
xij ≤ si , i = 1, . . . , m.
j=1

Also, to satisfy the demand at Rj we must have


m
xij ≥ dj , j = 1, . . . , n.
i=1

In summary, we obtain the following LP:



m 
n
minimize cij xij
i=1 j=1

n
subject to xij ≤ si , i = 1, . . . , m
j=1 (10.1)

m
xij ≥ dj , j = 1, . . . , n
i=1
xij ≥ 0, i = 1, . . . , m, j = 1, . . . , n.

10.2.6 A production planning problem


Example 10.7 MIA Corporation manufactures n products P1 , . . . , Pn using
m different types of resources (such as raw material, labor, etc.), R1 , . . . , Rm .
There are bi units of resource i available per week. Manufacturing one unit
of product Pj requires aij units of resource Ri . It is known that each unit of
product Pj will sell for cj dollars. MIA Corporation needs to decide how many
units of each product to manufacture in order to maximize its weekly profit.

We will use index i for the ith resource, i = 1, . . . , m; and index j for the
th
j product, j = 1, . . . , n. We define the decision variables as

xj = the number of units of product j to manufacture, j = 1, . . . , n.

Then the objective function is to maximize

c 1 x1 + . . . + c n xn .

The resource constraints, which make sure that the corporation does not ex-
ceed the availability of each resource, are given by

ai1 x1 + . . . + ain xn ≤ bi , i = 1, 2, . . . , m.
Introduction to Linear Programming 221

Including the nonnegativity constraints, we obtain the following formulation:

maximize c1 x1 + ... + c n xn
subject to a11 x1 + ... + a1n xn ≤ b1
.. .. .. ..
. . . .
am1 x1 + ... + amn xn ≤ bm
x1 , . . . , x n ≥ 0,

or, equivalently,

n
maximize c j xj
j=1

n
subject to aij xj ≤ bi , i = 1, 2, . . . , m
j=1
xj ≥ 0, j = 1, 2, . . . , n.

Denoting by
⎡ ⎤ ⎡ ⎤ ⎡ ⎤
a11 ··· a1n b1 c1
⎢ .. .. ⎥ , ⎢ ⎥ ⎢ ⎥
A=⎣ . ..
. . ⎦ b = ⎣ ... ⎦ , c = ⎣ ... ⎦ ,
am1 ··· amn bn cn

we represent the LP in a matrix form:

maximize cT x
subject to Ax ≤ b
x ≥ 0.

10.3 Practical Implications of Using LP Models


Just like any other methodology used to solve practical problems, linear
programming has its strengths and limitations. Its main advantages are in the
relative simplicity of LP models and scalability of state-of-the-art algorithms,
which are implemented in software packages capable of solving LP models with
millions of variables and constraints. These features are sufficiently appealing
to make LP by far the most frequently solved type of optimization problems
in practice. However, once LP is selected as the modeling tool for a particular
practical problem, it is important to recognize the assumptions that such
a choice implicitly entails, as well as practical implications of making such
assumptions.
Of course, the first major assumption we make by representing a problem
as an LP is the linearity and certainty of dependencies involved in formulating
the model’s objective function and constraints. On the one hand, this is a
222 Numerical Methods and Optimization: An Introduction

rather strong assumption, especially given that most of the real-life processes
we attempt to model are nonlinear in nature and are typically influenced by
some uncertainties. On the other hand, any mathematical model is only an
approximation of reality, and in many situations a linear approximation is
sufficiently reasonable to serve the purpose. Recall that a linear function f (x)
in IRn is given by
f (x) = c1 x1 + . . . + cn xn ,
where c1 , . . . , cn are constant real coefficients. This implies the properties of
additivity,
f (x + y) = f (x) + f (y) for any x, y ∈ IRn ,
and proportionality,

f (αx) = αf (x) for any x ∈ IRn , α ∈ IR.

In particular, contributions of each variable to the objective function value is


independent of contributions of the other variables, and if we change the value
of one of the variables, say xj , by Δ, while keeping the remaining variables
unchanged, then the function value will change by cj Δ, i.e., the change in the
function value is proportional to the change in a variable value.
In addition to additivity, proportionality, and certainty, another important
assumption that is made in LP models is divisibility, meaning that fractional
values of decision variables are acceptable. In reality, it may be essential that
some of the decision variables are integer, however, introducing integrality
constraints would turn the LP into a (mixed) integer linear programming
problem, which is much harder to solve in general.

10.4 Solving Two-Variable LPs Graphically


If a linear program involves only two variables, it can be solved geomet-
rically, by plotting the lines representing the constraints and level sets of the
objective function. We will illustrate this approach by graphically solving the
linear program formulated in Section 10.1:

maximize 15x1 + 25x2 (profit)


subject to x1 + x2 ≤ 450 (solid color fabric constraint)
x2 ≤ 300 (printed fabric constraint)
4x1 + 5x2 ≤ 2, 000 (budget constraint)
x1 ≤ 350 (demand constraint)
x 1 , x2 ≥ 0 (nonnegativity constraints).

First, consider the line representing the points where the solid color fabric
constraint is satisfied with equality, x1 + x2 = 450. This line passes through
Introduction to Linear Programming 223
x2 x2
(a) solid fabric constraint (b) printed fabric constraint
450
(x1 + x2 ≤ 450) (x2 ≤ 300)

300

450
x1 x1
x2
(c) budget constraint (d) demand constraint (x1 ≤ 350)
x2
(4x1 + 5x2 ≤ 2, 000)
400

500 350
x1 x1
(e) nonnegativity constraints (f) the feasible region
x2 x2

x1 x1

FIGURE 10.1: Drawing the feasible region in the Heavenly Pouch, Inc.
example.
224 Numerical Methods and Optimization: An Introduction
x2
450

' solid fabric constraint


400

printed fabric constraint



300

' demand constraint

budget constraint
'

0 350 450 500 x1

FIGURE 10.2: Feasible region of the Heavenly Pouch LP.

points (0,450) and (450,0) and splits the plane into two halves, where only
the points in the lower half-plane satisfy the solid color fabric constraint (Fig-
ure 10.1(a)). Similarly, we can plot the half-planes representing the sets of
points satisfying the printed fabric constraint, the budget constraint, and the
demand constraint, respectively (see Figure 10.1). Intersection of all these
half-planes with the nonnegative quadrant of the plane will give us the fea-
sible region of the problem (Figure 10.1(f)), which represents the set of all
points that satisfy all the constraints. Figure 10.2 shows the feasible region of
the Heavenly Pouch LP, with lines corresponding to each constraint marked
accordingly.
To solve the LP graphically, we will use level sets of the objective function,
which in case of a maximization LP are sometimes referred to as iso-profit
lines. Given a target objective function value (profit) z̄, the iso-profit line is
the set of points on the plane where z = z̄, i.e., it is just the level set of
the objective function z at the level z̄. The iso-profit lines corresponding to
different profit values z̄ may or may not overlap with the feasible region. We
typically start by plotting the iso-profit line for a reasonably low value of z̄ to
Introduction to Linear Programming 225
x2
450

' solid fabric constraint


400

printed fabric constraint



300
x∗
z ∗ = 9, 375 ' demand constraint
240 '

z = 6, 000
'
120 budget constraint
'

z = 3, 000
'

0 125 200 350 400 450 500 x1

FIGURE 10.3: Solving the Heavenly Pouch LP graphically.

ensure that it contains feasible points and hence can be conveniently shown
on the same plot as the feasible region. For the Heavenly Pouch LP, it appears
reasonable to first plot the iso-profit line for z = 15x1 + 25x2 = 3, 000, which
passes through the points (200, 0) and (0, 120) (see Figure 10.3). We see that
this profit level is feasible, so we can try a higher value, say z = 6, 000. We
see from the illustration that as we increased the target profit value, the new
iso-profit line is parallel to the previous one (since the slope remained the
same), and can be thought of as the result of movement of the previous iso-
profit line up or to the right. If we keep increasing the target value of z, the
corresponding iso-profit line will keep moving toward the upper right corner
of the figure. It is clear that if we select the profit value that is too optimistic
(say z = 10, 000), the iso-profit line will have no common points with the
feasible region.
However, we do not need to keep guessing which values of z would work.
Instead, we observe that the optimal solution in our example corresponds to
the last point that the iso-profit line will have in common with the feasible
region as we move the line toward the upper right corner. From the figure,
226 Numerical Methods and Optimization: An Introduction

it is obvious that this point (denoted by x∗ in the figure) is on the inter-


section of the lines defining the budget constraint (4x1 + 5x2 = 2, 000) and
the printed fabric constraint (x2 = 300). Hence, we can find it by solving
the linear system consisting of these two equations. Solving this system gives
the optimal solution, x∗1 = 125, x∗2 = 300, which yields the optimal profit
z ∗ = $15 · 125 + $25 · 300 = $9, 375.

Example 10.8 Consider again the Heavenly Pouch example discussed in Sec-
tion 10.1 and just solved graphically. Suppose that the price of a non-reversible
carrier is raised by $5, so the new objective function is z = 20x1 + 25x2 . Solve
the resulting modified Heavenly Pouch LP graphically.

The modified Heavenly Pouch LP we need to solve is given by

maximize 20x1 + 25x2 (profit)


subject to x1 + x2 ≤ 450 (solid color fabric constraint)
x2 ≤ 300 (printed fabric constraint)
4x1 + 5x2 ≤ 2, 000 (budget constraint)
x1 ≤ 350 (demand constraint)
x 1 , x2 ≥ 0 (nonnegativity constraints).

In this case, the iso-profit line has the same slope as the line defining
the budget constraint, so the two lines are parallel (see Figure 10.4). Thus,
all points on the thick line segment between points x∗ = [125, 300]T and
x = [250, 200]T in the figure are optimal. The optimal objective function value
is z ∗ = 10, 000. Thus, there are infinitely many solutions, all of which belong
to the convex combination of two extreme points (also known as vertices or
corners) of the feasible region. As we will see later, any LP that has an optimal
solution must have at least one corner optimum.

Example 10.9 A retail store is planning an advertising campaign aiming


to increase the number of customers visiting its physical location, as well as
its online store. The store manager would like to advertise through a local
magazine and through an online social network. She estimates that each 1,000
dollars invested in magazine ads will attract 100 new customers to the store,
as well as 500 new website visitors. In addition, each 1,000 dollars invested in
online advertising will attract 50 new local store customers, as well as 1,000
new website visitors. Her target for this campaign is to bring at least 500
new guests to the physical store and at least 5,000 new visitors to the online
store. Formulate an LP to help the store minimize the cost of its advertising
campaign. Solve the LP graphically.

The decision variables are

x1 = budget for magazine advertising (in thousands of dollars)


x2 = budget for online advertising (in thousands of dollars),
Introduction to Linear Programming 227
x2
450

' solid fabric constraint


400

printed fabric constraint



300
x∗
' demand constraint
240 )
optima x
200

120 budget constraint


'
z ∗ = 10, 000
'
z = 6, 000
'
z = 3, 000
'
0 125 150 250 300 350 450 500 x1

FIGURE 10.4: Graphical solution of the modified Heavenly Pouch LP.

and the problem can be formulated as the following LP:

minimize x1 + x2
subject to 100x1 + 50x2 ≥ 500 (store visitors)
500x1 + 1, 000x2 ≥ 5, 000 (website visitors)
x 1 , x2 ≥ 0. (nonnegativity)

We start solving the problem graphically by plotting the lines describing the
constraints and drawing the feasible region (Figure 10.5). Then we plot two
level sets for the objective function, which in case of minimization problems
are called iso-cost lines, for z = 15 and z = 10. We observe that as the value
of z decreases, the iso-cost line moves down, toward the origin. If we keep
decreasing z, the iso-cost line will keep moving down, and at some point, will
contain no feasible points. It is clear from the figure that the last feasible point
the iso-cost line will pass through as we keep decreasing the value of z will be
the point of intersection of the lines defining the store visitors constraint and
228 Numerical Methods and Optimization: An Introduction
x2

10

z = 15
'
← store visitors
20/3 constraint z = 10
'

z ∗ = 20/3
'
10/3
website visitors
' constraint

0 10/3 5 20/3 10 x1

FIGURE 10.5: Solving Example 10.9 LP graphically.

the website visitor constraint. Hence, solving the system

100x1 + 50x2 = 500


500x1 + 1, 000x2 = 5, 000,

we find the optimal solution x∗1 = x∗2 = 10/3 ≈ 3.333, z ∗ = 20/3 ≈ 6.666.
Thus, the store should spend $6,666 on advertising and split this budget evenly
between the magazine and online advertising to reach its goals.
Note that even though the LP we just solved has an unbounded feasible
region, it still has an optimal solution. However, if the objective function was
improving along one of the directions in which the feasible region is unbounded
(called direction of unboundedness), an optimal solution would not exist.

Example 10.10 Consider a problem that has the same objective function and
feasible region as the LP in the previous example, but change the objective to
Introduction to Linear Programming 229

maximization:
maximize x1 + x2
subject to 100x1 + 50x2 ≥ 500
500x1 + 1, 000x2 ≥ 5, 000
x 1 , x2 ≥ 0.

Clearly the objective function value tends to infinity if one of the variables is
increased toward infinity; thus this LP has no optimal solution.

Encountering an LP with a feasible region containing points with any


desirable objective value is highly unlikely in practice. Next we consider an
example of an LP that may arise in decision-making situations with limited
resources. Namely, having insufficient resources may lead to a model that not
only has no optimal solution, but does not even have a feasible solution.

Example 10.11 Assume that the retail store in Example 10.9 has an ad-
vertising budget limited to $5,000. This condition is reflected in the budget
constraint in the corresponding LP model:

minimize x1 + x2
subject to 100x1 + 50x2 ≥ 500 (store visitors)
500x1 + 1, 000x2 ≥ 5, 000 (website visitors)
x1 + x2 ≤ 5 (budget)
x 1 , x2 ≥ 0. (nonnegativity)

From the illustration in Figure 10.5 it is clear that the set of points such that
x1 + x2 ≤ 5 does not overlap with the set of points satisfying each of the
remaining constraints of the LP. Thus, no feasible point exists for this LP.
Indeed, we previously determined that an advertising campaign that will yield
the target results will cost at least $6,666.

10.5 Classification of LPs


LPs can be classified in terms of their feasibility and optimality properties.
We saw in the previous section that some LPs have one or more optimal
solutions, whereas others may have no optimal or even feasible solutions.

Definition 10.1 An LP is called

• feasible if it has at least one feasible solution and infeasible,


otherwise;

• optimal if it has an optimal solution;


230 Numerical Methods and Optimization: An Introduction
• unbounded if it is feasible and its objective function is not
bounded (from above for a maximization problem and from below
for a minimization problem) in the feasible region.

For example, the Heavenly Pouch LP, as well as LPs in Examples 10.8 and 10.9
are optimal (which also implies that they are feasible LPs). In particular, the
LP in Example 10.9 is optimal despite its feasible region being unbounded. The
LP considered in Example 10.10 is unbounded, and the LP in Example 10.11
is infeasible.
Later (Theorem 11.5 at page 266) we will establish the following fact.

If an LP is not optimal, it is either unbounded or infeasible.

If an optimal LP has more than one optimal solution, then it is easy to show
that it has infinitely many optimal solutions. Indeed, consider a maximization
LP
max cT x,
x∈X

where X is a polyhedral set, and assume that the LP has two alternative
optimal solutions x∗ and x with the optimal objective value z ∗ = cT x∗ = cT x .
Then, for an arbitrary α ∈ (0, 1) consider a convex combination of x∗ and x ,
y = αx∗ + (1 − α)x ∈ X . We have

cT y = cT (αx∗ + (1 − α)x ) = αcT x∗ + (1 − α)cT x = αz ∗ + (1 − α)z ∗ = z ∗ ,

so, y is also an optimal solution of the LP. Thus, we established that the
following property holds.

If an LP is optimal, it either has a unique optimal solution or infinitely


many optimal solutions. Moreover, the set of all optimal solutions to an
LP is a convex set.

Exercises
10.1. Romeo Winery produces two types of wines, Bordeaux and Romerlot,
by blending Merlot and Cabernet Sauvignon grapes. Making one bar-
rel of Bordeaux blend requires 250 pounds of Merlot and 250 pounds
of Cabernet Sauvignon, whereas making one barrel of Romerlot re-
quires 450 pounds of Merlot and 50 pounds of Cabernet Sauvignon. The
profit received from selling Bordeaux is $800 per barrel, and from selling
Introduction to Linear Programming 231

Romerlot, $600 per barrel. Romeo Winery has 9,000 pounds of Merlot
and 5,000 pounds of Cabernet Sauvignon available. Formulate an LP
model aiming to maximize the winery’s profit. Solve the LP graphically.

10.2. O&M Painters produce orange and maroon paints by mixing the so-
called primary red, yellow, and blue paint colors. The proportions of red,
yellow, and blue paints used to get the required shades are 50%, 40%,
and 10%, respectively for orange, and 60%, 10%, and 30%, respectively
for maroon. What is the maximum combined amount of orange and
maroon paints that O&M Painters can produce, given that they have
6 gallons of red paint, 4 gallons of yellow paint, and 1.8 gallons of blue
paint available for mixing? Formulate this problem as an LP and solve
it graphically.

10.3. The Concrete Guys make two types of concrete by mixing cement, sand,
and stone. The regular mix contains 30% of cement, 15% of sand, and
55% of stone (by weight), and sells for 5 cents/lb. The extra-strong mix
must contain at least 50% of cement, at least 5% of sand, and at least
20% of stone, and sells for 8 cents/lb. The Concrete Guys have 100,000 lb
of cement, 50,000 lb of sand, and 100,000 lb of stone in their warehouse.
Formulate an LP to determine the amount of each mix the Concrete
Guys should make in order to maximize their profit.

10.4. A football coach is deciding on an offensive plan for a game. He estimates


that a passing play will yield 7 yards on average, whereas a rushing play
will average 5 yards. To balance the offense, he wants neither passing
nor rushing to constitute more than 2/3 of all offensive plays. Propose
an LP formulation to determine the distribution of passing and rushing
plays that maximizes an average gain per play. Solve the formulated LP
graphically.

10.5. A plant uses two alternative processes to manufacture three different


products, X, Y, and Z, of equal value. An hour of the first process costs
$3 and yields 3 units of X, 2 units of Y , and 1 unit of Z, whereas an
hour of the second process costs $2 and yields 2 units of each product.
The daily demand for X, Y , and Z is 25, 20, and 10 units, respectively.
Each machine can be used for at most 10 hours a day. Formulate an LP
to minimize the daily manufacturing costs while satisfying the demand
and time constraints. Solve the LP graphically.

10.6. SuperCleats Inc. is a small business manufacturing 4 models of soccer


shoes, Dynamo, Spartacus, Torpedo, and Kanga. Manufacturing one
pair of each model is associated with material, labor, and overhead costs
given in the table below, which also lists the company’s annual budget
for each kind of resource.

You might also like