Lecture 4 - Computer Application to LP (2020)
Lecture 4 - Computer Application to LP (2020)
1
Example: Olympic Bike Co.
2
Example: Olympic Bike Co.
Model Formulation
• Verbal Statement of the Objective Function
Maximize total weekly profit.
x1, x2 > 0
3
Solved by POM Software
Step 1
Step 2
- Choose Linear Programming
Module
4
Solved by POM Software
Step 3
- Type the title of the problem, number of constraints and variables
- Choose type of objective function
- Choose format of the constraints’ name
Step 4
- Input the formulation to the POM Software
Max 10x1 + 15x2 (Total Weekly Profit)
s.t. 2x1 + 4x2 < 100 (Aluminum Available)
3x1 + 2x2 < 80 (Steel Available)
x1, x2 > 0
10
5
Solved by POM Software
Step 5
- Solve the formulation by clicking Solve Button
11
Step 6
- Interpret the result
12
6
Solved by POM Software
Step 7
- The graph can be displayed by maximizing Graph window
13
14
7
Standard Computer Output
15
16
8
Example: Olympic Bike Co.
Computer Output (Continued)
17
18
9
Sensitivity Analysis
Sensitivity analysis (or post-optimality analysis) is used
to determine how the optimal solution is affected by
changes, within specified ranges, in:
• the objective function coefficients
• the right-hand side (RHS) values
• the constraint coefficients
19
Reduced Cost
The reduced cost for a decision variable whose value is 0
in the optimal solution is:
• the amount the variable's objective function coefficient
would have to improve (increase for maximization
problems, decrease for minimization problems) before
this variable could assume a positive value (e.g. come
into the solution).
20
10
Range of Optimality
The range of optimality of an objective function
coefficient is found by
• determining an interval for the objective function
coefficient in which the original solution (the decision
does not change and the value of the objective
function is still optimal, even if it changes) remains
optimal while keeping all other data of the problem
constant.
21
22
11
Example: Olympic Bike Co.
Range of Optimality
Answer:
The output states that the solution remains optimal as
long as the objective function coefficient of x1 is between 7.5
and 22.5. Since 20 is within this range, the optimal solution
will not change. The optimal profit will change: 20x1 + 15x2
= 20(15) + 15(17.5) = $562.50.
23
24
12
Example: Olympic Bike Co.
Range of Optimality
Answer
The output states that the solution remains optimal as
long as the objective function coefficient of x1 is between 7.5
and 22.5. Since 6 is outside this range, the optimal solution
would change.
OBJECTIVE FUNCTION RANGES
Variable Lower Limit Current Value Upper Limit
x1 7.500 10.000 22.500
x2 6.667 15.000 20.000
25
26
13
Example: Olympic Bike Co.
Range of Optimality and 100% Rule
Question:
If simultaneously
• 1) the profit on Deluxe frames was raised to $16 and
• 2) the profit on Professional frames was raised to $17,
would the current solution be optimal?
27
28
14
Shadow Price
A shadow price for a constraint’s right-hand side value is
the amount the objective function value will change per
unit increase in the right-hand side value of the
constraint.
A shadow price reflects the value of an additional unit of
the resource if the resource cost is sunk.
A shadow price reflects the extra value over the normal
cost of the resource when the resource cost is relevant.
The shadow price for a non-binding constraint (one in
which there is positive slack or surplus when evaluated
at the optimal solution) is 0.
29
Dual Price
A dual price for a right-hand side (or resource limit) is the
amount the objective function will improve per unit
increase in the right-hand side value of a constraint.
30
15
Range of Feasibility
31
32
16
Example: Olympic Bike Co.
Range of Feasibility and Sunk Costs
Question
33
34
17
Example: Olympic Bike Co.
Range of Feasibility and Sunk Costs
Answer
Since the cost for aluminum is a sunk cost, the shadow
price provides the value of extra aluminum.
35
Question
36
18
Example: Olympic Bike Co.
Range of Feasibility and Relevant Costs
Answer
37
Step 1
38
19
Solved by LINDO Software
39
Step 3
- Solve the formulation by clicking Solve Button
40
20
Solved by LINDO Software
Step 4
- Interpret the result
41
42
21
Modifying to Integer Problem
43
44
22
Modifying to Integer Problem
Optimal Solution for Modifying Problem
According to the output:
x1 (Deluxe frames) = 14,
Make sense RESULT
Although it has
decreasing objective
function
Z=410
x2 (Professional frames) = 18, and
45
Example 2
Consider the following linear program:
x1, x2 > 0
46
23
Example 2
Computer Output:
OBJECTIVE FUNCTION VALUE = …….
47
Example 2
Computer Output (Continued):
OBJECTIVE COEFFICIENT RANGES
Variable Lower Limit Current Value Upper Limit
x1 ……. ……. ……..
x2 ……. ……. No Upper Limit
48
24
Example 2
Optimal Solution
• x1 = …….. and
• x2 = …….., and
• the objective function value = ………..
49
Example 2
Range of Optimality
Question
50
25
Example 2
Range of Optimality
Answer
The output states that the solution remains optimal as
long as the objective function coefficient of x1 is between
…… and ……..
51
Example 2
Range of Optimality
Question
How much can the unit cost of x2 be decreased without
concern for the optimal solution changing?
Answer
The output states that the solution remains optimal as
long as the objective function coefficient of x2 does not fall
below ………...
52
26
Example 2
Range of Optimality and 100% Rule
Question
53
Example 2
Range of Optimality and 100% Rule
Answer
If c1 = 7.5, the amount c1 changed is 7.5 - 6 = 1.5. The
maximum allowable increase is 12 - 6 = 6, so this is a
……../………= ………% change.
If c2 = 6, the amount that c2 changed is 9 - 6 = 3. The
maximum allowable decrease is 9 - 4.5 = 4.5, so this is a
……../…….. = ………% change.
The sum of the change percentages is ..…% + …..% =
……..%. Since this does not exceed 100% the optimal
solution (would/would not) change.
54
27
Example 2
Range of Feasibility
Question
55
Example 2
Range of Feasibility
Answer
A dual price represents the improvement in the
objective function value per unit increase in the right-hand
side. A negative dual price indicates a deterioration
(negative improvement) in the objective, which in this
problem means an increase in total cost because we're
minimizing.
Since the right-hand side remains within the range of
feasibility, there is (change/no change) in the optimal
solution. However, the objective function value increases
by $4.50.
Compiled by Nurhadi Siswanto 56
56
28
The Effects of Degeneracy on
Range of Optimality analysis
57
58
29
Transportation, Assignment, and Transshipment
Problems
The Transportation Problem:
• The Network Model and a
• Linear Programming Formulation
59
a set of nodes,
60
30
More “Network Models”
61
Transportation, Assignment,
and Transshipment Problems
Each of these three models (transportation, assignment,
and transshipment models) can be formulated as linear
programs and solved by general purpose linear
programming codes.
62
31
Transportation Problem
63
Transportation Problem
Supply Shipping Cost Demand
c11
s1 1 1 d1
c12
c21 c13
s2 2 2 d2
c31
s3 3 3 d3
Sources Destinations
(Origins) Commodity (Sinks)
factories cement warehouses
refineries oil distribution center
groves oranges stores.
. .
Compiled by Nurhadi Siswanto 64
64
32
Transportation Problem
Problem Definition
1 D1=15
c11=6
S1=30 1 c12=2
c13=6
2 D2=18
c21=4
c22=9
S2=25 2
c23=5
3 D3=12
SOURCES DESTINATIONS
65
Step 1
-Choose Transportation
Module
66
33
Solved by POM Software
Step 2
- Type the title of the problem, number of Sources and Destinations
- Choose type of objective function
- Choose format of the name options
67
Step 3
-Input data to the POM Software
-Choose starting method
68
34
Solved by POM Software
Step 4
- Solve the formulation by clicking Solve Button
69
Step 5
- Interpret
the result
70
35
Transportation Problem: Special Situations
LP Formulation Special Cases or Situations.
Special-case modifications to the linear programming
formulation can be made, such as:
• Minimum shipping guarantees from i to j:
xij > Lij
• Maximum route capacity from i to j:
xij < Lij
• Unacceptable routes:
delete the variable
71
Min cijxij
ij
72
36
Transportation Problem Formulation
Objective Function
Min cijxij
ij
Min 6x11+2x12 +6x13 +4x21+9x22 +5x23
Subject to
xij < si for each origin i
j
x11+ x12 + x13 < 30
x21+ x22 + x23 < 25
73
74
37
Solved by LINDO
75
Solved by LINDO
76
38
Adding Special Situations
LP Formulation Special Cases or Situations.
Special-case modifications can be made, such as:
• Minimum shipping guarantees from i to j: xij > Lij
x22 > 5
77
78
39
Adding Special Situations
79
S3=10 3 3 D3=12
c44
S4=15 4 c45 4 D4=20
c54 c46
S5=28 5 5 D5=25
c64
S6=14 6 6 D6=22
Compiled by Nurhadi Siswanto 80
80
40
More Complex Transportation Problem
- Cost Data
Destination
Sources
1 2 3 4 5 6
1 6 2 6 7 4 2
2 4 9 5 3 8 5
3 5 2 1 9 7 4
4 7 6 7 3 9 2
5 2 3 9 5 7 2
6 5 5 2 2 8 1
81
The data section allows you to isolate model's data from the formulation
82
41
How to Model Using LINGO :
2 Warehouses and 3 Demands Transp. Problem
Objective Function
Min 6x11+2x12 +6x13 +4x21+9x22 +5x23
or in mathematical notation
Min cijxij
ij
83
Mathematical notation
xij < si for each origin i
j
84
42
How to model Using LINGO :
2 sources and 3 Destination Transportation Problem
•Demand Constraints
x11+ x21 = 15
x12+ x22 = 18
x13+ x23 = 12
Mathematical notation
xij = dj for each destination j
i
85
Step 1
86
43
Solved by LINGO Software
Step 2
Input data AND save to
the LINGO Software
87
Step 3
Solve the formulation
by clicking Solve Button
OR Ctrl-S
88
44
Solved by LINGO Software
Step 4
- Interpret
the result
89
S5=28 5 5 D5=25
c64
S6=14 6 6 D6=22
Compiled by Nurhadi Siswanto 90
90
45
How to Solve using LINGO : More Complex
Transportation Problem
-The model does not change
-ONLY add the data
91
92
46
Assignment Problem
An assignment problem seeks to minimize the total cost
assignment of m workers to m jobs, given that the cost of
worker i performing job j is cij.
It assumes all workers are assigned and each job is
performed.
An assignment problem is a special case of a transportation
problem in which all supplies and all demands are equal to
1; hence assignment problems may be solved as linear
programs.
The network representation of an assignment problem with
three workers and three jobs is shown on the next slide.
93
Assignment Problem
Problem Definition
C11=6
1 1
C12=2
C13=6
C21=4
C22=9
2 2
C23=5
C31=5
C32=2
3 C33=1 3
WORKERS JOBS
Compiled by Nurhadi Siswanto 94
94
47
Solved by POM Software
Step 1
-Choose Assignment
Module
95
Step 2
- Type the title of the problem, number of Jobs and Machines
- Choose type of objective function
- Choose format of the name options
96
48
Solved by POM Software
Step 3
-Input data to the POM Software
-Solve the problem
97
Step 4
- Interpret
the result
98
49
Assignment Problem
Linear Programming Formulation
Min cijxij
ij
99
Solved by LINDO
100
50
Solved by LINDO
101
Solved by LINGO
102
51
Solved by LINGO
103
Assignment Problem--Special
Considerations:
Special considerations can include:
104
52
Assignment Problem
Special Case - 1
1 C11=6 1
C12=2
C13=6
C21=4
2 C22=9 2
C23=5
C31=5
C32=2
3 3
C33=1
C41=7
C42=6
4
C43=7
WORKERS JOBS
Compiled by Nurhadi Siswanto 105
105
Assignment Problem
Special Case – 2 : Worker no.3 can do two jobs
1 C11=6 1
C12=2
C13=6
C21=4
2 C22=9 2
C23=5
C31=5
C32=2
3 3
C33=1
C42=3
C41=7
C43=9 4
WORKERS JOBS
Compiled by Nurhadi Siswanto 106
106
53
Assignment Problem
Special Case – 3 : Worker no.1 can not do job no. 2
1 C11=6 1
C13=6
C21=4
2 C22=9 2
C23=5
C31=5
C32=2
3 3
C33=1
C42=3
C41=7
C43=9 4
WORKERS JOBS
Compiled by Nurhadi Siswanto 107
107
Transshipment Problem
Transshipment problems are transportation problems in
which a shipment may move through intermediate nodes
(transshipment nodes)before reaching a particular
destination node.
Transshipment problems can be converted to larger
transportation problems and solved by a special
transportation program.
Transshipment problems can also be solved by general
purpose linear programming codes.
The network representation for a transshipment problem
with two sources, three intermediate nodes, and two
destinations is shown on the next slide.
Compiled by Nurhadi Siswanto 108
108
54
Transshipment Problem
Network Representation
3 c36
c13 c37
s1 1 c14 6 d1
c15 c46
4 c47
c23 c24
c56 7 d2
s2 2
c25
5 c57
109
Transshipment Problem
Linear Programming Formulation
xij represents the shipment from node i to node j
Min cijxij
ij
110
55
Example: Transshipping
Thomas Industries and Washburn Corporation supply
three firms (Zrox, Hewes, Rockwright) with customized
shelving for its offices. They both order shelving from the
same two manufacturers, Arnold Manufacturers and
Supershelf, Inc.
Currently weekly demands by the users are 50 for Zrox,
60 for Hewes, and 40 for Rockwright. Both Arnold and
Supershelf can supply at most 75 units to its customers.
Additional data is shown on the next slide.
111
Example: Transshipping
Because of long standing contracts based on past
orders, unit costs from the manufacturers to the suppliers
are:
Thomas Washburn
Arnold 5 8
Supershelf 7 4
112
56
Example: Transshipping
Network Representation
ZROX
Zrox 50
5 1
75 Arnold Thomas 5
8 8
ARNOLD Hewes 60
3 4
7
Super Wash-
75 Shelf
4 Burn 4
Rock-
Wright 40
113
Example: Transshipping
Linear Programming Formulation
• Decision Variables Defined
xij = amount shipped from manufacturer i to supplier j
xjk = amount shipped from supplier j to customer k
where i = 1 (Arnold), 2 (Supershelf)
j = 3 (Thomas), 4 (Washburn)
k = 5 (Zrox), 6 (Hewes), 7 (Rockwright)
114
57
Example: Transshipping
Objective Function Defined
115
Example: Transshipping
Constraints Defined
116
58
Solved by LINDO
117
Solved by LINDO
118
59
Solved by LINGO
119
Solved by LINGO
-Interpret
the result
120
60
Transshipping - Extension
Network Representation
Zrox 50
75 Arnold 5 Thomas 1 5
8 8
ARNOLD Hewes 60
50
Super 7 Wash- 3 4
75
Shelf 4 Burn 4 Rock-
Wright 40
8 8
80 Super
6 Wash- 3 5
Blow By 6 Rock-
4 Blue 65
121
61