0% found this document useful (0 votes)
4 views30 pages

7 - Pre-Class Student Version

Class 7 focuses on Linear Programming (LP) formulation and solving techniques, including identifying decision variables, objective functions, and constraints. It includes examples such as maximizing profit in mask production and transportation problems for vaccine distribution. The class also discusses methods to solve LPs, including graphical methods and Excel Solver.

Uploaded by

Gia Hân
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views30 pages

7 - Pre-Class Student Version

Class 7 focuses on Linear Programming (LP) formulation and solving techniques, including identifying decision variables, objective functions, and constraints. It includes examples such as maximizing profit in mask production and transportation problems for vaccine distribution. The class also discusses methods to solve LPs, including graphical methods and Excel Solver.

Uploaded by

Gia Hân
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 30

Jindal School of Management

Class 7
Linear Programming

Review: Class 6

• Service Process with Variability


– Variability causes queues
– Process performance measures
– Little’s Law

• Case Study: Logan Airport

• Optional Reading
– Cachon and Terwiesch 8.1 to 8.6, and 8.9

1
Learning Objectives: Class 7

• How to Formulate an LP
– Identify decision variable
– Objective and constraints
– Optimal / feasible solution
• How to Solve an LP
– Isoprofit line
– Excel Solver
• Optional Reading
– Topaloglu Chapters 1-2

Example 1

• A face mask production business can produce two types


of face masks: surgical and cloth. The table below shows
their cost and profit:
Profit Labor from Labor from
Types
($/unit) Adam (hour) Bob (hour)
Surgical 1 2 5
Cloth 2 3 2

Adam is available for at most 12 hours of production.


Bob is available for at most 15 hours of production.
• How much surgical and cloth masks should they produce
in order to maximize profit?

2
Formulating an LP

• Four steps:
– Identify decision variables
– Write out objective function
– Write out constraints
– Write the LP

1. Identify Decision Variables

• What has to be decided and can take numerical


values
– Examples: How many products to
produce/buy/consume?

• Denote them as (usually) x1, x2, … , xn

“How many surgical and cloth masks would they


produce in order to maximize profit? ”
X1: quantity of surgical masks; X2: quantity of cloth masks.

3
2. Write out Objective Function

• What is your goal? Do we want to maximize or


minimize?
– Examples: minimize costs, maximize profit

• What is the cost/profit in terms of the decision


variables?

Min z = c1 x1 + … + cnxn
or
Max z = p1 x1 + … + pnxn

Example 1: Objective Function

Profit Labor from Labor from


Types
($/unit) Adam (hour) Bob (hour)
Surgical 1 2 5
Cloth 2 3 2
Adam is available for at most 12 hours of production. Bob is available
for at most 15 hours of production.

4
3. Write out Constraints

• What is restricting the decision variables?


– Example: a resource can only be used for a certain
number of hours

• The decision variable also determines the


resources to be used:
– The quantity of the resource used by each x1 is a1, for
each x2 it is a2, etc
– b is the total quantity of the resource

a1 x1 + … + an xn ≤ b

Example 1: Constraints

Profit Labor from Labor from


Types
($/unit) Adam (hour) Bob (hour)
Surgical 1 2 5
Cloth 2 3 2

Adam is available for at most 12 hours of production. Bob is available


for at most 15 hours of production.

5
4. Write the LP

• We have a maximization problem:

Max z = p1 x1 + … + pnxn Objective function

s.t. a11 x1 + … + a1n xn ≤ b1 Resource constraints


a21 x1 + … + a2n xn ≤ b2

x1≥ 0
Non-negativity constraints

xn≥ 0

Example 1: Write LP

Labor from Labor from


Types Profit ($/unit)
Adam (hour) Bob (hour)
Surgical 1 2 5
Cloth 2 3 2

Adam is available for at most 12 hours of production. Bob is available


for at most 15 hours of production.

6
Solution and Optimal Objective
Value
• A set of values for x1,…, xn is called
– A feasible solution if it satisfies all the constraints (including non-
negativity)
– An optimal solution if it satisfies all the constraints (including non-
negativity) AND gives the best value of the objective value z

• The best value of z is called the optimal objective value z*.

• Goal: find an optimal solution and the optimal objective value

• Remark: There could be


– One unique optimal solution
– An infinite number of optimal solutions
– No optimal solution

Example 1:

• Could they produce 3 units of surgical and 1 unit


