Lecture 4 &5 Linear Programming Graphical Solution
Download
Report
Transcript Lecture 4 &5 Linear Programming Graphical Solution
QMB 4701
MANAGERIAL OPERATIONS
ANALYSIS
Chapter 3
Linear Programming: Graphical Solution
Procedure & Spreadsheet Solution Procedure
Jay Marshall Teets
Decision and Information Sciences
University of Florida
Agenda
• Graphical linear programming
– Example: Par, Inc. Problem
– Graphical solution procedure
– Example: Dorian problem
• Additional considerations
–
–
–
–
Degeneracy
Inconsistent problem
Multiple optimal solutions
Unbounded problem
• Spreadsheet solution basics
Example: Par, Inc. Problem
Par, Inc:
Manufacturer of golf supplies
New products: Standard golf bags and Deluxe golf bags
Manufacturing operations:
Cutting & Dyeing
Sewing
Finishing
Inspection & Packaging
Production Time (Hrs)
Standard Bag
Deluxe Bag
Cutting &
Dyeing
Sewing
Finishing
Inspection
& Packaging
Profit
Contribution ($)
Objective: Maximize total profit
Resource
Constraints (Hrs)
7/10
1/2
1
1
5/6
2/3
630
600
708
1/10
1/4
135
10
9
Par Inc. Model Formulation
1. What is the objective in words?
Maximize the total profit
2. What are the constraints in words?
Cutting & Dyeing
Cutting & Dyeing
Hours Allocated Hours Available
Sewing Hours Allocated Sewing Hours Available
Inspection & Packaging
Inspection & Packaging
Hours Allocated
Hours Available
Finishing Hours Allocated Finishing Hours Available
Par Inc. Model Formulation
3. What are the decision variables?
x1 = Number of Standards Produced
x2 = Number of Deluxes Produced
4. Formulate the objective function:
Profit Contribution
Maximize 10 x1 + 9 x2
5. Formulate the constraints:
Subject to:
Cutting & Dyeing:
Sewing
Finishing
Inspection & Packaging
7/10 x1
1/2 x1
x1
1/10 x1
+
x2 630
+ 5/6 x2 600
+ 2/3 x2 708
+ 1/4 x2 135
6. Do we need non-negative constraints?
Logic
x1 0 ,
x2 0
How to Solve It?
Trial and Error?
Profit Contribution
Subject to:
Cutting & Dyeing:
Sewing
Finishing
Inspection & Packaging
Logic
Maximize 10 x1 + 9 x2
7/10 x1
1/2 x1
x1
1/10 x1
x1 0 ,
x1 = 600,
x2 = 100?
Profit = 6900
x1 = 700,
x2 = 100?
Profit =7900
520
383.33
666.67
85
590
433.33
766.67
95
+
x2 630
+ 5/6 x2 600
+ 2/3 x2 708
+ 1/4 x2 135
Feasible
Solution
x2 0
x2
1200
1000
800
600
400
200
200
400
600
800
1000
1200
x1
1400
Infeasible
Solution
Graphical Approach
Solution: any production plan
Solutions
Feasible solutions
A. Determine feasible region
(draw constraint lines)
Feasible solution:
solution that satisfies all constraints
B. Construct isoprofit lines
Optimal solutions
C. Locate the optimal solution
Optimal solution:
feasible solution that achieves
the maximal objective value
Constraints Determine Feasible Region
Approach:
1. Draw lines representing the constraints solved as equalities
2. Show the direction of feasibility
3. The feasible region is the set of values which simultaneously satisfies all the constraints
x2
Cutting & Dyeing
Sewing
Finishing
Inspection & Packaging
1200
1000
7/10 x1
1/2 x1
x1
1/10 x1
x1 0,
800
600
400
200
x1
200
400
600
800
1000
1200
1400
+
x2 630
+ 5/6 x2 600
+ 2/3 x2 708
+ 1/4 x2 135
x2 0,
A. Constraints Determine Feasible
Region
x2
x2
Cutting & Dyeing
1200
1000
1000
800
800
600
600
400
400
200
200
200
400
x2
600
800
1000
1200
1400
x1
Finishing
1200
Sewing
1200
200
400
600
800
1000
1200
1400
x1
Inspection
& Packaging
x2
1200
1000
1000
800
800
600
600
400
400
200
200
200
400
600
800
1000
1200
1400
x1
200
400
600
800 1000 1200 1400
x1
A. Constraints Determine Feasible
Region
x2
Feasible Region
1200
1000
Redundant
constraint
800
600
400
200
200
400
600
800
1000
1200
1400
x1
x2
1200
1000
800
600
400
200
Feasible
200
Region
400
600
800
1000
1200
x1
1400
Construct Isoprofit Lines
Approach:
1. Select a constant C
2. Draw the “profit line” 10 x1 + 9 x2 = C
3. Construct parallel profit lines
x2
Isoprofit
Lines
1200
1000
Slope of the objective function:
x2= -10/9 x1+C/9
800
9000
600
400
4500
200
x1
200
400
600
800
1000
1200
1400
Locate The Optimal Solution Observations
Observations:
1. The optimal solution cannot fall in the interior of the feasible region
2. The optimal solution must occur at a “corner point” of the feasible region
3. In searching for the optimal solution we only have to examine the corner points
x2
1200
1000
800
600
Optimal Solution
400
200
4500
x1
200
400
600
800
1000
1200
1400
Locate The Optimal Solution
Find extreme points (corner points) and calculate objective values
Extreme Points: the vertices or “corner points” of the feasible region.
With two variables, extreme points are determined by the intersection
of the constraint lines.
x2
Point
1
2
3
4
Constraint
Non-negative
Non-negative
Cutting & Dyeing
Cutting & Dyeing
5
Non-negative
1200
Constraint
Non-negative
Finishing
Finishing
Inspection
& Packaging
Inspection
& Packaging
1000
800
600
5
I &P
4
400
C&D
3
200
F
200
1
400
600
800
2
1000
1200
1400
x1
x1
0
708
540
300
x2
0
0
252
420
Obj.
0
77080
7668
6780
0
540
4860
Locate The Optimal Solution - Find Extreme
Points
Example: Find extreme point #3:
Intersection of the cutting & dyeing constraint and the finishing constraint:
Cutting & Dyeing: 7/10 x1
Finishing
x1
+
+
x2
2/3 x2
=
=
630
708
Solve the two equations for x1 and x2:
7/10 x1 + x2 = 630 7/10 x1 = 630 x2 x1 =
x1 + 2/3 x2 =
708
900 10/7 x2
(900 10/7 x2) +2/3 x2 = 708
900 - 30/21 x2 + 14/21 x2 = 708 16/21 x2 = 192 x2 = 21/16 192 =
252
x1 =
900 -
10/7 x2 x1 =
900 10/7 (252) x1 =
900 360
= 540
Slack and Binding Constraints
x2
1200
1000
Slack constraint
800
600
I &P
Binding constraints
C&D
400
200
F
200
400
600
800
1000
1200
1400
x1
At optimal solution (540, 252)
Hrs used
Hrs available
Binding
C&D:
630
=
630
Slack = 600 480 = 120
S:
480
<
600
Binding
F:
708
=
708
Slack = 135 117 = 18
I&P:
117
<
135
Summary of Graphical Approach
A. Graph Feasible Region
– Draw each constraint line
• For each constraint, plot points on the x1 axis (x2=0) and x2 axis
(x2=0) and connect the points with a line.
– Indicate the feasible area with arrow
• Check if (0,0) is include, if so, draw arrow towards (0,0). If
not, draw arrow away from (0,0). If (0,0) is on the constraint
line, you must choose another point to use as a check
– Hatch the area in common for all constraints and their respective
arrows
B. Find Extreme Points
– Set the intersecting constraints equal to one another - basic algebra
Summary of Graphical Approach
C. Find optimal solution
Option #1
– List all the extreme points and calculate objective function values
for each extreme point.
– Choose the point with the highest (profit) or lowest (cost) value
Option #2
– Find the slope of the objective function
– Choose which extreme point is last touched by the isoprofit/isocost
line as it is increased/decreased. This point is the optimal point
– Calculate the objective value for the optimal point.
Note: Simplex Method
1. Start with a feasible corner point solution
2. Check to see if a feasible neighboring corner
x2 point is better
1200
3. If not, stop; otherwise move to that better neighbor
and return to step 2.
1000
800
600
400
200
200
400
600
800
1000
1200
1400
x1
Graphing Example: Minimization
Problem
Dorian Problem
MIN 50,000 x1 + 100,000 x2
ST
HIW:
7x1 + 2 x2 28
HIM:
2x1 + 12 x2 24
x1 0, x2 0
Extreme Points
x2
16
14
0,14
12
10
8
HIW
6
4
2
3.6,1.4
2
4
6
HIM
8
12,0
10
12
x1
1
2
3
14
x1
16
x2
0
3.6
12
14
1.4
0
OBJ
1400
320
600
Additional Consideration: Degeneracy
Degeneracy: Assume Inspection & Packaging time is 117 hours (instead of 135)
x2
Feasible Region
1200
Profit Contribution
Maximize 10 x1 + 9 x2
ST
Cutting & Dyeing:
7/10 x1 +
x2 630
Sewing
1/2 x1 + 5/6 x2 600
Finishing
x1 + 2/3 x2 708
Inspection & Packaging 1/10 x1 + 1/4 x2 117
Logic
x 1 0 , x2 0
1000
800
600
400
200
200
400
600
800
1000
1200
1400
x1
Additional Consideration: Inconsistent
Problem
Assume there is an additional constraint: need to produce at least 725 standard bags,
i.e., x1 725
x2
Profit Contribution
Maximize 10 x1 + 9 x2
ST
Cutting & Dyeing:
7/10 x1 +
x2 630
Sewing
1/2 x1 + 5/6 x2 600
Finishing
x1 + 2/3 x2 708
Inspection & Packaging 1/10 x1 + 1/4 x2 135
x1
725
Logic
x1 0 , x2 0
Feasible Region
1200
1000
800
600
400
200
200
400
600
800
1000
1200
1400
x1
Additional Consideration: Multiple Optimal
Solutions
Assume the objective function is 12 x1 + 8 x2
(instead of 10 x1 + 9 x2)
Profit Contribution
Maximize 12 x1 + 8 x2
ST
Cutting & Dyeing:
7/10 x1 +
x2 630
Sewing
1/2 x1 + 5/6 x2 600
Finishing
x1 + 2/3 x2 708
Inspection & Packaging 1/10 x1 + 1/4 x2 135
Logic
x1 0 , x2 0
x2
1200
1000
800
Slope of the new objective function:
x2 =-12/8 x1 +C/8
= =-3/2 x1 +C/8
600
400
200
200
400
600
800
1000
1200
x1
1400
Additional Consideration: Unbounded
Problem
Assume we have the following problem:
Profit Contribution
ST
Demand:
Maximize 10 x1 + 9 x2
x1 + x2 1000
x1
725
x1 0 , x2 0
Logic
x2
1200
1000
800
600
400
200
200
400
600
800
1000
1200
x1
1400
Excel Solver Solution Procedure
• Excel can do the following:
– Solve linear programs
Note: Activate the “Assume Linear Model”
option if your problem is a LINEAR program,
otherwise the Solver will treat it as a
NONLINEAR program.
– Solve nonlinear programs
– Solve integer programs
– Perform sensitivity analysis
Implementing an LP Model in a Spreadsheet
• Organize the data for the model on the spreadsheet
including:
– Objective Coefficients
– Constraint Coefficients
– Right-Hand-Side (RHS) values
• clearly label data and information
• visualize a logical layout
• row and column structures of the data are a good
start
Implementing an LP Model in a Spreadsheet
• Reserve separate cells to represent each decision variable
– arrange them such that the structure parallels the input
data
– keep them together in the same place
– Right-Hand-Side (RHS) values
• Create a formula in a cell that corresponds to the Objective
Function
• For each constraint, create a formula that corresponds to
the left-hand-side (LHS) of the constraint
• NOTE: Once you’ve formulated a spreadsheet model for a
certain type of application, it’s useful to save it as a
template for future use!
Solver Terminology
• Target cell
– Represents the objective function
– Must indicate max or min
• Changing cells
– Represents the decision variables
• Constraint cells
– the cells in the spreadsheet that represent the LHS formulas of the
constraints in the model
– the cells in the spreadsheet that represent the RHS values of the
constraints in the model
– TIP: If you scale the constraints such that they are all "" or all
"", then it's easier to input the constraints as a block. Then, you
avoid having to enter each constraint as a separate line.
Solver Example: Par, Inc. Model
A
B
C
D
Production Time (hrs/unit)
Operation
Standard Bag Deluxe Bag Hrs Used
Cutting & Dyeing
0.7
1
0
Sewing
0.5 0.83333333
0
Finishing
1 0.66666667
0
Inspection & Packaging
0.1
0.25
0
1
2
3
4
5
6
7
8
9 Profit per Unit
10
11 No. of Units Produced
A
1
2
3
4
5
6
7
8
9
10
11
Operation
Cutting & Dyeing
Sewing
Finishing
Inspection & Packaging
E
F
Hrs Available
630
600
708
135
<=
<=
<=
<=
Total Profit
10
9
0
0
B
C
Production Time (hrs/unit)
Standard Bag Deluxe Bag
0.7
1
0.5
=5/6
1
=2/3
0.1
0.25
Profit per Unit
10
9
No. of Units Produced
0
0
0
D
Hrs Used
=B3*$B$11+C3*$C$11
=B4*$B$11+C4*$C$11
=B5*$B$11+C5*$C$11
=B6*$B$11+C6*$C$11
E
<=
<=
<=
<=
F
Hrs Available
630
600
708
135
Total Profit
=B9*B11+C9*C11
Par, Inc. Model - Answer Report
Worksheet: [LP.xls]Par
Report Created: 1/27/00 11:09:15 PM
Target Cell (Max)
Cell
Name
$F$9 Profit per Unit Total Profit
Solver Parameters: Objective: MAX F9
Variables: B11:C11
Constraints: D3:D6 <= F3:F6
Options: Assume Linear Model
Original Value Final Value
Assume Non-Negative
0
7668
Optimal objective value
Adjustable Cells
Cell
Name
Original Value Final Value
$B$11 No. of Untis Produced Standard Bag
0
540
$C$11 No. of Untis Produced Deluxe Bag
0
252
Constraints
Cell
Name
$D$3 Cutting & Dyeing Hrs Used
$D$4 Sewing Hrs Used
$D$5 Finishing Hrs Used
$D$6 Inspection & Packaging Hrs Used
Cell Value
630
480
708
117
Formula
$D$3<=$F$3
$D$4<=$F$4
$D$5<=$F$5
$D$6<=$F$6
Optimal solution
Status Slack
Binding
0
Not Binding
120
Binding
0
Not Binding
18
Constraints Binding
& Slack
Information
Summary of Excel Solver Procedure
LHS
Constraints
Left Hand Side Coefficients
Coefficients of Decision Variables
Decision Variables
Inequality
=
Formulas >=
<=
RHS
Right Hand Side
Coefficients
Objective Function
Solver Example: Minimization Example
Dorian Problem
MIN 50,000 x1 + 100,000 x2
ST
7x1 + 2 x2 28
2x1 + 12 x2 24
x1 0, x2 0
A
B
C
D
E
F
Population (M) reached by Ads
Comedy Ads
Football Ads
LHS
Requirement
High-income women
7
2
0 >=
28
High-income men
2
12
0 >=
24
1
2
3
4
5
6
7 Cost per minute($M)
8
9 # of Ads paid
Total Cost
50
100
0
0
0
Solver Example: Minimization Example
A
B
C
D
E
Population (M) reached by Ads
Commedy Ads Football Ads LHS
Requirement
High-income women 7
2
=SUMPRODUCT(B3:C3,$B$9:$C$9) >= 28
High-income men
2
12
=SUMPRODUCT(B4:C4,$B$9:$C$9) >= 24
1
2
3
4
5
6
7 Cost per minute($M)
8
9 # of Ads paid
50
100
0
0
F
Total Cost
=SUMPRODUCT(B7:C7,B9:C9)
Summary of Additional Considerations
ADDITIONAL
CONSIDERATIONS
GRAPHICAL
EXCEL
SOLVER
MANAGERIAL
IMPLICATION
Degeneracy
More than two
constraint lines
intersect at one
point
Inconsistent Problem
Feasible region
does not exist
Could not find a
feasible solution
Too many restrictions
Multiple Optimal
Solutions
Slope of
objective
function is same
as that of one
constraint
Output shows
only a single
optimal solution
Unbounded Problem
Optimal value is
infinite
The set of cell
values do not
converge
Problem is improperly
formulated
Summary
• Graphical solution procedure
–
–
–
–
Feasible region
Extreme points
Optimal solution
Binding and Slack Constraints
• Additional considerations
–
–
–
–
Degeneracy
Inconsistent problem
Multiple optimal solutions
Unbounded problem
• Spreadsheet solution basics