IMB425 Chapter 2
IMB425 Chapter 2
Operations Research
Michael Mutingi
[email protected]
Office: 248-182
Chapter 2
Linear Programming: Basics
1
Overview
• Background
• Linear Programming (LP) Situations
• Prototype Example
• LP Modelling
• LP Standard Form
• Graphical Solution Method
• Excel Solver Solution Approach
2
Background
• linear programming is among the most significant advances in
the 90s
– Production scheduling
– Employee scheduling, e.g., scheduling of healthcare staff in hospitals
– Selection of shipping patterns or routes
– Portfolio selection
– allocation of national resources to domestic needs
– Agricultural planning
– allocation of production facilities to products
4
Linear Programming Preliminaries
• Linear Programming uses mathematical models
5
Prototype Example: Wyndor Glass Co.
Product Mix Problem
• Wyndor has developed the following new products:
– An 8-foot glass door with aluminum framing.
– A 4 x 6-foot double-hung, wood-framed window.
Questions:
1. Should they go ahead with launching these two new products?
2. If so, what should be the product mix?
6
Prototype Example: Wyndor Glass Co.
Product Mix Problem
• Which mix of the two products would be most profitable.
Product mix problem
7
Prototype Example: Wyndor Glass Co.
Product Mix Problem
• Summary of data gathered.
Resource limits
8
Linear Programming Formulation
• Objective: Maximize profit
– Let
Z = profit per week ($000) from producing these two products
• Decision variables
– Let
x1 = number of batches of product 1 produced per week
x2 = number of batches of product 2 produced per week
• Restraints (Constraints)
– Production capacity constraints
– Non-negativity constraints
9
Linear Programming Formulation
Production Time per
Batch, Hours
Product
Production Time
Plant 1 2 Available per Week, Hours
1 1 0 4
2 0 2 12
3 3 2 18
Profit per batch $3,000 $5,000
• xj → decision variables
• cj, bi , and aij → input constants or parameters
12
The LP Standard Form
Maximize Z = c1x1 + c2x2 +…+ cnxn
Subject to Constraints
a11x1 + a12x1 +… + a1nxn ≤ b1
a21x1 + a22x1 +… + a2nxn ≤ b2
..
.
am1x1 + a2x1 +… + amnxn ≤ bm
and x1 ≥ 0, x2 ≥ 0, . . . , xn ≥ 0.
Resource Usage per Unit of Activity Amount of
Resource Available
Activity
Resource 1 2 … n
1 a11 a12 … a1n b1
2 a21 a22 … a2n b2
. .
. .
. … … … … .
3 am1 am2 … amn bm
Contribution to Z c1 c2 … cn 13
per unit of activity
Graphical Solution Method: Product Mix
W
6 (4, 6)
Graph shows the points
5 (D, W) = (2, 3) and (D,
W) = (4, 6) for the
4 A p roduct mix of
D = 2 and W = 3
Wyndor Glass Co.
product-mix problem.
3 (2, 3)
1
Origin
-2 -1 0 1 2 3 4 5 6 7 8 D
Production rate (units p er week) for doors
-1
14
-2
Graph Showing Constraints: D ≥ 0 and W ≥ 0
W
Graph showing
that the constraints
D ≥ 0 and W ≥ 0
6
Production rate for windows
0 2 4 6 8 D 15
Production rate for doors
Nonnegative Solutions Permitted by D ≤ 4
W
D=4
6
Production rate for windows
0 2 4 6 8 D16
Production rate for doors
Nonnegative
ate for windows
Solutions Permitted by 2W ≤ 12
W
2 W = 12
Production rate for windows
4
Graph showing that the nonnegative solutions
permitted by the constraint 2W ≤ 12 must lie
between the horizontal axis and the constraint
boundary line whose equation is 2W = 12.
2
0 2 4 6 8 17D
Production rate for doors
Boundary Line for Constraint 3D + 2W ≤ 18
Production rate for windows
W
10
2
1
(5, 1 _ )
2
(6, 0)
0 2 4 6 8 D 18
Production rateforfordoors
Production rate doors
Changing Right-Hand Side Creates
n rate for windows
Parallel Constraint Boundary Lines
W
12
6
boundary lines.
3D + 2W = 18
4
2 3D + 2W = 12
0 2 4 6 8 10 D
19
Production
Production rate for doors
rate for doors
Nonnegative Solutions Permitted by
3D + 2W ≤ 18
Production rate for windows
W
10
Graph showing that nonnegative
solutions permitted by the
Production rate for windows
20 D
0 2 4 6 8
Production
Productionrate
ratefor
fordoors
doors
Production rate for windows Graph of Feasible Region
W
10 Graph showing how the feasible region is
formed by the constraint boundary lines, where
6 2 W =12
Feasible
region
2
0 2 4 6 8 D
Production rate for doors 21
Production rate for doors
Objective Function (Let P = 1,500)
Production rate W
for windows
8 Graph showing the line containing
all the points (D, W) that give a
value P = 1,500 for the objective
6
function.
Feasible
4
region
P = 1500 = 300D + 500W
0 2 4 6 8 D22
Production rate for doors
Finding the Optimal Solution
Production rate W
for windows
Figure 2.7 Graph showing
8
0 2 4 6 8 1023 D
Production rate for doors
Summary of the Graphical Method
• Draw the constraint boundary line for each constraint. Use the origin
(or any point not on the line) to determine which side of the line is
permitted by the constraint.
• Find the feasible region by determining where all constraints are
satisfied simultaneously.
• Determine the slope of one objective function line. All other objective
function lines will have the same slope.
• Move a straight edge with this slope through the feasible region in the
direction of improving values of the objective function. Stop at the last
instant that the straight edge still passes through a point in the feasible
region. This line given by the straight edge is the optimal objective
function line.
• A feasible point on the optimal objective function line is an optimal
solution.
24
Solver: Identify Target & Changing Cells
B C D E F G
3 Doors Windows • Choose the “Solver”
4 Unit Profit $300 $500
5 Hours Hours from Tools menu.
6
7 Plant 1
Hours Used Per Unit Produced
1 0
Used
1 <=
Available
1
• Select the cell you
8 Plant 2 0 2 2 <= 12 wish to optimize in
9
10
Plant 3 3 2 5 <= 18 the “Set Target
11 Doors Windows Total Profit Cell” window.
12 Units Produced 1 1 $800
• Choose “Max” or
“Min” depending on
whether you are
maximizing or
minimizing.
• Enter all the
changing cells in the
“By Changing
Cells” window.
25
Solver: Adding Constraints
• To begin entering constraints, click the “Add” button to the right of the
constraints window.
• Fill in the entries in the resulting Add Constraint dialogue box.
B C D E F G
3 Doors Windows
4 Unit Profit $300 $500
5 Hours Hours
6 Hours Used Per Unit Produced Used Available
7 Plant 1 1 0 1 <= 1
8 Plant 2 0 2 2 <= 12
9 Plant 3 3 2 5 <= 18
10
11 Doors Windows Total Profit
12 Units Produced 1 1 $800
26
Solver: Complete Solver Dialogue Box
28
The Optimal Solution
Doors Windows
Unit Profit $300 $500
Hours Hours
Hours Used Per Unit Produced Used Available
Plant 1 1 0 2 <= 4
Plant 2 0 2 12 <= 12
Plant 3 3 2 18 <= 18
Solver
Results
Dialogue
Box
29
Modelling Languages
30