Linear Programming
1.1 Introduction
Linear programming (LP) is the problem of optimizing (maximizing or min-
imizing) a linear function subject to linear constraints. A wide variety of
practical problems, from nutrition, transportation, production planning, fi-
nance, and many more areas can be modeled as linear programs. We begin
by introducing one of the earliest examples, the diet problem, and then give
some additional applications in the areas of production management, trans-
portation, finance, and personnel scheduling. Some of these examples are not
initially linear programs, but are amenable to being transformed into LPs and
techniques for conversion are illustrated. The embedded assumptions behind
linear optimization problems are discussed. A definition of a standard form of
a linear optimization problem is given and techniques for converting an LP
into standard form are illustrated.
1.1.1 The Diet Problem
Due to a limited budget you would like to find the most economical mix of
food items subject to providing sufficient daily nutrition. The available food
items are peanut butter, bananas, and chocolate, and the cost per serving
is 20 cents, 10 cents, and 15 cents, respectively. The amount of nutrients of
fat, carbohydrates, and protein per serving of peanut butter is 130 grams,
51.6 grams, and 64.7 grams. For bananas, the amounts of these nutrients per
serving are 1 gram, 51 grams, and 2 grams, whereas for chocolate the amounts
per serving are 12 grams, 22 grams, and 2 grams. Suppose it is decided by
a dietician that you need at least 35 grams of fat, at least 130 grams of
carbohydrate, and at least 76 grams of protein daily. Then, a combination
of these three food items should provide you with sufficient amounts of each
nutrient for the day. The problem of determining the least cost combination of
the food items that provide a sufficient amount of nutrients can be represented
as a problem of the following form:
© 2014 by Taylor & Francis Group, LLC
2 Introduction to Linear Optimization and Extensions with MATLAB
minimize cost of food items used
subject to food items must provide enough fat
food items provide must enough carbohydrates
food items provide must enough protein
This form of the problem reveals two major components, i.e., (1) there
is a goal or objective (minimize cost of food items used) and (2) a set of
constraints that represent the requirements for the problem (food items must
provide enough nutrition). A linear programming problem will exhibit the
same form, but with mathematical representations of the components of the
problem. In general, a linear program will consist of decision variables, an
objective, and a set of constraints.
To illustrate the formulation of the diet problem as a linear program, let
= servings of peanut butter
= servings of bananas
= servings of chocolate.
These variables represent the quantities of each food item to be used and
should be non-negative, i.e., x
0, x
0, and x
0, and are called
decision variables since they must be determined.
The total cost associated with any particular combination of food items
, x
, and x
+ .10x
+ .15x
, (1.1)
which says that the total cost of food items used is the sum of the costs
incurred from the use of each food item.
To ensure that the mix of the three foods will have enough fat one can
impose the following linear inequality constraint
+ 1x
+ 12x
35, (1.2)
which expresses that the total amount of fat from the three food items should
be at least the required minimum of 35 grams. Similarly, one can impose the
+ 51x
+ 22x
130 (1.3)
to ensure that a combination of food items will have enough carbohydrates
and finally impose the constraint
+ 2x
+ 2x
76 (1.4)
to ensure enough protein.
© 2014 by Taylor & Francis Group, LLC

Get Introduction to Linear Optimization and Extensions with MATLAB® now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.