Topic 4
Linear Programming Models
What is Linear Programming (LP)?
• A mathematical tool for allocating limited resources among competing activities
in an optimal way.
– Linear All mathematical functions are linear
– Programming Involves the planning of activities
• A constrained optimization technique, which optimizes linear objective function
under limited linear constraints.
• Application of Linear Programming:
– Production planning and inventory control
– Oil refinery management
– Financial and economic planning
– Manpower/ Workforce planning
– Urban development planning
Background
1939 - Leonid V. Kantorovich : Foundations of Linear Programming
1947 - George B. Dantzig : Invention of the Simplex Algorithm
– the father of Linear Programming
Today, some people say and believe that:
Linear programming is the most important development of
mathematics in the 20th century
3
Assumptions of LP
Proportionality/ Linearity: All relationships are linear (objective function and
constraints)
if the level of any activity is multiplied by a constant factor, the contribution
of this activity to the objective, or to any of the constraints in which the
activity is involved, is multiplied by the same factor.
Additivity: Every function is the sum of the individual contributions of the
activities
the sum of the contributions from the various activities to a particular
constraint equals the total contribution to that constraint
Divisibility: All variables are continuous
both integer and noninteger levels of the activities are allowed
Certainty: The parameter values are known with certainty
Single objective (minimize or maximize)
4
Example – Product Mix
The company produces glass products and owns 3 plants. Management
decides to produce two new products.
Product 1
1 hour production time in Plant 1
3 hours production time in Plant 3
Production time available each week
$3000 profit per batch
Plant 1: 4 hours
Plant 2: 12 hours
Product 2 Plant 3: 18 hours
2 hour production time in Plant 2
2 hours production time in Plant 3
Find the optimal number of units that
$5000 profit per batch
should be produced for each
product.
5
LP Solutions - Terminology
Solution: Any specification of values for the decision variables
Feasible solution: A solution for which all constraints are satisfied
Infeasible solution: A solution for which at least one constraint is
violated
Feasible region: The collection of all feasible solutions
Optimal solution: A feasible solution that has the most favorable value
of the objective function
LP Solutions - Terminology
Example 1 – Product mix
The company produces glass products and owns 3 plants. Management
decides to produce two new products.
Product 1
1 hour production time in Plant 1
3 hours production time in Plant 3
$3000 profit per batch Production time available each week
Plant 1: 4 hours
Product 2 Plant 2: 12 hours
2 hour production time in Plant 2 Plant 3: 18 hours
2 hours production time in Plant 3
$5000 profit per batch Find the optimal number of units that
should be produced for each
product.
8
Example 1 – Formulation and Excel
9
Example 2 – Product mix
A juice company produces canned apple and bottled juice with
profit margin RM4 and RM2, respectively per unit. The following
table shows the labor, equipment, and ingredients to produce
each product per unit.
Canned apple Bottled juice Total
(x) (y)
Labor 2.0 3.0 12.0
Equipment 3.2 1.0 8.0
Ingredients 2.4 2.0 9.0
Formulate the linear programming problem (model) specifying
the product mix which will maximize the profit without
exceeding the levels of resources.
Example 2 – Formulation and Excel
11
Example 3 – Production planning
A bed mart company is in the business of manufacturing beds
and pillows. The company has 40 hours for assembly and 32
hours for finishing work per day. Manufacturing of a bed requires
4 hours for assembly and 2 hours in finishing. Similarly, a pillow
requires 2 hours for assembly and 4 hours for finishing.
Profitability analysis indicates that every bed would contribute
RM80, while a pillow contribution is RM55 respectively. Find out
the daily production of the company to maximize the
contribution.
Example 3 – Formulation and Excel
13
Example 4 – Production planning
Blue Ridge Hot Tubs manufactures and sells two models of hot tubs: the Aqua-
Spa and the Hydro-Lux. Howie Jones, the owner and manager of the company,
needs to decide how many of each type of hot tub to produce during his next
production cycle. Howie buys prefabricated fiberglass hot tub shells from a
local supplier and adds the pump and tubing to the shells to create his hot
tubs. (This supplier has the capacity to deliver as many hot tub shells as
Howie needs.) Howie installs the same type of pump into both hot tubs. He will
have only 200 pumps available during his next production cycle. From a
manufacturing standpoint, the main difference between the two models of hot
tubs is the amount of tubing and labor required. Each Aqua-Spa requires 9
hours of labor and 12 feet of tubing. Each Hydro-Lux requires 6 hours of labor
and 16 feet of tubing. Howie expects to have 1,566 production labor hours
and 2,880 feet of tubing available during the next production cycle. Howie
earns a profit of $350 on each Aqua-Spa he sells and $300 on each Hydro-Lux
he sells. He is confident that he can sell all the hot tubs he produces. The
question is, how many Aqua-Spas and Hydro-Luxes should Howie produce if he
wants to maximize his profits during the next production cycle?
14
Example 4 – Formulation and Excel
15
Example 4 – Graphical solution
16
Example 5: Advertising model
The General Flakes Company sells a brand of low-fat breakfast cereal that appeals
to people of all age groups and both genders. The company advertises this cereal
in a variety of 30-second television ads, and these ads can be placed in a variety of
television shows. The ads in different shows vary by cost—some 30-second slots
are much more expensive than others—and by the types of viewers they are likely
to reach. The company has segmented the potential viewers into six mutually
exclusive categories: males age 18 to 35; males age 36 to 55; males over 55;
females age 18 to 35; females age 36 to 55; and females over 55. A rating service
can supply data on the numbers of viewers in each of these categories who will
watch a 30-second ad on any particular television show. Each such viewer is called
an exposure. The company has determined the required number of exposures it
wants to obtain for each group. It wants to know how many ads to place on each of
several television shows to obtain these required exposures at minimum cost. The
data on costs per ad, numbers of exposures per ad, and minimal required
exposures are listed in Table 4.1, where numbers of exposures are expressed in
millions, and costs are in thousands of dollars. What should the company do?
Example 5 - Advertising model continued
Objective To find the minimum-cost advertising strategy that meets minimum
exposure constraints.
The company needs to decide how many ads to place on each television
show that minimizes the total advertising cost.
Example 5: Excel spreadsheet
1. Input values and range names. Enter the inputs from the table above
in light blue ranges, and name the ranges as shown.
2. Ads purchased. Enter any values in the Number_ads_purchased
range. These are the only decision variable cells for this model.
3. Exposures obtained. The numbers of ads purchased determine the
numbers of exposures to the various viewer groups. To calculate these
exposures, enter the formula.
4. Total cost. The quantities of ads purchased also determine the total
cost of advertising. Calculate this cost in cell B31 with the formula.
Example 5: Excel spreadsheet
Example 5: Using integer constraints
• To this point, the advertising models have allowed non-integer values in the
changing cells. In reality, this is not allowed.
• To force the changing cells to have integer values, you simply add another
constraint in the Solver dialog box.
• Be aware that Solver must do a lot more work to solve problems with integer
constraints.
Example 5: Using integer constraints
Example 5: Using integer constraints
• Consider the following about this integer solution:
– The total cost in the target cell is now worse (larger) than before.
– The optimal integer solution is not the rounded non-integer solution.
– When there are integer constraints, Solver uses an algorithm - called
branch and bound - that is significantly different from the simplex method.
• Integer-constrained models are typically much harder to solve than
models without any integer constraints.
Linear models and scaling
• In some cases, the Solver message may indicate that the proportionality and
additivity conditions are not satisfied. This could be:
– due to a logical error in formulation, or
– due to a roundoff error in Solver’s calculations.
• In any case, it always helps to have a well-scaled model, where all of the
numbers are roughly the same magnitude.
• If the model is poorly scaled, you can:
– check the Use Automatic Scaling option in solver,
– redefine the units in which the various quantities are defined, or
– change the Precision setting in Solver’s Options dialog box to a larger
number.
Conclusion
• In this chapter, we have presented LP spreadsheet models of many diverse
situations.
• There are several keys you should use with most spreadsheet optimization
models:
– Determine the changing cells, the cells that contain the values of the
decision variables. These cells should contain the values the decision
maker has direct control over, and they should determine all other outputs,
either directly or indirectly.
– Set up the spreadsheet model so that you can easily calculate what you
want to maximize or minimize (usually profit or cost).
– Set up the spreadsheet model so that the relationships between the cells in
the spreadsheet and the problem constraints are readily apparent.
Conclusion continued
– Make your spreadsheet readable. Use descriptive labels, use range names,
use cell comments and text boxes for explanations, and plan your model
layout before you dive in. This might not be too important for small,
straightforward models, but it is crucial for large, complex models. Just
remember that other people are likely to be examining your spreadsheet
models.
– Keep in mind that LP models tend to fall into categories, but they are
definitely not all alike. For example, a problem might involve a combination
of the ideas discussed in the worker scheduling, blending, and production
process examples of this chapter.