7 - Pre-Class Student Version
7 - Pre-Class Student Version
Class 7
Linear Programming
Review: Class 6
• 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
2
Formulating an LP
• Four steps:
– Identify decision variables
– Write out objective function
– Write out constraints
– Write the LP
3
2. Write out Objective Function
Min z = c1 x1 + … + cnxn
or
Max z = p1 x1 + … + pnxn
4
3. Write out Constraints
a1 x1 + … + an xn ≤ b
Example 1: Constraints
5
4. Write the LP
Example 1: Write LP
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
Example 1:
Max z = 1 x1 + 2 x2
s.t. 2 x1 + 3 x2 ≤ 12
5 x1 + 2 x2 ≤ 15
x1 ≥ 0
x2 ≥ 0
7
Quiz
Quiz
8
Assumptions for LP
Example 1 (cont’d)
9
Quiz
Example 1 (cont’d)
10
Adding Constraints
Example 2
11
Example 2
13 Warehouse 3 350
$15
Quiz
13 Warehouse 3 350
$15
12
Example 2: Decision Variables
13
Quiz
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
• 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
– 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
x2
Max z = 1 x1 + 2 x2
s.t. 2 x1 + 3 x2 ≤ 12
5 x1 + 2 x2 ≤ 15
x1 ≥ 0
x2 ≥ 0
x1
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
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
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
20
Binding Constraints
=,≤ 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
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
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
23
Quiz
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
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
• 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
Place for X1
Place for X2
2X1+3X2=SUMPRODUCT(B10:C10,B14:C14)
26
Step 2: Set up Excel Solver
Maximizing profit
Decisions
Constraints:
How do I add constraints?
Click Add
27
Step 3: Select Options and Solve
Excel also produces three reports (Answer, Sensitivity, Limits) to help you
understand the tradeoffs between decisions and your objective values.
28
Answer Report – notice
that optimal solution uses
all Adam’s labor
• 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.
• Optional Reading
– McLaughlin and Olson Chapter 7
59
30