Linear Programming
Linear Programming
LINEAR PROGRAMMING
Maximization Model
Beaver Creek Pottery Company is a small crafts operation run by a Native
American tribal council. The company employs skilled artisans to produce clay
bowls and mugs with authentic Native American designs and colors. The two
primary resources used by the company are special pottery clay and skilled labor.
Given these limited resources, the company desires to know how many bowls and
mugs to produce each day in order to maximize profit. This is generally referred to
as a product mix problem type. This scenario is illustrated in Figure 2.1.
The two products have the following resource requirements for production
and profit per item produced (i.e., the model parameters):
Resource Requirements
Product Labor Clay Profit
(hr./unit) (lb./unit) (per unit)
Bowl 1 4 40
Mug 2 3 50
There are 40 hours of labor and 120 pounds of clay available each day for
production. We will formulate this problem as a linear programming model by
defining each component of the model separately and then combining the
components into a single model. The steps in this formulation process are
summarized as follows:
Decision Variables
The decision confronting management in this problem is how many bowls
and mugs to produce. The two decision variables represent the number of bowls
and mugs to be produced on a daily basis. The quantities to be produced can be
represented symbolically as
𝑥1 = 𝑛𝑢𝑚𝑏𝑒𝑟 𝑜𝑓 𝑏𝑜𝑤𝑙𝑠 𝑡𝑜 𝑝𝑟𝑜𝑑𝑢𝑐𝑒
𝑥2 = 𝑛𝑢𝑚𝑏𝑒𝑟 𝑜𝑓 𝑚𝑢𝑔𝑠 𝑡𝑜 𝑝𝑟𝑜𝑑𝑢𝑐𝑒
The Objective Function
The objective of the company is to maximize total profit. The company’s
profit is the sum of the individual profits gained from each bowl and mug. Profit
derived from bowls is determined by multiplying the unit profit of each bowl, $40,
by the number of bowls produced, 𝑥1 . Likewise, profit derived from mugs is derived
from the unit profit of a mug, $50, multiplied by the number of mugs
produced, 𝑥2 . Thus, total profit, which we will define symbolically as Z, can be
expressed mathematically as $40𝑥1 + $50𝑥2 . By placing the term maximize in
front of the profit function, we express the objective of the firm—to maximize total
profit:
𝑚𝑎𝑥𝑖𝑚𝑖𝑧𝑒 𝑍 = $40𝑥1 + $50𝑥2
where
Z = total profit per day
$40𝑥1 = profit from bowls
$50𝑥2 = profit from mugs
Model Constraints
In this problem, two resources are used for production—labor and clay—both of
which are limited. Production of bowls and mugs requires both labor and clay. For
each bowl produced, 1 hour of labor is required. Therefore, the labor used for the
production of bowls is 1𝑥1 hours. Similarly, each mug requires 2 hours of labor;
thus, the labor used to produce mugs every day is 2𝑥2 hours. The total labor used
by the company is the sum of the individual amounts of labor used for each
product:
1𝑥1 + 2𝑥2
However, the amount of labor represented by is limited to 40 hours per day;
thus, the complete labor constraint is
1𝑥1 + 2𝑥2 ≤ 40 ℎ𝑟
The “less than or equal to” (≤) inequality is employed instead of an equality
because the 40 hours of labor is a maximum limitation that can be used, not an
amount that must be used. This constraint allows the company some flexibility; the
company is not restricted to using exactly 40 hours but can use whatever amount
is necessary to maximize profit, up to and including 40 hours. This means that it is
possible to have idle, or excess, capacity (i.e., some of the 40 hours may not be
used).
The constraint for clay is formulated in the same way as the labor constraint.
Because each bowl requires 4 pounds of clay, the amount of clay used daily for
the production of bowls is 4𝑥1 pounds; and because each mug requires 3 pounds
of clay, the amount of clay used daily for mugs is 3𝑥2 . Given that the amount of
clay available for production each day is 120 pounds, the material constraint can
be formulated as
4𝑥1 + 3𝑥2 ≤ 120 𝑙𝑏
A final restriction is that the number of bowls and mugs produced must be
either zero or a positive value because it is impossible to produce negative items.
These restrictions are referred to as nonnegativity constraints and are expressed
mathematically as
𝑥1 ≥ 0, 𝑥2 ≥ 0
The complete linear programming model for this problem can now be
summarized as follows:
𝑚𝑎𝑥𝑖𝑚𝑖𝑧𝑒 𝑍 = $40𝑥1 + $50𝑥2
Subject to
1𝑥1 + 2𝑥2 ≤ 40
4𝑥1 + 3𝑥2 ≤ 120
𝑥1 , 𝑥2 ≥ 0
The solution of this model will result in numeric values for and that will
maximize total profit, Z. As one possible solution, consider 𝑥1 = 5 bowls and 𝑥2 =
10 mugs. First, we will substitute this hypothetical solution into each of the
constraints in order to make sure that the solution does not require more resources
than the constraints show are available:
1 (5) + 2(10) ≤ 40
25 ≤ 40
and
4(5) + 3(10) ≤ 120
50 ≤ 120
Because neither of the constraints is violated by this hypothetical solution, we say
the solution is feasible (i.e., possible). Substituting these solution values in the
objective function gives Z = 40 (5) + 50 (10) = $700. However, for the time being,
we do not have any way of knowing whether $700 is the maximum profit.
Now consider a solution of 𝑥1 = 10 bowls and 𝑥2 = 20 mugs. This solution
results in a profit of
Z = $40 (10) + $50(20)
= 400 + 1,000
= $1,400
Although this is certainly a better solution in terms of profit, it is infeasible
(i.e., not possible) because it violates the resource constraint for labor:
1(10) + 2(20) ≤ 40
50 ≤ 40
The solution to this problem must maximize profit without violating the
constraints. The solution that achieves this objective is 𝑥1 = 24 bowls and 𝑥2 = 8
mugs, with a corresponding profit of $1,360. The determination of this solution is
shown using the graphical solution approach in the following section.
Graphical Solutions of Linear Programming Models
Following the formulation of a mathematical model, the next stage in the
application of linear programming to a decision-making problem is to find the
solution of the model. A common solution approach is to solve algebraically the
set of mathematical relationships that form the model either manually or using a
computer program, thus determining the values for the decision variables.
However, because the relationships are linear, some models and solutions can be
illustrated graphically.
The graphical method is realistically limited to models with only two decision
variables, which can be represented on a graph of two dimensions. Models with
three decision variables can be graphed in three dimensions, but the process is
quite cumbersome, and models of four or more decision variables cannot be
graphed at all.
Although the graphical method is limited as a solution approach, it is very
useful at this point in our presentation of linear programming in that it gives a
picture of how a solution is derived. Graphs can provide a clearer understanding
of how the computer and mathematical solution approaches presented in
subsequent chapters work and, thus, a better understanding of the solutions.
Point B is obviously outside the constraint area because the values for
𝑥1 𝑎𝑛𝑑 𝑥2 yield a quantity (100) that exceeds the limit of 40 hours.
We draw the line for the clay constraint the same way as the one for the
labor constraint— by finding two points on the constraint line and connecting them
with a straight line. First, let 𝑥1 = 0 𝑎𝑛𝑑 𝑠𝑜𝑙𝑣𝑒 𝑓𝑜𝑟 𝑥2 :
40 (0) + 3 𝑥2 = 120
𝑥2 = 40
Performing this operation results in a point, 𝑥1 = 0 , 𝑥2 = 40. Next, we
, 𝑥2 = 0 and then solve for 𝑥1 :
40 𝑥1 + 3(0) = 120
𝑥1 = 30
Combining the two individual graphs for both labor and clay (Figures 2.4 and 2.5)
produces a graph of the model constraints, as shown in Figure 2.6. The shaded
area in Figure 2.6 is the area that is common to both model constraints. Therefore,
this is the only area on the graph that contains points (i.e., values for 𝑥1 𝑎𝑛𝑑 𝑥2 )
that will satisfy both constraints simultaneously. For example, consider the points
R, S, and T in Figure 2.7. Point R satisfies both constraints; thus, we say it is a
feasible solution point. Point S satisfies the clay constraint but exceeds the labor
constraint; thus, it is infeasible. Point T satisfies neither constraint; thus, it is also
infeasible.
The shaded area in Figure 2.7 is referred to as the feasible solution area
because all the points in this area satisfy both constraints. Some point within this
feasible solution area will result in maximum profit for Beaver Creek Pottery
Company. The next step in the graphical solution approach is to locate this point.
and
4𝑥1 + 3𝑥2 = 120
4𝑥1 = 120 − 3𝑥2
𝑥1 = 30 − 3𝑥2 /4
Now, we let 𝑥1 in the first equation equal 𝑥1 in the second equation
40 − 2𝑥2 = 30 − 3𝑥2 /4
and solve for 𝑥2 :
5𝑥2 /4 = 10
𝑥2 = 8
Substituting 𝑥2 = 8 into either one of the original equations given a value
for 𝑥1 :
𝑥1 = 40 − 2𝑥2
𝑥1 = 40 − 2(8)
𝑥1 = 24
Thus, the optimal solution at point B in Figure 2.11 is 𝑥1 = 24 𝑎𝑛𝑑 𝑥2 = 8.
Substituting these values into the objective function gives the maximum profit,
Z = 40 𝑥1 + 50 𝑥2
Z = 40(24) + 50(8)
Z = $1,360
In terms of the original problem, the solution indicates that if the pottery
company produces 24 bowls and 8 mugs, it will receive $1,360, the maximum daily
profit possible (given the resource constraints).
Given that the optimal solution will be at one of the extreme corner points,
A, B, or C, we can also find the solution by testing each of the three points to see
which results in the greatest profit, rather than by graphing the objective function
and seeing which point it last touches as it moves out of the feasible solution area.
Figure 2.12 shows the solution values for all three points, A, B, and C, and the
amount of profit, Z, at each point.
As indicated in the discussion of Figure 2.10, point B is the optimal solution
point because it is the last point the objective function touches before it leaves the
solution area. In other words, the objective function determines which extreme
point is optimal. This is because the objective function designates the profit that
will accrue from each combination of 𝑥1 𝑎𝑛𝑑 𝑥2 values at the extreme points. If
the objective function had had different coefficients (i.e., different 𝑥1 𝑎𝑛𝑑 𝑥2 profit
values), one of the extreme points other than x B might have been optimal.
Let’s assume for a moment that the profit for a bowl is $70 instead of $40,
and the profit for a mug is $20 instead of $50. These values result in a new
objective function, Z = 70 𝑥1 + 20 𝑥2 . If the model constraints for labor or clay are
not changed, the feasible solution area remains the same, as shown in Figure 2.13.
However, the location of the objective function in Figure 2.13 is different from that
of the original objective function in Figure 2.10. The reason for this change is that
the new profit coefficients give the linear objective function a new slope.
The slope can be determined by transforming the objective function into the
general equation for a straight line, y = a + bx , where y is the dependent variable,
a is the y intercept, b is the slope, and x is the independent variable. For our sample
objective function, 𝑥2 is the dependent variable corresponding to y (i.e., it is on the
vertical axis), and 𝑥1 is the independent variable. Thus, the objective function can
be transformed into the general equation of a line as follows:
Z = 70 𝑥1 + 20 𝑥2
20 𝑥2 = Z − 70 𝑥1
Slack Variable
Once the optimal solution was found at point B in Figure 2.12, simultaneous
equations were solved to determine the values of 𝑥1 𝑎𝑛𝑑 𝑥2 . Recall that the
solution occurs at an extreme point where constraint equation lines intersect with
each other or with the axis. Thus, the model constraints are considered as
equations (=) rather than ≤ or ≥inequalities.
There is a standard procedure for transforming ≤ inequality constraints into
equations. This transformation is achieved by adding a new variable, called a
slack variable, to each constraint.
For the pottery company example, the model constraints are
𝑥1 + 2𝑥2 ≤ 40 ℎ𝑟. 𝑜𝑓 𝑙𝑎𝑏𝑜𝑟
𝑥1 + 3𝑥2 ≤ 120 𝑙𝑏. 𝑜𝑓 𝑐𝑙𝑎𝑦
The addition of a unique slack variable, 𝑠1, to the labor constraint and 𝑠2 to
the constraint for clay results in the following equations:
𝑥1 + 2𝑥2 + 𝑠1 = 40 ℎ𝑟. 𝑜𝑓 𝑙𝑎𝑏𝑜𝑟
4 𝑥1 + 3𝑥2 + 𝑠2 = 120𝑙𝑏. 𝑜𝑓 𝑐𝑙𝑎𝑦
The slack variables in these equations, 𝑠1 𝑎𝑛𝑑 𝑠2 , will take on any value
necessary to make the left-hand side of the equation equal to the right-hand side.
For example, consider a hypothetical solution of 𝑠1 = 5 𝑎𝑛𝑑 𝑠2 = 10. Substituting
these values into the foregoing equations yields
𝑥1 + 2𝑥2 + 𝑠1 = 40 ℎ𝑟. 𝑜𝑓 𝑙𝑎𝑏𝑜𝑟
5 + 2(10) + 𝑠1 = 40 ℎ𝑟. 𝑜𝑓 𝑙𝑎𝑏𝑜𝑟
𝑠1 = 15 ℎ𝑟. 𝑜𝑓 𝑙𝑎𝑏𝑜𝑟
and
4𝑥1 + 3𝑥2 + 𝑠2 = 120 𝑙𝑏. 𝑜𝑓 𝑐𝑙𝑎𝑦
5(5) + 3(10) + 𝑠2 = 120 𝑙𝑏. 𝑜𝑓 𝑐𝑙𝑎𝑦
𝑠2 = 70 𝑙𝑏. 𝑜𝑓 𝑐𝑙𝑎𝑦
In this example, 𝑥1 = 5 bowls and 𝑥2 = 10 mugs represent a solution that
does not make use of the total available amount of labor and clay. In the labor
constraint, 5 bowls and 10 mugs require only 25 hours of labor. This leaves 15
hours that are not used. Thus, 𝑠1 represents the amount of unused labor, or slack.
In the clay constraint, 5 bowls and 10 mugs require only 50 pounds of clay.
This leaves 70 pounds of clay unused. Thus, 𝑠2 represents the amount of unused
clay. In general, slack variables represent the amount of unused resources.
The ultimate instance of unused resources occurs at the origin, where 𝑥1 =
0 𝑎𝑛𝑑 𝑥2 = 0. Substituting these values into the equations yields
𝑥1 + 2𝑥2 + 𝑠1 = 40
0 + 2(0) + 𝑠1 = 40
𝑠1 = 400 ℎ𝑟. 𝑜𝑓 𝑙𝑎𝑏𝑜𝑟
and
4𝑥1 + 3𝑥2 + 𝑠2 = 120
4(0) + 3(0) + 𝑠2 = 120
𝑠2 = 120 𝑙𝑏. 𝑜𝑓 𝑐𝑙𝑎𝑦
Because no production takes place at the origin, all the resources are
unused; thus, the slack variables equal the total available amounts of each
resource: 𝑠1 = 40 hours of labor and 𝑠2 = 120 pounds of clay.
What is the effect of these new slack variables on the objective function?
The objective function for our example represents the profit gained from the
production of bowls and mugs,
𝑍 = 40𝑥1 + 50𝑥2
The coefficient 40 is the contribution to profit of each bowl; 50 is the
contribution to profit of each mug. What, then, do the slack variables and
contribute? They contribute nothing to profit because they represent unused
resources. Profit is made only after the resources are put to use in making bowls
and mugs. Using slack variables, we can write the objective function as
𝑚𝑎𝑥𝑖𝑚𝑖𝑧𝑒 (𝑍) = 40𝑥1 + 50𝑥2 + 0𝑠1 + 0 𝑠2
As in the case of decision variables (𝑥1 𝑎𝑛𝑑 𝑥2 ), slack variables can have
only nonnegative values because negative resources are not possible. Therefore,
for this model formulation 𝑥1 , 𝑥2 , 𝑠1 𝑎𝑛𝑑 𝑠2 ≥ 0.
The complete linear programming model can be written in what is referred
to as standard form with slack variables as follows:
𝑚𝑎𝑥𝑖𝑚𝑖𝑧𝑒 (𝑍) = 40𝑥1 + 50𝑥2 + 0𝑠1 + 0 𝑠2
Subject to
𝑥1 + 2𝑥2 + 0𝑠1 = 40
4𝑥1 + 3𝑥2 + 𝑠2 = 120
𝑥1 , 𝑥2 , 𝑠1 𝑎𝑛𝑑 𝑠2 ≥ 0.
The solution values, including the slack at each solution point, are
summarized as follows:
Figure 2.14 shows the graphical solution of this example, with slack
variables included at each solution point
As mentioned at the beginning of this chapter, there are two types of linear
programming problems: maximization problems (like the Beaver Creek Pottery
Company example) and minimization problems. A minimization problem is
formulated the same basic way as a maximization problem, except for a few minor
differences. The following sample problem will demonstrate the formulation of a
minimization model.
At the end of the lesson, you should be able to:
1. enumerate the model components of linear programming;
2. apply minimization model on decision-making problem;
3. formulate minimization linear programming; and
4. formulate mathematical model using a graph.
A farmer is preparing to plant a crop and needs to fertilize a field. There are two
brands of fertilizer to choose from, Super-gro and Crop-quick. Each brand yields a
specific amount of nitrogen and phosphate per bag, as follows:
Rather than a ≤ (less than or equal to) inequality, as used in the Beaver
Creek Pottery Company model, this constraint requires a ≥ (greater than or equal
to) inequality. This is because the nitrogen content for the field is a minimum
requirement specifying that at least 16 pounds of nitrogen be deposited on the
farmer’s field. If a minimum cost solution results in more than 16 pounds of nitrogen
on the field, that is acceptable; however, the amount cannot be less than 16
pounds.
The constraint for phosphate is constructed like the constraint for nitrogen:
4𝑥1 + 3𝑥2 ≥ 24 lb.
With this example, we have shown two of the three types of linear
programming model constraints, ≤ and ≥.The third type is an exact equality, = .This
type specifies that a constraint requirement must be exact. For example, if the
farmer had said that the phosphate requirement for the field was exactly 24
pounds, the constraint would have been
4𝑥1 + 3𝑥2 ≥ 24 lb.
As in our maximization model, there are also nonnegativity constraints in
this problem to indicate that negative bags of fertilizer cannot be purchased:
𝑥1 , 𝑥2 ≥ 0
The complete model formulation for this minimization problem is
𝑚𝑎𝑥𝑖𝑚𝑖𝑧𝑒 (𝑍) = 6𝑥1 + 3𝑥2
Subject to
2𝑥1 + 4𝑥2 ≥ 16 lb. of nitrogen
4𝑥1 + 3𝑥2 ≥ 24 lb. of phosphate
𝑥1 , 𝑥2 ≥ 0
After the feasible solution area has been determined, the second step in the
graphical solution approach is to locate the optimal point. Recall that in a
maximization problem, the optimal solution is on the boundary of the feasible
solution area that contains the point(s) farthest from the origin. The optimal solution
point in a minimization problem is also on the boundary of the feasible solution
area; however, the boundary contains the point(s) closest to the origin (zero being
the lowest cost possible).
As in a maximization problem, the optimal solution is located at one of the
extreme points of the boundary. In this case, the corner points represent
extremities in the boundary of the feasible solution area that are closest to the
origin. Figure 2.18 shows the three corner points—A, B, and C—and the objective
function line.
As the objective function edges toward the origin, the last point it touches in
the
feasible solution area is A. In other words, point A is the closest the objective
function can get to the origin without encompassing infeasible points. Thus, it
corresponds to the lowest cost that can be attained
The final step in the graphical solution approach is to solve for the values of
and at point A. Because point A is on the 𝑥2 axis, 𝑥1 = 0; ; thus,4(0) + 3𝑥2 = 24
𝑥2 = 8
Given that the optimal solution is 𝑥1 = 0, 𝑥2 = 8, the minimum cost, Z, is
Z = 6𝑥1 + 3𝑥2
Z = 6(0) + 3(8)
Z = $24
This means the farmer should not purchase any Super-gro but, instead,
should purchase eight bags of Crop-quick, at a total cost of $24.
Surplus Variables
Greater-than or equal-to constraints cannot be converted to equations by
adding slack variables, as with constraints. Recall our fertilizer model, formulated
as
𝑚𝑎𝑥𝑖𝑚𝑖𝑧𝑒 (𝑍) = 6𝑥1 + 3𝑥2
Subject to
2𝑥1 + 4𝑥2 ≥ 16 lb. of nitrogen
4𝑥1 + 3𝑥2 ≥ 24 lb. of phosphate
𝑥1 , 𝑥2 ≥ 0
where
𝑥1 = 𝑏𝑎𝑔𝑠 𝑜𝑓 𝑆𝑢𝑝𝑒𝑟 − 𝑔𝑟𝑜 𝑓𝑒𝑟𝑡𝑖𝑙𝑖𝑧𝑒𝑟
𝑥2 = 𝑏𝑎𝑔𝑠 𝑜𝑓 𝐶𝑟𝑜𝑝 − 𝑞𝑢𝑖𝑥𝑘 𝑓𝑒𝑟𝑡𝑖𝑙𝑖𝑧𝑒𝑟
𝑍 = 𝑓𝑎𝑟𝑚𝑒𝑟 ′𝑠𝑡𝑜𝑡𝑎𝑙 𝑐𝑜𝑠𝑡 𝑜𝑓 𝑝𝑢𝑟𝑐ℎ𝑎𝑠𝑖𝑛𝑔 𝑓𝑒𝑟𝑡𝑖𝑙𝑖𝑧𝑒𝑟
Because this problem has constraints as opposed to the constraints of the
Beaver Creek Pottery Company maximization example, the constraints are
converted to equations a little differently. Instead of adding a slack variable as we
did with a constraint, we subtract a surplus variable. Whereas a slack variable is
added and reflects unused resources, a surplus variable is subtracted and reflects
the excess above a minimum resource requirement level. Like a slack variable, a
surplus variable is represented symbolically by and must be nonnegative. For the
nitrogen constraint, the subtraction of a surplus variable gives
2𝑥1 + 4𝑥2 − 𝑠1 = 16
The surplus variable transforms the nitrogen constraint into an equation.
As an example, consider the hypothetical solution
𝑥1 = 0
𝑥2 = 10
Substituting these values into the previous equation yields
2(0) + 4(10) − 𝑠1 = 16
− 𝑠1 = 16 - 40
− 𝑠1 = 24 lb. of nitrogen
In this equation, can be interpreted as the extra amount of nitrogen above
the minimum requirement of 16 pounds that would be obtained by purchasing 10
bags of Crop-quick fertilizer. In a similar manner, the constraint for phosphate is
converted to an equation by subtracting a surplus variable, 𝑠2 :
4𝑥1 + 3𝑥2 − 𝑠2 = 24
As is the case with slack variables, surplus variables contribute nothing to
the overall cost of a model. For example, putting additional nitrogen or phosphate
on the field will not affect the farmer’s cost; the only thing affecting cost is the
number of bags of fertilizer purchased. As such, the standard form of this linear
programming model is summarized as
𝑚𝑎𝑥𝑖𝑚𝑖𝑧𝑒 (𝑍) = 6𝑥1 + 3𝑥2 + 0𝑠1+0 𝑠2
Subject to
2𝑥1 + 4𝑥2 − 𝑠1 = 16
4𝑥1 + 3𝑥2 − 𝑠2 = 24
𝑥1 , 𝑥2 , 𝑠1 , 𝑠2 ≥ 0
Figure 2.19 shows the graphical solutions for our example, with surplus variables
included at each solution point.
Exercises
1. Moore’s Meatpacking Company produces a hot dog mixture in 1,000-pound
batches. The mixture contains two ingredients—chicken and beef. The cost
per pound of each of these ingredients is as follow
Ingredient Cost/lb
Chicken Php75
Beef Php125