You are on page 1of 28

3/6/2023

Chapter No. 2

INTRODUCTION TO OPTIMIZATION AND LINEAR PROGRAMMING


MUHAMMAD IDREES ASGHAR
PIM | SMEDA | NBDP | UNCTAD | UNITAR | ITC
Course Director - Pakistan Institute of Management
Ministry of industries and Production. Government of Pakistan
(+92-323-8804472, +92-331-6658771)

Introduction to Linear Programming

1
3/6/2023

ELECTROTECH CASE
• The Electrotech Corporation manufactures two industrial-sized
electrical devices: Generators and Alternators.
• Both of these products require wiring and testing during the
assembly process.
• Each generator requires 2 hours of wiring and 1 hour of testing
and can be sold for a $250 profit. Each alternator requires 3
hours of wiring and 2 hours of testing and can be sold for a
$150 profit. There are 260 hours of wiring time and 140 hours
of testing time available in the next production period.
Electrotech wants to maximize profit.

Introduction
• We all face decision about how to use limited resources such
as:
– Oil in the earth
– Land for dumps
– Time
– Money
– Workers

Deciding how best to use the limited resources available to an individual or a


business is a universal problem.

2
3/6/2023

Introduction (Contd..)
• In today’s competitive business environment, it is increasingly
important to make sure that a company’s limited Resources
are Used in the Most Efficient Manner Possible.
• Typically, this involves determining how to allocate the
resources in such a way as to maximize profits or minimize
costs.

Mathematical Programming...
• Mathematical Programming is a field of management science
that finds the optimal, or most efficient, way of using limited
resources to achieve the objectives of an individual or a
business.
• a.k.a. Optimization.

Optimal: Best or most favorable


Efficient: Achieving maximum productivity with
minimum wasted effort or expense

3
3/6/2023

Applications of Optimization
1. Determining Product Mix

2. Manufacturing

3. Routing and Logistics

4. Financial Planning

Applications of Optimization (Contd..)

1. Determining Product Mix


Most manufacturing companies can make a variety of products.
However, each product usually requires different amounts of
raw materials and labor.
Similarly, the amount of profit generated by the products
varies.
The manager of such a company must decide how many of
each product to produce in order to maximize profits or to
satisfy demand at minimum cost.

4
3/6/2023

Applications of Optimization (Contd..)


2. Manufacturing
Printed circuit boards (PCB), like those used in most
computers, often have hundreds or thousands of
holes drilled in them using a computer-controlled
drilling machine that must be programmed to drill in
a given location, then move the drill bit to the next
location and drill again to accommodate the different
electrical components that must be plugged into Printed Circuit Board
(PCB)
them.
Manufacturers of these boards would benefit from
determining the drilling order that minimizes the
total distance the drill bit must be moved.

Applications of Optimization (Contd..)


3. Routing and Logistics
Many retail companies have warehouses
around the country that are responsible for
keeping stores supplied with merchandise.
The amount of merchandise available at the
warehouses and the amount needed at each
store tend to fluctuate, as does the cost of
shipping or delivering merchandise from the
warehouses to the retail locations.
Large amounts of money can be saved by
determining the least costly method of
transferring merchandise from the
warehouses to the stores.

5
3/6/2023

Applications of Optimization (Contd..)

4. Financial Planning
The federal government requires individuals to begin
withdrawing money from individual retirement accounts (IRAs)
and other tax-sheltered retirement programs no later than age
70.5.
Various rules must be followed to avoid paying penalty taxes on
these withdrawals.
Most individuals want to withdraw their money in a manner
that minimizes the amount of taxes they must pay while still
obeying the tax laws.

Characteristics of Optimization
1. Decisions (Alternatives)

2. Restrictions/Limitations (Constraints)

3. Goals/Seek (Objectives)

6
3/6/2023

Characteristics of Optimization (Contd..)


1. Decision (Alternatives)
The decisions in an optimization problem are often represented
in a mathematical model by the symbols X1, X2, . . . , Xn. We
will refer to X1, X2, . . . , Xn as the decision variables (or simply
the variables) in the model.
These variables might represent the quantities of different
products the production manager can choose to produce.
They might represent the amount of different pieces of
merchandise to ship from a warehouse to a certain store.
They might represent the amount of money to be withdrawn
from different retirement accounts.