of cloth?

Max z = 1 x1 + 2 x2
s.t. 2 x1 + 3 x2 ≤ 12
5 x1 + 2 x2 ≤ 15
x1 ≥ 0
x2 ≥ 0

7
Quiz

• Could they produce 1 unit of surgical and 3 units


of cloth, i.e., is this a feasible solution?
A. Yes
B. No
C. It depends
Max z = 1 x1 + 2 x2
s.t. 2 x1 + 3 x2 ≤ 12
5 x1 + 2 x2 ≤ 15
x1 ≥ 0
x2 ≥ 0

Quiz

• What is the profit if they produce 1 unit of


surgical and 3 units of cloth?
A. $7
B. $11
C. $8
D. $5 Max z = 1 x1 + 2 x2
s.t. 2 x1 + 3 x2 ≤ 12
5 x1 + 2 x2 ≤ 15
x1 ≥ 0
x2 ≥ 0

8
Assumptions for LP

• In an LP problem, it is assumed that the decision


variables can take any positive real number
value, i.e., not just integer values
– They can produce, say, 2.5 units of surgical masks
• In some problems, non-integer solutions do not
really make sense…
– Example: What does it mean to produce 2.5 tables and
1/3 of a desk?
• If we wanted to restrict the set of solutions to
integer-valued ones, it would become an integer
programming (IP).

Example 1 (cont’d)

• The finance department insists that working


capital constraints must be factored into the
calculations. The CFO specifies that making a
unit of surgical mask locks up $2 of working
capital whereas making a unit of cloth mask
requires $4 of working capital. The available
working capital is $24.
• What changes now?

9
Quiz

• With the new constraint, what can we say about


the new optimal objective value z*?
A. It is still 8
B. It is greater than 8
C. It is lower than 8
Max z = 1 x1 + 2 x2
s.t. 2 x1 + 3 x2 ≤ 12
5 x1 + 2 x2 ≤ 15
2 x1 + 4 x2 ≤ 24
x1 ≥ 0
x2 ≥ 0

Example 1 (cont’d)

• The marketing department insists that, to


maintain market presence, at least 3 units of
surgical mask must be made for every 1 unit of
cloth mask made.
• What changes now?

10
Adding Constraints

• In general, when new constraints are added to a


maximization LP, what happens to the optimal
objective value z*?

• Similarly, if new constraints are added to a


minimization LP, what happens to the optimal
objective value z*?

Example 2

• A vaccine manufacturing business has two plants and three


warehouses. The vaccine is made in the plants and sold from the
warehouses. The two plants are in TX and CA. The TX plant can
make at most 100 doses of vaccine in a month. The CA plant can
make up to 200 doses of vaccine in a month. The sale potential at
the first warehouse is 150 per month, at the second warehouse is
200 and the third 350. The sales revenue per dose are: $12, $14
and $15 at the three warehouses. The cost of shipping from each
plant to each warehouses shown below.
Cost ($) To warehouse
From Plant Warehouse 1 Warehouse 2 Warehouse 3
TX 8 10 12
CA 6 9 13

Determine how much to make and ship to each of the warehouses


from the two plants.

11
Example 2

• This type of problem has a name, it is called a


Transportation problem.
Max demand
Max production
8 Warehouse 1 150
6 $12
100 TX Plant
10
9 Warehouse 2 200
$14
200 CA Plant
12

13 Warehouse 3 350
$15

Quiz

• How many decision variables will we have?


A. 3
B. 5
C. 6
D. Another number Max demand
Max production
8 Warehouse 1 150
6 $12
100 TX Plant
10
9 Warehouse 2 200
$14
200 CA Plant
12

13 Warehouse 3 350
$15

12
Example 2: Decision Variables

Example 2: Objective Function


Cost ($) To warehouse
From Plant Warehouse 1 Warehouse 2 Warehouse 3
TX 8 10 12
CA 6 9 13
Revenue 12 14 15

• Profit related to xij is:


Profit ($) To warehouse
From Plant Warehouse 1 Warehouse 2 Warehouse 3
TX 4 4 3
CA 6 5 2

• So the objective function is:

13
Quiz

• How many constraints will we have (excluding


the non-negativity constraints)?
A. 3
B. 5
C. 6
Max demand
D. Another number
8 Warehouse 1 150
Max production
6 $12
100 TX Plant
10
9 Warehouse 2 200
$14
200 CA Plant
12

