W6 Lesson 5 - Introduction To Optimization and Linear Programming - Module
W6 Lesson 5 - Introduction To Optimization and Linear Programming - Module
1
Introduction to Optimization and Linear Programming
A. Mathematical Models
These can describe diverse situations which mean that they are general rather than
specific. Mathematical models offer easy manipulation for experimentation and prediction.
Factors deemed important in solving problems, relationships and interrelationships among
variables are explicitly depicted with the use of mathematical models.
Mathematical models may be used to represent almost everything in the real world.
Let us suppose that you would like to build a rectangular sandbox for your kids to play in.
Based on the materials that you have, there are two options you can take to build the
sandbox. You want the rectangular sandbox to maximize its largest area as possible. Your
first option is a length of 8 feet and a width of 5 feet. The second option is a length of 7 feet
and a width of 6 feet. You would like to determine which of the 2 dimensions will result in a
Course Module
Management Science2
Introduction to Optimization and Linear Programming
larger area. The good news is in mathematics, we have a formula to determine the area (A)
of a rectangle using its length (L) and width (W).
A=LxW
We can now use the data for us to calculate the two area options.
A1 = 8 x 5 = 40 square feet
A2 = 7 x 6 = 42 square feet
The area of option two is larger by two feet than the area of option one. So, you now
have an easy decision by knowing which option provides the bigger area of the sandbox.
The formula we just used is an example of a mathematical model.
The most common types of mathematical models are equations (or formulas like
our example) and graphs. Here is another example of an equation as a mathematical
model.
Suppose that a retail store is having a moving out sale and everything in the store is
25% off. If an item is x pesos, then the discount is 25% of x., or 0.25x. The sale price can be
determined by deducting the discount (0.25x) from the original price (x). The following
equation models the moving out sale price of any item in the store with the original price:
S = x – 0.25x
After combining like terms, the equation can also be written as:
S = 0.75x
S = P100 -0.25(P100)
Management Science
3
Introduction to Optimization and Linear Programming
S = P100 -P25
S = P75.00
The sale prices of the retail store items are illustrated by Figure 1 in its y-axis, the x-
axis represents the original prices. Given a 15% discount and the equation S=0.85x we will
be able to locate on the graph that if an item originally costs $5, then the sale price would
be $4.25.
As you would already know by now, there are a lot of symbolic models and the same
can be said about mathematical models. Therefore, we will only discuss the broad or
general classifications of mathematical models.
Course Module
Management Science4
Introduction to Optimization and Linear Programming
It is very helpful to study these broad categories because these are where all other
categories derive from. The first category is based on the type of outcome they predict. This
is where the division of deterministic models versus stochastic models are found.
The second broad category is the level of understanding on which the model is
based. Within the system being modelled, there is a hierarchy of organizational
structure, this is the simplest way to explain it.
The four models above represent the extremes of a range of model types. There is a
whole spectrum of models in between them. It is important to note as well that these two
broad categories are complimentary. This means that a stochastic model may either be
empirical or mechanistic (but not deterministic) and vice versa.
Management Science
5
Introduction to Optimization and Linear Programming
There are only limited resources available to the whole world. In business, this is
pretty much the same. An organization engaged in manufacturing employs only a limited
number of employees. A fast food chain only as a limited dining space for seating.
A universal problem of individuals and businesses is how to best use the limited
resources available. In the competitive environment of business today, the most efficient
way to use a company’s limited resources is ever increasingly important. This typically
involves the determination of how to allocate resources to either maximize profit or
minimize costs.
Business analytics is an area that looks for the optimal, or the most efficient, way of
using limited resources to achieve the goals of a business or an individual. This area is
called MP or Mathematical Programming and often referred to as optimization.
To make it easier for you to understand optimization, its purpose, and the types of
problems where it is used, here are decision-making situations where we can see the
application of MP techniques:
Course Module
Management Science6
Introduction to Optimization and Linear Programming
must then move on to the next location to drill. To complete all holes on the
circuit board, this process must be repeated hundreds or thousands of times.
Once the drilling order that minimizes the total distance of drill movement is
determined, manufacturers of the circuit boards will benefit.
• Routing and Logistics –around the country there are many warehouses
owned by retail companies. The said warehouses supply retail stores with
merchandise. The amount of merchandise needed by each store and available
in each warehouse has great tendencies of fluctuation, as does shipping cost
or delivering the merchandise to the retail locations from the warehouses. By
determining the least costly method of relocating the merchandise from the
warehouses to the retail locations then a lot of money can be saved.
• Financial Planning–in the United States, individuals are required by the
federal government to start withdrawing from their individual retirement
accounts (IRAs) not later than the age of 70.5 and at this age individuals must
also withdraw from their other tax-shielded retirement programs.
Unfortunately, various rules need to be followed in order to avoid penalty
which makes individuals wanting to minimize taxes and still obey tax laws
when they withdraw their money.
In the application examples we just discussed it gave you some idea on the issues
that involve optimization. The examples involve one or more decisions that needs to be
made: how many of each product to produce? which location to drill next? how much of
Management Science
7
Introduction to Optimization and Linear Programming
each product to ship from the warehouses to each retail location? how much to withdraw
from individual retirement accounts?
f (X1, X2, …, Xn) we will refer to as LHS or left-hand side of the constraint and
to letter b as RHS or right-hand side value of the constraint. For example, a
manager, in order not to exceed the amount of available labor ensures that
total labor in producing a given number of products will use a less than or
equal to constraint. In the case of withdrawing from an individual retirement
account and ensure minimum amount required by the IRS a greater than or
equal to constraint will be used. Depending on the requirements of a
situation, any number of these constraints can be used to represent a given
optimization problem.
function. In our examples, this objective function can be used to describe the
association of a product mix to total profit, drill bit’s total distance of
movement, transport costs of moving merchandise, and total tax liability of
an individual.
There are a lot of different kinds of functions which can be used to represent the
constraints and the objective function in an MP model. It is obviously very important that
you accurately describe constraints and the objective function of the problem being solved
by using functions that do the same accuracy.
Course Module
Management Science10
Introduction to Optimization and Linear Programming
The nature of the functions can be linear (those that form flat surfaces or straight
lines) or it could be nonlinear (those that form curved surfaces or curved lines). Decision
variables on the other hand may take on integer values (whole numbers) while other times
they can take on the form of fractional values (fractions).
MP problems that can be encountered are very diverse, and to solve these
diversities of problems many MP techniques have been developed. We will begin by
studying LP technique or Linear Programming. This technique is where linear objective
functions and linear constraints are used to create and solve optimization problems. Many
business situations provide the arena of applications for LP to be a very powerful tool. LP
also forms the basis for some other techniques which makes it a great starting point into
the world of optimization.
LP Problem Example
We will take a simple example but make no mistake about it, that LP
cannot solve more complicated or realistic problems. Linear Programming
has been used to solve extremely complex problems, giving millions of
dollars in savings to companies. Much like joining a marathon, you cannot
jump directly into complex problems without going for a jog, so let’s start
with a simple problem.
Two models of hot tubs are manufactured and sold by Blue Ridge
Hot Tubs: the Hydro-Lux and the Aqua-Spa. The manager who also
happens to be the owner of the company, Mr. Howie Jones, needs to
decide before or by his next production cycle how many of each type of
hot tub he needs to produce. From a local supplier, prefabricated
fiberglass hot tub shells are bought by Mr. Jones to create his hot tubs.
Mr. Jones then adds the pump and tubing to the shells to finish his
products. Note that the supplier is able to deliver as many hot tubshells
Management Science
11
Introduction to Optimization and Linear Programming
as needed by Mr. Jones. In both hot tubs, Mr. Jones installs the same
type of pump. During his next cycle of production, he will only have 200
pumps of inventory. From a manufacturing perspective, the amount of
tubing and labor required is what differentiates the two models of hot
tubs. 12 feet of tubing and 9 hours of labor is required by each Aqua-
Spa. 16 feet of tubing and 6 hours of labor is required by each Hydro-
Lux. Mr. Jones expects to have 2,880 feet of tubing and 1,566 production
labor hours available during the next cycle of production. Mr. Jones’
profits are as follows when he is able to sell the hot tubs: $350 on each
Aqua-Spa and $300 on each Hydro-Lux. So, the problem is, how many of
each model of hot tub should Mr. Jones produce if he aims for profit
maximization during his next production cycle.
The following are steps to ensure that you have an accurate formulation of a
particular problem. We will use our hot tub example.
Course Module
Management Science12
Introduction to Optimization and Linear Programming
The problem in our example is relatively easy to understand: How many
Hydro-Luxes and Aqua-Spas should Mr. Jones produce to maximize his profit,
while being limited to 1,566 labor hours, 2,880 feet of tubing, and no more than
200 pumps?
2. Identify the decision variables. After making sure that you understand the
problem, you should now move to identifying the decision variables. In order to
solve the problem, you would need to know the answer to the question “what
fundamental decisions need to be made”? Appropriate decision variables will
come from the answers to this question. To identify decision variables also
means to determine what the symbols X1, X2, …, Xn will be representing in your
model.
Let us check from our example what fundamental decision does Mr. Jones
need to make: How many should be produced of Aqua-Spas and Hydro-Luxes? In
this problem, we let X1 represent the number of Aqua-Spas to be produced and
X2 to represent the number of Hydro-Spas to be produced.
This function would calculate the associated total profit that Mr. Jones would
earn for whatever values would be given to X1 and X2. And obviously, Mr. Jones
wants to maximize this value of profit.
Management Science
13
Introduction to Optimization and Linear Programming
In our example, Mr. Jones is faced with three major constraints. Each hot
tub requires one pump but only 200 pumps are available. This means that Mr.
Jones can’t produce more than 200 hot tubs in total. When stated
mathematically, this restriction is represented as:
Another constraint that Mr. Jones faces is that he only has 1,566 hours of
labor available during the next production cycle. 9 hours of labor is required by
each Aqua-Spa (each unit of X1) that is built, and 6 hours of labor is required by
each Hydro-Lux (each unit of X2) that is made. The number of labor hours
constraint is stated as:
be less than or equal to the total hours of labor available, which is 1,566. Also, in
the next production cycle, only 2,880 feet of tubing is available, this is the final
constraint. Each unit of X1 (each Aqua-Spa built) requires 12 feet of tubing, while
each unit of X2 (each Hydro-Lux built) requires 16 feet of tubing.
To ensure that the production plan of Mr. Jones does not exceed or use more
tubing than the available tubing, this constraint is necessary:
Course Module
Management Science14
Introduction to Optimization and Linear Programming
Represented by 12X1 + 16X2, total number of tubing (in feet) used must
only be less than or equal to the total number of tubing (in feet) available, which
is 2,880.
5. Identify any upper or lower bounds on the decision variables. Upper and
lower bounds can be seen as additional constraints in the problem. These simple
upper and lower bounds are applied to decision variables.
Since it is impossible or there is no way that a negative number of hot tubs
can be produced, the simple lower bounds on the variables X1 and X2 is zero. We
therefore, say that the following two constraints are also true to the problem:
X1 ≥ 0
X2 ≥ 0
Most of the time, constraints of this type are called nonnegativity conditions.
Intuitive Approach
A line of reasoning could be that Mr. Jones should produce as much units as
he can of Aqua-Spa (X1) because it gives him a higher profit $350 versus $300 of
Hydro-Lux (X2). What then is the maximum number of Aqua-Spas that Mr. Jones
could produce?
By making zero units of X2, Mr. Jones can produce the maximum number of
units of X1. Suppose now that we let X2 be equal to zero indicating that no Hydro-
Luxes will be produced, what then would be the largest possible value of X1?
X1 + X2 ≤ 200
If X2 = 0, then
X1 ≤ 200
Now considering the constraints for labor hours and given that X2 = 0
9X1 + 6X2 ≤ 1,566
9X1 ≤ 1,566
Simplifying both sides
9X1 1,566
_____ ≤ ________
9 9
X1 ≤ 174
So, continuing with the constraints for feet of tubing
12X1 + 16X2 ≤ 2,880
Course Module
Management Science16
Introduction to Optimization and Linear Programming
12X1 ≤ 2,880
Given the 3 constraints, what is the largest value of X1 that satisfies all other
constraints?
X1 ≤ 174
If Mr. Jones builds 174 units of Aqua-Spas (X1) and 0 units of Hydro-Luxes
(X2), then Mr. Jones will have used up all the available labor hours for production.
9(174) ≤ 1,566
1,566 ≤ 1,566
Mr. Jones will have 26 pumps left and 792 feet of tubing will remain unused.
200 – X1 =26 pumps
12X1 ≤ 2,880
2880-12(174) = feet of tubing
2880-2088 = 792 feet
Now let us check the objective function value which shows what the total
profit now is given the receding conditions:
We can now analyze that the solution X1 = 174, X2 = 0 which satisfies all
constraints of the model is a feasible solution. But what we also want to know is if
there is a better solution or even an optimal solution which results in a higher
objective function. What other approach can we take aside from just an Intuitive
Approach?
Management Science
17
Introduction to Optimization and Linear Programming
Graphical Approach
The feasible region for the problem or the set of feasible solutions is actually
defined by the constraints of an LP model. The challenge in LP is to determine the
point or points that will give the best possible value of the objective function. For
simple problems like our example which has only two decision variables it will be
very easy to sketch and locate the optimal feasible point graphically. Although the
graphical approach offers very limited use because it can only be used if there are
two decision variables it is a great path to develop a basic understanding of the LP
problem solving strategy.
The boundary of the first constraint is shown by the line X1 + X2= 200.
Connecting the dots or points of (X1, X2)=(200,0) and (X1, X2)=(0,200) will give you
this line. It actually extends beyond the 2 points mentioned but since X1 and X2 have
assumed nonnegativity they will only have positive values or will not go lower than
the value of zero. The feasible area is represented by the shaded area in Figure 2.
Course Module
Management Science18
Introduction to Optimization and Linear Programming
Therefore, any point within this are is a feasible solution when it comes to the pump
constraint.
That being said, the feasible solutions to one constraint may not usually
satisfy one or more of the other constraints. (X1, X2)=(200,0) satisfies the first
constraint but it does not satisfy the second constraint (9X1+6X2 ≤ 1,566)which
requires that labor hours to be no more than 1,566 hours (9x200+6x0=1800 hours).
To be able to plot the constraint we must get the maximum values for both X1
and X2. If X1=0, then X2= 1566/6 = 261. If X2=0, then X1= 1566/9 = 174. These two
points (0,261) and (174,0) when connected by a straight line represents the labor
hours constraint as shown by Figure 3.
After creating the line, it now represents the area that satisfies the second
constraint. The point of their intersection and the shaded area is the point where
both constraints are satisfied.
To find the values of X1 and X2 that satisfies all constraints we now need to
plot the third constraint. We need to find the boundary points of this constraint
which states that no more than 2,880 feet of tubing will be used to produce hot tubs.
Our equation for the third constraint 12X1 + 16X2 ≤ 2,880 will set our
boundary line. If X1=0, then X2= 2880/16 = 180. If X2=0, then X1 = 2880/12 = 240.
The two points (0,180) and (240,0) when connected by a straight line represents
the boundary of the third constraint as shown in Figure 4.
Course Module
Management Science20
Introduction to Optimization and Linear Programming
The feasible region shows the values, or it is the set of points that can be
assumed or taken by the decision variables. From this feasible region we must be
able to find the optimal solution. This is where two or more of the boundary lines
intersect. If the intersection occurs within the feasible region, these would be called
extreme points or corner points. To get the optimal solution, we must locate
where the boundary lines of the pump and labor constraints intersect. These
usually are the corner or extreme points. To get the exact values we use the
equations for the two constraints:
X1 + X2 = 200
9X1 + 6X2 = 1,566
From the first equation we can conclude that X2 = 200 – X1. If we substitute
this to X2 of the second equation we will obtain 9X1 + 6(200-X1) = 1,566. Using
simple algebra, we will be able to derive that X1 = 122 and then from X2 = 200 – X1,
we get that X2 = 78.
We have finally determined that the optimal solution to our problem can be
found at the point (X1,X2) = (122,78). Substituting these values in our objective
function we get the maximum profit of Mr. Jones:
$350(122) + $300(78) = $66,100
Management Science
21
Introduction to Optimization and Linear Programming
Course Module