Characteristics of Optimization (Contd..)


2. Restrictions/Limitations (Constraints)
The constraints in an optimization problem can be represented
in a mathematical model in a number of ways. Three general
ways of expressing the possible constraint relationships in an
optimization problem are:

A less than or equal to constraint: f(X , X , . . . , X ) ≤ b


1 2 n

 A greater than or equal to constraint: f(X , X , . . . , X ) ≥ b


1 2 n

 An equal to constraint: f(X , X , . . . , X ) = b


1 2 n

7
3/6/2023

Characteristics of Optimization (Contd..)


2. Restrictions/Limitations (Constraints)

f(X , X , . . . , Xn)
1 2 ≤ b
f(X , X , . . . , Xn)
1 2 ≥ b
f(X , X , . . . , Xn)
1 2 = b

Left-hand-side (LHS) Left-hand-side (LHS)

Characteristics of Optimization (Contd..)


3. Goals/Seek (Objectives)
The objective in an optimization problem is represented
mathematically by an objective function in the general format:
MAX (or MIN): f (X , X , . . . , Xn )
1 2

The objective function identifies some function of the decision


variables that the decision maker wants to either MAXimize or
MINimize.

8
3/6/2023

Linear Programming
• Linear programming (LP), which involves creating and
solving optimization problems with linear objective
functions and linear constraints.
• LP is a very powerful tool that can be applied in many
business situations. It also forms a basis for several other
techniques discussed later and is, therefore, a good
starting point for our investigation into the field of
optimization.

Linear Programming (An Example)


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?

9
3/6/2023

Requirements of a
Linear Programming Problem
• Four properties in common

– Seek to maximize or minimize some quantity (the


objective function)
– Restrictions or constraints are present
– Alternative courses of action are available
– Linear equations or inequalities

Linear Programming (An Example)

Formulating LP Models
• The process of taking a practical problem—such as determining how many
Aqua-Spas and Hydro-Luxes Howie should produce—and expressing it
algebraically in the form of an LP model is known as formulating the model.

10
3/6/2023

LP Properties and Assumptions

PROPERTIES OF LINEAR PROGRAMS


1. One objective function
2. One or more constraints
3. Alternative courses of action
4. Objective function and constraints are linear –
proportionality and divisibility
5. Certainty
6. Divisibility
7. Nonnegative variables

Steps In Formulating An LP MODEL

State the
State the
objective Identify any
constraints as
Identify the function as a upper or lower
Understand linear
decision linear bounds on the
the problem combinations
variables combination of decision
of the decision
the decision variables
variables
variables

11
3/6/2023

Steps In Formulating An LP MODEL (Contd..)

1. Understand the Problem

• The problem in our example is fairly easy to understand:

– How many Aqua-Spas and Hydro-Luxes should Howie produce to


maximize his profit, while using no more than 200 pumps, 1,566
labor hours, and 2,880 feet of tubing?

Steps In Formulating An LP MODEL (Contd..)

2. Identify the Decision Variables


• Ask yourself, what are the fundamental decisions that must be
made in order to solve the problem?
• In our example, the fundamental decision Howie faces is this:
– How many Aqua-Spas and Hydro-Luxes should be produced? In this
problem, we will let X1 represent the number of Aqua-Spas to
produce and X2 represent the number of Hydro-Luxes to produce.

12
3/6/2023

Steps In Formulating An LP MODEL (Contd..)


3. State the objective function as a linear combination of the decision
variables
• Objective function expresses the mathematical relationship between the
decision variables in the model to be maximized or minimized.
• In our example, Howie earns a profit of $350 on each Aqua-Spa (X1) he sells
and $300 on each Hydro-Lux (X2) he sells. Thus, Howie’s objective of
maximizing the profit he earns is stated mathematically as:

MAX: 350 X1 + 300 X2