13 Warehouse 3 350
$15

Example 2: Constraints

Max demand
8 Warehouse 1 150
Max production
6 $12
100 TX Plant
10
9 Warehouse 2 200
$14
200 CA Plant
12

13 Warehouse 3 350
$15

14
Example 2: Write LP

Learning Objectives: Class 7

• How to Formulate an LP
– Identify decision variable
– Objective and constraints
– Optimal / feasible solution
• How to Solve an LP
– Isoprofit line
– Excel Solver
• Optional Reading
– Topaloglu Chapters 1-2

15
Solve the LP

• Methods to solve an LP

– If there are at most two variables


• Can be solved graphically

– Otherwise
• Simplex method (not in this course)
• Use Microsoft Excel solver

Example 1
1. Draw Graph

x2 Max z = 1 x1 + 2 x2
s.t. 2 x1 + 3 x2 ≤ 12
5 x1 + 2 x2 ≤ 15
x1 ≥ 0
x2 ≥ 0

x1

16
2. Draw Constraints

• Represent each equation by a line on the graph

x2
Max z = 1 x1 + 2 x2
s.t. 2 x1 + 3 x2 ≤ 12
5 x1 + 2 x2 ≤ 15
x1 ≥ 0
x2 ≥ 0

x1

Geometry Review: Drawing a Line

• We want to draw a line to represent the equation


a x1 + b x2 = c
• So you connect the two following two points:
! !
0, " and #
,0

• Check which side of the line is feasible by


checking the feasibility of (0,0)

17
Example 1
2. Draw Constraints

x2 D1
2 x1 + 3 x2 = 12
N1
5 x1 + 2 x2 = 15 D2
7.5
x1 = 0 N1
x2 = 0 N2
D2

D1
N2

3 x1
6

3. Identify Feasible Region

• For each constraint, indicate the direction


corresponding to the inequality sign on the
graph
• Find the area (if any) where to all the arrows are
pointing
• This is the area of feasible solutions or feasible
region
– It could be a closed area or an infinite area
• All the points in this area satisfy all the
constraints

18
Example 1
3. Identify Feasible Region

x2
N1
7.5
2 x1 + 3 x2 ≤ 12 D1
5 x1 + 2 x2 ≤ 15 D2
x1 ≥ 0 N1
D2 x2 ≥ 0 N2

Feasible region

D1
N2

3 6 x1

Quiz

• What happens when you add a new constraint to


the an LP problem
A. The feasible region gets bigger or stays the same
B. The feasible region gets smaller or stays the same
C. The feasible region always stays the same
D. Anything can happen

19
The Isoprofit Lines
Max z = 1 x1 + 2 x2
s.t. 2 x1 + 3 x2 ≤ 12
x2 5 x1 + 2 x2 ≤ 15
N1 x1 ≥ 0
x2 ≥ 0

• For any value of z, the values of x1


D2 and x2 to achieve z form a line
• Example: in order to achieve z=2, we
need to have 1 x1 + 2 x2 = 2
Slope -1/2 • For different values of z, these lines
are parallel
• On any one of these lines, the profit
is identical
D1
z=6 N2
z=2
x1

Find Optimal Solution


Max z = 1 x1 + 2 x2
x2 s.t. 2 x1 + 3 x2 ≤ 12
5 x1 + 2 x2 ≤ 15
x1 ≥ 0
x2 ≥ 0
• Start with isoprofit line with zero
profit
• Shift up (down) for maximization
(minimization) problems
• Stop when the isoprofit line
passes through the feasible region
the last time
z=8
z=2
z=0 x1

20
Binding Constraints

• At an optimal solution, we say that a constraint is


– Binding if it is satisfied as an equality
– Non-binding otherwise
• Graphically, binding constraints are those that
touch the optimal corner point.
• The slack of a constraint is the absolute
difference between its right-hand side and the
left-hand side evaluated at an optimal solution
– It is either zero or a strictly positive number

Example – Binding Constraints


Example 1
• The optimal solution is Max z = 1 x1 + 2 x2
x1 = 0, x2 =4 s.t. 2 x1 + 3 x2 ≤ 12 D1
5 x1 + 2 x2 ≤ 15 D2
x1 ≥ 0 N1
x2 ≥ 0 N2

=,≤ Right
Constraint Left hand side Binding? Slack
,≥ hand side
D1
D2
N1
N2

21
Example 1
Binding Constraints

• Graphically, binding
x2 constraints are those
N1
that touch the optimal
solution.
D2

Bottleneck!

D1
z=8 N2
x1

What if Objective Function


Changes?

Suppose the selling price of cloth is $1 instead of $2

Max z = 1 x1 + 1 x2
s.t. 2 x1 + 3 x2 ≤ 12 D1
5 x1 + 2 x2 ≤ 15 D2
x1 ≥ 0 N1
x2 ≥ 0 N2

What should we do?

22
Example 1
The New Isoprofit Lines
Max z = 1 x1 + 1 x2
s.t. 2 x1 + 3 x2 ≤ 12
x2
N1
5 x1 + 2 x2 ≤ 15
x1 ≥ 0
x2 ≥ 0
• The feasible region does not
D2 change since the constraints are
the same
• The slope of the isoprofit line
(21/11, 30/11) changes
• The optimal solution changes
• Bottleneck changes!
D1
z=8 N2
x1

What if Objective Function


Changes?

Suppose the selling prices are $2 for surgical and $2


for cloth
Max z = 2 x1 + 2 x2
s.t. 2 x1 + 3 x2 ≤ 12 D1
5 x1 + 2 x2 ≤ 15 D2
x1 ≥ 0 N1
x2 ≥ 0 N2

What should we do?

23
Quiz

• What happens if the selling price are $2 for


surgical and $2 for cloth (instead of $1 and $1)?
A. The feasible region changes but the optimal solution is the same
B. The feasible region and the optimal solution change
C. The feasible region is the same but the optimal solution changes
D. The feasible region and the optimal solution are the same

Max z = 1 x1 + 1 x2 Max z = 2 x1 + 2 x2
s.t. 2 x1 + 3 x2 ≤ 12 s.t. 2 x1 + 3 x2 ≤ 12
5 x1 + 2 x2 ≤ 15 5 x1 + 2 x2 ≤ 15
x1 ≥ 0 x1 ≥ 0
x2 ≥ 0 x2 ≥ 0

What if Objective Function


Changes?
Suppose the selling prices are $4 for surgical and $6
for cloth
Max z = 4 x1 + 6 x2
s.t. 2 x1 + 3 x2 ≤ 12 D1
5 x1 + 2 x2 ≤ 15 D2
x1 ≥ 0 N1
x2 ≥ 0 N2

What should we do?

24
The New Isoprofit Lines

Max z = 4 x1 + 6 x2
x2
N1
s.t. 2 x1 + 3 x2 ≤ 12
5 x1 + 2 x2 ≤ 15
x1 ≥ 0
x2 ≥ 0
D2

D1

N2 x1

Learning Objectives: Class 7

• How to Formulate an LP
– Identify decision variable
– Objective and constraints
– Optimal / feasible solution
• How to Solve an LP
– Isoprofit line
– Excel Solver
• Optional Reading
– Topaloglu Chapters 1-2

25
Step 0: Install the Solver

Step 1: Set up Spreadsheet

Objective function = X1+2X2=


B10*B11 + C10*C11=
sumproduct(B10:C10,B11:C11)

Place for X1
Place for X2

2X1+3X2=SUMPRODUCT(B10:C10,B14:C14)

Enter formulae for objective function and constraints.

26
Step 2: Set up Excel Solver

Maximizing profit

Decisions

Constraints:
How do I add constraints?
Click Add

Step 2: Set up Excel Solver

The amount of Adam’s labor used is “≤” the amount available

27
Step 3: Select Options and Solve

Choose “Simplex LP”


Can tick “Make Unconstrained..
Click “Solve”

Excel also produces three reports (Answer, Sensitivity, Limits) to help you
understand the tradeoffs between decisions and your objective values.

The optimal solution:


X1*: 0 (surgical)
X2*: 4 (cloth)
Profit: 8

28
Answer Report – notice
that optimal solution uses
all Adam’s labor

Learning Objectives: Class 7

• How to Formulate an LP
– Identify decision variable
– Objective and constraints
– Optimal / feasible solution
• How to Solve an LP
– Isoprofit line
– Excel Solver
• Optional Reading
– Topaloglu Chapters 1-2

29
After-Class Activities

• Homework
– Complete homework 7 and submit it to eLearning
by 11:59 pm on Apr 1.

• Next Class Topic


– Healthcare Analytics

• Optional Reading
– McLaughlin and Olson Chapter 7

59

30

You might also like