For whatever values might be assigned to X1 and X2, the previous function calculates the associated total
profit that Howie would earn. Obviously, Howie wants to maximize this value.

Steps In Formulating An LP MODEL (Contd..)


3. State the constraints as linear combinations of the decision variables
• There are usually some limitations on the values that can be assumed by
the decision variables in an LP model. These restrictions must be identified
and stated in the form of constraints.
• In our example, Howie faces three major constraints. Because only 200
pumps are available and each hot tub requires one pump, Howie cannot
produce more than a total of 200 hot tubs. This restriction is stated
mathematically as:

Constraint 1 1 X1 + 1 X2 ≤ 200
This constraint indicates that each unit of (X1) produced (i.e., each Aqua-Spa built) will use one of the 200 pumps
available—as will each unit of (X2) produced (that is, each Hydro-Lux built). The total number of pumps used
(represented by (X1) + (X2) ) must be less than or equal to 200.

13
3/6/2023

Steps In Formulating An LP MODEL (Contd..)


3. State the constraints as linear combinations of the decision
variables
• Another restriction Howie faces is that he has only 1,566 labor
hours available during the next production cycle. Because each
Aqua-Spa he builds (each unit of (X1)) requires 9 labor hours
and each Hydro-Lux (each unit of (X2)) requires 6 labor hours,
the constraint on the number of labor hours is stated as:
Constraint 2 9 X1 + 6 X2 ≤ 1566
The total number of labor hours used (represented by 9X1 + 6X2) must be less than or equal to the total labor hours
available, which is 1,566.

Steps In Formulating An LP MODEL (Contd..)


3. State the constraints as linear combinations of the decision
variables
• The final constraint specifies that only 2,880 feet of tubing is
available for the next production cycle. Each Aqua-Spa produced
(each unit of X1) requires 12 feet of tubing, and each Hydro-Lux
produced (each unit of X2) requires 16 feet of tubing.
• The following constraint is necessary to ensure that Howie’s
production plan does not use more tubing than is available:

Constraint 3 12 X1 + 16 X2 ≤ 2880
The total number of feet of tubing used (represented by 12 X1 + 16 X2) must be less than or equal to the total number
of feet of tubing available, which is 2,880.

14
3/6/2023

Steps In Formulating An LP MODEL (Contd..)


3. Identify any upper or lower bounds on the decision variables
• Often, simple upper or lower bounds apply to the decision
variables. You can view upper and lower bounds as additional
constraints in the problem.
• In our example, there are simple lower bounds of zero on the
variables X1 and X2 because it is impossible to produce a negative
number of hot tubs. Therefore, the following two constraints also
apply to this problem:

Constraint 3 X1 ≥ 0
X2 ≥ 0
Constraints like these are often referred to as non-negativity conditions and are quite common in LP problems.

SUMMARY OF LP MODEL (EXAMPLE)


3. Identify any upper or lower bounds on the decision variables
• The complete LP model for Howie’s decision problem can be stated as:
MAX: 350 X1 + 300 X2
Subject to: 1 X1 + 1 X2 ≤ 200
9 X1 + 6 X2 ≤ 1566
12 X1 + 16 X2 ≤ 2880
X1 ≥ 0
X2 ≥ 0
Constraints like these are often referred to as non-negativity conditions and are quite common in LP problems.

15
3/6/2023

PLOTTING THE LP MODEL

THE FEASIBLE REGION


• The Feasible Region is the set of points or values that the
decision variables can assume and simultaneously satisfy all
the constraints in the problem.

16
3/6/2023

PLOTTING THE OBJECTIVE FUNCTION


We can easily eliminate most of the feasible solutions in an LP
problem from consideration. It can be shown that if an LP
problem has an optimal solution with a finite objective function
value, this solution will always occur at a point in the feasible
region where two or more of the boundary lines of the
constraints intersect. These points of intersection are sometimes
called Corner points or Extreme points of the feasible region.

17
3/6/2023

Formulating LP Problems
• Developing a mathematical model to represent the
managerial problem
• Steps in formulating a LP problem
1. Completely understand the managerial problem being faced
2. Identify the objective and the constraints
3. Define the decision variables
4. Use the decision variables to write mathematical expressions
for the objective function and the constraints

Formulating LP Problems
• Common LP application – product mix problem
• Two or more products are produced using limited
resources
• Maximize profit based on the profit contribution per unit of
each product
• Determine how many units of each product to produce

18
3/6/2023

Flair Furniture Company


• Flair Furniture produces inexpensive tables and chairs
• Processes are similar, both require carpentry work and painting
and varnishing
– Each table takes 4 hours of carpentry and 2 hours of painting
and varnishing
– Each chair requires 3 of carpentry and 1 hour of painting and
varnishing
– There are 240 hours of carpentry time available and 100 hours
of painting and varnishing
– Each table yields a profit of $70 and each chair a profit of $50

Flair Furniture Company


• The company wants to determine the
best combination of tables and chairs to
produce to reach the maximum profit

HOURS REQUIRED TO
PRODUCE 1 UNIT
(T) (C) AVAILABLE HOURS
DEPARTMENT TABLES CHAIRS THIS WEEK
Carpentry 4 3 240

Painting and varnishing 2 1 100

Profit per unit $70 $50

19
3/6/2023

Flair Furniture Company


• The objective is
Maximize profit
• The constraints are
– The hours of carpentry time used cannot
exceed 240 hours per week
– The hours of painting and varnishing time used
cannot exceed 100 hours per week
• The decision variables are
T = number of tables to be produced per week
C = number of chairs to be produced per week

Flair Furniture Company


• Create objective function in terms of T and C
Maximize profit = $70T + $50C

• Develop mathematical relationships for the


two constraints
– For carpentry, total time used is
(4 hours per table)(Number of tables produced)
+ (3 hours per chair)(Number of chairs produced)
– First constraint is
Carpentry time used ≤ Carpentry time available
4T + 3C ≤ 240 (hours of carpentry time)

20
3/6/2023

Flair Furniture Company


• Similarly
Painting and varnishing time used
≤ Painting and varnishing time available
2 T + 1C ≤ 100 (hours of painting and varnishing time)

This means that each table produced requires two


hours of painting and varnishing time

– Both of these constraints restrict production capacity


and affect total profit

Flair Furniture Company


• The values for T and C must be
nonnegative
T ≥ 0 (number of tables produced is greater than or
equal to 0)
C ≥ 0 (number of chairs produced is greater than or
equal to 0)
The complete problem stated mathematically
Maximize profit = $70T + $50C
subject to
4T + 3C ≤ 240 (carpentry constraint)
2T + 1C ≤ 100 (painting and varnishing constraint)
T, C ≥ 0 (nonnegativity constraint)

21
3/6/2023

Solving Flair Furniture’s


LP Problem

• Most organizations have access to


software to solve big LP problems
• There are differences between software
implementations, the approach is
basically the same
• With experience with computerized LP
algorithms, it is easy to adjust to minor
changes

Using Excel’s Solver


• The Solver tool in Excel can be used to find solutions to
– LP problems
– Integer programming problems
– Noninteger programming problems
– Solver is limited to 200 variables and, in some situations, 100
constraints

22
3/6/2023

Using Solver
• Recall the model for Flair Furniture is
Maximize profit = $70T + $50C
Subject to 4T + 3C ≤ 240
2T + 1C ≤ 100
• To use Solver, it is necessary to enter data and
formulas

Using Solver
1. Enter problem data
– Variable names, coefficients for the objective
function and constraints, RHS values for each
constraint
2. Designate specific cells for the values of
the decision variables
3. Write a formula to calculate the value of
the objective function
4. Write a formula to compute the left-hand
sides of each of the constraints

23
3/6/2023

Using Solver

Using Solver

24
3/6/2023

Using Solver

Using Solver

25
3/6/2023

Using Solver

Using Solver

26
3/6/2023

Using Solver

Using Solver

27
3/6/2023

Four Special Cases in LP


• Four special cases and difficulties arise at times when
using the graphical approach
1. No feasible solution
2. Unboundedness
3. Redundancy
4. Alternate Optimal Solutions

28

You might also like