Professional Documents
Culture Documents
2. In Fig. 1.1, why is the object representing the model drawn with straight lines?
3. In Fig. 1.1, why is the object representing the procedure drawn as an oval with a box
around it?
4. What are the assumptions associated with a model? Why is it necessary to make
assumptions?
5. Why may it be necessary to go back and change the model after solving it?
On testing the model it may be found to be invalid (perhaps it does not address
the original problem). The model found may be impossible to solve (intractible).
Problem Solving in Operations Research 2
10. How would you define an organization in the context of problem solving? Who are
its members?
The organization is the society in which the problem arises or for which the
solution is important. The organization may be the citizens of a governmental
entity, a branch of government, a corporation, a department, or perhaps even a
household or individual.
11. What is an abstraction? Why does one make abstractions in the modeling process?
12. What must happen if the solution to a model turns out to violate some important
constraints not previously stated by the decision maker?
The process must return to the problem statement step (or modeling step) to
incorporate the violated constraint.
13. Why do operations research studies often involve a team rather than a single person?
14. Explain how the conflicting goals of tractability and validity may cause the
modeling process to fail.
It may impossible to construct a model that both can be solved (that is tractable)
and is valid (represent the situation).
A solution specifies values for the variables of the model, while the model is a
representation of the situation and does not specify a solution.
16. In what two activities of the problem solving process should the decision maker play
a large role?
The decision maker plays a large role in the problem formulation and solution
implementation.
Problem Solving in Operations Research 4
17. Why would an analyst make assumptions that he or she does not necessarily believe
when formulating a model?
A model has two important values. For the decision makers and analyst the
model can add to the understanding of the situation. Just building the model
often describes features of the model in more objective terms. The problem can
then be addressed more intelligently, possibly without further recourse to the
model. Some models can be solved to suggest decisions that can be
implemented. In these cases the value of the model can be measured by the
success of the decisions in addressing the original problem.
Operations Research Models and Methods
by Paul A. Jensen and Jonathan F. Bard
John Wiley and Sons, Inc.
Copyright 2003 – All rights reserved
To do this problem consider the equation of a line ax1 + bx2 = 1. Any line not
passing through the origin can have this form by assigning the correct values of a
and b. Given any two points on the line, one can solve for a and b. For instance
let the intercept on the x1 axis be at point (j, 0) and the intercept on the x2 axis be
(0, k). Since both intercepts lie on the line
a*j =1 and b*k = 1 or a = 1/j and b = 1/k.
Using line 1 in the problem the intercepts are at j = 2 and k = 1. The
equation for line 1 is therefore
1/2x1 + x2 = 1.
To write the constraint we must determine if it is a £ or ≥ constraint. The easiest
way to do this is to see in the picture whether the origin (0, 0) is feasible for the
constraint and set the sense of the constraint to accomplish this. For line 1, the
origin is not feasible, so the constraint must be
1/2x1 + x2 ≥ 1.
In like manner, we can write the entire set of constraints.
2. The figure below shows the graphical model of a linear program. The large numbers
on the right 1, 2, and 3 indicate the constraints. The feasible region is shown in
white and the infeasible region is cross hatched. The small numbers indicate four
feasible corner points: 0, 1, 2, 3. Three objective functions are under consideration, as
indicated by the three lines labeled A, B, and C. The arrows represent the direction
of increasing objective function. Objective B is parallel with constraint 3. In each
case, specify the location of the optimal solution. If more than one optimum exists,
characterize all of them.
a. maximize A
b. maximize B
c. maximize C
d. minimize A
e. minimize B
f. minimize C
g. Drop x1 ≥ 0 and minimize C
Note that this problem assumes the feasible region is defined by the three
constraints and nonnegativity conditions on x1 and x2. Thus the region is
unbounded in the x2 direction.
a. Point 2 b. Point 3 and all points above the
point on line 3. There are an
infinite number of alternative
optima.
c. The solution is unbounded. d. The solution is unbounded.
e. The solution is unbounded. f. Point 0
g. The solution is unbounded.
Linear Programming Models 4
x2 unbounded
Grid size = 1 feasible region
(1)
10
(2)
(3) (4)
10 x1
Sensitivity Analysis
Constraint Analysis
Shadow Constraint Range Lower Range Upper
Num. Name Value Status Price Limit Limit Limit
1 Con1 10. Upper -0.75 10. -4. 20.
2 Con2 0. Basic 0. 4. -10. ---
3 Con3 12.5 Basic 0. 8. --- 12.5
4 Con4 20. Lower 1.25 20. 14. ---
Linear Programming Models 5
c1 = 0.5 c1 = •
x2 x2
(1) (1)
10 10
(2) (2)
(3) (4) (3) (4)
10 x1 10 x1
c2 = -4 c2 = 4
x2 (1) x2 (1)
10 10
(2) (2)
(3) (4) (3) (4)
10 x1 10 x1
b1 = -4 b1 = 20
(1)
x2 x2
10 10
(1)
(2) (2)
(3) (4) (3) (4)
10 x1 10
Linear Programming Models 6
b2 = -10 b3 = 12.5
x2 x2
(1) (1)
10 10
(2)
(2)
(3) (4) (3) (4)
10 x1 10 x1
For b2 = •, constraint 2 moves down For b3 = -•, constraint 3 moves down
and off the picture and off the picture.
b4 = 14 As b4 increases the optimum
increases along the constraint (1) line.
There is no limit to the increase, so
x2
(1) the upper limit is •.
10
(2) x2
10
(1)
(3) (4)
10 x1 (4)
(2)
For b2 = •, constraint 2 moves down
(3)
and off the picture
10 x1
Linear Programming Models 7
4. For the resource allocation problem, show that the dual variables can be used to
estimate the effects of changes in the right-hand sides of the constraints. Add one
more machine of type 3 with a corresponding increase in availability of 40 hours.
Solve the resulting linear program using the software that accompanies the book or
any LP code available to you. Show that the objective function value obtained is the
same as that predicted from the dual variables associated with the optimal solution
given in the text.
From the information given in the text one finds the dual variable for M3 is 8.96.
The upper limit on the range of b for this constraint is 237.5. Increasing the right
side from the current value of 120 to 160, corresponding to an additional
machine, results in a right side within the range specified for M3. Since the value
of profit is 2988.73, and the change in b is 40, the predicted profit after the
change is
2988.73 + (8.96)(40) = 3347.13
Solving the revised problem with the computer results in below.
Optimal Solution
Name: E_04 Solver: Jensen LP/IP
Type: LP1 Type: Linear
Goal: Max Sens.: Yes
P r o f i t : 3347.3 Side: No
Variables 1 2 3 4 5
Name: P1 P2 P3 P4 P5
Values: 70.572 41.313 0 32.996 43.213
The difference between the predicted profit and the computed Z is due to
the numerical accuracy of the computations. Note that the basic variables (the
ones with nonzero values) have the same identity but different values for the new
solution.
Linear Programming Models 8
5. For the blending problem, show that the ranges given in the objective function
analysis suggest how the solution will change as the price of corn changes. Solve the
problem for the price equal to 24, 25, 90 and 91. Compare the four solutions with the
solution given in the text with the price of corn equal to 30.5.
The following compares the solution to the results given in the text.
∑ Cost 24: The basis changes. The diet has minimum calcium rather than
maximum calcium. (L = 0.0176, C = 0.6614, S = 0.3209, Z = 44.94)
∑ Cost 25 and 90: The same solution as the text. (L = 0.0282, C = 0.6486,
S = 0.3233, Z = 45.59 (for cost = 25), Z = 87.75 (for cost = 90)
∑ Cost 91: The basis changes. The diet has maximum calcium and
maximum fiber. The minimum protein and minimum calcium constraints
are loose. (L = 0.0277, C = 0.4631, S = 0.5092, Z = 88.25)
Linear Programming Models 9
6. Change the car rental problem to add a Monday-Wednesday-Friday plan that costs
$105 for the three days and a Tuesday-Thursday plan that costs 64 for the two days.
What is the new optimum rental plan? If one of these new plans is not used, from
sensitivity analysis determine how much the cost of the plan should be reduced to
have the plan be adopted.
Answer: Let the new variables be y6 for the MWF option and y7 for the TTh.
option. The solution has a cost of 1930 and the following assignments.
Var. x1 x2 x3 x4 x5 x6 x7 y3 y4 y5 we wd w y6 y7
Value 0 2 0 0 5 3 0 0 0 1 0 0 3 7 0
From the sensitivity analysis we learn that if the cost of the TTh option were
reduced by more than 4, the basis will change.
Linear Programming Models 10
7. Use an approach similar to the car rental problem to solve this workforce scheduling
problem. A bus company is scheduling drivers for its buses. The requirement for
drivers varies by time of day as in the table below. These requirements repeat every
day of the week.
Drivers are hired for eight hour shifts that start at midnight, 4a.m., 8a.m., 12 noon,
4pm, or 8pm . That is, a driver starting at midnight will work until 8a.m. Drivers that
start at 8pm work until 4pm the next morning. Find a schedule of drivers that will
minimize the number of drivers necessary to meet the daily requirements. Note
that some drivers may be idle for a part of their shifts.
The matrix representation of this model when the workers have 8 hour shifts is
shown below.
8. Solve the workforce scheduling problem with each of the work rules below. Use the
same requirements. Comment on the integrality of the solution each case.
a. Each driver works a 12 hour shift.
b. Drivers brought in at a particular time work for four hours, break for four hours,
and then work for another four hours.
a. The matrix representation of this model when the workers have 12 hour shifts
is shown below.
Optimal Solution
x0 x4 x8 x12 x16 x20 z
8 0 8 0 4 0 20
The solution is still integer and will be for any work schedule that has drivers
working a continuous sequence of hours.
b. The matrix representation of this model when the workers must work 4 hours,
break 4 hours, and then work 4 hours is shown below.
Optimum Solution
x0 x4 x8 x12 x16 x20 Z
1 5.5 9 1.5 3 2.5 22.5
The solution is not integer and in general will not be integer when workers
have split shifts.
Linear Programming Models 12
9. How must the model for the aggregate planning problem be modified to account for
costs incurred when production levels change? In particular, if production goes up
from one month to the next, there is an additional cost of $2 per unit of change. If
production goes down from one month to the next, there is a cost of $1 per unit of
change. The current production level is 1000.
For each period add the appropriate objective function terms and a constraint
that relates the variables Et and Ft to the production in adjacent months; i.e.,
Pt -1 – Pt + Et – Ft = 0 for t = 1, ...,6
Modifying the model along these lines and solving gives the following solution.
Because of the added costs of changing production levels, the solution has a
more uniform production plan.
10. For the power distribution problem, assume that a generator failure occurs at station
B so that it can no longer serve any outlying areas and falls 25 MW short of serving
its own area. Set up and solve the linear programming model to find the optimal
distribution of power in this circumstance.
The network model when generator B has no capacity and requires 25 extra
units is shown below.
[fixed, variable, cost] [0,100,500]
(gain)
(0.90) A (0.90)
[-30] Z X [-25]
(0.95)
(0.95)
(0.95)
(0.95)
(0.90) (0.90)
(0.95)
[-25] B C [0,100,400]
(0.95)
(0.90) (0.90)
Y
[-50]
Sketch the feasible region and several isovalue contours for the objective function in
the (x1,x2)-space. Show the optimal solution on the graph.
Z = 60
x2 Note that the objective function line is
parallel to the second constraint. All
10
Z = 36
feasible points on that constraint line
are alternative optima.
0 x1
0 10
Linear Programming Models 15
12. Ten jobs are to be completed by three men during the next week. Each man works a
40-hour week. The times for the men to complete the jobs are shown in the table
below. The values in the cells assume that each job is completed by a single person;
however, jobs can be shared with completion times being determined proportionally.
If no entry exists in a particular cell, it means that the corresponding job cannot be
performed by the corresponding person.
Set up and solve a linear programming model that will determine the optimal
assignment of men to jobs. The goal is to minimize the total time required to
complete all the jobs.
Man \ Task 1 2 3 4 5 6 7 8 9 10
A –– 7 3 –– –– 18 13 6 –– 9
B 12 5 –– 12 4 22 –– 17 13 ––
C 18 –– 6 8 10 –– 19 –– 8 15
VARIABLE DEFINITIONS
xij : Proportion of job j performed by man i, for i = A, B, C, and j = 1, ... , 10.
Variables should be defined for only the man–job combinations not eliminated
with an X in the table. Thus there are 20 variables in this problem.
CONSTRAINTS
Each man can only work 40 hours.
MANA: + 7xA2 + 3xA3 +18xA6 +13xA7 + 6xA8 + 9xA10 £ 40
MANB: +12xB1 + 5xB2 +12xB4 + 4xB5 +22xB6 +17xB8 +13xB9 £ 40
MANC: +18xC1 + 6xC3 + 8xC4 +10xC5 +19xC7 + 8xC9 +15xC10 £ 40
Each job must be done.
TASK1: +xB1 +xC1 = 1
:
TASK10: +xA10 +xC10 = 1
NONNEGATIVITY AND SIMPLE UPPER BOUNDS
0 < xij < 1 for all i and j for which variables are defined.
OBJECTIVE FUNCTION
MINIMIZE: Total time required for the jobs.
Min Z = 7xA2 + 3xA3 +18xA6 +13xA7 + 6xA8 + 9xA10
+12xB1 + 5xB2 +12xB4 + 4xB5 +22xB6 +17xB8 +13xB9
+18xC1 + 6xC3 + 8xC4 +10xC5 +19xC7 + 8xC9 +15xC10
Assignment: Value 88
Linear Programming Models 16
1 2 3 4 5 6 7 8 9 10
Man A X 0 1 X X 0.5 1 1 X 1
Man B 1 1 X 0 1 .5 X 0 0 X
Man C 0 0 0 1 0 X 0 X 1 0
Hrs. Dual
Man A 40 -.22
Man B 32 0
Man C 16 0
Linear Programming Models 17
13. A company has two manufacturing plants (A and B) and three sales outlets (I, II,
and III). Shipping costs from the plants to the outlets are as follows.
Outlet
Plant I II III
A 4 6 8
B 7 4 3
The company wants to plan production, shipping and sales for the next two
periods. The data for the periods is shown below. The plants can store products
produced in one period for sale in the next. The maximum storage at each plant is
50 and the inventory cost is $1 per unit. Find the solution that maximizes profit.
Manufacturing data
Plant A Plant B
Period Unit cost ($) Capacity Unit cost ($) Capacity
1 8 175 7 200
2 10 150 8 170
Demand Data
Variables
PA1, PB1, PA2, PB2: production at A and B in the two periods
S11, S21, S31: sales in period 1 at three locations
S12, S22, S42: sales in period 2 at three locations
xA11, xA21, etc: shipments in period 1
xA12, xA22, etc: shipments in period 2
IA, IB: Inventory storage at A and B
Profit $4450.
14. A company is planning its aggregate production schedule for the next three months.
Units may be produced on regular time or overtime. The relevant costs and
capacities are shown in the table below. The demand for each month is also shown.
There are three ways of meeting this demand: inventory, current production, and
backorders. Units produced in a particular month may be sold in that month or kept
in inventory for sale in a later month. There is a $1 cost per unit for each month an
item is held in inventory. Initially, there are 15 units in inventory. Also, sales can
be backordered at a cost of $2/unit/mo. Backorders represent production in future
months to satisfy demand in past months, and hence incur an additional cost.
Production cost
Capacity (units) ($/unit)
a. Develop a model that when solved will yield the optimum production plan. Find
the solution with a computer program.
b. How would the model change if the inventory cost depends on the total time an
item is stored. Let the cost be $1/unit for items kept in inventory for 1 month,
$3 for items kept for 2 months, and $5 for items kept for 3 months. Assume that
the initial inventory has been in storage for 1 month. Solve the model with this
change.
Part a
Variables for part a
Rk = Regular production in month k
Ok = Overtime production in month k
Ik = Inventory stored in month k
Bk = items backordered from month k
Linear Programming Models 20
15 Initial Inv.
R1 (Regular prod.)
(60) Demand Conservation of product
1
O1 (Regular prod.) R1 + O1 - I1 + B2 = 60 - 15
R2 + O2 + I1 - I2 - B2 + B3 = 80
I1 B2 R3 + O3 + I2 - B3 = 140
Part b.
Variables for part b
Inventory variables: We will use a variable for the amount of material put into
inventory in each period and separate variables for the amounts used in period
jthat were produced in period k, where j ≥ k.
Initial Inventory: I0 and I01, I02, I03.
Period 1 Inventory: I1 and I12, I13.
Period 2 Inventory: I2 and I23.
Production Variables:
Regular time and Over time Production: Rk, Ok, for k = 1…3.
Production used immediately for sales: PSk for k = 1…3.
Unfortunately, we can’t find any parameters that make it advisable store more
than one period. The solution is the same as for part a.
15 Initial Inv.
0
I01
R1 (Regular prod.)
I02 (60) Demand
1_P 1_D
O1 (Regular prod.)
B2
R2 (Regular prod.)
(80) Demand
2_P 2_D
O2 (Regular prod.)
B3 I03
R3 (Regular prod.)
(140) Demand
3_P 3_D
O3 (Regular prod.)
15. (Shuttle Bus Staffing) A shuttle bus system operates from 6 a.m. to 12 midnight, a
period of 18 hours. To meet student demands for service, the following schedule has
been determined for the number of bus drivers required during each hour of the day.
Times are stated with respect to a 24-hour clock.
Time period: 6-7 7-8 8-9 9-10 10-11 11-12 12-13 13-14 14-15
No. drivers: 5 20 25 20 15 12 25 20 15
Time periods: 15-16 16-17 17-18 18-19 19-20 20-21 21-22 22-23 23-24
No. drivers: 15 12 20 20 18 15 10 5 3
During an 8-hour day, the drivers receive two 1-hours breaks after working
for two hours. Thus the 8-hour period is divided between work and breaks as shown
below. During their breaks the drivers may be assigned other duties.
The company would like to determine how many drivers to call in at each
hour of the day. Drivers begin their shifts on the hour (at 6, 7, 8,…, 16). No drivers
are called after time 16. There must be at least enough drivers scheduled to cover
the hourly requirements under the condition that each follows the 8-hour pattern
given above. The goal is to minimize the total number of drivers used. Formulate a
linear programming model that can be used to solve this problem.
Time 7-8: x6 + x7 ≥ 20
Time 8-9: + x7 + x8 ≥ 25
Time 9-10: x6 + x8 + x9 ≥ 20
Linear Programming Models 23
Solution
x6 x7 x8 x9 x10 x11 x12 x13 x14 x15 x16 Z
LP 7.5 12.5 12.5 0 0 5 5 4 6 4 5 61.5
LP 7.5 12.5 12.5 0 0 5 0 0 6 9 9 61.5
IP 7 13 12 1 0 5 5 4 6 4 5 62
Operations Research Models and Methods
by Paul A. Jensen and Jonathan F. Bard
John Wiley and Sons, Inc.
Copyright 2003 – All rights reserved
a. Max. Z
Z –5x1 –3x2 = 0
3x1 +5x2 +x3 = 15
5x1 +2x2 +x4 = 10
–x1 + x2 +x5 = 2
x2 +x6 = 2.5
x1> 0x2> 0 x3> 0 x4> 0 x5> 0 x6> 0
Linear Programming Methods 2
b.
x
2
5
2 3
4
3 4
2 OPTIMUM
1
1
0
x
0 1 2 3 4 5 1
c.
Corner Nonbasic Basic Solution Feasibility Objective
Point Variables Variables (x1, ..,x6) (Yes, No) Value
–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––----
#1 (1, 2) (3, 4, 5, 6) (0, 0, 15, 10, 2, 2.5) Yes 0
#2 (1, 3) (2, 4, 5, 6) (0, 3, 0, 4, –1, –0.5) No 9
#3 (1, 4) (2, 3, 5, 6) (0, 5, –10, 0, –3, –2.5) No 15
#4 (1, 5) (2, 3, 4, 6) (0, 2, 5, 6, 0, 0.5) Yes 6
#5 (1, 6) (2, 3, 4, 5) (0, 2.5, 2.5, 5, –0.5, 0) No 7.5
#6 (2, 3) (1, 4, 5, 6) (5, 0, 0, –15, 7, 2.5) No 25
#7 (2, 4) (1, 3, 5, 6) (2, 0, 9, 0, 4, 2.5) Yes 10
#8 (2, 5) (1, 3, 4, 6) (–2, 0, 21, 20, 0, 2.5) No –10
#9 (2, 6) (1, 3, 4, 5) No Solution ––– –––
#10 (3, 4) (1, 2, 5, 6) (1.053, 2.368, 0, 0, 0.685, 0.132) Yes 12.369
#11 (3, 5) (1, 2, 4, 6) (0.625, 2.625, 0, 1.625, 0, –0.13) No 11
#12 (3, 6) (1, 2, 4, 5) (0.833, 2.5, 0, 0.835, 0.333, 0) Yes 11.665
#13 (4, 5) (1, 2, 3, 6) (0.857, 2.857, –1.86, 0, 0, –0.357) No
12.856
#14 (4, 6) (1, 2, 3, 5) (1, 2.5, –0.5, 0, 0.5, 0) No 12.5
#15 (5, 6) (1, 2, 3, 4) (0.5, 2.5, 1, 2.5, 0, 0) Yes 10
–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––----
The optimum is #10.
Linear Programming Methods 3
d. First we must solve the objective function and constraints in terms of the basic
variables z, x1. x2, x5 and x6. We obtain
Max. z = 12.368 - 0.263 x 3 - 0.842 x 4
Subject to :
0.263 x 3 - 0.158 x 4 + x 2 = 2.468
-0.105 x 3 + 0.263 x 4 + x1 = 1.053
-0.368 x 3 + 0.421x 4 + x 5 = 0.684
-0.263 x 3 + 0.158 x 4 + x 6 = 0.132
x j ≥ 0, j = 1K 6
The figure below shows the feasible region in terms of the x3 and x4 variables.
The objective function line shown is for z = 10.368. The optimum solution is at x3
= x4 = 0.
Linear Programming Methods 4
a. Select x3 and x4 as the axes and sketch the feasible region and an objective iso-
value contour in terms of these variables. Identify the extreme points of the
region.
b. Analytically determine the set of all solutions that are intersections of two
constraints or nonnegativity restrictions. Identify whether or not the solutions
are feasible, and from the feasible subset select the optimum by evaluating the
objective function at each.
b.
Linear Programming Methods 5
a. Construct the equality form of the model by introducing slack variables x5 and x6
for the two constraints.
b. What is an upper bound on the number of basic solutions?
c. Analytically determine the set of basic solutions by listing all possible selections
of the basic variables. Identify which are feasible and which are infeasible.
Compute the objective function values for the feasible solutions and select the
optimum.
a.
Maximize z = 10x1 + 5x2 + 8x3 – 3x4
subject to -2x1 + x2 + 2x3 –3 x4 - x5 = 12
x1 + x2 + x3 + x4 + x6 = 20
xj ≥ 0, j = 1,…, 6
Minimize z = x1 + 2.5x2 + x3
subject to x1 + x2 ≥ 10
+ x2 + x3 ≥ 10
xj ≥ 0, j = 1,…, 3
Algebraically determine the set of all basic solutions and identify whether or not
each is feasible. Determine the optimum by evaluating the objective function at
each feasible point.
Coefficients
Row Basic z x1 x2 x3 x4 x5 RHS
0 z 1 1 –1 –1 0 2 20
1 0 1 5 –1 1 12 12
2 0 0 8 1 2 16 16
a.
z + x1 - x2 - x3 +2x5 = 20
x1 + 5x2 - x3 + x4 +12x5 = 12
+ 8x2 + x3 + 2x4 +16x5 = 16
6. Starting with the tableau found in part b of problem 5, consider the three cases listed
below. Construct the new tableau in the simplex form, write the basic solution ob-
tained, and use the marginal information available from the tableau to comment on
any characteristics the solution exhibits. The parts of the problem all start from the
same basis definition.
a. Allow x2 to replace x4 as a basic variable.
b. Allow x5 to replace x4 as a basic variable.
c. Allow x5 to replace x1 as a basic variable.
7. For the example Section 3.5, start with the basic solution denoted by #1 in Fig. 3.5.
Sequentially change the basis by allowing variables to enter and leave so that the
basic solutions are #2, #3, #4 and #5 in this order. Show the equations in the
simplex form for each of the four cases, and sketch the view of the feasible region
described for each basis.
z 4 x2 – 3 x5 = 30
4 x2 + x3 – x5 = 20
3 x2 + x4 + 2 x5 = 35
x1 +2 x2 – x5 = 5
z -2x1 – x5 = 10
-2x1 + x3 + x5 = 20
1.5x1 + x4+ 0.5x5= 35
0.5x1 + x2 – 0.5x5 = 5
z -4x1 + x3 = 30
-2x1 + x3 + x5 = 20
2.5x1 -0.5x3 + x4 = 25
-0.5x1 + x2 + 0.5x3 = 15
Linear Programming Methods 14
z + 0.2x3+ 1.6x4 = 70
+ 0.6x3+ 0.8x4 + x5 = 40
x1 0.2x3+ 0.4x4 = 10
+ x2+ 0.4x3+ 0.2x4 = 20
z -0.5x2 + 1.5x4 = 60
-1.5x2 + 0.5x4 + x5 = 10
x1+ 0.5x2 + 0.5x4 = 20
+ 2.5x2 + x3+ 0.5x4 = 50
Linear Programming Methods 15
8. This is an exercise to illustrate the pivoting process. In each case listed, start from
the tableau below and let the specified variable enter the basis. Tell which variable
should leave the basis, predict the new basic solution and predict the new value of
the objective function. Tell whether the objective value increases or decreases.
a. x1 enters. b. x5 enters. c. x6 enters. d. x7 enters. e. x10 enters.
Basic 1 2 3 4 5 6 7 8 9 10 Right
Variables z X1 X2 X3 X4 X5 X6 X7 X8 X9 X 10 Side
z 1 -0 -0 0 0 -0.2 0.2 -0.2 0 0 0.6 11
X3 0 2 0 1 0 1 0 -1 0 0 2 5
X4 0 -2 0 0 1 -1 1 2 0 0 -4 0
X8 0 0 0 0 0 0 1 1 1 0 -3 12
X9 0 0 0 0 0 0 2 1 0 1 -9 9
X2 0 1 1 0 0 1 -1 -1 0 0 3 3
a) If x1 enters the basis, then x3 will leave the basis, the objective does not
change.
Basic 1 2 3 4 5 6 7 8 9 10 Right
Variables z X1 X2 X3 X4 X5 X6 X7 X8 X9 X 10 Side
z 1 0 0 0 0 -0.2 0.2 -0.2 0 0 0.6 11
X1 0 1 0 0.5 0 0.5 0 -0.5 0 0 1 2.5
X4 0 0 0 1 1 0 1 1 0 0 -2 5
X8 0 0 0 0 0 0 1 1 1 0 -3 12
X9 0 0 0 0 0 0 2 1 0 1 -9 9
X2 0 0 1 -0.5 0 0.5 -1 -0.5 0 0 2 0.5
b. If x5 enters the basis, then x2 will leave the basis. Objective increases.
Basic 1 2 3 4 5 6 7 8 9 10 Right
Variables z X1 X2 X3 X4 X5 X6 X7 X8 X9 X 10 Side
z 1 0.2 0.2 0 0 3E-09 -0 -0.4 0 0 1.2 11.6
X3 0 1 -1 1 0 0 1 0 0 0 -1 2
X4 0 -1 1 0 1 0 0 1 0 0 -1 3
X8 0 0 0 0 0 0 1 1 1 0 -3 12
X9 0 0 0 0 0 0 2 1 0 1 -9 9
X5 0 1 1 0 0 1 -1 -1 0 0 3 3
c. If x6 enters the basis, then x4 will leave the basis. The objective will stay the
same. This is a degenerate iteration.
Basic 1 2 3 4 5 6 7 8 9 10 Right
Variables z X1 X2 X3 X4 X5 X6 X7 X8 X9 X 10 Side
z 1 0.4 0 0 -0.2 3E-09 -0 -0.6 0 0 1.4 11
X3 0 2 0 1 0 1 0 -1 0 0 2 5
X6 0 -2 0 0 1 -1 1 2 0 0 -4 0
X8 0 2 0 0 -1 1 0 -1 1 0 1 12
X9 0 4 0 0 -2 2 0 -3 0 1 -1 9
X2 0 -1 1 0 1 0 0 1 0 0 -1 3
d. If x7 enters the basis, then x4 will leave the basis. The objective will stay the
same. This is a degenerate iteration.
Linear Programming Methods 16
Basic 1 2 3 4 5 6 7 8 9 10 Right
Variables z X1 X2 X3 X4 X5 X6 X7 X8 X9 X 10 Side
z 1 0.4 0 0 -0.2 3E-09 -0 -0.6 0 0 1.4 11
X3 0 2 0 1 0 1 0 -1 0 0 2 5
X6 0 -2 0 0 1 -1 1 2 0 0 -4 0
X8 0 2 0 0 -1 1 0 -1 1 0 1 12
X9 0 4 0 0 -2 2 0 -3 0 1 -1 9
X2 0 -1 1 0 1 0 0 1 0 0 -1 3
Basic 1 2 3 4 5 6 7 8 9 10 Right
Variables z X1 X2 X3 X4 X5 X6 X7 X8 X9 X 10 Side
z 1 -0.2 0 0 0.1 -0.3 0.3 3E-09 0 0 0.2 11
X3 0 1 0 1 0.5 0.5 0.5 0 0 0 0 5
X7 0 -1 0 0 0.5 -0.5 0.5 1 0 0 -2 0
X8 0 1 0 0 -0.5 0.5 0.5 0 1 0 -1 12
X9 0 1 0 0 -0.5 0.5 1.5 0 0 1 -7 9
X2 0 0 1 0 0.5 0.5 -0.5 0 0 0 1 3
e. If x10 enters the basis, then x2 will leave the basis. The objective will
decrease.
Basic 1 2 3 4 5 6 7 8 9 10 Right
Variables z X1 X2 X3 X4 X5 X6 X7 X8 X9 X 10 Side
z 1 -0.2 -0.2 0 0 -0.4 0.4 8E-09 0 0 -0 10.4
X3 0 1.333 -0.67 1 0 0.333 0.667 -0.33 0 0 0 3
X4 0 -0.67 1.333 0 1 0.333 -0.33 0.667 0 0 0 4
X8 0 1 1 0 0 1 0 0 1 0 0 15
X9 0 3 3 0 0 3 -1 -2 0 1 0 18
X 10 0 0.333 0.333 0 0 0.333 -0.33 -0.33 0 0 1 1
Linear Programming Methods 17
9. The tableau below has been found at an intermediate stage of the simplex algorithm
for a maximization problem. In each part of this exercise, start from the tableau and
perform the suggested pivot operation. Show the complete tableau obtained and
comment on any special characteristics it may exhibit. The parts are not cumulative.
Coefficients
Row Basic z x1 x2 x3 x4 x5 RHS
0 z 1 0 –2 2 0 –2 –2
1 x1 0 1 1 –1 0 4 4
2 x4 0 0 4 1 1 8 8
Z 0 1 2 0 0 0 6 6
x3 1 0 –1 –1 1 0 –4 –4
x4 2 0 0 4 0 1 8 8
–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
This is an infeasible solution.
d. Let x3 enter the basis and x4 leave the basis.
Var. Eq. Z x1 x2 x3 x4 x5 Rt. side
–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
Z 0 1 0 –10 0 –2 –18 –18
x1 1 0 1 5 0 1 12 12
x3 2 0 0 4 1 1 8 8
–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
This is solution is feasible but not optimal.
e. Let x5 enter the basis and x1leave the basis.
Var. Eq. Z x1 x2 x3 x4 x5 Rt. side
–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
Z 0 1 0.5 –1.5 1.5 0 0 0
x5 1 0 0.25 1 –1 0 1 1
x4 2 0 –2 2 3 1 0 0
–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
This is a nonoptimal, feasible, degenerate solution.
f. Let x5 enter the basis and x4 leave the basis.
Var. Eq. Z x1 x2 x3 x4 x5 Rt. side
–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
Z 0 1 0 –1 2.25 0.25 0 0
x1 1 0 1 –1 –1.5 –0.5 0 0
x5 2 0 0 –0.5 0.125 0.125 1 1
–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
This is a nonoptimal, feasible, degenerate solution.
Linear Programming Methods 19
Coefficients
Row Basic z x1 x2 x3 x4 x5 x6 RHS
0 z 1 –3 0 0 –3 –2 0 10
1 x3 0 4 0 1 5 –3 0 4
2 x2 0 2 1 0 –3 1 0 2
3 x6 0 1 0 0 2 –2 1 2
Starting from this tableau in each case, perform the indicated operations to derive a
new tableau.
a. Let x1 enter the basis. b. Let x4 enter the basis. c. Let x5 enter the basis.
d. Which of the three choices gives the greatest increase in the objective function?
Referring to the primal simplex algorithm, rewrite Step 2.1 so that the variable
chosen to enter the basis is the one that gives the greatest increase in the
objective function. Would you suggest that this procedure replace the steepest
ascent rule? Explain.
a. x1 enters the basis and x3 leaves the basis. There is a tie in the leaving
variable and x2 can also leave.
Basic 1 2 3 4 5 6 Right
Variables z X1 X2 X3 X4 X5 X6 Side
z 1 0 0 0.75 0.75 -4.25 0 3
X1 0 1 0 0.25 1.25 -0.75 0 1
X2 0 0 1 -0.5 -5.5 2.5 0 0
X6 0 0 0 -0.25 0.75 -1.25 1 1
d. The greatest changes in the objective function take place when x5 enter
the basis. To find the variable that would increase the objective by the most, you
must multiply the reduced cost by the minimum ratio. This would be
computational expensive because we need to compute the primal ratio for all the
candidates. Steepest ascent step is much more simpler.
Linear Programming Methods 21
11. Using the tableau given in Exercise 10, if x1 enters the basis, there is a tie for the
variable to leave the basis. Starting from the original tableau, consider the two
possibilities and determine what the solution will be in each case.
a. Let x3 leave the basis.
b. Let x2 leave the basis.
Coefficients
Row Basic z x1 x2 x3 x4 x5 x6 RHS
0 z 1 –3 2 0 0 –1 0 4
1 x3 0 2 0 1 0 0 0 13
2 x4 0 –2 1 0 1 –7 0 7
3 x6 0 4 2 0 0 –2 1 2
b. Use the most negative rule to select the entering variable. Proceed until the
algorithm terminates.
b. Use the most negative rule to select the entering variable. Proceed until the
algorithm terminates.
Iteration 1 :
Basic 1 2 3 4 5 6 Right
Variables z X1 X2 X3 X4 X5 X6 Side
z 1 0 3.5 0 0 -2.5 0.75 5.5
X3 0 0 -1 1 0 1 -0.5 12
X4 0 0 2 0 1 -8 0.5 8
X1 0 1 0.5 0 0 -0.5 0.25 0.5
Iteration 2
Basic 1 2 3 4 5 6 Right
Variables z X1 X2 X3 X4 X5 X6 Side
z 1 0 1 2.5 0 0 -0.5 35.5
X5 0 0 -1 1 0 1 -0.5 12
X4 0 0 -6 8 1 0 -3.5 104
X1 0 1 0 0.5 0 0 0 6.5
Unbounded
Linear Programming Methods 23
Coefficients
Row Basic z x1 x2 x3 x4 x5 x6 RHS
0 z 1 0 0 0 0 2 4 10
1 x3 0 4 0 1 5 –3 2 4
2 x2 0 2 1 0 –3 1 3 2
The solution is optimal, , we can pick x1 or x4 to enter the basis to get alternate
optimal as their reduced costs are 0. The alternate optimal are
(x1 = 1, x2 = 0), ( x4 = 0.8, x2 = 4.4)
Basic 1 2 3 4 5 6 Right
Variables z X1 X2 X3 X4 X5 X6 Side
z 1 0 0 0 0 2 4 10
X4 0 0.8 0 0.2 1 -0.6 0.4 0.8
X2 0 4.4 1 0.6 0 -0.8 4.2 4.4
Basic 1 2 3 4 5 6 Right
Variables z X1 X2 X3 X4 X5 X6 Side
z 1 0 0 0 0 2 4 10
X1 0 1 0 0.25 1.25 -0.75 0.5 1
X2 0 -3E-08 1 -0.5 -5.5 2.5 2 -3E-08
Linear Programming Methods 24
14. Put the following problem into the simplex form and solve with the Math
Programming Excel Add-in. What are the values of the original problem variables?
Minimize z =3x1 + 2x2
subject to x1 – x2 = –11
–x1 – 2x2 £ –10
x1 ≥ –3
x1 and x2 unrestricted
Variables 1 2 3 4
Name: y1 y1' y2 y2'
Values: 0 3 8 0
Lower Bounds: 0 0 0 0
Upper Bounds: 10000 10000 10000 10000
15. Drop the second constraint from the example problem in Section 3.2 and solve.
Comment on any special characteristics of the optimal solution.
When C2 is dropped from the model used in Section 3.2, the solution becomes
unbounded.
Relation Name: X+ Y+ X-
Values: 0 0 10000
Lower Bounds: 0 0 0
Upper Bounds: 10000 10000 10000
16. Add the simple lower bound constraints x ≥ –5 and y ≥ –5 to the example problem in
Section 3.2. Solve the problem with these constraints explicitly included and
comment on any special characteristics of the optimum.
Minimize z = x + y
subject to x + y £ 20
x + y ≥ –20
x – y £ 20
x – y ≥ –20
x ≥ -5
y ≥ -5
x and y unrestricted
Let x = x+ – x- and y = y+ – x-
Name: X+ Y+ X-
Values: 0 0 5
Lower Bounds: 0 0 0
Upper Bounds: 10000 10000 10000
17. Repeat Exercise 16 but use a transformation to eliminate the lower bounds on x and
y from the constraint set. That is, do not treat x and y as unrestricted variables.
Let x = x+ – 5 and y = y+ – 5
Minimize z = x’ + y’ - 10
subject to x’ + y’ £ 30
x’ + y’ ≥ –10
x’ – y’ £ 20
x’ – y’ ≥ –20
x’ ≥ 0
y’ ≥ 0
The optimum solution is: x’ = y’ = 0. In terms of the original variables this is: x = y
= -5. The solution is the same as for problem 16.
Linear Programming Methods 28
18. Add the constraint x1 – x2 ≥ 0 to the first example problem in Section 3.8, and solve
with the two-phase method.
–2x1 + x2 ≥ 3
x1 – x2 ≥ 0
x1 ≥ 0, x2 ≥ 0
Basic 1 2 3 4 5 6 7 Right
Variables z X1 X2 X3 X4 art1 art2 art3 Side
z 1 -3 -8 1 1 0 0 0 -33
art1 0 4 8 0 0 1 0 0 30
art2 0 -2 1 -1 0 0 1 0 3
art3 0 1 -1 0 -1 0 0 1 0
Basic 1 2 3 4 5 6 7 Right
Variables z X1 X2 X3 X4 art1 art2 art3 Side
z 1 -19 0 -7 1 0 8 0 -9
art1 0 20 0 8 0 1 -8 0 6
X2 0 -2 1 -1 0 0 1 0 3
art3 0 -1 0 -1 -1 0 1 1 3
Basic 1 2 3 4 5 6 7 Right
Variables z X1 X2 X3 X4 art1 art2 art3 Side
z 1 0 0 0.6 1 0.95 0.4 0 -3.3
X1 0 1 0 0.4 0 0.05 -0.4 0 0.3
X2 0 0 1 -0.2 0 0.1 0.2 0 3.6
art3 0 0 0 -0.6 -1 0.05 0.6 1 3.3
This basis is optimal for phase 1, but all slack variables are not at zero. There is
no feasible solution to the original problem.
Linear Programming Methods 29
19. For the problem below, use the phase 1 procedure to find a feasible solution. Set up
the tableau to begin phase 2.
x1 + 2x2 – x3 + 4x4 ≥ 2
x4 £ 20
xj ≥ 0, j = 1,…, 4
Iteration 1 : x4 enters the basis and art1 leaves. This tableau is optimum for
phase 1.
Basic 1 2 3 4 5 6 7 8 Right
Variables z X1 X2 X3 X4 X5 X6 X7 art1 Side
z 1 0 0 0 0 0 0 0 1 0
X5 0 3.25 1.5 1.75 0 1 -1.25 0 1.25 22.5
X4 0 0.25 0.5 -0.25 1 0 -0.25 0 0.25 0.5
X7 0 -0.25 -0.5 0.25 0 0 0.25 1 -0.25 19.5
subject to x1 – x3 + x4 £ 5
–x1 + 2x2 + x4 £ 6
x2 + 2x3 + 0.5x4 £ 8
0 £ xj £ 1, j = 1, 2, 3, 4
After several pivots the simplex tableau appears as below, where x5, x6 and x7 are the
slack variables for the three constraints.
Coefficients
Row Basic z x1 x2 x3 x4 x5 x6 x7 RHS
0 z 1 0 –1.5 0 –1.25 2 0 1.5 22
1 x1 0 1 0.5 0 1.25 1 0 0.5 9
2 x6 0 0 2.5 0 2.25 1 1 0.5 15
3 x3 0 0 0.5 1 0.25 0 0 0.5 4
a. What is the basic solution described by the tableau? Give the values of all
variables and the objective function.
b. Without performing a pivot, predict the solution that would be obtained if x5
were to enter the basis. Use the usual rule to determine the leaving variable.
c. Without performing a pivot predict the solution that would be obtained if x5 were
to enter the basis. Let the leaving variable be x6.
d. Write the equation described by row 3 in the tableau.
e. What variable should enter the basis to obtain the greatest total increase in the
objective at the next iteration?
f. Using the "most negative reduced cost" rule to determine the entering variable,
what variables will enter and leave the basis at the next iteration?
g. Let x7 enter the basis and select the variable to leave the basis that assures the
next solution will be feasible. Perform a pivot and show the new tableau.
Basic 1 2 3 4 5 6 7 Right
Variables z X1 X2 X3 X4 X5 X6 X7 Side
z 1 0 -3 -3 -2 2 0 0 10
X1 0 1 0 -1 1 1 0 0 5
X6 0 0 2 -1 2 1 1 0 11
X7 0 0 1 2 0.5 0 0 1 8
Linear Programming Methods 32
Minimize z = 2x1 + x2
subject to –x1 + 2x2 £ 10
x1 – 2x2 £ 4
x1 + x2 ≥ 8
x1 + 2x2 £ 20
x1 ≥ 0, x2 ≥ 0
b. The number of basic solutions for this problem could be no more than 15.
c. A selection of x1 x2 x4 x6 as basic variable can cause the first and third
constraints to be tight (same as setting x3 and x5, to 0).
The basic solution is x1 = 2, x2 = 6, x4 =14, x6 = 6.
Linear Programming Methods 33
Basic 1 2 3 4 5 6 7 Right
Variables z X1 X2 X3 X4 X5 X6 art1 Side
z 1 -1 -1 0 0 1 0 0 -8
X3 0 -1 2 1 0 0 0 0 10
X4 0 1 -2 0 1 0 0 0 40
art1 0 1 1 0 0 -1 0 1 8
X6 0 1 2 0 0 0 1 0 20
f Either x1 or x2 may enter the basis. If x1 enters, then the artificial variable will
leave. If x2 enters then x3 must leave the basis.
Linear Programming Methods 34
22. Starting from the tableau below, perform at least two iterations of the dual simplex
algorithm. Comment on the solution obtained after constructing the second tableau.
Coefficients
Row Basic z x1 x2 x3 x4 RHS
0 z 1 0 2 0 3 –5
1 x3 0 0 2 1 6 4
2 x1 0 1 –1 0 –2 –4
Starting tableau
Row Basic Basic 1 2 3 4 Right
Number Index Variables z X1 X2 X3 X4 Side
0 0 z 1 -4E-08 2 -1E-08 3 -5
1 3 X3 0 -9E-08 2 1 6 4
2 1 X1 0 1 -1 -6E-17 -2 -4
Dual Ratio --- --- 2 --- 1.5
The solution is still infeasible. At this point x4 must leave the basis. Since there
are no negative entries in row 2, there is no variable that can enter. This means
there is no feasible solution.
Linear Programming Methods 35
23. The tableau below shows the optimal solution for the problem
a. Reoptimize after the original problem is changed so the right-hand side of (C1) is
6 and the right-hand side of (C2) is 2.
b. Reoptimize after the original problem is changed so the objective coefficient of
x1 is 2 and the objective coefficient of x2 is –3.
c. Reoptimize using the dual simplex method after adding the constraint x2 £ 1 to
the original problem.
a. When the RHS of (C1) is 6 and the RHS of (C2) is 2 the tableau changes.
We use the dual simplex to reoptimize. x1 is selected to leave the basis and x1
enters. The tableau is now optimum.
Row Basic Basic 1 2 3 4 Right
Number Index Variables z X1 X2 X3 X4 Side
0 0 z 1 0 0 3.5 9 1
1 2 X2 0 0 1 1 3 0
2 1 X1 0 1 0 -0.5 -1 1
c. To add the constraint x2 £ 1, we must first write the constraint in terms of the
nonbasic variables. This is: 2x1 – x4 £ -3.
We add this constraint to the tableau with the slack variable x5. The new basic
variable is negative, so we need a dual simplex iteration.
Basic Basic 1 2 3 4 5 Right
Index Variables z X1 X2 X3 X4 X5 Side
0 z 1 7 0 0 2 0 8
2 X2 0 2 1 0 1 0 4
3 X3 0 -2 0 1 2 0 4
5 X5 0 -2 0 0 -1 1 -3
Dual Ratio --- 3.5 --- --- 0.5 ---
We select x3 to leave the basis and x1 enters to obtain the new optimum solution.
Basic Basic 1 2 3 4 5 Right
Index Variables z X1 X2 X3 X4 X5 Side
0 z 1 0 0 0.5 0 3 1
2 X2 0 0 1 0 0 1 1
1 X1 0 1 0 -0.167 0 -0.333 0.3333
4 X4 0 0 0 0.3333 1 -0.333 2.3333
Linear Programming Methods 37
24. Consider the following problem with the tableau indicating the optimal solution.
x1 + x2 + x3 + x4 £ 8
xj ≥ 0, j = 1,…, 4
Coefficients
Row Basic z x1 x2 x3 x4 x5 x6 x7 RHS
0 z 1 1.5 0 4 0 0 0.5 4 35
1 x2 0 –0.5 1 1 0 0 0.5 0 3
2 x4 0 1.5 0 0 1 0 –0.5 1 5
3 x5 0 3 0 –1 0 1 –2 1 1
b. Starting from the tableau found in part (a), perform two iterations of the dual
simplex method. Use the most negative rule to choose the pivot row. State the
solution obtained in the second iteration.
a. Changing the RHS as indicated yields the tableau below. The basic variables
have the values: (x2 = 5, x4 = -2, x5 = -16).
b. For the dual simplex method, we allow x5 to leave the basis and x6 enter. The
resulting tableau is optimal. Only one iteration is necessary. The solution now is:
(x2 = 1, x4 = 2, x6 = 8).
Linear Programming Methods 38
25. Answer the following questions regarding the simplex algorithm. Each question is
independent of the others.
a. How could you change the algorithm to solve a minimization problem directly
without changing it to an equivalent maximization problem?
b. If the algorithm always chose the entering variable as the one with the negative
entry having the smallest absolute value, how would that change the ef-
fectiveness of the algorithm?
c. If the algorithm were changed to choose the variable to leave the basis having the
greatest ratio, how would that change the effectiveness of the algorithm?
a. Instead of looking for a negative reduced cost for the variable to enter the
basis, a minimization problem would allow variables with positive reduced costs
to enter the basis.
b. As long as one selects variables with negative reduced costs to enter, the
simplex algorithm will ultimately reach the optimum if the algorithm does not
cycle because of degeneracy. Choosing the variable with the smallest absolute
value for its reduced cost (it must be a negative reduced cost) the algorithm may
progress slower than when choosing the largest.
c. The primal simplex method will fail if you violate the ratio rule. Choosing
anything but the variable with the smallest ratio, will cause the solution to
because infeasible. The primal simplex algorithm will then fail.
Linear Programming Methods 40
26. Put the problem below into the matrix format. Use xsi as the slack variable for
constraint i.
2x2 + x3 + 2x4 + x5 £ 15
x1 + x2 + x5 £ 15
x1 + x2 + x3 + x4 + x5 £ 10
xj ≥ 0, j = 1,…, 5
Ê xˆ
The matrix format is [A I] Á ˜ = b where A are the constraint coefficients and I
Ë xs ¯
is identity matrix and b is RHS
The matrix form is:
c = (111
, , .2,1.2, 0.8)
x T = ( x1, x 2 , x 3 , x 4 , x 5 , x s1, x s2 , x s3 , x s4 , x s5 )
È2 0 2 1 1˘ È1 0 0 0 0˘ È12˘
Í ˙ Í ˙ Í ˙
Í0 2 1 2 1˙ Í0 1 0 0 0˙ Í15˙
A = Í1 1 0 0 1˙, I = Í0 0 1 0 0˙,b = Í15˙
Í ˙ Í ˙ Í ˙
Í5 7 4 5 6˙ Í0 0 0 1 0˙ Í60˙
ÎÍ1 1 1 1 1˚˙ ÎÍ0 0 0 0 1˙˚ ÍÎ10˙˚
The model is: Max z =cx, Ax+I £ b. x ≥ 0
Linear Programming Methods 41
27. Referring to Exercise 26, for xB = (x2, x3, xs2, xs3, xs4), the basis inverse is shown
below. The rows and columns are in the order they appear in xB.
È-0.5 0 0 0 1˘
Í 0.5 0 0 0 0˙
Í ˙
B-1 = Í 0.5 1 0 0 -2 ˙
Í ˙
Í 0.5 0 1 0 -1˙
ÍÎ 1.5 0 0 1 -7˙˚
a. Find the primal and dual basic solutions corresponding to this information.
b. Compute the reduced cost associated with each basic variable.
c. Perform two iterations of the revised simplex procedure starting from this basis.
Dual Solution
Pi 0.1 0 0 0 1
28. For the problem in Exercise 26, at optimality xB = (x2, x3, x4, xs3, xs4) and the basis
inverse is given below. Construct the simplex tableau showing this optimal solution.
Note the order of the basic variables given by xB.
È-1 -1 0 0 3˘
Í 0 -1 0 0 2˙
Í ˙
B-1 = Í 1 2 0 0 -4 ˙
Í1 1 1 0 -3˙˙
Í
ÎÍ 2 1 0 1 -9˚˙
Maximize z = x1 + x2
subject to x1 + 3x2 ≥ 15
2x1 + x2 ≥ 10
x1 + 2x2 £ 40
3x1 + x2 £ 60
Solve with the revised simplex method and comment on any special characteristics
of the optimal solution. Sketch the feasible region for the problem as stated above
(before any transformations) and show on the figure the solution at the various
iterations.
The procedure adds artificial variables xa1 and xa2 for the first two constraints
Corner Basic Solution Feasibility Objective
Point Variables (x1, ..,x6) (Yes, No) Value
–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––----
#1 (a1, a2, 5, 6) (15, 10, 40, 60) No –25
#2 (2, a2, 5, 6) (5, 5, 30, 55) No –5
#3 (2, 1, 5, 6) (4, 3, 29, 47) Yes 0 change to ph 2
#3 (2, 1, 5, 6) (4, 3, 29, 47) Yes 7
#4 (4, 1, 5, 6) (20, 15, 25, 15) Yes 15
#5 (4, 1, 5, 3) (30, 20, 20, 5) Yes 20
#6 (4, 1, 2, 3) (34, 16, 12, 37) Yes 28
–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––----
The solution is optimum for #7.
Linear Programming Methods 44
The figure shows the sequence of basic solutions followed by the simplex algorithm.
The final solution shows no special properties besides optimality.
Operations Research Models and Methods
by Paul A. Jensen and Jonathan F. Bard
John Wiley and Sons, Inc.
Copyright 2003 – All rights reserved
1. The LP below has optimal solution x* = (5, 0, 0, 0, 2) with z* = 60 and xB = (x1, x2,
x5).
x1 + 3x3 = 5
x1 + 2x2 – x5 = 3
xj ≥ 0, j = 1,…, 5
Compute simple ranges over which the basis does not change for each of objective
function coefficient and right-hand-side constant.
Constraint Analysis
Shadow Constraint Range Lower Range Upper
Num. Name Value Status Price Limit Limit Limit
1 Con1 1 0 . Equality 4.8571 10. 5.3333 10.
2 Con2 5 . Equality 2.2857 5. 5. ---
3 Con3 3 . Equality 0. 3. --- 5.
Sensitivity Analysis, Duality, and Interior Point Methods 3
xj ≥ 0, j = 1,…, 4
Ê 2/11 5/11 ˆ
B–1 = Á –1/11 3/11 ˜
Ë ¯
Constraint Analysis
Shadow Constraint Range Lower Range Upper
Num. Name Value Status Price Limit Limit Limit
1 Con1 1 3 . Upper 0.8182 13. -37.5 45.
2 Con2 1 5 . Upper 1.5455 15. 4.3333 ---
c. Find the range of parameter variation when for every unit increase in c1 we have
a unit decrease in c3 (see Exercise 3).
Sensitivity Analysis, Duality, and Interior Point Methods 4
x1 x2 x3 x4
c= 5 –3 4 –1
c* = 1 0 –1 0
Note that we do not have to add slack variables because their objective
coefficients would be zero, and hence, have no effect the results. At
optimality, we require all reduced costs to be nonnegative.
The next step is to compute the reduced costs associated with c and c*:
c = pA - c and c * = pA - c* ; however, due to the optimality of the bases matrix
B, it is only necessary to consider the reduced costs associated with x1 and
x3. The other reduced costs are greater than or equal to zero by construction
and not affected by c* as defined above.
Ê 3ˆ
c1 = (p 1 , p 2 ) A1 - c1 = (9 / 11, 17 / 11)Á ˜ - 5 = 57 / 11
Ë 5¯
Ê 3ˆ
c1* = (p 1* , p 2* ) A1 - c1* = ( -2 / 11, -5 / 11)Á ˜ - 1 = -42 / 11
Ë 5¯
l £ 57/42 = 1.36.
Sensitivity Analysis, Duality, and Interior Point Methods 5
Ê 3ˆ 44
c3 = (p 1 , p 2 ) A3 - c3 = (9 / 11, 17 / 11)Á ˜ - 4 = -4=0
Ë 1¯ 11
Ê 3ˆ -11
c3* = (p 1* , p 2* ) A3 - c3* = ( -2 / 11, -5 / 11)Á ˜ + 1 = +1 = 0
Ë 1¯ 11
d. Find the range of parameter variation when for every unit increase in b1 we have
a unit decrease in b2 (see Exercise 4).
Thus, l £ min{33.67, 8} = 8
Sensitivity Analysis, Duality, and Interior Point Methods 6
e. Find the range of parameter variation when for every unit increase of a11 there is
a 0.5 decrease of a21.
This problem can be solved by replacing the first column of the A-matrix with a
parameterized column, call it A1(l), and determining the range over which l can
–
vary while the reduced cost, c1(l), remains ≥ 0. Let
Ê 1 ˆ Ê 3ˆ Ê 1 ˆ
A1(l) = A1 + l Á ˜= Á ˜+ lÁ ˜
Ë -0.5¯ Ë 5¯ Ë -0.5¯
– Ê 3ˆ Ê 1 ˆ
and compute c1(l) = pA1(l) – c1 = (9 / 11, 17 / 11) Á ˜ + l (9 / 11, 17 / 11) Á ˜–5
Ë 5¯ Ë -0.5¯
112 1 57 1
= +l -5= +l
11 22 11 22
–
So, for c1(l) ≥ 0, we must have l ≥ –114.
Sensitivity Analysis, Duality, and Interior Point Methods 7
Determine the range over which l can vary and B remain optimal. You must find lB
– –
and lB such that lB £ l £ lB.
zRHS(l) = Maximize z = cx
subject to Ax = b + lb*, x ≥ 0
- -
Let B be the optimal basis for some value of l, and let b = B–1b and b* = B–1b*. For
B to remain optimal, primal feasibility must be maintained; i.e.,
- -
bi + lb*i ≥ 0 for all i (1)
Find the lower and upper bounds l B and lB , respectively, such that l B £ l £ lB and
B is optimal.
-
Implicit in the optimality of B is the requirement that bi ≥ 0 for all i such that bi* =
0. Otherwise, for condition (1) to hold, we must have l ≥ -bi / bi* for all i when
bi* > 0, and l £ -bi / bi* for all i when bi* < 0. To determine the upper and lower
bounds on l, we must consider all values of i. Let
Ï -b ¸
lB = minimum Ì *i : i, such that bi* < 0 ˝
Ó bi ˛
*
= +• if bi ≥ 0 for all i
Ï -b ¸
lB = maximum Ì *i : i, such that bi* > 0 ˝
Ó bi ˛
*
= –• if bi £ 0 for all i
If l B > lB , B is never primal feasible for any l. If l B £ lB , the closed interval {l :
l B £ l £ lB } = [ l B , lB ] is known as the characteristic interval or optimal interval
for the basis B.
Sensitivity Analysis, Duality, and Interior Point Methods 9
5. Let zOF(l) be the optimal objective function value for the parametric objective
coefficient problem in Exercise 3. Prove that zOF(l) is a convex function of l. Hint:
consider two values l1 and l2 and corresponding solutions x1 and x2. Now use the
definition of convexity.
6. Let zRHS(l) be the optimal objective function value for the parametric RHS problem
in Exercise 4. Consider two values l1 and l2 and corresponding solutions x1 and x2.
a. Prove that zRHS(l) is a concave function of l by writing the dual of the parametric
RHS problem and making use of the results of Exercise 5.
Let x1 be the solution to the parametric RHS problem when l = l1 and x2 be the
solution when l = l2. We must show that
zRHS(al1 + (1 – a)l2) ≥ azRHS(l1) + (1 – a)zRHS(l2) for all a Œ [0, 1] (1)
To begin, let x be the solution to the parametric RHS problem when l = al1 + (1
– a)l2, and let x√ = ax1 + (1 – a)x2. It is easy to see that x√ is feasible to the
parametric RHS problem when l = al1 + (1 – a)l2. In particular, for all a Œ [0, 1]
aAx1 = ab + al1b* (2)
(1 – a)Ax2 = (1 – a)b + (1 – a)l2b* (3)
Summing (2) and (3) gives
A x√ = b + (al1 + (1 – a)l2)b*
Also, x√ ≥ 0 for all a Œ [0, 1]. Now,
Sensitivity Analysis, Duality, and Interior Point Methods 11
x1 – x2 + 5x3 – x4 + x5 = 8
xj ≥ 0, j = 1,…, 5
For what range of values of l is the basic vector (x2, x3) optimal for this problem?
Determine the optimal BFSs for all l ≥ 0.
ÏÔ - c ¸Ô
lB = minimum Ì * j : j, such that c j* < 0 ˝
ÔÓ c j Ô˛
= +• if c j* ≥ 0 for all j
ÏÔ - c ¸Ô
l B = maximum Ì * j : j, such that c j* > 0 ˝
ÔÓ c j Ô˛
= –• if c j* £ 0 for all j
x1 x2 x3 x4 x5
c= –3 –4 –7 1 –1
c* = 0 –8 0 0 3
A= 5 –4 14 –2 1
1 –1 5 –1 1
È-4 14 ˘
For x2 and x3 basic, B = Í ˙ and the basis inverse matrix B–1 =
Î -1 5 ˚
Ê -1ˆ È5 -14 ˘ . Using B–1, we can find the dual variables associated with the
Ë 6 ¯ ÍÎ1 -4 ˙˚
vectors c and c*:
Sensitivity Analysis, Duality, and Interior Point Methods 13
-1 È5 -14 ˘
p = c BB-1 = (–4, – 7) Ê ˆ Í = (9/2, –14)
Ë 6 ¯ Î1 -4 ˙˚
and
-1 È5 -14 ˘
p* = c*BB-1 = (–8, 0) Ê ˆ Í = (20/3, –56/3).
Ë 6 ¯ Î1 -4 ˙˚
The next step is to compute the reduced costs associated with c and c*:
c = pA - c and. c ¢ = p ¢A - c¢
Ê 5ˆ
c1 = (p 1 , p 2 ) A1 - c1 = (9 / 2, -14)Á ˜ - ( -3) = 11.5
Ë 1¯
Ê 5ˆ
c1* = (p 1* , p 2* ) A1 - c1* = (20 / 3, -56 / 3)Á ˜ - 0 = 44 / 3
Ë 1¯
Ê -4ˆ
c2 = (p 1 , p 2 ) A2 - c2 = (9 / 2, -14)Á ˜ - ( -4) = 0
Ë -1¯
Ê -4ˆ
c2* = (p 1* , p 2* ) A2 - c2* = (20 / 3, -56 / 3)Á ˜ - ( -8) = 0
Ë -1¯
Ê14ˆ
c3 = (p 1 , p 2 ) A3 - c3 = (9 / 2, -14)Á ˜ - ( -7) = 0
Ë 5¯
Ê14ˆ
c3* = (p 1* , p 2* ) A3 - c3* = (20 / 3, -56 / 3)Á ˜ - 0 = 0
Ë 5¯
Ê -2ˆ
c4 = (p 1 , p 2 ) A4 - c4 = (9 / 2, -14)Á ˜ - 1 = 4
Ë -1¯
Ê -2ˆ
c4* = (p 1* , p 2* ) A4 - c4* = (20 / 3, -56 / 3)Á ˜ - 0 = 16 / 3
Ë -1¯
Ê1ˆ
c5 = (p 1 , p 2 ) A5 - c4 = (9 / 2, -14)Á ˜ - ( -1) = -8.5
Ë1¯
Ê1ˆ
c5* = (p 1* , p 2* ) A5 - c4* = (20 / 3, -56 / 3)Á ˜ - 3 = -15
Ë1¯
8.5 ¸
lB = minimum ÏÌ ˝ = -0.57 .
Ó -15 ˛
with solution
x* = (0, 2, 2, 0, 0) and z *= –12.4.
Part b: By trial and error we determine that there is no range of l ≥ 0 for which
the optimal basic vector is (x2, x3). The optimal solutions are shown below.
Lambda X1 X2 X3 X4 X5
0 0 0 1.3333 0 1.3333
0.166 0 0 1.3333 0 1.3333
0.167 unbounded
Sensitivity Analysis, Duality, and Interior Point Methods 15
8. Let x5, x6 and x7 be slack variables for the LP given below, and let xB = (x1, x2, x3).
Compute B–1.
xj ≥ 0, j = 1,…, 4
a. If the availability of only one of the raw materials can be marginally increased,
which should it be? Explain.
b. For what range of values of b1 (the amount of raw material 1 available) does the
basis B remain optimal? What is an optimal solution to the problem if b1 = 20?
c. If 7 more units of raw material 1 can be made available (above the present 8
units), what is the maximum you should pay for them? Explain.
C1 C2 C3
p 1 0.5 0.25
Basis X1 -0.2 0.6 0
Inverse X2 0.4 -0.2 0
X3 -0.2 0.1 0.25
This is the optimal basis.
Sensitivity Analysis for Worksheet P_08
Constraint Analysis
Shadow Constraint Range Lower Range Upper
Num. Name Value Status Price Limit Limit Limit
1 Con1 8 . Upper 1.1 8. 3. 18.
2 Con2 6 . Upper 0.45 6. 2.6667 16.
3 Con3 6 . Upper 0.25 6. 2. ---
Sensitivity Analysis, Duality, and Interior Point Methods 16
a. Raw Material 1 has the greatest shadow price. It’s availability should be
increased because the objective will increase by 1.1 for each unit of b1.
b. The current basis, (1, 2, 3), remains optimal as long as 3 £ b1 £ 18.
c. Since 8 + 7 = 15 is within the range determined for part b, the objective value
will increase be 1.1*7 = 7.7. The maximum you should pay for the extra raw
material is 1.1 per unit of 7.7 for the 7 units.
Sensitivity Analysis, Duality, and Interior Point Methods 17
xj ≥ 0, j = 1,…, 4
4y1 – 3y2 ≥ –3
3y1 + y2 ≥ 4
–5y1 + 2 y2 ≥ –1
yj ≥ 0, j = 1, 2
Sensitivity Analysis, Duality, and Interior Point Methods 18
10. The tableau below shows an intermediate solution for the problem in Exercise 9.
Use the information in the tableau to find the primal and dual solutions, and to
illustrate the various primal–dual relationships.
Basic Coefficients
Row variables z x1 x2 x3 x4 xs1 xs2 RHS
0 z 1 0 0 –3 3 0 1 15
1 xs1 0 0 5.8 2.4 –6.2 1 –0.6 4
2 x1 0 1 –0.6 0.2 0.4 0 0.2 3
Primal Solution: xT = (x1, x2, x3, x4, xs1, xs2 ) = (3, 0, 0, 0, 4, 0), zP = 15
Dual Solution: y = (ys1, ys2, ys3, ys4, y1, y2) = (0, 0, –3, 3, 0, 1), zD = 15
The complementary pairs are in order. (x1, ys1), etc. Note that the solution
satisfies complementary slackness.
The objective values of the primal and dual are the same.
The primal is feasible, and the dual is infeasible.
Sensitivity Analysis, Duality, and Interior Point Methods 19
11. The tableau below shows another intermediate solution for the problem in Exercise
9. Use the information in this tableau to find the primal and dual solutions and to
illustrate the various primal–dual relationships.
Basic Coefficients
Row variable z x1 x2 x3 x4 xs1 xs2 RHS
s
0 z 1 5.18 1.64 0 0 0.82 1.55 33.82
1 x3 0 2.82 –0.64 1 0 0.18 0.46 9.18
2 x4 0 1.09 –1.18 0 1 –0.09 0.27 2.91
Primal Solution: xT = (x1, x2, x3, x4, xs1, xs2 ) = (0, 0, 9.18, 2.91, 0, 0), zP = 33.82
Dual Solution: y = (ys1, ys2, ys3, ys4, y1, y2) = (5.18, 1.64, 0, 0, 0.82, 1.55),
zD = 33.82
Note that rounding errors in the primal and dual solutions may result in some
differences in the primal and dual solutions when computed with the numbers in
the tableau.
The complementary pairs are in order. (x1, ys1), etc. Note that the solution
satisfies complementary slackness.
The objective values of the primal and dual are the same.
The primal is feasible, and the dual is feasible, so both solutions are optimal.
Sensitivity Analysis, Duality, and Interior Point Methods 20
2x1 + x2 + 3x3 £ 10
x1 + x2 + x3 = 5
xj ≥ 0, j = 1,…, 3
2y1 + y2+ y3 ≥ –3
–y1 + 3y2+ y3 ≥ 1
yj ≥ 0, j = 1, 2
y3 unrestricted
b. Solution of Primal
Row Basic Basic 1 2 3 4 5 6 7 Right
Number Index Variables z X1 X2 X3 X4 X5 art1 art2 Side
0 0 z 1 0 0 0 2.6667 6 9996.3 9984.7 -17
1 1 X1 0 1 0 0 -0.667 -1 0.6667 2.3333 3
2 3 X3 0 0 0 1 0.3333 1 -0.333 -1.667 1
3 2 X2 0 0 1 0 0.3333 0 -0.333 0.3333 1
Sensitivity Analysis, Duality, and Interior Point Methods 21
x1 + x2 + 4x3 – x4 £ 6
2x1 + 3x2 – x3 + x4 £ 10
x1 + x3 + x4 £ 7
xj ≥ 0, j = 1,…, 4
Call the slack variables for the four constraints xs1, xs2, xs3 and xs4, respectively.
For each of the constraints, let the basic variables be x4, xs2, x2, and xs4 in this order.
Thus x4 is the basic variable for constraint 1, xs2 the basic variable for constraint 2,
and so on. The basis inverse for the optimal solution under these assumptions is
3/7 0 1/7 0
Ê 4/7 1 –1/7 0
ˆ
B–1 = Á ˜
–1/7 0 2/7 0
Ë –3/7 0 –1/7 1 ¯
Answer each of the following parts independently of each other using the above
information.
a. Show the basis matrix.
b. Compute the basic solution and corresponding dual solution.
c. Describe the marginal effects of allowing x1 to enter the basis. (How much will
the objective function and each of the other variables change for every unit
increase in x1?)
d. How much should x1 increase to obtain the adjacent basic solution?
e. Perform the primal simplex iteration that will allow x1 to enter the basis. Show
the new basis inverse.
f. How many basic feasible solutions are adjacent to the solution found in part (b)?
g. Let the right-hand side of the 4th constraint now be 7. Describe the marginal
effects of changing this value on the objective function and the variables,
assuming that the current solution is to remain basic.
h. What is the maximum amount that the RHS of constraint 4 can change in either
direction without causing the current solution to become infeasible?
Sensitivity Analysis, Duality, and Interior Point Methods 23
i. What if the RHS of constraint 4 were changed to be one unit greater than the
amount found in part (h). Using the dual simplex algorithm to regain feasibility,
what variables should enter and leave the basis at the next iteration?
j. Say a new constraint is added to the problem: x1 + x3 ≥ 6. Starting from the
original basic solution, how will this change the basis inverse? Without
performing any computations, explain how the next step of the solution process is
to be accomplished.
k. Say that x3 has an upper bound of 1.5, and that the problem is being solved by the
upper bounded simplex method. What is the current basic solution? Find the
variables that will enter and leave the basis in the next step. Assume that all the
variables except x3 are unbounded from above.
The problem was setup with Revised Simplex option of the Teach LP add-in. The
figures are from the spreadsheet.
a. The basis matrix is:
Basic Variables x4 s2 x2 s4
cB 5 0 1 0
Basis C 1 2 0 -1 0
C 2 -1 1 1 0
C 3 1 0 3 0
C 4 1 0 0 1
The reduced cost of x1 is 6. This means that the objective function will decrease
by 6 for every unit increase of x1. The numbers in the column indicate how much
each basic variable will decrease per unit increase in x1. For example, x4 is basic
for C1. Then x4 decreases by 1.5714 for each unit increase in x1. Similarly, s2 will
decrease by 2.4286, x2 will decrease by 0.1429, and s4 will increase by 0.571.
The minimum ratio is for x4, so the adjacent basic solution will included x1 and not
include x4.
f. How many basic feasible solutions are adjacent to the solution found in part
(b)?
There are 8 variables and 4 non-basic variables. Any one of the non-basic
variables can be chosen to enter the basis. Using the ratio rule some variable
will be selected to leave the basis. Pivoting will lead to the adjacent basic
solution. Since there are 4 non-basic variables, there are 4 adjacent feasible
solutions (assuming no degeneracy).
g. Let the right-hand side of the 4th constraint now be 7. Describe the marginal
effects of changing this value on the objective function and the variables,
assuming that the current solution is to remain basic.
The slack variable for the 4th constraint is basic, so the constraint is currently
loose. The marginal affect on the basic variables and objective value is 0.
h. What is the maximum amount that the RHS of constraint 4 can change in
either direction without causing the current solution to become infeasible?
Sensitivity Analysis, Duality, and Interior Point Methods 25
The RHS can increase by any amount and decrease to 4.857 without changing
any of the variables nor the objective function value.
i. What if the RHS of constraint 4 were changed to be one unit greater than the
amount found in part (h). Using the dual simplex algorithm to regain feasibility,
what variables should enter and leave the basis at the next iteration?
Since C4 is loose no amount of change will affect the basis. We will do this for
C3. This constraint is currently tight. The current RHS is10 and it may range
from 4 to 25. We will change the RHS to 26. The basic solution becomes:
Basic Solution
Z 42
x4 7.1429
s2 6.8571
x2 6.2857
s4 -0.143
The basis inverse now has the dimensions 5x5 because there are 5 constraints.
The basis inverse is:
Sensitivity Analysis, Duality, and Interior Point Methods 26
C 1 C 2 C 3 C 4 C 5
Basis x4 0.4286 0 0.143 0 0
Inverse s2 0.5714 1 -0.14 0 0
x2 -0.143 0 0.286 0 0
s4 -0.429 0 -0.14 1 0
s5 0 0 0 0 -1
k. Say that x3 has an upper bound of 1.5, and that the problem is being solved
by the upper bounded simplex method. What is the current basic solution? Find
the variables that will enter and leave the basis in the next step. Assume that all
the variables except x3 are unbounded from above.
This is not a good problem. The current basis has x3 non-basic and the solution
is optimum. The basis is not changed if the simple upper bound is added to x3.
Sensitivity Analysis, Duality, and Interior Point Methods 27
x1 ≥ 0, x2 ≥ 0,…, xn ≥ 0 p1 ≥ 0, p2 ≥ 0,…, pm ≥ 0
Complementary slackness: p(Ax – b) = 0 for the primal and (c – pA)x for the dual.
These are the equivalent to Equations (3) – (6) in the text.
Economic Interpretation
Suppose the primal problem represents a government agency that provides a set of
services to its clients, and that the dual represents a consulting firm that can provide the
same set of services with various complements of resources. For the former, suppose that
the demand for service type i is bi, i = 1,.. .,m, which can be met with n different types of
resources. Let aij be the amount of service type i provided by one unit of resource j at
Sensitivity Analysis, Duality, and Interior Point Methods 28
cost cj. The problem is to decide how many units of resource j to employ, denoted by xj,
so that all demand is met at minimum cost.
In contrast, the problem faced by the consulting firm is to determine how to price
its services to maximize its profit while assuring that the cost to the customer is no
greater than he can achieve by employing his own resources to provide the services. To
construct a model, let pi be the price charged per unit of service type i. The constraints
m
on the prices are Si=1piaij £ cj for all j = 1,.. .,n. Given these prices, the government
agency checks whether it can meet its service levels less expensively by contracting with
the consulting firm rather than by acquiring or employing its own resources. Because the
cost per unit of resource j is cj, and it can get the same complement of service provided
m
by one unit of resource j from the consulting firm at a cost of Si=1piaij, it would not be
m
worthwhile for the government agency to use any amount of resource j if Si=1piaij < cj.
In this case, then, we have xj = 0.
Conversely, if the consulting firm associates a positive price per unit of service
type i (pi > 0), then the government agency would do best by meeting exactly its service
n
demands. This implies that when pi > 0 the cost center will try to satisfy Sj=1aijxj = bi.
A similar interpretation can be given about the prices that the consulting firm will adopt
knowing the amounts of resources that the government agency is using.
These are precisely the complementarity slackness conditions for the primal-dual
pair given in the above tables. When they are satisfied, there is no incentive for the
government agency to change the amount of resources it employs or for the consulting
firm to change its prices. The minimum cost incurred by the former is exactly the
maximum revenue realized by the latter. This results in an economic equilibrium where
n m
cost ÊËSj=1cjxjˆ¯ = ÊËSi=1pibiˆ¯ revenue.
Sensitivity Analysis, Duality, and Interior Point Methods 29
Maximize z = –x1 – x2
subject to x1 + x2 + x3 = 1
x1 ≥ 0, x2 ≥ 0, x3 ≥ 0
a. Formulate the primal barrier problem and find closed form solutions for x1(m),
x2(m) and x3(m).
Before beginning, note that the optimal solution is x* = (0, 0, 1) and z* = 0. Now,
from Table 4.14, the Lagrangian for the problem is
n
LP = cx + µ Âlog(xj) – p(Ax – b)
j=1
∂LP m
= –1 + –p = 0 (2)
∂x2 x2
∂LP m
= –p = 0 (3)
∂x1 x3
x1 + x2 + x3 = 1 (4)
Equations (1) and (2) imply that x1 = x2. Using this fact, Eq. (4) indicates that x3 = 1
– 2x1. Solving Eqs. (1) and (3) for p and equating the result gives
m m m
-1 + = = .
x1 x3 1 - 2 x1
2 x12 - (3m + 1) x1 + m = 0
Solving gives
Sensitivity Analysis, Duality, and Interior Point Methods 30
3m + 1 ± 9 m 2 - 2 m + 1
x1(m) = .
4
For the procedure to work, it is necessary to use the negative sign in front of the
square root term (note that this term is always positive). Thus,
3m + 1 - 9 m 2 - 2 m + 1
x1(m) =
4
3m + 1 - 9 m 2 - 2 m + 1
x2(m) =
4
3m + 1 - 9 m 2 - 2 m + 1
x3(m) = 1 –
2
b. Show that as m decreases to zero, the vector (x1(m), x2(m), x3(m)) converges to the
unique optimal solution.
1- 1 1- 1
As m Æ 0, x1(m) Æ = 0, x2(m) Æ 0, and x3(m) = 1 – = 1 which is
4 2
indeed the optimal solution.
c. Solve the problem using the primal-dual path following algorithm starting at the
point x0 =(1/3, 1/3, 1/3).
We used the model shown below in the Teach LP add-in with the interior point
option.
Data X 1 X 2 X 3 X 4
x 3E-05 3E-05 3E-05 1
c -1 -1 0 0 RHS
C 1 1 1 1 0 0
C 2 0 0 0 1 1
The add-in only works with problems with at least two constraints, so the second
constraint is added. It is a dummy constraint that simply makes x4 = 1.
Starting from x0 =(1/3, 1/3, 1/3) we find the final interior point solution:
Sensitivity Analysis, Duality, and Interior Point Methods 31
Current Solution Pi
X Z 1 2
1 3E-05 1.0001 0.0001 0.0002
2 3E-05 1.0001
3 0.9999 0.0001 Iter.: 17
4 0.9781 0.0002 Gap 0.0003
Mu 2E-05
d. Solve the problem using the primal-dual path following algorithm starting at the
point x0 =(1/2, 1/2, 1/2).
We use the same model, but start from x0 =(1/2, 1/2, 1/2).
The solution obtained is:
Current Solution Pi
X Z 1 2
1 6E-05 1.0001 1E-04 0.0003
2 6E-05 1.0001
3 1.0333 1E-04 Iter.: 9
4 1 0.0003 Gap 0.0005
Mu 3E-05
This is essential the same solution as in part c.
Sensitivity Analysis, Duality, and Interior Point Methods 32
16. The data for a primal LP in the form: max{cx : Ax = b, x ≥ 0}, is given below.
Using the initial primal and dual solutions x0 = (1, 1, 1, 1)T and p0 = (1, 1), take
three steps of the primal-dual path following algorithm. Note that the dual solution
is only partially specified so you must find the complete solution in order to begin.
Use a step size factor g = 0.8.
Ê 1 2 2 3 ˆ Ê 8 ˆ
c = (1, 2, 3, 4), A = Á 2 1 3 2 ˜ and b = Á 8 ˜
Ë ¯ Ë ¯
Start
X Z 1 2
1 1 2 1 1
2 1 1
3 1 2 Iter.: 1
4 1 1 Gap 6
Mu 0.375
Feasibility Vectors
Primal Dual Comp. Slack.
1 0 1 0 1 -1.625
2 0 2 0 2 -0.625
3 0 3 -1.625
4 0 4 -0.625
Iteration 1
X Z 1 2
1 0.5368 0.87 1.1901 0.3399
2 0.2 0.7201
3 1.2105 0.4 Iter.: 2
4 1.5474 0.2502 Gap 1.4824
Mu 0.0926
Feasibility Vectors
Primal Dual Comp. Slack.
1 -4E-15 1 -2E-16 1 -0.374
2 -2E-15 2 -2E-16 2 -0.051
3 -3E-16 3 -0.392
4 1E-16 4 -0.294
Iteration 2
X Z 1 2
1 0.1074 0.645 1.2251 0.2099
2 0.1161 0.6602
3 1.5373 0.08 Iter.: 3
4 1.5286 0.0952 Gap 0.4144
Mu 0.0259
Feasibility Vectors
Primal Dual Comp. Slack.
1 1E-14 1 0 1 -0.043
2 1E-14 2 1E-16 2 -0.051
3 -7E-17 3 -0.097
4 6E-17 4 -0.12
Iteration 3
X Z 1 2
1 0.0234 0.6112 1.2039 0.2037
2 0.0232 0.6115
3 1.5859 0.0188 Iter.: 4
4 1.5861 0.019 Gap 0.0885
Mu 0.0055
Feasibility Vectors
Primal Dual Comp. Slack.
1 0 1 1E-16 1 -0.009
2 -2E-15 2 -2E-16 2 -0.009
3 6E-17 3 -0.024
4 -7E-16 4 -0.025
17. The optimality conditions for the primal-dual path following interior point algorithm
are given in Eq. (7). Perform the algebra necessary to obtain the Newton directions
dx, dp and dz given in Eqs. (8) – (10).
Let us start with the following equations which are equivalent to Eq. (7).
Adx = dP (1)
AT d p – d z = d D (2)
To find dp, we multiply (2) by X and add the result to (3) to get
Recalling that X = diag {x10 ,..., xn0 } and Z = diag {z10 ,..., zn0 } , the first two terms on the
right-hand side of (6) are
–Adx – AZ–1XZe = –ddP – Ax0 = –b
so (6) is equivalent to
AZ–1XATdp = –b + AZ–1µe + AZ–1XddD. (7)
which is the desired result. Equation (9) in the text is just Eq. (2) above. Eauation
(10) in the text is obtained by moving Xdz to the right-hand side of Eq. (3) above
18. Work through the algebra leading to the result in Eq. (11) that says the duality gap
will shrink at each iteration of the primal-dual path following algorithm if the barrier
parameter m < gap(0)/n. Begin with the equation for gap(a).
Equation (11) is based on the fact that both the primal and dual are feasible so the
perturbation variables, dD and dP, are both zero in Eq. (7). The implication is that dz
= –ATdp and Adx = 0, so (dz)Tdx = 0. Thus,
The second term on the right-hand side of the last equations must be greater than
zero for the gap to shrink, but this is nothing more than Eq. (11).
Operations Research Models and Methods
by Paul A. Jensen and Jonathan F. Bard
John Wiley and Sons, Inc.
Copyright 2003 – All rights reserved
Provide a network model and then find the optimal solution for each of the problems
below using the accompanying Excel add-ins or any available software package.
1. Find the shipping plan between sources and destinations that minimizes total
shipping cost while meeting the demands. The numbers in the table represent unit
shipping costs. Identify the bottlenecks in the solution.
D1 D2 D3 D4 Supply
S1 10 10 6 15 10
S2 5 15 10 12 15
S3 11 8 7 21 8
Demand 5 3 8 17
[10] [-5]
(10)
S1 D1
(10)
(15) (6)
[15] [-3]
(5)
S2 (5) D2
(10)
(12)
[8] (11) [-8]
(8)
S3 D3
(7)
(21)
2. Using the shipping costs given for Problem 1 and the production and demand data
given below, find the production schedule that maximizes profit.
[-10] {-15}
(10, -30)
D4 D4
The network model for this problem has three subnetworks, each
representing one of the three periods. The nodes labeled P1, P2, and P3
represent the manufacturing plant in the three periods. Arcs leaving these nodes
carry the shipments to the outlets and are assigned the shipping costs. The
external flows on these nodes describe the manufacturing costs and capacities in
the three periods.
Inventories are carried on the arcs from P1 to P2 and P2 to P3. The
parameters on these arcs indicate the inventory cost and capacity. Outlets are
modeled by the nodes labeled A, B, and C with maximum sales and revenues
specified by the slack external flows.
( Capacity, Cost)
(175,8) (50,-15) (200,10) (150,11)
( Cost) (75,-18) (20,-15)
A1 A2 A3
(4) (4) (4)
(6) (100,-20) (80,-18)
(6) (150,-17) (6)
P1 B1 P2 B2 P3 B3
(8) (8) (8)
(75,-14) (50,-17)
(75,-21)
C1 C2 C3
(1,100) (1,100)
4. Five crews are available to do three jobs. The matrix below shows the time in hours
required for each crew to do each job completely, but a crew can do portion of any
job in a corresponding fraction of the time. The crews are only paid for the time
they work, and can work no more than 20 hours. Their hourly wage rates are also
shown in the matrix. Find the assignment of jobs to crews that minimizes the total
cost of completing the jobs.
Crews
Jobs 1 2 3 4 5
1 15 20 40 35 45
2 20 22 30 50 35
3 25 32 50 48 60
Cost / hr 150 130 100 80 70
Model
[Fixed External Flow] Nodes on left represent crews. C4
(Upper, (Gain) and C5 are not shown. The nodes
Cost) on the right represent jobs. The -1
[-1]
(20,150) (1/15)
C1 J1 fixed flow is the requirement that
(1/20 the job be done.
(1/25 The gain on arc (i,j) is proportion of
[-1]
(20,130)
C2 J2 the job completed in one hour, or
the inverse of the time to complete
the job.
[-1]
(20,100)
C3 J3
Network Flow Programming Models 5
Solution
[Fixed External Flow]
(Upper, (Gain)
Cost)
[-1]
(20,150) (1/15)
C1 J1
(1/20
(1/25
[-1]
(20,130)
C2 J2
[-1]
(20,100)
C3 J3
6. A company has three workers. On a particular day, six jobs are scheduled to be
completed. The cost for each worker to do each job is shown in the matrix below.
Using a network flow programming model to answer each part of the problem.
Job
1 2 3 4 5 6
A 3 2 2 6 4 6
Worker B 4 3 7 5 3 3
C 9 9 7 9 7 6
a. What is the minimum cost assignment when each worker can do two jobs?
b. What is the minimum cost assignment when each worker can do only one job?
c. What is the minimum cost assignment when each worker can do any number of
jobs?
[+1] [–1]
C J3
Network Flow Programming Models 8
[+1]
(1, 0)
C J3
[–1]
(6, 0)
C J3
Network Flow Programming Models 9
7. Find the shortest path tree rooted at node 1 for the network shown.
4
(2) (5)
(9)
2 7
(3) (15)
(8)
(12) (1) (16)
1 5 9
(4)
(9) (6)
(13) (4)
3 8
(12)
(2)
6
a. Let the numbers on the arcs represent distances and find the shortest path tree
rooted at node 1.
b. Let the numbers represent flow capacity and find the maximum flow from node
1 to node 9.
[fixed] [-1]
Shortest Path
(flow, cost)
4 (1,5)
[-1] (2,2)
[-1]
(0,9)
2 7 (0,15)
[8] (6,3) [-1] (0,1)
(3,8)
(12,12) (16,16)
1 5 9 [-1]
(0,4)
(2,9) (2,6)
(0,13)
3 (2,4)
8
[-1] (1,12) [-1]
(0,2)
6
[-1]
Network Flow Programming Models 11
9. A company has just purchased a new machine for $4000. The operating cost and
resale value of the machine varies with age according to the schedule in the table
below. The discount rate for time value of money calculations is 10%.
a. Draw the generalized network that could be used to evaluate the policy “buy a
new machine every three years.” Show only the relevant arcs and the
corresponding parameters. Use this network to compute the present worth of
following this policy for an infinite period of time.
b. Show the single additional arc that would be required to determine if replacing
the machine every two years was superior to replacing it every three years.
Which is this better policy?
a.
[1]
0 1 2 3
(c0, g1 ) (c1 , g2) (c2, g3)
(c'3 , 1 )
c0 is the purchase cost, c1 and c2 are the operating costs in the two years. c3' is
the operating cost less resale value in the third year. The gi are the gain factors
are all equal to 1/(1 + i), where in this case i = 10%.
0 1 2 3
(c0, g1 ) (c1 , g2) (c2 , g3)
(c' 2, 1 )
(c'3 , 1 )
c2' is the sum of the operating cost and the resale value in the operating cost less
resale value in the second year, c2’ = 0. The optimum solution does not use this
arc and the solution is the same as for part a.
c. The complete network model is shown below. The optimum policy is to
replace every 4 years. The cost of this solution is 22170.
interes 0.1
Arc Data and Flows
Num. Name Flow Origin Term. Lower Upper Cost Gain Flow_O
1 Y0-Y1 3.155 1 2 0 10000 4000 0.909 2.868
2 Y1-Y2 2.868 2 3 0 10000 800 0.909 2.607
3 Y2-Y3 2.607 3 4 0 10000 800 0.909 2.37
4 Y3-Y4 2.37 4 5 0 10000 1000 0.909 2.155
5 Y4-Y5 0 5 6 0 10000 1500 0.909 0
6 Y1-Y0 0 2 1 0 10000 -1200 1 0
7 Y2-Y0 0 3 1 0 10000 0 1 0
8 Y3-Y0 0 4 1 0 10000 600 1 0
9 Y4-Y0 2.155 5 1 0 10000 1300 1 2.155
10 Y5-Y0 0 6 1 0 10000 2000 1 0
The sensitivity analysis for the variables is obtained when the model is solved as
an LP. It is shown below.
Network Flow Programming Models 14
10. You have two choices for providing yourself with the use of a new Honda:
1. You can purchase a contract for $100,000 that provides you with the car for 10
years. There are no other costs associated with this option. For purposes of
analysis, assume that the same contract will be available 10 years from now, and
forever after.
2. You can purchase the Honda for $20,000 and keep it for either 2 years, 4 years
or 6 years. The annual maintenance and salvage values are listed below. Resale
values for odd years are not shown because they are not included as options.
Again it is assumed that this or similar car will be available forever.
1 $500 ––
2 500 $10000
3 1000 ––
4 2000 6000
5 3000 ––
6 5000 2000
Maintenance and salvage values occur at the end of the year. Purchase costs are at
the beginning of the year. The selection depends on your minimum acceptable rate
of return, which is 25% per year.
a. Determine whether (1) or (2) is the optimal choice. The goal is to minimize the
present worth of the cost of ownership for an infinite time period.
Network Model
[external flow]
(cost, gain)
g = 1/(1+.25) = 0.8
[1]
(20000, (500, g) (500, g) (1000, g) (2000, g) (3000, g)
0 1 2 3 4 5 6
0 1 2 3 4 5
(-9500, 1)
6
(-4000, 1)
7
(3000, 1)
10 8
(100000, g )
7 8
9 10
g = 0.10737
(0, 1)
10
Flow solution
[external flow]
(flow)
[1]
(1.3553) (1.0842) (0.8674) (0.6939) (0.5551) (0.4441)
0 1 2 3 4 5 6
0 1 2 3 4 5
(0)
6
(0)
7
(0.3553)
10 8
(0 )
7 8
9
(0)
10
11. The accompanying figure shows a generalized network. All arc costs are 1 and all
arc gains are 2. All arcs have lower bounds of zero and unlimited upper bounds on
flow. Write the linear programming model for this network and find the solution.
The objective is to minimize the total flow cost.
[-8]
1
2 3
4 5 6
subject to:
Node 1: x1 - 2 x3 = -8
Node 2: x3 + x7 - 2 x2 - 2 x9 = 0
Node 3: x2 + x4 - 2 x1 - 2 x6 = 0
Node 4: x9 - 2 x8 = 0
Node 5: x6 + x8 - 2 x5 - 2 x7 = 0
Node 6: x5 - 2 x4 = 0
xk ≥ 0 for k = 1º9
Optimum Solutions, Cost = 8
[External Flow] (flow, cost, gain)
[-8] [-8]
1 1
(2.286,1,2) (2,1,2)
2 3 2 3
(1.143,1,2) (0.286,1,2)
(0,1,2) (0,1,2) (0,1,2) (0,1,2) (0,1,2) (0,1,2)
12. Draw an arc that describes a plant that transforms wood to chairs. A gain parameter
should be used to reflect this transformation. Flow entering the arc is measured in
pounds of wood. Flow leaving the arc is to be in units of chairs. Twenty pounds of
wood are required for each chair. The plant can process no more than 1000 chairs at
a cost of $40 per chair.
13. The arc below has a nonzero lower bound. Show an equivalent arc that has a zero
lower bound.
[b = 4] [b = –2]
i j
(l = 5, u = 10, c = 3, g = 1)
[b = -1] [b = 3]
i j
(l = 0, u = 5, c = 3, g = 1)
14. A company offers volume discounts for its products. The first 20 units are sold for
$5 per unit, the next 10 for $2 per unit, and any number beyond that for $1 per unit.
Show the arc structure that describes this revenue function for a minimum cost
network flow programming model.
(upper, cost)
(20, -5)
(10, -2)
(M, -1)
Network Flow Programming Models 19
16. A mining company has discovered a mineral reserve with 400 tons of recoverable
ore. Engineers estimate that the cost of mining the first 200 tons will be $150 per
ton. To mine the next 100 tons will cost $200 per ton. The final 100 tons will cost
$300 per ton. The raw ore can be stored at the mine site for a cost of $50 per ton per
year. The equipment available allows a maximum of 50 tons to be mined each year.
After mining, the ore is processed into ingots at a cost of $2 per ingot. Each
ton makes 100 ingots. The processing capacity is 40 tons (or 4000 ingots) per year.
Ingots may be stored after they are processed but because of impurities in the
atmosphere, 10% of the amount stored in any year will be lost. The cost of storing
an ingot for a year is $0.60.
The demand and the selling price for ingots for the next 10 years is shown in
the table below. The demand figures indicate the maximum sales. The actual sales
may be less than the stated demands.
Set up and solve the network flow model to determine the optimal policy for
mining ore, storing it, processing it into ingots, storing ingots and selling them. The
solution should determine each of these quantities for each of the next 10 years.
Year 1 2 3 4 5 6 7 8 9 10
Demand 0 0 2000 3000 4000 5000 6000 7000 8000 9000
Price ($) 4.5 5.0 5.5 6.0 6.0 6.5 6.5 6.0
(200, 150, 1)
Ore (100, 200, 1)
Reserve Mine (upper, cost, gain)
(100, 300, 1)
All arcs
Mining
(50,0,1)
M1 M2 M3 M4 M5 M6
I1 I2 I3 I4 I5 I6
(3000,-5.0,1)
(4000,-5.5,1)
(5000,-6,1)
(2000,-4.5,1)
[0] [0]
Sales
All arcs
(M,.6,.9)
Ingot Storage
Network Flow Programming Models 21
17. A company makes two items labeled A and B. Management wants to obtain a
production plan for the next three months. The demand for the two items over this
period is given in the table below. The company does not have to sell the amount
demanded, rather the numbers given are upper bounds on sales. If the company
provides less than the amount demanded, the difference is lost. The unit revenues
for the items in each of the next three months are also shown.
(20,5,0.9 ) (20,5,0.9 )
A1 A2 A3
(M,0,12 ) (100,-50,1) (M,0,12 ) (200,-55,1) (M,0,12 ) (176,-49,1)
(250, 0, 1) (250, 0, 1)
(250, 0, 1)
(15, 150,1) P1 S1
(15, 150,1)
P2 S2 P3 S3
(15, 150,1)
We have modeled the labor cost with the marginal value of labor used. The idle
cost of labor is fixed at $450 per month so the optimum solution will not depend
on this amount.
Period 1 2 3
Workers 15 15 15
Prod A 4.375 0 4.75
Prod B 10.625 15 10.25
Sales A 52.5 0 57
Sales B 75 129 82
Total 127.5 129 139
Inv A 0 0 0
Inv B 10 0 0
The optimum solution cost for this network is: -28296. Adding the fixed labor cost
of 15*450 = 20250, we obtain a net profit of $8046 for the optimum solution.
Network Flow Programming Models 24
18. A small university has four buildings, A through D, and six faculty parking lots, I
through VI.
a. With the data in the table below determine the lots to which the building
occupants should be assigned to minimize the total walking distance for the
faculty.
b. Say that five faculty members in each building are full professors, two are
associate professors, and the remainder are assistant professors. Use a goal
programming approach to assure that the full professors have priority over all
others and that the associate professors have priority over the assistant professors
in the assignment of parking spots.
Network Model
[15] [21] [13] [7]
[fixed flow]
A B C D
I II III IV V VI
Part a. Numbers on arcs are assignments. The solution has total distance at 106.
[15] [21] [13] [7]
[fixed flow]
A (3) B C D
I II III IV V VI
Part b. Must define a node for each professor type, and an arc from each
professor type to each parking lot. We multiply the distances for full professors
by 100, associate professors by 10 and assistant professors by 1. This gives the
required priority structure. The figure below shows the assignment of professors
to lots. The total distance traveled by all professors is still 106 as in part a, but
here the full and associate professors are given special consideration.
Name I II III IV V VI Min. Max.
Prof A 0 2 0 0 3 0 5 5
Prof B 5 0 0 0 0 0 5 5
Prof C 0 0 0 5 0 0 5 5
Prof D 0 0 0 5 0 0 5 5
Assoc A 0 2 0 0 0 0 2 2
Assoc B 0 0 0 0 0 2 2 2
Assoc C 0 0 2 0 0 0 2 2
Assoc D 0 0 2 0 0 0 2 2
Assis A 0 8 0 0 0 0 8 8
Assis B 0 0 5 0 0 9 14 14
Assis C 0 0 6 0 0 0 6 6
Assis D 0 0 0 0 0 0 0 0
Min.: 0 0 0 0 0 0
Max: 5 12 15 10 3 15
Network Flow Programming Models 26
19. For this distribution problem supply and demand data, direct shipping costs from
suppliers to customers, and transshipment costs to and from a terminal are given
below.
Customers
5 6 7 Terminal Supply
1 5 4 3 2 15
Suppliers 2 1 2 3 2 15
3 5 5 4 3 15
4 6 1 4 3 15
Terminal 3 1 2
Demand 17 15 20
Set up and solve the minimum cost network flow model for this problem.
Network Model
[-17]
(15) (10) [Fixed flow]
M
S1 D5
(Capacity)
(15) [-15]
S2 D6
[-20]
(15)
S3 D7
(15)
S4
(15)
T1 T2
All arcs have capacities of 7, except the arc (M, D5) with a capacity of 10, (T1,
T2) with a capacity of 15, and the input arcs.
Network Flow Programming Models 27
20. A developing country has two mines labeled M1 and M2 from which coal can be
obtained, two power plants labeled P1 and P2 that burn coal to produce electricity,
and 3 cities labeled C1, C2 and C3 that use the electricity. The government's energy
department wants to determine the optimal plan for producing and delivering the
electricity, and for mining the coal over a given period of time. The demand, which
is measured in megawatt hours (MWH), is 1000 MWH for C1, 500 MWH for C2, and
3000 MWH for C3.
Power is transmitted from the plants to the cities over lines that experience losses
due to electrical resistance. The size of the losses depends on the origin and
destination of the power transmitted and are given as a percentage for each plant-city
pair.
The efficiency of a plant is measured in MWH hours produced per ton of fuel input.
Each plant is limited in terms of the maximum input of fuel allowed during the
period. Processing costs for the fuel are given in the table below.
The coal must be shipped from the mines to the plant. Shipping costs are given in
dollars per ton in the following table.
During the time period covered by the plan a limited amount of coal may be taken
from each mine. For mine M1, 1200 tons may be extracted at a cost of $9 per ton
and an additional 1500 tons can be extracted at a cost of $12 per ton. For mine M2,
1500 tons can be extracted at a cost of $13 per ton with an additional 2000 tons
available at $15 per ton. Develop in detail a minimum cost network flow model that
can be used to solve the planning problem. Find the optimal solution.
Network Flow Programming Models 29
Network model.
[External Flow]
(Capacity, Cost, Gain) [-1000]
C1
(M,0,0.99)
(M,6,1) (4000,10,1)
S1 P1 Q1 (M,0,0.95)
(1200,9,1) (M,12,1)
(M,0,0.98) [-500]
(1500,12,1)
C2
(1500,13,1) (M,0,0.92)
(M,3,1)
(2000,15,1) (3000,9,0.9) (M,0,0.96)
S2 P2 Q2 [-3000]
(M,8,1)
(M,0,0.91) C3
21. A company has two plants, P1 and P2, that manufacture three products, A, B and C.
The number of labor hours needed to produce a unit of each product is shown on the
left in the table below. The cost of raw materials is shown on the right. The weekly
demand for the three products is 1000, 500 and 700, respectively. There are 1500
labor hours available at both plants. Set up a network flow model with the objective
of minimizing raw material costs, and find the solution that will meet the demand for
the products without exceeding the labor constraints.
Hint: The network should be bipartite with flow going from plants to products. Each
arc should have two parameters: cost/hr and a gain factor in terms of products/hr.
The units of flow in the network should be ‘hours.’
(17.5,0.5) [-700]
C
Network Flow Programming Models 31
Products
A B C Hrs. Used
Plants P1 500/1000 0 1000/667 1500
P2 0 600/500 66/33 666
Units Produced 1000 500 1000
Exercises 1 - 7 relate to a company with two warehouses and four customers. The
transportation costs between warehouses and customers are shown in the matrix below.
In each case, setup and solve the problem using the transportation algorithm.
Customer
1 2 3 4
Warehouse A 10 15 8 13
B 3 5 7 10
1. Each warehouse has a supply of 30 and each customer has a demand of 15. The
objective is to minimize total shipping cost. Demand must be satisfied.
2. All demands are 15 and all supplies are 40. All demands must be met, but not all
supplies must be shipped. The objective is to minimize total shipping cost.
3. All demands are 20 and all supplies are 30. All demands need not be met but ship as
much as possible. The objective is to minimize total shipping cost.
4. All demands are 20 and all supplies are 30. All demands need not be met but each
customer must receive at least 5 units. Ship as much as possible. The objective is to
minimize total shipping cost.
5. The maximum shipment to each customer is 15 and the maximum shipment from
each warehouse is 30; however, it is not necessary to meet these maximums. The
product is made at the warehouses and there is a cost of production of $8 and $10
per unit at warehouses A and B, respectively. Revenues are $14, $17, $20 and $23,
for customers 1, 2, 3 and 4, respectively. The objective is to maximize total profit.
No_Sup: 5
Option: Run Trans. Cost 1 2 3 4 5
Delay: 1 Name D1 D2 D3 D4 DDSupply D1 D2 D3 D4
1 SA 4 6 -4 -2 0 3 0 SA 10 15 8 13
2 SB - 1 -2 -3 -3 0 3 0 SB 3 5 7 10
3 SD 0 0 0 0 0 60 -14 -17 -20 -23
D e m an 1 5 15 15 15 60
6. The company needs to establish a shipping schedule for the next two months. The
demands for each customer are 15 units in the first month and 20 units in the second
month. These demands must be met. Assume that the warehouses are really
manufacturing plants where the products are made. Plant A has a manufacturing
capacity of 30 in each month, while plant B has a capacity of 50 in each month. In
the first month the cost of manufacture at A is $8 per unit and the cost of
manufacture at B is $10 per unit. In the second month the cost of manufacture is $10
at both plants. Products can be stored at the customer sites from one month to the
next at a cost of $1 per unit. Products cannot be stored at the plants. Shipping costs
are as given in the table above except that the shipping company is giving a discount
of $1 per unit on all routes during the first month. The goal is to minimize total
production, shipping, and inventory costs over the two months. Note that not all
production capacity will be utilized by the solution.
Teach Transportation
Name: P_06 Enter transportation data and press the button.
Type: TeachTrans
Supplies: 4
No_Sup: 9
Option: Run Trans. Cost 1 2 3 4 5 6 7 8 9
Delay: 1 Name D11 D21 D31 D41 D12 D22 D32 D42 DD Supply D1 D2 D3 D4
1 SA1 1 7 2 2 1 5 2 0 1 8 23 16 21 0 30 SA 10 15 8 13 8
2 SB1 1 2 1 4 1 6 1 9 1 3 15 17 20 0 50 SB 3 5 7 10 10
3 SA2 ### ### ### ### 2 0 25 18 23 0 30 10 15 8 13 10
4 SB2 ### ### ### ### 1 3 15 17 20 0 50 3 5 7 10 10
D e m an 1 5 1 5 1 5 1 5 2 0 20 20 20 20
7. Modify the model developed in Exercise 6 to allow shortages in the first period to be
filled by production in the second period. The backorder cost is $2 per unit.
Teach Transportation
Name: P_07 Enter transportation data and press the button.
Type: TeachTrans
Supplies: 4
No_Sup: 9
Option: Run Trans. Cost 1 2 3 4 5 6 7 8 9
Delay: 1 NameD11 D21 D31 D41 D12 D22 D32 D42 DDSupply D1 D2 D3 D4
1 SA1 1 7 2 2 1 5 2 0 1 8 2 3 1 6 2 1 0 30 SA 10 15 8 13 8
2 SB1 1 2 1 4 1 6 1 9 1 3 1 5 1 7 2 0 0 50 SB 3 5 7 10 10
3 SA2 2 2 2 7 2 0 2 5 2 0 2 5 1 8 2 3 0 30 10 15 8 13 10
4 SB2 1 5 1 7 1 9 2 2 1 3 1 5 1 7 2 0 0 50 3 5 7 10 10
D e m an 1 5 1 5 1 5 1 5 2 0 2 0 2 0 2 0 2 0
Destination
Source D1 D2 D3 D4 Supplies
S1 10 10 6 15 10
S2 5 15 10 12 15
S3 11 8 7 21 8
Demands 5 3 8 17
Iter: 2
Cost: 383
Status: Feasible Demanders
Enter: (3, 2) 1 2 3 4 Supply Dual(u
Leave: (1, 2) 1 10 0 10 15 6 0 15 7 -4
5 B 0 N 5 B 0 N 10
2 5 -9 15 16 10 0 12 0 0
Suppliers 0 N 0 N 3 B 12 B 15
3 11 -12 8 0 7 -12 21 0 9
0 N 3 B 0 N 5 B 8
Demand 5 3 8 17
Dual(v) 14 -1 10 12
Iter: 3
Cost: 347
Status: Feasible Demanders
Enter: (3, 1) 1 2 3 4 Supply Dual(u
Leave: (2, 3) 1 10 0 10 3 6 0 15 -5 10
2 B 0 N 8 B 0 N 10
2 5 3 15 16 10 12 12 0 2
Suppliers 0 N 0 N 0 N 15 B 15
3 11 0 8 0 7 0 21 0 11
3 B 3 B 0 N 2 B 8
Demand 5 3 8 17
Dual(v) 0 -3 -4 10
Network Flow Programming Methods 7
Iter: 4
Cost: 337
Status: Feasible Demanders
Enter: (1, 4) 1 2 3 4 Supply Dual(u
Leave: (3, 4) 1 10 0 10 3 6 0 15 0 10
0 B 0 N 8 B 2 B 10
2 5 -2 15 11 10 7 12 0 7
Suppliers 0 N 0 N 0 N 15 B 15
3 11 0 8 0 7 0 21 5 11
5 B 3 B 0 N 0 N 8
Demand 5 3 8 17
Dual(v) 0 -3 -4 5
Iter: 5
Cost: 337
Status: Feasible Demanders
Enter: (2, 1) 1 2 3 4 Supply Dual(u
Leave: (1, 1) 1 10 2 10 5 6 0 15 0 3
0 N 0 N 8 B 2 B 10
2 5 0 15 13 10 7 12 0 0
Suppliers 0 B 0 N 0 N 15 B 15
3 11 0 8 0 7 -2 21 3 6
5 B 3 B 0 N 0 N 8
Demand 5 3 8 17
Dual(v) 5 2 3 12
b. Add another source to the problem with a supply of 5 units and shipping costs to
the four destinations of 4, 9, 7 and 13, respectively. Find the new optimum. Not
all supplies need be used.
Start with the basis determined in part a. Add two new independent basic cells to
account for the added row and column.
Iter: 1 Press the button for iterations of the Simplex.
Cost: 327
Status: Not Optimum Demanders
Enter: 1 2 3 4 5 Supply Dual(u)
Leave: 1 10 2 10 3 6 0 15 0 0 1 0
0 N 0 N 3 B 7 B 0 N 10
2 5 0 15 11 10 7 12 0 0 4 -3
Suppliers 5 B 0 N 0 N 10 B 0 N 15
3 11 2 8 0 7 0 21 5 0 0 1
0 N 3 B 5 B 0 N 0 B 8
4 4 -5 9 1 7 0 13 -3 0 0 1
0 N 0 N 0 N 0 N 5 B 5
Demand 5 3 8 17 5
Dual(v) 8 7 6 15 -1
W4 12 M 12 16 15
W5 18 17 14 M 13
10. A company has three workers. On a particular day, six jobs are scheduled to be
completed. A cost is estimated for each worker-job combination and is shown in the
matrix below. Set up and solve the transportation model for each of the following
situations.
a. Find the minimum cost assignment when each worker can do two jobs.
Teach Transportation
Name: P_10a Enter transportation data and press the button.
Type: TeachTrans
Supplies: 3
No_Sup: 6
Option: Run Trans. Cost 1 2 3 4 5 6
Delay: 1 Name J 1 J 2 J 3 J 4 J 5 J 6 Supply
1 A 3 2 2 6 4 6 2
2 B 4 3 7 5 3 3 2
3 C 9 9 7 9 7 6 2
D e m an 1 1 1 1 1 1
b. Find an assignment that completes as many jobs as possible with minimum cost
when each worker can do only one job.
Teach Transportation
Name: P_10b Enter transportation data and press the button.
Type: TeachTrans
Supplies: 4
No_Sup: 6
Option: Run Trans. Cost 1 2 3 4 5 6
Delay: 1 Name J 1 J 2 J 3 J 4 J 5 J 6 Supply
1 A 3 2 2 6 4 6 1
2 B 4 3 7 5 3 3 1
3 C 9 9 7 9 7 6 1
4 Not 0 0 0 0 0 0 3
D e m an 1 1 1 1 1 1
Assignment: J1-not done, J2-B, J3-A, J4- not done, J5- not done, J6-C
c. Find a minimum cost assignment when each worker can do any number of jobs.
Job
Worker 1 2 3 4 5 6
A 3 2 2 6 4 6
B 4 3 7 5 3 3
C 9 9 7 9 7 6
Solution: Assign the job to the cheapest worker: J1-A, J2-A, J3-A, J4-B, J5-B, J6-
B
Network Flow Programming Methods 13
11. In the directed network below find the short path from the root node 1 to all other
nodes.
1
(7) (7) 7
2
(8) (11)
3 5 7 9
10 14
[7] [22] [30] [41]
12. The matrix given in the table below describes the distance between pairs of nodes in
a network. An “¥” in a cell indicates that there is no connection between the
corresponding pair of nodes. Find the shortest path tree rooted at node 1.
To
1 2 3 4 5 6
1 X 10 3 1 X X
2 X X 0 1 2 X
From 3 X X X 0 2 4
4 0 X X X 2 9
5 1 6 X X X 6
6 2 3 4 X X X
We use the label setting algorithm, we start with node 1 and sequentially add the
following arcs. The associated labels are shown.
Link Label
1-4 1
1-3 3
4-5 3
3-6 7
5-2 9
Network Flow Programming Methods 15
13. The following table shows the distance between all pairs of six points. Find the
shortest path from point D to point E.
To
A B C D E F
A –– 13 12 15 22 10
B 2 –– 9 8 26 13
From C 14 8 –– 12 7 9
D 7 4 22 –– 30 12
E 17 8 14 10 –– 3
F 13 8 10 15 15 ––
We use the label setting algorithm, we start with node D and sequentially add the
following arcs. The associated labels are shown.
Link Label
D-B 4
B-A 6
D-F 12
B-C 13
C-E 20
14. Find the shortest path tree for the network below when the origin is node L. All
links are two-way.
(28)
[157] [120] [45] [28]
E F (75) G (17) H
A (30) B (23) C D
[148] [118] [95] [48]
Network Flow Programming Methods 17
15. Find the shortest path tree from node A using the branch lengths in the table.
To
A B C D E F
Network Flow Programming Methods 18
16. Solve the following problems for the graph below. All edges may be traveled in
either direction.
a. Find the shortest path tree with origin at node A.
b. Find the shortest path tree with origin at node C.
(3)
B C
(2)
(10) (13)
(7) (10)
(7)
A D
(8)
(10) (10)
(2)
F E
(2)
[0] (7) [7]
(7)
A D
(10)
F E
[9] [10]
(2)
[5] [12]
(7)
A D
(8)
F (2) E
[8] [10]
Network Flow Programming Methods 19
17. Give a linear programming formulation for the shortest path problem based on the
minimum cost flow model described by Equations (7) to (9).
Âx ij – Âx ji = -1 i Œ N - s (2)
{ j ;( i , j )ŒA} { j :( j , i )ŒA}
Âx ij – Âx ji = N -1 for i = s (3)
{ j ;( i , j )ŒA} { j :( j , i )ŒA}
xij ≥ 0 for each (i, j)Œ A
One constraint is redundant. The arcs with nonzero flow are members of the
shortest path tree.
Network Flow Programming Methods 20
8
1 3 9
17
9
2 18
10
4 10
3 11 19
1 12 14
4 5 13 11 20
14
5 21
6 15 12
6 22
16
7 13
Initial Flows
Arc 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
Flow 1 0 1 0 1 0 1 0 0 1 0 0 0 1 0 0 1 1 1 0 0 0
initial solution at 7
the right. 1
3
8
9 17
[2] 9
2
[9] 18
10
4 10
3 11 19 [21]
1 12 14
[0]
4 5 13 11 20
[4]
14 [8]
5 21
6 15 12
6 22
16
[6] 7 13
8
1
3 9 17
[-9] 9
2
[13] 18
10
4 10
3 11 19 [20]
1 12 14
[0] [15]
4 5 13 11 20
[4]
14
5 21
6 15 12
6 [-14] 22
16
[6] 7 13
8
1
3 9 17
[-9] 9
2
[13] 18
10
4 10
3 11 19
1 12 14
[0]
4 5 13 11 20
[4]
14
5 21
6 15 12
6 22
16
7 13
1 6
(2)
(5) 5 (3)
2 8
(3)
3 5
6
(3, 4)
2 4
3
(5,5) (2, 2) (3, 7)
1 4 7
1 6
(0, 2)
(1, 5) 5 (3, 3)
2 8
(1, 3)
3 6
5
1 6
(2, 2)
[0] (4, 5) 5 (3, 3)
2 8
(2, 3)
3 5
[2] 6 [6]
21. Give a linear programming formulation for the maximum flow problem based on the
minimum cost flow model (4a) - (4c).
Âx ij – Âx ji = 0 i Œ N - {s and t} (2)
{ j ;( i , j )ŒA} { j :( j , i )ŒA}
Âx ij – Âx ji - v = 0 for i = s (3)
{ j ;( i , j )ŒA} { j :( j , i )ŒA}
Âx ij – Âx ji + v = 0 for i = t (4)
{ j ;( i , j )ŒA} { j :( j , i )ŒA}
xij £ uij for each (i, j)Œ A
xij ≥ 0 for each (i, j)Œ A
Network Flow Programming Methods 27
3 [0]
Using this figure, determine the primal and dual basic solutions when are as
given in each part. Classify each as feasible, infeasible, or no solution. Classify
feasible solutions as optimal or nonoptimal. In each case, indicate the reason for
your classification.
(i) nB = {8, 7, 2, 5}, n0 = {1, 3, 6}, n1 = {4}.
3
[0,5]
3
[0,5]
3
[0,-3]
The solution is not feasible because some flows are above the upper bound and
some flows are negative.
Network Flow Programming Methods 29
23. For the network below, determine if the flows given are optimal. The basic arcs in
the figure are 1, 4, 7 and 9. If the solution is not optimal, what arcs violate the
optimality conditions?
(1, 2, 0)
1 4 5
[0] (1, 1, 2)
(4, 5, 0)
5 1 2 (0, 3, 1) 4 [–3]
9
8
(2, 2, 6)
(2, 2, 1)
6 (2, 3, 3)
3 7
3
[–1]
[0, 3]
[fixed external flow, p]
(flow, upper bound, cost) 2
(1, 3, 3) (0, 1, 2)
(1, 2, 0)
1 4 5
[0] [–3, 6]
(1, 1, 2)
(4, 5, 0)
5 1 2 (0, 3, 1) 4
9 8
(2, 2, 6)
(2, 2, 1) 6 (2, 3, 3)
3 7
3
[-1, 3]
Arcs violating optimality: d5 = –1 and x5 = 0, d6 = 6 and x5 = u6.
This is a continuation of the primal simplex that is not necessary for this problem.
Let x6 enter the basis. Arc 4 will leave. The new solution will have x6 = 1 and x4
= 0. The other flows remain the same. In the new basis has nB = {9. 1. 6,7}, and
p = [0, 3, 9, 12, 0].
Network Flow Programming Methods 30
24. Compute the primal and dual solutions for the basis consisting of arcs 1, 2, 4, 6, 8,
10, 12 and 14. Test the solution for optimality. If it is not optimal which arcs violate
the optimality conditions.
(4, 3 )
(4, 6 )
(9
(4, 4 )
(4, 5 )
9 13
(20, 0) 1 5 16
1
(7, 3 )
(4, 2 )
(6, 1 )
(9
(5, 7 )
,7 3 15
) 7 11
2
(10,18 ) (11, 8 ) (11, 11 )
3 5 7 9
6 10 14
[–8]
d5 = -1, d7 = -2. Arcs 5 and 7 violate optimality conditions and are candidates to
enter the basis.
Operations Research Models and Methods
by Paul A. Jensen and Jonathan F. Bard
John Wiley and Sons, Inc.
Copyright 2003 – All rights reserved
The following problems are cumulative in that each part is based on the answer to
the previous parts.
a. Rewrite the model using only binary variables.
b. Rewrite the model as a minimization problem with all less than or equal to
constraints.
c. Rewrite the model as a minimization problem with all positive objective function
coefficients.
a. From the first constraint, the bound on each variable is at most 15, so we
replace each variable by: xj = xj1 + 2xj2 + 4xj3 + 8xj4, or
c. Complement all the variables, remove constants from the objective function,
and move constraints in the constraints to the right-hand side of the
inequalities.
Integer Programming Models 3
VARIABLE DEFINITIONS
Let the following binary variables represent the decision to select a project in a specified
year. Thus A1 is the decision to select project A in period 1.
Variables: A1, A2, A3, B1, B2, B3, C1, C2, C3.
OBJECTIVE FUNCTION
Max Z = +7A1 +5A2 +8A3 +6B1 +4B2 +7B3 +4C1 +4C2 +5C3
NO MORE THAN TWO INVESTMENTS IN A YEAR.
INV1: + A1 + B1 + C1 £ 2
INV2: + A2 + B2 + C2 £ 2
INV3: + A3 + B3 + C3 £ 2
TOTAL INVESTMENT IN A YEAR CANNOT EXCEED 9.
BUD1: +5A1 +3B1 +5C1 £ 9
BUD2: +5A2 +3B2 +5C2 £ 9
BUD3: +5A3 +3B3 +5C3 £ 9
PROJECT B MUST BE SELECTED AFTER PROJECT A. THEY CANNOT BE IN THE
SAME YEAR.
AB1: + B1 =0
AB2: + A1 – B2 ≥0
Integer Programming Models 4
AB3: + A2 + A2 – B3 ≥ 0
A PROJECT CAN BE SELECTED AT MOST ONCE.
ME1: + A1 + A2 + A3 £ 1
ME2: + B1 + B2 + B3 £ 1
ME3: + C1 + C2 + C3 £ 1
BINARY RESTRICTION
All variables are 0 – 1
OPTIMAL SOLUTION
All variables are zero except A1, B3, and C3. Invest in project A in period 1 and
projects B and C in period 3. The value of the objective function is 19.
Integer Programming Models 5
∑ The second link touching the city adds the cost d2.
∑ The third link touching the city adds the cost d3.
VARIABLE DEFINITIONS
A variable must be defined for each potential link between ciy pairs.
The constraints will assure that at least one link touches each city. Variables
must be included for the second and third link.
Ï1 if a second link touches city j
Let y j 2 = Ì j = 1,º, 5
Ó0 if not
Similarly yj3 is defined for the third link touching each city.
Integer Programming Models 6
CONSTRAINTS
Constraints are included for pairs: (1,4), (1,5), (2,3), (2,4), (2,5), (3,4), (3,5), (4,5).
Constraint that assures that four links will be chosen. This is necessary for a tree.
TREE: x12+x13 +x14+x15 +x23 +x24+x25 +x34 +x35 +x45 = 4
Constraints that assure that the second link is added before the third link.
OBJECTIVE FUNCTION
Min z = 3y12 + 1y13 + 3y22 + 1y23 + 3y32 + 1y33 +3y42 + 1y43 + 3y52 + 1y53 +
13x45
OPTIMAL SOLUTION
The optimal tree is interconnections between node pairs: (1, 3), (2, 3), (3, 4), and
(4, 5). The total cost is 56.
Integer Programming Models 7
4. The figure below shows a road network between two cities A and B located in
different states. The federal government wants to place inspection stations on the
roads so that all traffic moving between the cities must pass through at least one
station. The cost of establishing a station on road k is ck, as indicated by the
numbers in parentheses in the figure.
a. Show that the problem of selecting the minimum cost location of stations can be
modeled as a set covering problem. (Hint: the rows of the A matrix will represent
paths between the two cities, and the columns will represent individual roads.)
b. Describe a more efficient way to solve this problem using one of the standard
network models.
(6)
5 (7) 16
(1)
(10)
(4) 4 (3)
(8) 3 17
2 7 (7)
(8) (1) 15 (6)
A 8 14
(9) 6 B
(7)
(3) (4)
1 9 (1)
(2) 11 13 18
(5)
10
12
a. This is a covering model for this problem. Identify all paths from A to B.
Ï1 if road j is on path i
Let aij = Ì
Ó0 otherwise
Minimize cx
subject to Ax ≥ e
Integer Programming Models 8
xj = 0 or1, j = 1,…,18
To illustrate, we have identified 14 paths that go from left to right in the figure.
There are others, but we do this for simplicity. The A matrix is shown below
together with the optimal solution. For this case it is best to put inspections
stations on roads 17 and 18, those leading directly into node B. The total cost is
14.
Var. X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 X11 X12 X13 X14 X15 X16 X17 X18
Values 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1
Cost 9 8 4 1 6 8 3 1 7 2 1 5 3 6 7 7 10 4
P1 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0
P2 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 1 1 0
P3 0 1 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 1
P4 0 1 1 0 0 0 1 0 0 0 0 0 0 0 0 1 1 0
P5 0 1 1 0 0 0 1 0 0 0 0 0 0 1 0 0 0 1
P6 0 1 1 0 0 0 1 0 0 0 0 0 1 0 1 0 0 1
P7 0 1 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1
P8 1 0 0 0 0 1 1 0 0 0 0 0 0 0 0 1 1 0
P9 1 0 0 0 0 1 1 0 0 0 0 0 0 1 0 0 0 1
P10 1 0 0 0 0 1 1 0 0 0 0 0 1 0 1 0 0 1
P11 1 0 0 0 0 1 0 1 0 0 0 0 1 0 0 0 0 1
P12 1 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 1
P13 1 0 0 0 0 0 0 0 0 1 1 0 1 0 0 0 0 1
P14 1 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 1
5. (Symmetric TSP) Consider an undirected graph with m edges and n nodes. Develop
a integer linear programming model for the symmetric traveling salesman problem.
In the model, let xe be a binary variable equal to 1 if edge e is used, and 0 otherwise.
Also, let S be a proper subset of the node set N, E(S) be the set of edges whose two
end points are contained in S, and let d(j) be the set of edges incident to node j. The
cost of traversing edge e is ce.
The symmetric TSP is defined on an undirected graph G(N, E} with node set N
and edge set E. The integer programming formulation is as follows.
Minimize Âc x
e ŒE
e e (1)
subject to Â
e Œd ( i )
xe = 2 , for all i Œ N (2)
| N | -1 ˘
 xe £ | S | -1 , for all 2 £ |S| £ ÈÍ (3)
e ŒE ( S ) Í 2 ˙˙
x Œ B|E| (4)
Constraint (2) ensures that there are two edges incident to each node. In a
feasible solution, one will be an entering edge and the other a leaving edge;
however, because of symmetry, this distinction is unimportant. Constraint (3) is
the subtour elimination constraint. As is true for the symmetric case, the number
of edges in a node set S must be less than or equal to the cardinality of S minus
1. This is because subtours consisting of |S| nodes must contain |S| edges.
Equation (4) indicates that each of the |E| variables are binary.
Integer Programming Models 11
6. (Prize collecting TSP) A variant of the traveling salesman problem occurs when the
salesman receives a profit of fj if he visits city j Œ N. His tour must start at city 1
and include at least two other cities. A cost of ce is incurred if he traverses edge e.
Unlike the traditional TSP, though, he does not have to visit all n cities. The goal is
to find a tour that maximizes the difference between profits and travel costs subject
to these restrictions. Formulate an integer linear program that can be used to solve
the problem. Use the notation introduced in the preceding exercise as well as any
new notation deemed necessary.
subject to Â
e Œd ( i )
xe = 2 yj,, for all i Œ N (2)
Â
e ŒE ( S )
xe £ Â
i ŒS \ {k}
yi , for all kŒS, S Õ N\{1} (3)
( or Â
e ŒE ( S )
xe £ Â yi - 1, for all S Õ N\{1} )
i ŒS
(3')
y1 = 1 (4)
x Œ B|E|, y Œ B|N| (5)
Constraint (2) ensures that if a node is visited, two edges are incident to that
node. For i = 1, we have  eŒd (1) xe = 2 due to constraint (4). The inequalities in
(3), or the equivalent (3'), are generalized subtour elimination constraints that
guarantee that there is no subtour that does not contain node 1. Note that if we
allow xe Œ {0, 1, 2} for e Œ d(1), we also allow subtours consisting of city 1 and a
single other city.
Integer Programming Models 12
7. It is possible to replace the subtour elimination constraints (C3) in the text with the
following constraints:
ÂÂ
s ŒS j ŒN \ S
xij ≥ 1, S Ã N, S π ∆ (SEC)
To see why this is true, show that (C3) is a linear combination of the assignment
constraints (C1) and (C2), and (SEC).
n
Exactly one successor: Âx
j =1
ij = 1, i = 1,…,n (1)
 Âx
i ŒS j =1
ij = |S| (2)
Next, multiply the subtour elimination constraint C3 in the text by –1 and add the
resultant inequality to Eq. (2). This gives
n
 Âx - Âx
i ŒS j =1
ij
i ŒS j ŒS
ij ≥ | S | - | S | +1 = 1 (3)
Ê n ˆ
 Á  xij -  xij ˜ ≥ 1
i ŒS Ë j =1 j ŒS ¯
Ê ˆ
or  ÁË Â x
i ŒS j ŒS
ij + Â
j ŒN \ S
xij - Â xij ˜ ≥ 1
j ŒS ¯
so ÂÂ
i ŒS j ŒN \ S
xij ≥ 1, for all S Ã N, S π ∆
8. Give a general integer programming formulation for the cutting stock problem
described in Section 8.7.
The following notation will be used in the formulation of the cutting stock problem.
Let
n = number of possible patterns
m = number of standard widths that can be cut
di = demand for roll of with i
aij =number of rolls of width i that can be cut in pattern j
xj = number of rolls cut in pattern j
Model
n
Minimize z = Âx
j =1
j
n
subject to Âa x
j =1
ij j ≥ di , i = 1,…,m
9. For the cutting stock example in Section 8.7, write the objective function for the
following two cases.
a. The goal is to find the number of each pattern so that the excess that must be
discarded is minimized.
b. In practice, each pattern requires a certain number of cuts. For instance, pattern 1
requires only one cut while pattern 2 requires two cuts. The goal is to find the
selection of patterns that minimizes the total number of cuts.
a. Minimize the excess discarded. This assumes that rolls that are cut but not
used are saved.
Min 0x1 + 3x2 + 2x3 + 0x4 + 1x5 + 0x6 + 3x7 + 1x8 + 4x9 + 2x10 + 0x11
Same constraints.
Solution:
Pattern 1 2 3 4 5 6 7 8 9 10 11
Number 20 0 0 25 0 30 0 0 0 0 0
If it is assumed that excess rolls of the standard sizes are discarded the solution
is the same as part a. There may be a number of solutions that have 0 waste, but
cut a large number of roles. To add the secondary objective of using the
minimum number of rolls that result in 0 waste, we can add a small e to each
objective coefficient.
Min 1x1 + 2x2 + 2x3 + 2x4 + 2x5 + 2x6 + 3x7 + 4x8 + 4x9 + 4x10 + 4x11
Solution:
Pattern 1 2 3 4 5 6 7 8 9 10 11
Number 21 0 8 17 12 6 0 0 0 0 0
10. The figure below shows well targets identified by geologists in an offshore oil field.
The wells are to be drilled from platforms that are very expensive to erect. To
reduce the cost, several wells may be drilled from the same platform. The cost of a
platform designed to drill k wells is ck. To drill a set of wells, the platform is located
at the centroid of the wells and directional drilling is used to reach a target. The
operational cost to drill a well is a(h + d)2, where h is the horizontal distance from
the platform location to the target, d is the depth, and a is a constant. The depth is
assumed to be constant over the field.
y(km)
18 19 20
9
15 16 17
8
13 14
7
11 12
6
10
5
8 9
4
6 7
3
4 5
2
1 2 3
1
0
0 1 2 3 4 5 6 7 8 9 10 11 x(km)
Eighteen platform designs are proposed as shown in the table below. When a platform is
constructed, assume all wells associated with it are drilled. The problem is to find the
selection of platforms that permits the drilling of all 20 wells at minimum total cost.
Solve the problem for a = 1, d = 0.5 and ck as given below. Specific values of h
must be computed
To illustrate the computation of the cost of placing a platform, consider platform II.
The coordinates of the centroid are the average of the coordinates of the wells in the
set. Platform II covers wells 4, 5 and 6 with coordinates (2, 2), (3, 2) and (3, 3),
respectively. The location of the centroid is (xc, yc) = (8/3, 7/3). To compute the
distance between well 4 and the centroid, we use the theory of right triangles; i.e.,
Similarly, h5 = 0.471 and h6 = 0.745. The cost of building the platform and drilling
the wells is as follows.
c3 + a(h4 + d)2 + a(h5 + d)2 + a(h6 + d)2 = 31.044
Platform Design (Partitioning Problem). Number the wells and the encircled sets of wells
and define the column vector aj such that:
Ï1 if well i is in set j
aij = Ì
Ó0 otherwise
Let Sj be the wells in set j. Let (ai, bi) be the (x,y) coordinates of well i. Then the location
associated with a platform for set Sj is
Ê Âai Âbiˆ
Ái ŒSj i ŒSj ˜
(xj, yj) = Ë |S | |S | ¯
j j
where |Sj | is the number in the set. Define the horizontal distance from well i to platform
j as
hij = (ai - xj)2 + (bi - yj)2
The cost of drilling well i from platform j is
a(hij + d)2
Integer Programming Models 17
The cost of erecting platform j and drilling the wells in the set Sj is
Ï1 if platform j is constructed
Let xj = Ì
Ó0 otherwise
P1 P2 P3 P4 P5 P6 P7 P8 P9
Obj 31.8 3 1 34.1 36.7 5 8 24.2 31.5 32.1 32.1
P10 P11 P12 P13 P14 P15 P16 P17 P18
4 3 61.5 39.8 67.1 69.8 99.2 49.5 23.5 457
Integer Programming Models 18
Optimal solution
Platform Wells
I (1, 2, 3)
II (4, 5, 6)
V (7, 8, 9, 10, 11)
XI (12, 13, 14, 15)
XIII (16, 17, 18, 19, 20)
Cost = 249.4
Integer Programming Models 19
11. The demand for a company’s product over the next 12 months is given in the
following table.
Month 1 2 3 4 5 6 7 8 9 10 11 12
Demand 5 10 7 12 13 3 10 12 6 11 12 13
There is a fixed charge of $50 to make a production run. The cost of holding the
product in inventory for one month is $2 for each unit remaining in inventory at the
end of a month. There is no lead time for production, initial inventory is zero, and
no inventory cost is charged for items held less than one month. It can be shown
that it is never optimal to produce when product remains in inventory, and that it is
never optimal to produce more than enough to cover an integral number of future
months.
a. Here the variables represent producing in one month an amount that is just
equal to the demand for the next j months.
Ï1 satisfies
if amount produced in month i
demand for next j months
xij = Ì
Ó0 otherwise
Notice that there are (12)(13)/2 = 78 variables.
Ï0 if k £ i or k ≥ i + j - 1
An element k in column aij is aijk = Ì .
Ó1 otherwise
Covering Model:
12 12 - i +1
Minimize ÂÂ
i =1 j =1
cij xij
12 13 - i
subject to ÂÂa x
i =1 j =1
ij ij =b
The model can be visualized as a network. Production enters at each node and
is either used to meet demand or put in inventory.
5 10 7
0
I0
1
I1
2
I2
3 .... 12
x1 x2 x3
Ï1 if production in month j
Let yj = Ì
Ó0 if not
12 12
Objective: Min  50 y j +  2 I j
j =1 j =1
Conservation of flow:
It -1 + xt - It = dt for t = 1,º,12
I0 = 0
Implication:
Ê 12 ˆ
xt = Á Â dk ˜ yt for t = 1,º,12
Ë k =t ¯
Simple Bounds and integrality:
0 £ yt £ 1 and integer, xt ≥ 0 for t = 1,º,12
c. Develop a network model for the problem such that the shortest path through the
network gives the optimal production plan.
Hint: Let the nodes correspond to months and the cost of the arcs be the cost of
producing and perhaps holding items in inventory for the corresponding number
of months.
[+1] [-1]
1 2 3 4 . . . . 13
Integer Programming Models 22
The data below describes the components of a system in which n = 4. Find the opti-
mal number of redundant components of each type subject to constraints on total
cost and weight. For redundant components, the maximum total cost must be less
than or equal to $1000 and the maximum total weight must be less than or equal to
80 lbs. In addition, no more than 5 redundant components of each type may be
installed.
Components 1 2 3 4
Reliability 0.9 0.8 0.95 0.75
Cost $100 50 40 200
Weight (lbs.) 8 12 7 5
We note that we can maximize the product of reliabilities by maximizing the sum
or the natural logs of the reliabilities.
Max {R1R2R3R4} fi Max {ln(R1) + ln(R2) + ln(R3) + ln(R4)}
Ri = 1 + (1 – ri)(1+x)
ln Ri = ln (1 + (1 - ri)(1+x))
The term ln (Ri) is a concave function as illustrated below. This simplifies the
problem of finding the optimal solution.
Integer Programming Models 23
ln R i
Concave
1 2 3
-.10536
5
Maximize  ln R
i =1
i
5 5
Letting xi = Â jxij and
j =1
Âx
j =0
ij = 1, for i = 1,…,4, the objective function to be
Also, the cost and weight constraints with respect to redundant components only
are as follows.
Integer Programming Models 24
Alternative approach: Note that each term in the objective function has the proper
shape (concave) for maximization. To translate the first point to the origin, we
add a constant to each cost curve to bring it to zero, as shown in the figure below
for R1. This makes it easier to use the procedure discussed in Section 7.8.
Concave
ln R i +.10536
1 2 3
Âx
j =1
ij £ 5, i = 1,…,4
Not other constraints are needed. We don’t have to add bound constraints for
the new variables, xij, because the spacing of the breakpoints is one in all cases.
Moreover, it is not necessary to restrict the order in which variables enter the
solution due to the fact that the objective function is concave.
13. The accompanying figure represents a grid on which electric power is generated and
distributed. Each node is a demand point and also a potential location for a power
generator. The numbers in parentheses indicate power demands in megawatts
(MW). Assume that the grid is in the xy-plane, where x, y = 0,1,2,3.
9 10 11 12
2
5 6 7 8
1
1 2 3 4
0 2 3 x
1
Integer Programming Models 27
Subject to:
Implication: z j £ 100 y j j = 1º16
Demand: zj + Âx
kj ŒA
kj - Âx
jk ŒA
jk = dj j = 1º16
Distance: 8y j + Ây
k ŒDk
k £8 j = 1º16
Rows: y j + y j +1 + y j + 2 + y j + 3 £ 1 £ 1 j = 1, 5, 9,13
Cols: y j + y j + 4 + y j + 8 + y j +12 £ 1 j = 1, 2, 3, 4
Rest 1: - y1 + y16 £ 0
y j = 0,1 zj ≥ 0 xij ≥ 0
The model has 80 variables and 57 constrains. The solution puts a power plant
at 2 and 11 for a total cost of 875.5.
Integer Programming Models 28
14. The accompanying figure shows several towns along a river that generate pollution
in the amounts indicated in square brackets adjacent to their locations. The units of
pollution are lb/hr. Without control measures the pollutants enter the river directly
and do not dissipate, so any quantity discharged at one point remains in the river at
every point downstream. In other words, assuming steady-state flows, if 10 lb/hr are
discharged at point A then 10 lb/hr will flow past every point downstream of point
A. Pollutant quantities are additive so that the amount flowing past any point is the
sum of the contributions of all points upstream.
Reach 1
Reach 2
Reach 4
Reach 6
Reach 5
Reach 3
For analytic purposes, the river has been divided into several segments called
reaches. The quantity in parentheses adjacent to each reach is the flow of water in
that segment measured in acre-feet per hour. An acre-foot is a unit volume of water.
The concentration in a reach is the ratio of pollutant flow to water flow and is
measured in lb/acre-foot.
The river basin authority requires that the concentration should be no more
that 10 lb/acre-foot in a reach. To satisfy this requirement control facilities must be
constructed in each city. Two kinds of facilities are available, one removes 90% of
the pollutant and the other 95%. Construction costs are in terms of volume of
pollutant input to the facility (lb/hr) and can be approximated by fixed charge
functions. The functions are
C0.9 = 1,000,000 + 100,000x ($/hr)
where x is the pounds of pollutant per hour. Of course the costs are zero if x is zero.
Operating costs for processing the pollutants are as follows.
c0.9 = 0.10 ($/lb)
The facilities have a life of 20 years; the interest rate (discount rate) to be used in the
economic calculations is 6% per year. Although a treatment facility may be built at
a city, it is not necessary that all pollution at the city be treated.
Set up a network model for this problem. For each city the model should
include a node corresponding to the pollutant source and a node corresponding to the
river entry point, giving 12 nodes in all. A terminal node should also be included.
Note that once the pollutants enter the river they cannot be treated. To determine
which arcs to include, consider the paths that a pollutant can take from the source to
the river. Define the necessary variables, write out all the constraints and objective
function, and find the solution that minimizes total costs.
Pollution Control
19 7 8 20 9 10 21 11 12 22 13 14 23 15 16 24 17 18
1 2 3 4 5 6
A B C D E F
Let xj = flow in arc j. j = 1, .., 18.
Ï1 if plant built in arc j+6
yj = Ì j = 1, .., 2
Ó0 otherwise
Note the j ranges from 1 to 12 and relates to flows in arcs 7 to 18. Compute the per hour
equivalent of construction costs in plants. For 90% removal plant j = 1, 3, 5, 7, 9, 11, the
fixed cost is
hfj = 1,000,000 i = hf(0.9) = $6.849/hr
where i is the interest rate per hour; i = 0.06/8760 = 6.85 ¥ 10 -6
hvj = 100,000 i = hv(0.9) = $0.685/hr
Concentration Limit.
x1 / 3 £ 10
x2 / 4 £ 10
x3 / 5 £ 10
x4 / 6 £ 10
x5 / 7 £ 10
x6 / 10 £ 10
At A: none
At B: y3 = 1, x9 = 15
At C: y5 = 1, x11 = 45
At D: y7 = 1, x13 = 20
At E: none
At F: y11 = 1, x17 = 20
This solution meets all restrictions. The total cost is 105.8716. There is at least
one other optimum solution with a facility at A instead of B.
Integer Programming Models 32
15. A company must determine on which of four possible sites to build warehouses.
The amortized monthly cost at each site has two components. The first is a con-
struction cost of $1000 and the second is an operating cost of $5 per unit shipped.
There are five customers with monthly demands and transportation costs ($ per unit)
as shown in the accompanying table.
Customer
Warehouse 1 2 3 4 5
1 8 12 6 15 9
2 11 17 3 4 7
3 9 17 10 2 6
4 15 20 5 12 3
Demand 20 30 40 50 20
c11
1 1 [-d1]
x1 c12
x2 2 2 [-d2 ]
x
3
3 3 [-d3 ]
xm
m n [-dn ]
Ï1 if warehouse i is built
yi = ÌÓ0 if warehouse i is not built
m m m n
Min  fi yi +
i =1
 ci zi +
i =1
ÂÂc x ij ij
i =1 j =1
Subject to
m
Âx
i =1
ij = d j, j = 1,...,n
n
Âx
j =1
ij – xi = dj, i = 1,...,m
n
zi £ ( Â d j ) yi, i = 1,...,m
j =1
zi ≥ 0, i = 1,...,m
xij ≥ 0, i = 1,...,m
yi = 0 or 1, i = 1,...,m, j = 1,...,n
16. (Diet Problem) The space agency is preparing the menu for a lunar mission. The
astronauts have given utility measures for a single unit of each food type labeled A
through H in the table below. The nutritional content of each food type is also
given.
Food type A B C D E F G H
Utility 9 12 6 8 10 3 6 7
Vitamins 10 8 13 12 4 6 9 6
Fat 8 9 10 6 18 9 10 5
Sugar 7 7 2 14 13 9 8 4
a. Find the menu that will maximize the total utility subject to the following
nutritional requirements: the diet must have a minimum of 40 vitamin units, a
maximum of 30 fat units, and a maximum of 30 sugar units. In addition, no
more than three units of any one food type are allowed and only whole units may
be selected.
b. Compare the answer found in part a with the solution of the linear programming
model obtained when the integrality conditions are dropped.
c. An alternative goal is to maximize vitamin intake subject to the other restrictions.
What should the new diet be? How does it affect the menu utility as compared to
the answer found in part a?
Version 1
a. Model with Integer Solution. Utility is 44.
Name: A B C D E F G H
Values: 2 1 0 0 0 0 0 2
Lower Bounds: 0 0 0 0 0 0 0 0
Upper Bounds: 2 2 2 2 2 2 2 2
Name: A B C D E F G H
Values: 1.69 1.18 0 0.13 0 0 0 2
Lower Bounds: 0 0 0 0 0 0 0 0
Upper Bounds: 2 2 2 2 2 2 2 2
17. A convenience store chain is planning to enter a growing market and must determine
where to open several new stores. The accompanying map shows the major streets
in the area being considered. Adjacent streets are 1 mile apart. The X's indicate
possible store locations. All travel must follow the street network, so distance is
determined with a rectilinear metric. For instance, the distance between corners A1
and C2 is 3 miles. Set up an integer program that can be used to find the optimal
store locations. Use the data and restrictions given below.
A B C D E
1 2
1 x x
3 4
2 x x
5 6
3 x x
7 8 9
4 x x x
10
5 x
(i) The cost to construct a store at the various locations is given in the following
table.
Location 1 2 3 4 5 6 7 8 9 10
Cost 100 80 90 50 80 90 100 70 90 80
(ii) No two stores selected can be on the same street (either north-south or east-
west).
(iii) Stores must be at least 3 miles apart. Stores exactly three miles apart are ac-
ceptable.
(iv) Every grid point (such as A1 and B2) must be no more than three miles from a
store.
VARIABLE DEFINITIONS
CONSTRAINTS
ZERO–ONE RESTRICTION
yj = 0, 1 for j = 1,...,10
OBJECTIVE FUNCTION
Min z = 100y1 + 80y2 + 90y3 + 50y4 + 80y5 + 90y6 + 100y7 + 70y8 + 90y9 + 80y10
On solution have facilities at locations 2, 4 and 10. The total cost is 210.
Integer Programming Models 39
18. When solving an integer program it is very helpful to be able to efficiently compute
bounds on the optimal objective function value. Consider the days-off scheduling
problem in Section 7.7 with coefficient cj =1 for j = 1,…, 7. With this data, the goal
is to minimize the size of the workforce (Burns and Carter, 1985).
a. Derive two simply lower bounds on W, the minimum number of workers needed
given daily requirements ri, i = 1,…, 7. The first should be based on the daily
demand, the second on the total weekly demand.
b. Assume another constraint has been added to the problem; namely, that each
employee must be given A out of every B weekends off where B > A. For
example, employees might be given 3 out of every 5 weekends off. Let r1 be the
demand on Sunday and r7 the demand on Saturday, with r = max{r1,r7}. Derive
a third lower bound based on this constraint. Hint: in B weeks, each employee is
available for (B – A) weekends.
(Somewhat surprisingly, the largest of these lower bounds is the optimal value of W
when the requirement that each employee works 5 consecutive days is changed to
the requirement that each employee works 5 out of 7 days but not more than 6
consecutive days.)
Part a. The first lower bound on W ensures that there are enough employees to
meet the maximum demand on any day.
L1≥ max{ri : i = 1,…,7}
The second lower bound is needed to ensure that there is sufficient coverage so
that each worker can take two days off a week.
È1 7 ˘
L2 ≥ Í Â ri ˙
Í 5 i =1 ˙
Part c. To construct a bound for this case, we note that in B weeks, each
employee is available for (B – A) weekends. This means,
Ê B - Aˆ W ≥ r
Ë B ¯
so for lower bound 3 we have
rB ˘
L3 ≥ ÈÍ
Í B - A ˙˙
Integer Programming Models 40
19. For the days-off scheduling ILP in Section 7.7, assume that cj = 1 for j = 1,…, 7, and
write its dual. Find two feasible solutions to the dual that yield objective function
values equal to the two bounds found in Exercise 18a.
The solution is taken from Alfares [1998]. To formulate the dual, we must ignore
the integrality constraints in the days-off scheduling problem. The corresponding
dual is
7
Maximize W = Â rp
i =1
i i
Ê 7 ˆ
Á Â p i ˜ - p j - p j +1 £ 1, j = 1,..., 7
subject to Ë i =1 ¯
p j ≥ 0, i = 1,..., 7
Note that x2 and x3 are not required to be integer. The values of f1(x1) are given in
the table below, and the functions f2 and f3 are displayed in the accompanying
figure. Set up the mixed-integer linear programming model that properly represents
the nonlinear terms in the objective function.
x1 0 1 2 3 4 5
f1(x1) 10 20 –5 15 0 0
f2 f3
18 18
15
9 9
0 0
x2 x3
0 3 6 9 0 1.5 3 5
In addition, binary integer variables must be defined to assure that the pieces for x3
enter the solution in the proper order. Since h2(x2) is concave, these variables are not
required for x2. Because the variables for x1 are already binary, additional variables are
not necessary. Define the following 0–1 variables, z31 and z32 to assure that x31 and x32
enter in the proper order.
OBJECTIVE FUNCTION
Max z = 10y11 – 25y12 + 20y13 –15y14 + 0y15 + 3x21 + 2x22 + 1x23 + 2x31+ 4.3x32
A number of extra constraints beyond those in the problem are listed below.
CONSTRAINTS TO ASSURE THAT PIECES ENTER IN THE PROPER ORDER
CX11–4 y11 ≥ y12 ≥ y13 ≥ y14 ≥ y15
ORIGINAL CONSTRAINTS
x1 + 2x2 +3x3 £ 13
2x1 –x3 ≥ 0
z31 = 0 or 1, z32 = 0 or 1, x1 ≥ 0, x2 ≥ 0, x3 ≥ 0
The optimal solution has z = 25 with y11 = 1, x21 = x22 = 3, x1= 1, x2 = 6. All other
variables are zero.
Integer Programming Models 43
21. The figure below shows an oil field with eight wells spaced uniformly around the
perimeter of a circle. The length of a radial line is 1000 feet. Oil is to be collected at
the wells and delivered to the tanks that are at the center of the circle by a pipeline
system. The lines shown in the figure represent potential pipeline segments. The
cost of building a segment is given by the formula
fk(xk) = ak(xk)b
where ak is the length of the segment, xk is the flow of oil through the segment, and
b is an economy of scale factor.
Each well produces one unit of oil in the
time period of interest. The goal is to find the
pipeline design that minimizes total
construction cost.
a. Explain why the problem can be solved as a
shortest path problem when b = 1 and find
the corresponding solution.
b. Explain why the problem can be solved as a
minimum spanning tree problem when b = 0
and find the corresponding solution. Collection network for wells
c. Set up and solve the mathematical
programming model for this problem when b = 1/2 for the radial lines and b = 1
for the chordal lines. Use three segments in the piecewise linear approximation
for the radial lines with breakpoints at 2, 4 and 8.
a. When costs are linear (b = 1) the cost of connecting a pipe to a well is equal
to the total length of pipe from the collection point to the well. Clearly the
optimum for the specified case is
b. When b = 0 the cost of the pipe is independent of the flow (unless flow = 0
where the cost = 0). The optimum then is the solution that minimizes total
pipe length. This is the minimal spanning tree. A solution appears below.
To setup the model we define variables for flow in each direction on the chordal
lines. The figure shows the definitions for arc numbers.
1
8
8 9 1 2
16
17 10
7 18 2
24
19
15 3
7 23 11
20 3
6 22
21
14 12
5 13 4 4
6
5
We call these xk for k = 1,…,16. These variables have linear costs equal to 765
(found with geometry).
We identify the flows on the radial arc from node j to the center point as as yj for j
= 1,…,8. These arcs are numbered from 17 to 24 in the figure. The most a radial
arc can carry is 8 units of flow. We choose to break the square root function at x
= 2, x = 4 and x = 8 with values 1.414, 2, and 2.83 respectively.
For the piecewise linear approximation, we identify the breakpoints and slopes as
for each radial arc as:
Integer Programming Models 45
The three pieces representing the flow in a radial arc are: yj1, yj2, yj3 where
yj = yj1 + yj2 + yj3 for j = 1…8
Objective:
16 8 8 8
z = 765Â x j + 707Â y j1 + 292 Â y j 2 + 207Â y j 3
j =1 j =1 j =1 j =1
y j - y j1 - y j 2 - y j 3 = 0 for j = 1,…,8
Define variables to control order of the entry of the pieces in the approximation:
22. (Car pooling) A total of m persons have filled out a questionnaire for the purpose
of becoming part a car pool. Based on this information, analysts have determined a
compatibility index between person i and person j, denoted by cij, for all pairs of persons.
A small value for this index implies incompatibility.
Let U and L represent the maximum and minimum number of people in a car
pool, respectively. Also, let
Ï1 if person i is assigned to car pool k
xik = Ì
Ó0 otherwise.
The objective is to construct n car pools so that the associated total compatibility
index is maximized and each person is assigned to one of the vehicles.
a. Using the above notation write out the objective function that is to be
maximized.
b. Write all the constraints (using linear functions only).
c. Write a linear constraint that would assure person 1 and person 2 are not
assigned to the same vehicle.
d. Write a linear constraint that assures persons 3 and 4 are assigned to the same
vehicle.
(Define any additional notation used.)
Part a. The objective function can been written in following quadratic form.
m m n
1
Maximize total compatibility:
2
ÂÂÂc x
i =1 j =1 k =1
ij ik x jk
j πi
Note that in this formulation the fraction 1/2 is included because each pair is
counted twice. Technically, it can be omitted because the results will be the
same.
It should be evident that the first option is preferable. Linear formulations are
always easier to work with than nonlinear formulations.
Part d. Once again, there is a good way and not so good way to write this
constraint.
23. (Vehicle routing) A trucking company has a fleet of m vehicles, each identical with
capacity Q. The company must visit n customers each day starting from its depot.
Customer i requires that di unit be picked up, where di is measured in the same units
as Q. The cost of traveling from customer i to customer j is cij. After a route is
complete, the truck must return to the depot with its load. Denote the depot by index
0. Each truck is assigned at most one route per day and starts with an empty cargo
bay.
Consider the case where all demand di = 1. Develop an integer programming
model that can be used to find the minimum cost of visiting all the customers exactly
once. (This problem is an extension of the traveling salesman problem. Here, any
subset (route) of n customers not containing the depot is infeasible.)
Constraints
n
(exactly 1 successor) Âx
j =0
ij
= 1 i = 1,...,n (1b)
n n
The objective function (1a) sums the arc costs. Because each customer is
on exactly one route, this is equivalent to the cost of visiting all customers.
Constraint (1b) ensures that each customer is served by exactly one vehicle. It
also implies that all the routes are pairwise disjoint so that a vehicle visits a
customer only if it is to provide service. Equation (1c) is the flow conservation
constraint, enforcing route continuity so that the constructed routes are tours
(loops) rather than open paths. The constraints defined by (1d) track the load on
a route at departure from a customer. They also eliminate subtours by ensuring
that the load is increasing. That is, if a customer where visited twice, the load on
the vehicle would be different after departure, depending on whether it was the
first or second visit. This would produce an infeasible solution. Constraint (1e)
guarantees that the vehicle's capacity is not exceeded, while (1f) defines the
binary flow variables. Because there is no advantage in restricting di = 1, we
have presented the model with the parameter.
A few additional comments are in order. First, the parameter Qj in
constraint (1d) can be any large number, but for algorithmic purposes we would
like it to be as small as possible. The smallest value that can be used without
causing any difficulties is Qj = Q – dj. Second, it might be possible to place
bounds on the number of vehicles needed to obtain a feasible solution. Of
course, if the company has a fixed number of vehicles, the upper bound is
known. If q = a known lower bound and b = a known upper bound then the
following constraint can be included in the model.
n
q £ Âx
j =1
0j £ b (1g)
 Âx
i ŒS j ŒS
ij £ | S | -1,
| N | -1 ˘
for all 2 £ |S| £ ÈÍ and S does not contain the depot.
Í 2 ˙˙
b. How would the model change if the objective were to minimize the number of
vehicles used to visit all the customers? Write the new objective function.
Integer Programming Models 50
One way to set up the objective function is to minimize the number of transition
from the depot. The corresponding objective function is
n
Minimize Âx
j =1
0j
Note that constraint (1b) ensures that the number of vehicles leaving the depot is
equal to the number returning.
c. If the integrality requirement on the decision variables xij is relaxed so that now
we only require 0 £ xij £ 1 for all i and j, and the corresponding linear program is
solved, will the xij’s turn out to be 0 or 1 anyway? Explain.
It is very unlikely that the relaxed LP solution will have all binary variables 0 or 1.
The main reason is that the A-matrix for the problem to not totally unimondular.
As note in the problem statement, the VRP is an extension of the TSP which is
known to be NP-hard. Therefore, we can’t expect the VRP to be any easier than
the TSP.
Operations Research Models and Methods
by Paul A. Jensen and Jonathan F. Bard
John Wiley and Sons, Inc.
Copyright 2003 – All rights reserved
5 7
2 5 8
8 3 3 10
6 2 5
1 3 6 9 11
9 5 1
1 5 7 4
4 7 10
9 4
Starting from both 1 and 5 we obtain the same answer. Because there are a
number of ties for edges to enter the tree, there may be other solutions. All
should have the same total length, that is, 36.
5 7
2 5 8
8 3 3 10
6 2 5
1 3 6 9 11
9 1
5 5 4
1 7
4 7 10
9 4
Integer Programming Methods 2
2. Solve the linear sequencing problem for the following set of jobs.
Job 1 2 3 4 5 6 7 8 9 10
Job time 10 12 2 8 3 15 9 2 19 6
Penalty 5 10 12 2 5 4 14 9 10 2
Job 1 2 3 4 5 6 7 8 9 10
Job Time 10 12 2 8 3 15 9 2 19 6
Penalty 5 10 12 2 5 4 14 9 10 2
Pen/Time 0.5 0.833 6 0.25 1.667 0.267 1.556 4.5 0.526 0.333
Job Order 7 5 1 10 3 9 4 2 6 8
Objective value 1964
3. The problem of finding the sequence of jobs that has the minimum average
completion time can also be solved with a greedy algorithm. Note that penalties do
not play a part in the criterion. Propose a greedy algorithm to solve this problem and
use the data in Exercise 2 to illustrate the computations.
If all jobs have the same penalty, we obtain the optimum order by ranking the
jobs by job time, smallest first. This ordering is
Job 3 8 5 10 4 7 1 2 6 9
Job Time 2 2 3 6 8 9 10 12 15 19
Finish Time 2 4 7 13 21 30 40 52 67 86
Average completion time = 32.2
Integer Programming Methods 3
4. Redefine the table given in Exercise 2 to represent data for a knapsack problem. Let
the term “job” become “item”, “job time” become “benefit”, and “penalty” become
“weight.” Use a greedy algorithm to find a selection of items for a knapsack with
weight capacity equal to 40 units. Also solve the problem with a linear
programming algorithm and a 0-1 integer programming algorithm. Comment on the
different solutions obtained.
Step 0. Sort the items by decreasing benefit/weight ratio. Index the variables
according to this ratio.
Set W = 40. Set k =1.
Step 1. If W – wk ≥ 0, set xk = 1, else xk = 0.
Increase k by 1. If k > n, stop. Otherwise repeat step 1
Item 4 6 10 1 9 2 7 5 8 3 z
B/W 4 3.75 3 2 1.9 1.2 0.643 0.6 0.222 0.167
IP App 1 1 1 1 1 1 0 1 0 0 73
LP Sol 1 1 1 1 1 1 0.5 0 0 0 74.5
IP Sol 1 1 1 1 1 1 0 1 0 0 73
Comments on the solution: It happens that the optimum IP solution is the same
as the heuristic. The optimum LP solution is always has a an objective value no
worse than the optimum LP. Rounding down the LP solution generally is not
good, however it works in this case.
Integer Programming Methods 4
5. State the conditions for which your greedy algorithm developed in Exercise 4 will
find the optimal solution for the knapsack problem. For the given data, indicate for
what size knapsacks will the algorithm provide the optimum?
6. The table below shows the cost of building a road between each pair of towns in a
remote Alaskan area. A road can be traveled in both directions. The goal is to select
the roads to be built so that total cost is minimized. There must be a path between
every pair of towns in the final network. Model the problem as an integer program
and solve. Define all notation and discuss your solution procedure.
Town pair A-B A-C A-D A-E B-C B-D B-E C-D C-E D-E
Cost 100 150 250 90 140 230 40 110 130 70
7. Use exhaustive enumeration to solve the 0-1 IP below. Draw the corresponding
search tree and provide a table similar to Table 5 listing the results obtained at each
iteration.
3x1 + 4x2 + x3 + x4 ≥ 6
xj = 0 or 1, j =1,2,3,4
The optimum solution to this problem has Z = 14 with x = (1, 1, 0, 1). The
enumeration tree has 32 nodes.
Integer Programming Methods 7
8. The accompanying tableau gives the unit costs of transporting a commodity from
each of three proposed warehouses to each of five customers. The demand for the
commodity is also listed.
Customer
Warehouse 1 2 3 4 5 6
1 9 13 2 12 3 3
2 7 2 13 4 12 10
3 1 12 14 6 7 13
Demand 50 60 70 20 30 40
We must decide which of the three locations should have a warehouse. The capacity
of a warehouse, if built, is 200, and the construction costs at locations 1, 2 and 3 are
500, 600 and 700, respectively.
Find the optimal locations of the warehouses using exhaustive enumeration. For the
locations selected, solve the transportation problem with software accompanying the
text for each complete solution obtained from the enumeration. Also show the
search tree generated by the procedure.
There are eight options for the locations of the warehouses. The facility cost plus
the optimum transportation costs are shown below. The optimal is option 2 which
has warehouses at locations 1 and 2.
Option 1 2 3 4 5 6 7 8
Build 1 1 1 1 1 0 0 0 0
Build 2 1 1 0 0 1 1 0 0
Build 3 1 0 1 0 1 0 1 0
Cost 2400 2000 2440 Inf. 3070 Inf. Inf. Inf.
Search Tree
Level
0 0
+1 –1
1 8 1
+2 –2 +2 –2
2 5 9 12 2
+3 –3 +3 –3 +3 –3 +3 –3
3 4 6 7 10 11 13 14 3
(1,1,1) (1,1,0) (1,0,1) (1,0,0) (0,1,1) (0,1,0) (0,0,1) (0,0,0)
2400 2000 2440 Inf. 3070 Inf. Inf. Inf.
Integer Programming Methods 8
9. The following path vector was generated by a depth-first search, branch and bound
algorithm for a 0-1 integer program containing 10 decision variables.
a.
Fixed to 1: W+ = {3, 5, 9}, Fixed to 0: W- = {4, 6}, Free: W0= {1, 2, 7, 8, 10}
b.
Level
0 0
+6 –6
1 1
+5 –5
3 2 2
+9 –9 Fathom
5 4 3
+4 –4 Fathom
6 4
+3 –3
8 7 5
Fathom
c.
Pk+1 = (–6, +5, +9, –4, +3, –8)
d.
Pk+1 = (–6, +5, +9, +4)
Integer Programming Methods 9
xj = 0 or 1, j = 1,…, 6
Optimum for this problem is 19 for y = (1, 1, 1, 0, 1, 0). For this problem the
relaxations yield
a. x = (1, 1, 1, 0, 1, 0.25), ZUB = 21.5
b. x = (1, 0, 1, 0, 1, 0.5), ZUB = 19
c. x = (0, 1, 1, 1, 1, 0), ZUB = 17, Fathom because of bound
d. Fathom. No feasible solution
e. x = (1, 1, 1, 0, 1, 0), ZUB = 19 Fathom, all integer, replace incumbent
Integer Programming Methods 10
11. Solve the knapsack problem in Exercise 10 using branch and bound coupled with LP
relaxation. At each iteration, branch on the fractional variable in the relaxed solution
and use a rounding technique to find feasible solutions. Show your results in a table
and draw the corresponding search tree.
Level
0 0
+6 –6
10 1 1
Fathom +4 –4
2 9 2
+1 –1 Int. z = 19
3 8 3
+3 –3 Fathom
4 7 4
+2 –2 Fathom
5 6 5
Int. z = 17 Fathom
Integer Programming Methods 11
12. Solve the following 0-1 IP using branch and bound. Draw the search tree and at
each node provide the relaxed LP solution and any other relevant information.
xj = 0 or 1, j = 1,…, 5
Level
0 0
+4 –4
6 1 1
+2 –2 +5 –5
7 8 5 2 2
Fathom Fathom Fathom +1 –1
4 3 3
Fathom Int. z = 50
Integer Programming Methods 12
13. You wish to solve the IP below with a cutting plane technique.
After relaxing the integrality requirements and solving the resulting linear program,
the following solution is obtained.
ÈÍ 14 10 ˘˙ 1 ÈÍ 8 –10 ˘˙
B = Í –10 8 ˙ and B–1 = 212 Í 10 14 ˙ .
Î ˚ Î ˚
a. What Gomory cuts can be derived from the current information? Express the
cuts in terms of the nonbasic variables in the solution above.
b. Write the cuts found in part a in terms of the original structural variables.
c. What Dantzig cut should be added to continue the cutting plane procedure?
d. Write the Dantzig cut in terms of the original structural variables.
e. Add the Gomery cut with the largest right-hand-side value to the original linear
program and use an LP code to find the solution. Report the values of the
variables in the optimal solution. How has the objective value changed with the
addition of the cut?
c. Dantzig cut
D. x3 + x4 + x5 ≥ 1
e.
The new LP solution
Var. no. Name Value Status
1 x1 1.182 BASIC
2 x2 1.546 BASIC
3 x3 0 ZERO
4 SLK–1(x3) 0 ZERO
5 SLK–2(x4) 0.546 BASIC
6 SLK–Cut(x5 ) 0 ZERO
Objective value = 7.8182
The objective value has decreased.
Integer Programming Methods 14
14. The tableau below gives the LP solution to the relaxation of an integer programming
problem with maximization objective. All aij and bi coefficients in the original
problem are integer.
a. Write out all Gomory cuts that can be derived from the tableau.
b. Write out the Dantzig cut that can be derived from the tableau.
c. Add the Gomory cut with the largest right-hand-side value to the tableau and use
the dual simplex method to find the new solution. Perform these computations
by hand.
b. Write out the Dantzig cut that can be derived from the tableau.
x1 + x2 + x4 ≥ 1
c. Add the Gomory cut with the largest right-hand-side value to the tableau and
use the dual simplex method to find the new solution. Perform these
computations by hand.
Basic Basic 1 2 3 4 5 6 7 Right
I n d e x Variables z X 1 X 2 X 3 X 4 X 5 X 6 X 7 Side
0 z 1 0.1 0.3 0 0.2 0 0 0 0
6 X 6 0 1.3 -0.3 0 -1 0 1 0 5.3
3 X 3 0 0 1.1 1 0.4 0 0 0 1.6
5 X 5 0 -0.8 -0.2 0 -0.5 1 0 0 3.7
7 X 7 0 -0.2 -0.8 0 -0.4 0 0 1 -0.7
Dual Ratio --- 0.5 0.375 --- 0.5 --- --- ---
Basic 1 2 3 4 5 6 7 Right
Variables z X 1 X 2 X 3 X 4 X 5 X 6 X 7 Side
z 1 0.025 -7E-09 0 0.05 0 0 0.375 -0.263
X 6 0 1.375 7E-09 0 -0.85 0 1 -0.375 5.5625
X 3 0 -0.275 -7E-09 1 -0.15 0 0 1.375 0.6375
X 5 0 -0.75 0 0 -0.4 1 0 -0.25 3.875
X 2 0 0.25 1 0 0.5 0 0 -1.25 0.875
This is the new optimal solution after the cut was added. Note, that the new z
value should be 22.8375.
Integer Programming Methods 16
subject to x1 + x2 £ 5
–x1 + x2 £ 2
x1 – x2 £ 2
x1 + x2 ≥ 3
Now identify which of the cuts below are valid for use in a cutting plane algorithm.
The constraints are not cumulative so each part should be analyzed separately.
Justify your conclusion in each case.
a. x1 £ 3
b. x2 £ 4
c. x1 + 3x2 £ 10
d. 1.75x3 – 0.75x4 ≥ 0.25 (Note that x3 and x4 are respectively the slack variables
for the first two constraints.)
16. An oil production company has eight wells that have failed and are not producing
oil. Engineers have estimated the time it takes for each well to be "worked over" in
order that production may resume. Also estimated is the amount of lost production
per day for each well. A single "workover crew" is to repair all the wells.
a. Write a mathematical programming model that can be used to find a well repair
schedule that minimizes the total oil lost. Define all terms.
b. Using the data from the table below in conjunction with a greedy algorithm,
determine the schedule of well repair that will minimize the total oil lost.
–––––––––––––––––––––––––––––––––––––
Well Workover time Production lost
no. (days) (barrels per day)
–––––––––––––––––––––––––––––––––––––
1 10 30
2 5 10
3 20 15
4 8 12
5 4 14
6 15 40
7 2 5
8 10 18
–––––––––––––––––––––––––––––––––––––
(A note not important to the solution: Even though all oil is eventually produced
from a well, the amount not produced while the well is down is delayed until the end
of the well's life. Because of the time value of money, the income from the oil may
be reduced significantly in value, so we assume for this problem that it is lost.)
Interpret Tias the completion time of well i, and let ci be the production lost per
day. Then ciTi is the production lost from the well. The goal is to minimize the
total loss over all wells. With these definitions the problem is a linear sequencing
problem. The sorted data and solution are in the table below.
Integer Programming Methods 18
Job 5 1 6 7 2 8 4 3 Sum
Job Time 4 10 15 2 5 10 8 20 74
Penalty 14 30 40 5 10 18 12 15
Pen/Time 3.5 3 2.667 2.5 2 1.8 1.5 0.75
Comp 4 14 29 31 36 46 54 74 288
Obj 56 420 1160 155 360 828 648 1110 4737
17. Propose greedy hueristics for the problems below taken from Chapter 7. For each
problem find an answer using your heuristic and compare it to the optimal solution.
discuss why the heuristic might fail to find the optimum for all instances of the
problem class.
(a) Solve the telecommunications network design problem described in Section 7.3 with
data given in Figure 7.1
We set up a network model similar to Fig. 7.1. For the expansion arcs (1 through
5) we use a combination of the fixed cost plus the variable cost. For arc k we use
the linear cost
c’k = ck + fk/uk
Solving this linear network model we obtain:
Name Flow Origin Term. Lower Upper Cost
x1 10 1 4 0 10 2.8
x2 0 4 6 0 10 4.6
x3 7 3 8 0 10 1.9
x4 5 7 5 0 10 2.7
x5 0 5 7 0 10 2.7
x6 4 1 2 0 12 10
x7 4 4 5 0 5 9
x8 0 5 4 0 5 9
x9 0 2 6 0 12 8
x10 0 2 3 0 10 5
x11 0 3 2 0 10 5
x12 0 6 5 0 4 5
x13 0 3 6 0 6 9
x14 0 6 8 0 5 7
x15 2 8 7 0 3 1
x16 0 7 8 0 3 1
x17 0 6 7 0 5 7
For the heuristic solution:
1. We evaluate the linear solution with the original fixed charge cost functions.
For this case the solution above evaluates to 139.
2. Set all arcs (1-5) with flow at capacity to open (1) and set all with flow at 0 to
close (0).
For the example, that is: y1 = 1, y2 = y5= 0.
3. Set the arc with the smallest usage (xk/uk) to 0. Evaluate the new cost.
For the example this is arc 4. We now have
y1 = 1, y2 = y5= y4 = 0 with cost 174.
4. If the cost goes up, go to step 5. Otherwise solve the linear problem and
repeat step 3.
5. Open all arcs not already set to 0. This is the heuristic solution.
For the example this is the solution: y1 = y3 = y4 = 1, y2 = y5= 0.
Integer Programming Methods 20
The solution happens to be optimal in this case. In general, the method may not
lead to the optimum, because it doesn’t change a decision once made.
(b) Solve the facility location problem described in Section 7.4 with the data given in
table 7.2.
(c) Solve the covering problem described in Section 7.5 with the data given in Figure
7.6.
(d) Solve the traveling Salesman problem described in Section 7.6 with the data given in
Figure 7.7. Use the nearest neighbor heuristic.
(e) Solve the directed minimal spanning tree problem described in Section 7.6 with the
data given in Figure 7.7. Use the nearest neighbor heuristic.
(f) Solve the cutting stock problem described in Section 7.7 with data given in Figure
7.14.
Each of these problems can lead to clever ideas. We suggest that the students
compete to find the best heuristic method.
Integer Programming Methods 21
18. (Lagrangian relaxation) Consider the following IP where the m constraints have
been partitioned into two groups of size m1 and m2, respectively, such that m = m1 +
m2, and the original matrix A = (A1, A2)T and the original right-hand-side vector b =
(b1, b2)T.
zIP = Maximize cx
subject to A1x £ b1
A2x £ b2
n
x Œ Z+
l) =
zLR(l Maximize cx + l(b1 – A1x)
subject to A2x £ b2
n
x Œ Z+
Now, let X denote the feasible region of the first problem and let T denote
the feasible region of the second problem. We see immediately that if x Œ T then
x Œ X, but not necessarily vice versa so condition (i) is satisfied (X Õ T).
To show condition (ii), let x Œ X, which means that b1 – A1x ≥ 0.
Combining this result with the fact that l ≥ 0, we get l(b1 – A1x) ≥ 0. Thus, cx +
l(b1 – A1x) ≥ cx for all x Œ X establishing the result.
Integer Programming Methods 22
b. Show that when the relaxed IP is solved for any l ≥ 0, we have zLR(l
l) ≥ zIP.
This is a consequence of the proof in part (a) where it was shown that cx + l(b1
– A1x) ≥ cx for all x Œ X. Now let x* solve the relaxed problem for some value of
l ≥ 0, and let x solve the original integer program. Thus
l) = cx* + l(b1 – A1x*) ≥ c x + l(b1 – A1 x ) ≥ c x = zIP
zLR(l
More generally, if RP is a relaxation of IP, zR ≥ z.
Proof: If x is an optimal solution of IP, x Œ X Õ T and z = c( x ) £ f( x ). Because x
Œ T, f( x ) is a lower bound on zR. This implies that z £ f( x ) £ zR.
zLD = l) : l ≥ 0}
Minimize {zLR(l
Explain why zLD ≥ zIP. Under what circumstances might zLD = zIP?
19. When solving the traveling salesman problem (TSP) it is possible to use the
assignment problem (AP) as a relaxation. This approach treats the intercity
distance matrix of the TSP as the cost matrix of the AP. Solving the assignment
problem for this matrix yields a set of cells such that no more than one cell is
selected from each row and column.
(tour length)
n n
Minimize z = Â Â cijxij
i=1 j=1
(exactly one successor for each node)
n
 xij = 1, i = 1,…, n (C1)
j=1
(exactly one predecessor for each node)
n
 xij = 1, j = 1,…, n (C2)
i=1
(subtour elimination)
The assignment problem, discussed in Section 6.1, is identical to the above TSP
except that the subtour elimination constraints (C3) are absent. Letting XTSP be
the feasible region of the TSP and XAP be the feasible region of the AP, we see
immediately that XTSP Ã XAP. Given that the objective functions of the two
problems are the same, the two conditions stated in the solution to Exercise
18.18a for one problem to be a relaxation of another are satisfied.
Integer Programming Methods 24
C1 C2 C3 C4 C5
C1 0 0 0 0 1
C2 1 0 0 0 0
C3 0 0 0 1 0
C4 0 0 1 0 0
C5 0 1 0 0 0
20. (Branch and cut) How could a cutting plane technique be incorporated into an
implicit enumeration technique for solving the pure integer programming
problem?
a. Write out the steps.
b. Under what circumstances could the cuts be used at each node of the search
tree?
If xk integral, put z Max{ z , zk}, fathom node, set Sk+1 = Sk \ {k}, and go
to Step 4.
Step 2: (Cut generation). Try to find cuts, Ck, that remove the current
fractional solution but do not eliminate any feasible solutions.
Add Ck to formulation by setting X k+1 = X k » Ck.
Integer Programming Methods 26
b. Under what circumstances could the cuts be used at each node of the search
tree?
Cuts that can be applied to every node of the search tree are called valid
inequalities.
n
Definition (Wolsey [1998]) Let X = {x Œ Z+ : Ax £ b}. An inequality px £ p0 is a
valid inequality for X if px £ p0 for all x Œ X.
Dantzig and Gomory cuts do not necessarily satisfy this definition. However,
sets of valid inequalities have been derived for many structured integer
programs such as the knapsack problem, the TSP, and related combinatorial
optimization problems.
Integer Programming Methods 27
21. (Generalized Gomory cut) Suppose we wish to use a cutting plane technique to
solve a pure integer program. Assume that the LP relaxation has been solved and
the ith constraint in the simplex tableau is
xB(i) + Â a- ijxj = b- i
jŒQ
where xB(i) is the ith basic variable and Q is the set of nonbasic variables.
Multiply this equation by any rational number h. Now, using the same approach
outlined in Section 8.4 to derive the basic Gomory fractional cut given in Eq.
(14), derive from the equation above a more generalized version of Eq. (14).
-
xB(i) = bi – Â a- ijxj , i = 0, 1, . . . , m (S1)
jŒQ
-
so that the basic solution to determined by (S1) is xB(i) = bi, i = 0, . . . , m, xj = 0
for j Œ Q. If we multiple (S1) by h π 0, we get
hxB(i) + Â ha x
j ŒQ
ij j = bi i
ÎhxB(i) ˚ + Â Îha ˚ x
j ŒQ
ij j £ hbi i (S2)
and because x must be integer, the left-hand side of (S2) must also be an
integer. This means that the left-hand side of (S2) cannot exceed the integer
part of the right-hand side, implying that
ÎhxB(i) ˚ + Â Îha ˚ x
j ŒQ
ij j £ Îhbi ˚ (S3)
 (Îh˚a - Îha ˚) x
j ŒQ
ij ij j ≥ Îh ˚bi - Îhbi ˚ (S3)
which is called the fundamental cut. By using (S3) in a variety of ways, several
different cuts and associated algorithms can be developed.
A generalization of the above procedure involves all the constraints in S, and
m
is known as the Chvátal-Gomory procedure. Let h Œ ¬ + be a row vector and
consider the composite constraint
n
 hA x
j =1
j j £ hb
which is valid for S. In this expression Aj is the jth column of A. The inequality
n
 ÎhA ˚ x
j =1
j j £ hb
 ÎhA ˚ x
j =1
j j £ Îhb˚ (S4)
n
n
is valid for X = {x Œ Z+ : Ax £ b} because x is integer, and thus  ÎhA ˚ x
j =1
j j is
integer. This result implies that the left-hand side of (S4) will never exceed the
integer part of the right-hand side. Somewhat surprisingly, we have
22. (Mixed-integer cuts) From the discussion in the text on rounding, we know that
when y £ b, y Œ Z1, the inequality y £ Îb˚ is valid for any integer program. This
idea is now extended for mixed-integer programs (Wolsey 1998).
1
a. Let X≥ = {(x, y) Œ ¬+ ¥ Z1 : x + y ≥ b} and f = b – Îb˚ > 0. Prove that the
inequality
x
x ≥ f ( Èb˘ – y) or f + y ≥ Èb ˘
is valid for X≥. (Note, this inequality holds when x ¨ Sj ajxj for aj, xj ≥ 0, and
when y ¨ Sk dkyk for dk, yk ≥ 0 and integer.)
1
b. Let X£ = {(x, y) Œ ¬+ ¥ Z1 : –x + y £ b}, and f = b – Îb˚ > 0. Prove that the
inequality
x
– 1–f + y £ Îb˚
y – fy – Îb˚ + f ( Îb˚) £ x
or ( y – Îb˚) – f ( y + Îb˚) £ x (1)
Integer Programming Methods 30
y –Îb˚ – f £ x (2)
Given that y + Îb˚ ≥ 1, we have f £ f ( y + Îb˚) so –f £ –f ( y + Îb˚). Noting this
relationship and substituting the right-hand side into Eq. (2), we get Eq. (1).
I
1 2
c. Consider the set XMIR = {(x, y) Œ ¬+ ¥ Z+ : –x + a1y1 + a2y2 £ b} where a1,
a2 and b are scalars with b œ Z1. Let f = b – Îb˚, fi = ai – Îai˚ for i = 1, 2 and
x Ê f2–f ˆ
– 1–f + Îa1˚y1 + ËÎa2˚ + 1–f ˜¯ y2 £ Îb˚
Á
is valid for XMIR. Hint: make use of the result in part b and the relation a2 =
Èa2˘ – (1 – f2). (Note, this inequality holds when x ¨ Sj ajxj for aj, xj ≥ 0, and
when y ¨ Sk dkyk for yk ≥ 0 and integer and dk ≥ 0 and any two dk fractional
with the rest integer.)
which is the required inequality. Note that the left-hand side in Eq. (3) is integer
valued and the right-hand side is continuous.
I
Integer Programming Methods 31
23. Prove the validity of the greedy algorithm for the minimal spanning tree problem
by
a. induction (prove that it is valid for 2 nodes, assume it is valid for n nodes, and
then prove it is valid for n + 1 nodes);
Proof by induction
1. When there are only two nodes, at the initialization step, one is placed in
S1 and the other in S2. The solution is trivial because there is only one
arc. We simply connect the two nodes.
2. Assume that the minimal spanning tree has been found for n nodes using
the greedy algorithm.
3. Let node n + 1 be some other node. Step 2 of the algorithm says that we
should select the edge that has the smallest length among all those edges
that connect nodes in S1 to node n +1. Because we selected the edge
with the smallest length, if the solution is not optimal, it means that the
spanning tree constructed for the first n nodes is not optimal. But this is
not possible due to the induction assumption made in the previous step.
I
b. contradiction (assume that a better solution exists that does not satisfy the
conditions of the algorithm and then show this to be impossible).When
Proof by contradiction
Assume that we have a minimal spanning tree of length z* that does not
satisfy the conditions of the algorithm. This means that there is at least one
node (call it n√) that has an edge (call it e√) incident to it whose length is
smaller than one of the edges incident to node n√ in the minimal spanning
tree. If we add edge e√ to the tree we get a graph with a cycle. Now, if we
remove one of the edges in the cycle that is incident to n√ whose length is
longer than that of e√, we get a tree whose overall length is less than z*. This,
however, is a contradiction.
I
Integer Programming Methods 32
24. Consider the four models shown below. For every pair (there are six), determine
whether one is a relaxation of the other. Also show the relation (£, =, ≥) between the
optimal objective values of each pair. If no relation can be established indicate that
result.
3x1 + 2x2 – x3 £ 3
xj = 0 or 1, j = 1, 2, 3
3x1 + 2x2 – x3 £ 3
0 £ xj £ 1 for j = 1, 2, 3
xj = 0 or 1, j = 1, 2, 3
0 £ xj £ 1 for j = 1, 2, 3
xj = 0 or 1, j = 1, 2, 3
Objective: Max
Objective Value: 14
LP Status: Optimal IP
Variables I- 1 I- 2 I- 3
Name: X 1 X 2 X 3
Values: 1 0 0
Linear Obj. Coef.: 14 10 8
Lower Bounds: 1 0 0
Upper Bounds: 1 0 0
26. Shown below is an integer programming model and the optimal tableau of its linear
programming relaxation.
x1 + x2 + 4x3 – x4 £ 6
2x1 + 3x2 – x3 + x4 £ 10
x1 + x3 + x4 £ 7
a. Write the Dantzig cut that can be derived from the tableau.
b. From the set of possible Gomory cuts, write the one with the greatest right-hand-
side value.
c. Write the Gomory cut that can be derived from row 0.
d. Write the Gomory cut that can be obtained from row 4. Add it to the tableau and
reoptimize using the dual simplex method.
e. Solve the problem with the cutting plane algorithm embodied in the Teach IP
Excel Add-in.
d. Write the Gomory cut that can be obtained from row 4. Add it to the tableau
and reoptimize using the dual simplex method.
0.4286 x1 +0.7143 x3+0.5714 xs1+0.8571 xs3 ≥ 0.1429
Tableau ready for the dual simplex
Basic Basic 1 2 3 4 5 6 7 8 9 Right
I n d e x Variables z x1 x2 x3 x4 xs1 xs2 xs3 xs4 xs5 Side
0 z 1 6 0 4 0 2 0 1 0 0 26
4 x4 0 1.5714 0 0.2857 1 0.4286 0 0.1429 0 0 4.8571
6 xs2 0 2.4286 0 4.7143 0 0.5714 1 -0.143 0 0 9.1429
2 x2 0 0.1429 1 -0.429 0 -0.143 0 0.2857 0 0 1.7143
8 xs4 0 -0.571 0 0.7143 0 -0.429 0 -0.143 1 0 2.1429
9 xs5 0 -0.429 0 -0.714 0 -0.571 0 -0.857 0 1 -0.143
Dual Ratio --- 13.999 --- 5.5999 --- 3.5002 --- 1.1667 --- ---
Let x9 leave the basis, and let xs3 enter basis. The new solution is feasible and
optimal.
Basic Basic 1 2 3 4 5 6 7 8 9 Right
I n d e x Variables z x1 x2 x3 x4 xs1 xs2 xs3 xs4 xs5 Side
0 z 1 5.4999 0 3.1666 0 1.3333 0 1E-08 0 1.1667 25.833
4 x4 0 1.5 0 0.1667 1 0.3333 0 -5E-09 0 0.1667 4.8333
6 xs2 0 2.5 0 4.8333 0 0.6667 1 5E-09 0 -0.167 9.1667
2 x2 0 -2E-05 1 -0.667 0 -0.333 0 -9E-09 0 0.3334 1.6666
8 xs4 0 -0.5 0 0.8333 0 -0.333 0 5E-09 1 -0.167 2.1667
7 xs3 0 0.5001 0 0.8334 0 0.6667 0 1 0 -1.167 0.1667
e. Solve the problem with the cutting plane algorithm embodied in the Teach IP
Excel Add-in.
Objective: Max
Press to setup. Objective Value: 22
LP Status: Optimal IP Status:
Variables I- 1 I- 2 I- 3 I- 4
Name: X 1 X 2 X 3 X 4
Values: 0 2 0 4
Linear Obj. Coef.: 2 1 -3 5
Lower Bounds: 0 0 0 0
Upper Bounds: 9999 9999 9999 9999
4x1 – 3x2 £ 4
When this problem is solved as an LP, both constraints are tight at optimality.
a. Identify the basic variables, show the basis, basis inverse and solution for the
optimal LP.
b. Add a Gomery cut and use the dual simplex method to reoptimize.
a.
Basic Variables X 2 X 1 C 1 C 2
cB 1 1 0.5 0.5
Basis C 1 5 -2 Basis X 2 0.2857 0.1429
C 2 -3 4 Inverse X 1 0.2143 0.3571
Basic Solution
Objective Value Z 4.5
2 X 2 2
1 X 1 2.5
2x1 + x2 + x4 =3
–6x1 + 4x2 + x5 = 7
After solving the linear programming relaxation we obtain the following tableau.
The following results are determined using the tableau from the TeachLP Add-in.
Row Basic Basic 1 2 3 4 5 6 Right
Number I n d e x Variables z X 1 X 2 X 3 X 4 X 5 art1 Side
0 0 z 1 0 0 1E-09 0.7143 0.0714 9999 2.6429
1 2 X 2 0 0 1 2E-09 0.4286 0.1429 -2E-09 2.2857
2 1 X 1 0 1 0 -1E-09 0.2857 -0.071 1E-09 0.3571
3 3 X 3 0 0 0 1 -1.429 1.3571 - 1 1.2143
We show the cuts in greater accuracy than possible with the tableau above.
Cuts taken from the tableau are only approximate.
29. Solve the problem below with branch and bound. Perform several iterations by hand
and then use the accompanying Excel add-ins.
xj ≥ 0 and integer, j = 1, 2, 3, 4
The complete branch and bound solution is below. It was obtained with the
Teach IP add-in.
Node Level Variable Value Up/Down Visit Relax
0 0 0 0 0 0 27.6471 Branch X(3) up at 2
Infeasible: Backtrack Level 1 :
1 1 3 2 1 1 Infeasible Branch X(3) down at 1
2 1 3 1 -1 2 21.3 Branch X(1) down at 1
3 2 1 1 -1 1 21.2308 Branch X(2) down at 0
Infeasible: Backtrack Level 3 :
4 3 2 0 -1 1 Infeasible Branch X(2) up at 1
Integer: Replace incumbent:
Backtrack Level 3 2 : Branch X(1)
5 3 2 1 1 2 21 up at 2
Fathom: Backtrack Level 2 1 0
6 2 1 2 1 2 17.8824 :Finished
Operations Research Models and Methods
by Paul A. Jensen and Jonathan F. Bard
John Wiley and Sons, Inc.
Copyright 2003 – All rights reserved
f(x) is convex
250
200
150
f(x)
100
50
0
-5
-4
-3
-2
-1
0
1
2
3
4
5
-50
x
f(x) is concave
50
0
-5
-4
-3
-2
-1
0
1
2
3
4
5
-50
f(x)
-100
-150
-200
x
Nonlinear Programming Models 2
6
5.8
5.6
5.4
5.2
f(x)
5
4.8
4.6
4.4
4.2
4
-0.9
-0.8
-0.7
-0.6
-0.5
-0.4
-0.3
-0.2
-0.1
-1
x
Nonlinear Programming Models 3
2. Plot several isovalue contours for each of the functions below on the (x1, x2)-plane
and determine if each is convex, concave or neither. Provide a mathematical
explanation for your conclusions.
2 2
a. f(x) = 2x1 + 4x2
Find the determinants of the leading principal submatrices of the Hessian matrix:
H1 = 4, H2 = 32, so f(x) is convex.
0.8
0.6
0.4
0.2
0
-0.5 0 x2 0.5
-0.2
-0.4
-0.6
-0.8
2 2
b. f(x) = –2x1 + 4x1x2 – 4x2 + 4x1 + 4x2 + 10
È- 4 4 ˘
First find the Hessian matrix: H(x) = Í ˙ , and then computer H1 = –4, H2 =
Î 4 - 8˚
16, so f(x) is concave
Nonlinear Programming Models 4
x1
7
6
5
4
x1+
3
x1-
2
1
0
-2 -1 0 2 4 x2 6
-2
X
2 2
c. f(x) = –0.5x1 – 2x1x2 – 2x2
È - 1 - 2˘
The Hessian is H(x) = Í ˙ and H1 = –1, H2 = 0
Î- 2 - 4˚
which indicates that H(x) is not negative definite. All the determinants of the
principle submatrices of size 1 are negative, however, so H is negative semi-
definite and f(x)is concave. To see this more clearly, note that
xTHx = –(x1)2 – 4x1x2 – 4(x2)2 = –(x1 + 2 x2)2 £ 0
20
x1
15
10
0
-10 -5 0 5 x2 10
-5
-10
-15
-20
Nonlinear Programming Models 6
È2 1˘
H=Í ˙ , H1 = 2, H2 = 3. Hessian is positive definite so the function is
Î1 2˚
convex.
2 2
b. f(x) = x1 + 2x1x2 + x2
È 2 2˘
H=Í ˙ , H1 = 2, H2 = 0 so H is not positive definite; however, the
Î 2 2˚
determinants of all principal submatrices are nonnegative so the Hessian is
positive semi-definite and f(x) is convex.. We can also apply the diagonalization
algorithm to see this.
Diagonalization algorithm
È 2 2˘ È1 1˘
H=Í ˙ Í0 0˙
Î 2 2˚ Î ˚
d1 = 2 d2 = 0
2 2
c. f(x) = x1 + 4x1x2 + x2
È 2 4˘
H=Í ˙ , H1 = 2, H2 = –12. The Hessian is indefinite so the function is
Î 4 2˚
neither convex nor concave.
2 2
d. f(x) = x1 – 6x1x2 + 2x2
Nonlinear Programming Models 7
È 2 -6˘
H=Í ˙ , H1 = 2, H2 = –-28. The Hessian is indefinite so the function is
Î-6 4 ˚
neither convex nor concave.
2 2 2
e. f(x) = 2x1 + 3x1x3 + x2 + 3x2x3 + 4x3 + x1 + 2x2 + 3x3
È4 0 3˘
H = Í0 2 3˙ , H1 = 4, H2 = 8, H3 = 64 – 36 – 18 = 10. The Hessian is
Í ˙
ÍÎ3 3 8˙˚
positive definite so the function is convex.
2 2 1 2
f. f(x) = 2x1 + 2x1x3 + x2 – 2x2x3 + 2 x3 + x1 + 2x2 + 3x3
È4 0 2˘
H = 0 2 -2 ˙ , H1 = 4, H2 = 8, H3 = 64 – 36 – 18 = 10. The Hessian is
Í
Í ˙
ÍÎ2 -2 1 ˙˚
indefinite, so the function is neither convex nor concave.
Nonlinear Programming Models 8
4. Determine whether or not the following constraint sets define convex regions.
a. 0 £ x £ 12 2 2
f. – 2x1 + 4x1x2 – 4x2 + 4x1 + 4x2 £ 0
b. | x | ≥ 6
g. x1+ 2x2 +x3< 10; x1– 2x3 < 9; x1 > 2, x2 > 0, x3 > 0
c. | x | £ 6
2 2 2
d. 4x 2 – 20 x ≥ 0 h. x1 + x2 + x3 £ 9; 1.5x1 + x3 ≥ 4
e. ln x ≥ 1
0.5
0
0.1
0.3
0.5
0.7
0.9
1.1
1.3
1.5
1.7
1.9
2.1
-0.5
f(x)
-1
-1.5
-2
-2.5
x
È-4 4 ˘
H=Í ˙ H1 = –4, H2 = 16. The function is concave. The region is not
Î 4 -8˚
convex.
g. The constraints are linear, so the region is convex.
h. The first constraint is convex, and the inequality is in the right direction. The
region is convex. The second constraint is linear and the region is convex. The
intersection of the two regions is convex.
Nonlinear Programming Models 10
5. In each part below, state the range of values of the parameters a and b for which the
function c(x) is convex when 0 < x £ 1.
c. c(x) = abx
b. The second derivative of the function is ab(b – 1)xb–2. For a Œ (0, •), convex
if b Œ [1, •) or b Œ (–•, 0); for aŒ (–•, 0) convex if b Œ [0, 1].
bx
c. Note that c(x) = abx = eln(a ) = e(b ln a)x. The second derivative of the function
e. The second derivative of the function is ae–x + 2b. Convex if a Œ [0, •), b Œ
[0, •) and some other cases where a ≥ –2bex.
Nonlinear Programming Models 11
1
6. Determine whether the quadratic f (x) = 2 xTQx is concave, convex, or neither for
the following Q matrices.
È 1 –1 –1
˘ È 4 2 –2
˘
a. Í –1 2 4 ˙ b. Í 2 4 2 ˙
Î –1 4 6 ˚ Î –2 2 5 ˚
È 1 –1 –1 ˘
Í ˙
a. Í –1 2 4 ˙ , H1 = 1, H2 = 1, H3 = 12 + 4 + 4 - 16 - 6 - 2 = -4. Neither.
Î –1 4 6 ˚
È 4 2 –2 ˘
Í ˙
b. Í 2 4 2 ˙ H1 = 4, H2 = 12, H3 = 80 - 8 - 8 - 16 - 20 - 16 = 12. Convex.
Î –2 2 5 ˚
Nonlinear Programming Models 12
7. Use the diagonalization algorithm and the determinant test to ascertain the
definiteness of the following matrices.
È1 2 2
˘
a. Í2 1 –2 ˙
Î2 –2 1 ˚
È1 0 0 ˘
D = Í0 -3 0 ˙ indefinite
Í ˙
ÍÎ0 0 9˙˚
È1 2 3
˘
b. Í2 0 –1 ˙
Î3 –1 1 ˚
È1 0 0 ˘
D = Í0 -4 0 ˙ indefinite
Í ˙
ÍÎ0 0 4.25˙˚
È 01 1 –1 2
1 0 –1
˘
c. Í –1 0 –1 1 ˙
Î 2 –1 1 0 ˚
row order: 2, 1, 4, 3
È1 0 0 0 ˘
Í0 -1 0 0 ˙
D=Í ˙ indefinite
Í0 0 8 0 ˙
Í0 0 0 -0.5˙
Î ˚
Nonlinear Programming Models 13
È 01 1
0
2
1
3
2
˘
d. Í 2 1 0 1 ˙
Î3 2 1 0 ˚
È0 0 0 0˘
Í0 0 0 0˙
D=Í ˙ no information
Í0 0 0 0˙
Í0 0 0 0 ˙˚
Î
Nonlinear Programming Models 14
Classify the following mathematical programs based on the problem types described
in Section 9.5.
e. Maximize{d(x)/f(x) : f(x) ≥ 4}
a(x) – b(x) is convex and separable. f(x) is linear. This problem is a separable
convex programming problem. Since the objective is quadratic, this is a quadratic
programming problem.
b(x) + c(x) is concave and separable, d(x) is convex and the constraint defines a
convex feasible region. The problem is a separable convex programming
problem. Note that we can change the problem to a convex minimization problem
by multiplying the objective by –1.
The functions d(x), c(x), e(x) , f(x) would define a convex programming problem.
The constraint a(x) ≥ 8 determines a nonconvex region, so when it is included
the problem becomes nonconvex.
e. Maximize{d(x)/f(x) : f(x) ≥ 4}
9. Decide whether each of the objective functions listed below could be part of a
convex separable programming model. In all cases the variables are nonnegative.
e. Minimize cost:
n
f (x) = Â fj(xj) where fj(xj) = aj xj–b, with aj > 0 and 0 <b < 1
j=1
c. Maximize f(x) = x12 + 4 x22 – 10x1 + 20x2. Note that c is not the same above.
e. Minimize cost:
n
f (x) = Â fj(xj) where fj(xj) = aj xj–b, with aj > 0 and 0 <b < 1
j=1
The function is separable and convex. Yes.
rj(xj) is concave while cj(xj) is convex. Since the cj(xj) are subtracted, f (x) is
concave. The corresponding minimization is convex. The function is separable.
Yes.
Nonlinear Programming Models 18
2 2 2
Maximize –2x1 – 4x2 – 3x3 + 4x1x2 + 2x1x3 – 2x2x3 + 10x1 + 15x2 + 20x3
subject to
x1 + x2 + x3 £ 15
2x1 + 4x2 £ 26
x2 + 3x3 £ 20
xj ≥ 0, j = 1, 2, 3
Solve this problem using the software that comes with the book.
When setup with the Math Programming add-in and solved with the Solver we
obtain the following. The optimum solutions is x = (6.8235, 3.0882, 4.5784)T. This
should be the global maximum.
Variables NL Terms 1 2 3
Relation Name: NL-1 NL-2 NL-3 x1 x2 x3
Values: 6.8235 3.0882 4.5784
Lower Bounds: 0 0 0
Upper Bounds: 10000 10000 10000
s
We want to show that f(x) = Â a f (x) is a convex function when each fi(x) is convex,
i =1
i i
ai ≥ 0 for all i, and x Œ S is a convex set. That is, for x1,x2 any two points in S, we must
confirm the following.
The proof will be by induction. For s = 1, the result is self-evident. Therefore, we will
show that Eq. (1) is true for s = 2.
a1 f1 ( x ) £ a1[lf1 ( x1 ) + (1 - l ) f1 ( x 2 )] (2)
a 2 f2 ( x ) £ a 2 [lf2 ( x1 ) + (1 - l ) f2 ( x 2 )] (3)
for all a1 ≥ 0, a2 ≥ 0, and l Œ [0, 1]. Adding Eqs. (2) and (3) and rearranging terms
gives
a1 f1 ( x ) + a 2 f2 ( x ) £ l[a1 f1 ( x1 ) + a 2 f2 ( x1 )] + (1 - l )[a1 f1 ( x 2 ) + a 2 f2 ( x 2 )]
= l f(x1)+ (1– l) f(x2)
Next we assume that the result is true for s = n – 1 and prove it is true for s = n.
Rewriting f(x), we have
n -1
f(x) = Â a f (x) + a
i =1
i i f (x)
n n
n -1
By assumption, g(x) = Â a i fi ( x ) is a convex function so f(x) = g(x) + a n fn ( x ) is also a
i =1
convex function by virtual of the proof for s = 2. Here, we simply have a1 = 1. (Note
that the same proof holds when all the functions are strictly convex.)
Nonlinear Programming Models 20
12. Prove Theorem 1. Make use of the fact that Definition 3 can be extended to any
finite number of points, say s, so that f(x) is convex if and only if (see Exercise 11)
s s s
f( x ) £ Â l f (x ) , where x = Â l x , Â l
i =1
i i
i =1
i i
i =1
i = 1, li ≥ 0, i = 1,…, s
Also make use of the fact that any point x in a polyhedron S can be represented by a
convex combination of its vertices. Note that the above equation for x defines what
is meant by a convex combination of points.
Let xi be the ith extreme point of S, i = 1,…,s, let f(xr) = max{f(xi) : i = 1,…,s} be
the extreme point that provides the largest value of f(x) among all extreme points,
and let x be the optimal solution to problem (3) in the text Maximize{f(x) : x Œ
S}.
s
By letting x = Â l x , we have the following relationships.
i =1
i i
Ê s ˆ
f( x ) = f Á Â li x i ˜
Ë i =1 ¯
£ l1 f ( x1 ) + l2 f ( x 2 ) + L + ls f ( x s ) (by convexity of f(x))
s
£ f(xr) (replace all f(xi) with f(xr) and note that  l = 1)
i =1
i
Now, because x maximizes f(x) over S, it must be that f( x ) = f(xr) so we have found
an extreme point that provides a global optimum, if one exists. If the optimal
solution cannot be represented by a convex combination of extreme points as
assumed, it means that the feasible region is unbounded and that there is no finite
optimum. Thus, f(x) Æ • along an extreme ray of S.
Nonlinear Programming Models 21
13. Use the definition of convexity to prove Theorem 2. Let x1 be a local minimum and
x2 a global minimum such that f(x2) < f(x1). Show that this leads to a contradiction.
= f(x1)
Now, for l arbitrarily close to 1, we have f( x ) < f(x1) implying that we have found a
point in the neighborhood of x1 which provides a lower objective function value than
x1. This contradicts the fact that x1 is a local optimum. Thus, it must be true that
f(x2) = f(x1). Because the same analysis applies for all local minima, Theorem 1
follows.
Nonlinear Programming Models 22
14. Following the suggestions in the text, prove that f(x) is convex for x defined on the
convex set S if (change wording to if and only if)
f(x1) ≥ f(x2) + —Tf(x2)(x1 – x2) for all x1, x2 Œ S.
First we prove the “if” part. Let x = lx1 + (1 - l )x 2 for any l Œ [0, 1] and assume
Now we prove the “only if” part. Suppose f is convex. Then for all l Œ [0, 1],
f ( x 2 + l ( x1 - x 2 ) - f ( x 2 )
£ f ( x1 ) - f ( x 2 ) (3)
l
Letting l Æ 0, we obtain
which is the desired result. (Note that in going from Eq. (3) to Eq. (4) we made use
f ( x 2 + l ( x1 - x 2 ) - f ( x 2 )
of the fact that the limit of as l Æ 0 is the directional
l
derivative of f at x2 in the direction x1 – x2. When f is once continuously
15. Five oil wells located in the (x,y)-plane have the coordinates (ai,bi) given by
It is desired to connect all the wells to a single collection point using the minimum
total amount of pipe. Each pipe segment will be placed in a straight line from the
well to the collection point.
a. Formulate a nonlinear programming model that can be used to determine where
the collection point should be located in the plane.
b. Classify this problem and find the optimal solution for the above data.
The problem is to select the location of the collection point, (x, y), such that the
total distance to the point is minimized
5
Min. z = Â ( x - ai )2 + ( y - bi )2
i =1
The distance function from (x, y) to any point (a, b) has the shape of a cone with
minimum value at (a, b). The cone is a convex function. Since the objective is the
sum of convex functions, z is also convex. The point reached should be a global
minimum. The solution obtained by Solver is shown below.
Coordinates of wells
1 2 3 4 5 Col. Point
a 5 0 10 50 -10 x 7.6188
b 0 10 10 50 50 y 11.215
Dist. Square 133 59.5 7.14 3300 1815
Dist. 11.5 7.72 2.67 57.4 42.6 Total 121.95
16. You are in charge of providing labor for a manufacturing shop for the next six
months. Currently, there are 20 employees in the shop. Each worker costs $1000
per month and can manufacture five units of product during the month. The cost of
hiring and training a new worker is $500. The cost of laying off a worker is $1000.
At the end of the six month period you want 20 persons working in the shop. All
products must be sold in the month they are produced.
Demand in each month is a random variable uniform distributed over the
ranges specified below. If demand is lower than production capacity, some workers
will be idle. If demand is higher than capacity, sales are lost with a penalty of $200
per item not sold. Set up and solve the nonlinear programming problem to
determine how many workers to hire or lay off at the beginning of each month to
minimize the expected cost? Workers may also be laid off at the end of month 6.
Minimum Maximum
Month demand demand
1 50 150
2 100 200
3 75 175
4 50 150
5 200 250
6 100 200
We assume that all hiring and firing is done at the beginning of the periods. This
leads to the constraint:
wt = wt-1 + ht – ft for t = 1…6. It is given that w0 = w6 = 20.
The cost of employees is
6
200
Et = [
2(bt - at )
25wt2 - 10bt wt + bt2 ]
For the six months this cost is:
6
200
 2(b - a ) [25w
t =1
2
t - 10bt wt + bt2 ]
t t
Notice that the expected value term is convex with respect to the variable wt. We
drop the constant term that is proportional to bt2.
The expression for Et is only valid if 5wt is less than bt. For the math
programming model we break wt into two variables ut and vt where wt = ut + vt..
vt is the workforce amount which is below 5wt and ut is the amount above. The
expression for Et is used for the vt variables.
17.
[200] 2 The accompanying figure represents a
reservoir system. The amount of water
1 2 entering at nodes 1, 2 and 3 is indicated
6 in square brackets. All the flow is to
leave the network at node 4. There are
[100] 1 3 [100]
5 six possible pipelines (arcs) labeled 1
through 6 that can carry water. The
3 4 problem is to assign the flow to arcs so
that the total cost is minimized. The
[-400] 4 flows are directed and must be conserved
at each node.
b
The arc costs are ai(fi) i, where fi
is the absolute value of the flow on arc i,
and ai and bi are constants for i = 1,…, 6.
Classify the problem for the various arc
cost functions in the tables below. Solve
the problems for the given data.
a.
Arc, i 1 2 3 4 5 6
ai 1 2 1 2 1.4 2.8
bi 0.9 0.7 0.9 0.7 0.9 0.7
This kind of cost function is often used to represent economies of scale with
respect to size, so this is a reasonable model for systems design.
Since the objective is concave and the constraints are linear, the solution will be
at a local minimum.
Some local minima solutions are below. The first one is the best found.
S1: x14 = 100, x24 = 200, x34 = 100, z = 227.58
S2: x23 = 200, x14 = 100, x34 = 300, z = 253.1
S3: x13 = 100, x24 = 200, x34 = 200, z = 284.2
Nonlinear Programming Models 27
b.
Arc, i 1 2 3 4 5 6
ai 1 2 1 2 1.4 2.8
bi 2 2 2 2 2 2
This kind of cost function is often used to represent the energy used for transmitting
flow through an arc, so this is a reasonable model for choosing a distribution
scheme.
Since the objective is convex and the constraints are linear, the solution will be at
a global minimum.
del Name: P_17b_2 Objective Terms Solver: Excel Solver
Type: Net Linear: 0 Type: Nonlinear
Change Goal: Min Nonlinear: 95428 Sens.: No
Cost: 95428
Solve
18. A company wants an aggregate production plan for the next 6 months. Projected
sales for its product are listed below.
Production in each month that exceeds sales may be put in inventory and sold in
some future month. Because of seasonal factors the production costs vary from
month to month. An additional charge of $4 per unit per month is incurred for units
in inventory.
The major costs center on production but the company also wishes to account
for not meeting monthly sales, production and inventory goals by penalizing
deviations from either predetermined targets or policies. The inventory goal is to
have 100 units in stock at the end of each month. The production goal is to
minimize labor and raw material fluctuations from one month to the next. To
account for these goals, squared penalty terms of the following form are added to the
objective function:
wS(actual sales – sales goal)2 + wI(actual inventory – inventory goal)2
+ wP(production – production in previous month)2
where wS, wI and wP are predetermined weights. Assume in your model that the
initial and final inventories are 100, and assume the production prior to month 1 is
1000.
Z = 6707370
Output Table
Month 0 1 2 3 4 5 6
Prod. 1000 1165.8 1 2 1 7 1170.6 1242.8 1479.1 1642.8
Sales --- 1182.9 1299.8 1115.9 961.02 1624.6 1733.7
Sales Goals --- 1300 1400 1000 800 1700 1900
Inv. 100 82.889 0 54.666 336.44 190.88 100
Inv. Goals --- 100 100 100 100 100 100
Nonlinear Programming Models 30
S
Inventory level
0
Time
S–Q
Q/d 2Q/d
Justify the formula below for cost per unit time and characterize the shape of the
function. The constants d, K, h, and c are defined in the text. Find the optimal
solution in algebraic form using calculus.
∂f (Q, S aK hS 2 p pS 2
=- 2 - + -
∂Q Q 2Q 2 2 2Q 2
∂ 2 f (Q, S ) 2 aK hS 2 pS 2
= 3 + 3 + 3
∂Q2 Q Q Q
∂ 2 f (Q, S ) hS pS
=- 2 - 2
∂Q∂S Q Q
∂f (Q, S ) hS pS
= - p+
∂S Q Q
∂ 2 f (Q, S ) h p
= +
∂S 2 Q Q
∂ 2 f (Q, S ) hS pS
=- 2 - 2
∂S∂Q Q Q
È 2 aK hS 2 pS 2 hS pS ˘
Í 3 + Q3 + Q3 - -
Q2 Q2 ˙
— 2 f (Q, S ) = Í Q
Í - hS2 - pS2 h p ˙˙
+
ÍÎ Q Q Q Q ˙˚
1 2 aK hS 2 pS 2
H = + 3 + 3 >0
Q3 Q Q
2
2 Ê 2 aK hS 2 pS 2 ˆ Ê h p ˆ Ê hS pS ˆ
H = Á 3 + 3 + 3 ˜Á + ˜ - Á- 2 - 2 ˜
Ë Q Q Q ¯ Ë Q Q¯ Ë Q Q ¯
= 2 aK (h + p) / Q 4 > 0
Both H1 and H2 are greater than 0, thus the cost function is a convex function.
We, then, want to find the minimum cost. The optimal solution is
Nonlinear Programming Models 32
∂f (Q, S )
=0
∂Q
pQ2 - S 2 (h + p) - 2 ak = 0 (1)
∂f (Q, S )
=0
∂S
S(h + p) - pQ = 0
S( h + p)
Q= (2)
p
S 2 ( h + p) 2
Then Q2 =
p2
S 2 ( h + p) 2
From(1) p 2
- S 2 (h + p) - 2 ak = 0
p
2 akp
S* =
h( h + p )
( h + p) 2 akp
Q* =
p h( h + p )
Nonlinear Programming Models 33
20. Write the nonlinear program model for the Markov queueing network associated
with the product routing problem represented by Fig. 16. Let the objective be to
minimize the average time in the system for a unit of product. Assume that all
stations have a single server. Find the solution when the arrival rate at station A is
30 units per hour and the service rates for the six stations are
mA = 40, mB = 20, mC = 30, mD = 10, mE = 30, mF = 40.
Station B Station D
µ = 20, s = 1 µ = 10, s = 1
l = 30 Station A Station F
µ = 40, s = 1 µ = 40, s = 1
Station C Station E
µ = 30, s = 1 µ = 30, s = 1
The model for this problem is described by the network below. The cost functions
on each arc are nonlinear. The optimum flows are shown below each arc. We
used a nonlinear network model and solved it with the Solver add-in.
fD
2
fB (6.34)
(4.67)
fA (11.01) fE fF
1 fC 3 4
(30) (18.99) (23.66) (30)
The average time in the system is the average number in system/flow rate. So
we should minimize the average number in the system. The average number at
each station is
Li = li /(mi – li)
so this is the cost measure to use in the model. li is the flow into station i and mi
is the service rate for station i. Note that you must start with a feasible solution
such that mi π li
Nonlinear Programming Models 34
21. The figure below depicts the geographical area (two miles wide and four miles long)
for which emergency service is to be provided. The area has been divided into eight
square cells (one mile by one mile), where each cell is identified by the number in
the upper left-hand corner. The average number of calls per hour is given in the
center of each cell. One service facility is to be located in cell 2 and another in cell
8. For cell 2, the service rate is 30 clients per hour, while the rate at cell 8 is 60
clients per hour.
For modeling purposes, it is assumed that travel from a cell to a service facility
originates and terminates at the center of the respective cell and follows a rectilinear
path (movement is either horizontal or vertical). Travel time is 10 minutes per mile.
The problem is to assign the demand to the service facilities so that the total time of
travel plus service is minimized.
a. Model the facilities as single channel queues with Poisson arrival and service
processes. Write the corresponding mathematical program that describes the full
situation.
8 10 15 7
5 6 7 8
12 8 2 10
Parameters
Nonlinear Programming Models 35
subject to:
x i2 + x i8 = di, i =1,2,…,8 (all calls must be processed)
Âx
i
i2
– y2 = 0 (determines the rate at 2)
Âx
i
i8 – y8 = 0 (determines the rate at 8)
Note that the model permits calls to be split between cells 2 and 8.
Solving with the Nonlinear Solver of Excel we obtain the objective value: 23.402
with the assignment below.
Nonlinear Programming Models 36
Cell 1 2 3 4 5 6 7 8 Total
Asgn. 2 8 10 0 0 4.937 0.2492 0 0 23.186
Asgn. 8 0 0 15 7 7.063 7.7508 2 10 48.814
Total 8 10 15 7 12 8 2 10
Modification:
If splitting of demand between cells 2 and 8 is prohibited, the following model can
be used.
Define binary variables zi = 1 if cell i is assigned to station 2, 0 if assigned to
station 8. Add 16 additional constraints:
The model is now a 0-1 nonlinear program. Excel can solve this model, but there
is no guarantee of optimality.
Nonlinear Programming Models 37
The absolute value function f(x) = |x|, for scalar x, is a piecewise linear convex
function, as is the nonnegatively weighted sum of two or more convex functions (see
Exercise 11). Because the objective is minimization, we can use the following
transformation to obtain a linear program. Let
ui+ - ui- = yi ± (b0 + b1 x1i + b2 x2 i + L + bm xmi ) , i = 1,…,n (1)
ui+ ≥ 0, ui- ≥ 0 , i = 1,…,n (2)
Model
n
Minimize  (u
i =1
+
i + ui- )
Model 1
Model 2
Minimize z
subject to (1) and (2)
z ≥ ui+ + ui- , i = 1,…,n
When this model is solved, at most one of the variables in the pair will be positive.
Why?
Nonlinear Programming Models 39
24. The data in the table below represents 20 observations of cotton quality (y) as a
function of amount of fertilizer applied per acre (x1), average daily temperature (x2),
and amount of insecticide applied per acre (x3).
a. Use a spreadsheet application like Excel and its built-in functions to solve the
bivariate least squares regression model y = b0 + b1x1. What are the values of b0,
b1 and R2 found? Repeat the analysis using an NLP solver.
Note that the x’s and y’s are given numbers (data) and the b’s are variables.
Using the LP solver gives b0 = 7.5625, b1 = 1.1875, b2 = 0.375, b3 = –0.812.
Minimize z = e
subject to e ≥ ai " i = 1,2,…,20
e ≥ – ai " i = 1,2,…,20
ai = yi – (b0 + b1 x1i +b2x2i + b3x3i) " i = 1,2,…,20
The value of h11 > 0, and the determinant of the above matrix is 50, so H is
positive definite. The stationary point is a local minimum
Nonlinear Programming Methods 2
È-4 0 -8˘
H = Í 0 -2 3 ˙
Í ˙
ÍÎ -8 3 -8˙˚
x1 = 1, x2 = 1
È-802 -400 ˘
H = Í ˙
Î-400 200 ˚
È 1 - 2 x1l ˘
dL Í 1 1 3
Setting = 2 - 2 x 2 l ˙ = 0 , we get x1 = , x2 = , x3 =
dx Í ˙ 2l l 2l
ÍÎ 3 - 2 x3 l ˙˚
dL
Setting = x12 + x 22 + x32 - 14 = 0 , and we obtain
dl
2 2 2
Ê 1 ˆ Ê1ˆ Ê 3 ˆ
Á ˜ + Á ˜ + Á ˜ = 14
Ë 2l ¯ Ë l ¯ Ë 2l ¯
1+ 4 + 9
= 14
4l 2
1
l=±
2
È- 2l 0 0 ˘
— L=Í 0
2
- 2l 0 ˙.
Í ˙
ÍÎ 0 0 - 2l ˙˚
1
This matrix is negative definite when l = , so the solution to the original
2
problem is x1 = 1 , x 2 = 2 , x 3 = 3 .
Nonlinear Programming Methods 5
7. Find the stationary points of the function f(x) = xyz subject to the condition that x2 +
y2 + z2 = 1. Indicate which are maxima, minima, or saddle points.
L(x,l) = xyz + l( x2 + y2 + z2 – 1)
È∂L ˘
Í ∂x˙ Èyz + 2 lx˘
Í∂L ˙ = Íxz + 2 ly˙.
Í ∂y˙ Í ˙
Í∂L ˙ Îxy + 2 lz˙˚
Í
Î ∂z˚
x 2 = y 2 = z2
Setting the partials equal to 0, we get Ê ˆ.
l = -Á yz 2 x ˜
Ë ¯
dL
From = x2 + y2 + z2 -1 = 0 ,
dl
The solution is: x = ±
1
3
,y=±
1
3
,z=±
1
3
and l = ± l = - yz 2 x ( )
There are eight points identified as stationary points of the Lagrangian.
Using the Teach NLP add-in, we investigate each of these points:
{(x,y,z) : x2 – xy + y2 – z2 = 1, x2 + y2 = 1}
nearest the origin in the (x,y,z)-space.
È∂L ˘
Í ∂x˙ È2 x + 2 l1 x - l1 y + 2 l2 x˘
Í∂L ˙ = Í2 y - l x + 2 l y + 2 l y˙
Í ∂y˙ Í 1 1 2 ˙
Í∂L ˙ Î Í 2 z - 2 l 1z ˙˚
Î ∂z˚
We set the first partials to 0 to find the stationary point.
The third equation leads to l1 = 1
The first equation leads to 4 x - y + 2 l2 x = 0 (1)
The second equation leads to 4 y - x + 2 l2 y = 0 (2)
Multiplying (1) by y and (2) by x and subtracting the two equations we find:
x2 = y2 .
Using the constraints and (1) and (2) we find:
l1 = 1, l 2 = (y/2x –2 ) - 2, x = ± 1 , y = ± 1 , z = ± - xy
2 2
We investigate four points that result in rational solutions
All stationary points of the Lagrangian have the same objective value.
For each case below, determine whether the KKT conditions are satisfied at the
points (1.5, 2.5), (4, 0) and (3, 0.5). Indicate which of these points, if any, are local
solutions. Find the global solutions.
We first write out the Lagrangian function excluding the nonnegative conditions;
we use different q values to represent the different objective functions.
L = – (x1 – 3)2 – (x2 – q )2 + l1 (x1 + x2 – 4) + l2 ( – x1 + x2 – 1)
∂L
2. = -2( x 2 - q ) + l1 + l 2 ≥ 0
∂x 2
3. x1 + x2 £ 4
4. – x1 + x2 £ 1
5. l1 (x1 + x2 – 4) = 0
6. l2 ( – x1 + x2 – 1)= 0
7. x1 (- 2( x1 - 3) + l1 - l 2 ) = 0
8. x 2 (- 2( x 2 - q ) + l1 + l 2 ) = 0
9. x1 ≥ 0, x2 ≥ 0, l1 ≥ 0, l2 ≥ 0
Nonlinear Programming Methods 8
For q = 2.5, we have l1= – 1.5. This does not satisfy 9, so it is not a local
maximum.
For q = 0.5, we have l1= 0.5 and l2= 3.5. It is a local maximum
Point 2, (4, 0)
As 4 is not binding, we have l2= 0. As x1 is greater than 0, we have
∂L
= -2( x1 - 3) + l1 - l2 = 0 , leading to l1= 2. Equation 2 is satisfied for all q, so it
∂x1
is a local maximum.
The global maximum is (0,0) for all cases. To show this, we must compare the
objective value of the four vertices (1.5, 2.5), (4,0), (0, 1) and (0,0) of the feasible
Nonlinear Programming Methods 9
Maximize
SOL1 OBJ1 OBJ2 OBJ3
x1 0 34 15.25 9.25
x2 0
x1 4 26 7.25 1.25
x2 0
x1 0 25 11.25 9.25
x2 1
Nonlinear Programming Methods 10
Minimize 2x12 + 4x22 + 3x32 – 4x1x2 – 2x1x3 + 2x2x3 – 10x1 – 15x2 – 20x3
subject to x1 + x2 + x3 £ 15
2x1 + 4x2 £ 26
x2 + 3x3 £ 20
xj ≥ 0, j = 1, 2, 3
Part a
Ê ±10ˆ È 4 –4 –2 ˘ È 1 1 1 ˘ Ê 15ˆ
cT = Á ±15˜ , Q = Í –4 8 2 ˙, A=Í 2 4 0 ˙, b = Á 26˜
Á ˜ Á ˜
Ë -20¯ Î –2 2 6 ˚ Î 0 1 3 ˚ Ë 20¯
x = (x1, x2, x3), y = (y1, y2, y3), µ = (m1, m2, m3), v = (v1, v2, v3)
The KKT conditions are
Qx + ATµT – y = – cT
Ax + v = b
x ≥ 0, µ ≥ 0, y ≥ 0, v ≥ 0
yTx = 0, µv = 0
Or
4x1 – 4x2 – 2x3 + m1 +2m2 – y1 = 10
x1+ x2+ x3 + v1 = 15
Nonlinear Programming Methods 11
2x1+ 4x2 + v2 = 26
x2+ 3x3 + v3 = 20
x1 y1 + x2 y2 + x3 y3 = 0 and m1 v1 + m2 v2 + m3 v3 = 0
and all x, y, m, v are nonnegative.
Part b.
The solution obtained with the Teach LP add-in using restricted basis entry is
shown below. The solution agrees with that obtained with the Math Programming
add-in and Solver.
x1 x2 x3 u1 u2 u3 y1 y2 y3 v1 v2 v3
6.8235 3.088 4.578 0 2.108 0 0 0 0 0.51 0 3.176
Nonlinear Programming Methods 12
11. Set up the linear programming model that can be used to solve following QP. Use
the simplex algorithm with a restricted bases entry rule to find the solution.
Also solve with a general NLP code and compare the results.
2 x1 +4 x2 +2 x3 – m1 +2m2 – y2 = 3
+2 x2+6 x3 – m1 +m2 – y3 = 5
3x1+ 2x2 + x3 + v2 = 6
We used the Teach LP add-in a controlled the variables that entered the basis so
that complementary slackness was satisfied. The solution obtained below
satisfies the KKT conditions.
x1 x2 x3 u1 u2 y1 y2 y3 v1 v2
0 0.4 0.7 0 0 1.8 0 0 0.1 4.5
Nonlinear Programming Methods 13
(2 – 5 )x1 + 2x3 ≥ 4
x1 ≥ 0, x2 ≥ 0, x3 ≥ 0
Test the KKT conditions for each of the points below and determine which is the
global minimum.
a. x = (0, 5, 2) d. x = (0, 3, 0)
b. x = (0, 0, 2) e. x = (3, 0, 0)
c. x = (2, 0, 5 )
We first write out the Lagrangian function excluding the nonnegative conditions
2
L = (x1 – 5) – x22 – x32 + l1 (x12 + x22 + x32 – 9) + l2 (( 5–2) x1 – 2x3 + 4)
5) ( 5–2) x1 – 2x3 £ – 4
7) l 2 ( ( 5–2)x1 – 2x3 + 4) = 0
8) (
x1 2( x1 - 5) + l1 (2 x1) + l 2 ( 5 - 2) = 0 )
9) x 2 (- 2 x 2 + l1 (2 x 2 ) ) = 0
10) x 3 (- 2 x3 + l1 (2 x3 ) - 2l 2 ) = 0
Nonlinear Programming Methods 14
11) x1 ≥ 0, x2 ≥ 0, x3 ≥ 0, l1 ≥ 0, l2 ≥ 0
a) for x = (0, 5, 2)
As x2 >0, we have l1 = 1 from 9, thus l2 =0 from 10, however, this leads to 1
being unsatisfied. The point is not a stationary point.
b) for x = (0, 0, 2)
4 is not binding, so we have l1=0. As x3 >0, we have from 10 that l2 = –2. Thus
11 is not satisfied, and the point is not a stationary point.
c) for x = (2, 0, 5 )
As x1 > 0 and x3 >0, from 8 and 10, we have
- 6 + 4l1 + l 2 ( 5 - 2) = 0 and
- 2 5 + 2 5l1 - 2l 2 = 0 .
Solving these equations, we get
l1 ≥ 0, l2 ≥ 0.
All equations are satisfied and the point is a stationary point.
d) for x = (0, 3, 0)
The point is not feasible, as (2 – 5 )x1 + 2x3 ≥ 4 is not satisfied.
subject to x1 + x2 + x3 ≥ 1
x1 + x2 + x3 £ 6
x1 ≥ 0, x2 ≥ 0, x3 ≥ 0
a. Using the KKT conditions investigate the points (1,0,0), (1,1,1), (0,0,6) and
(2,2,2), and determine which is the optimum.
g1(x) = –x1 – x2 – x3 +1
g2(x) = x1 + x2 + x3 –6
b. Using the restricted bases entry rule, set up and solve the associated linear
program.
x1 x2 x3 u1 u2 y1 y2 y3 v1 v2 a1 a2 a3 a4 a5
2 2 2 0 12 0 0 0 5 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 -1 -1 -1 -1 -1 RHS
2 0 0 -1 1 -1 0 0 0 0 1 0 0 0 0 16
0 2 0 -1 1 0 -1 0 0 0 0 1 0 0 0 16
0 0 2 -1 1 0 0 -1 0 0 0 0 1 0 0 16
1 1 1 0 0 0 0 0 -1 0 0 0 0 1 0 1
1 1 1 0 0 0 0 0 0 1 0 0 0 0 1 6
Nonlinear Programming Methods 17
14. Solve the problem in Exercise 13 using piecewise linear approximations to the
nonlinear separable functions. Let xj £ uj = 6 for j = 1, 2, 3, and use a grid size of 0.5
units.
The piecewise linear approximation is shown below together with the solution.
The model was solved with an LP. Since the objective function terms are convex
there is no need to use restricted basis entry.
15. Use separable programming approach to solve the following problems. Pick a
suitable grid for the variables.
1
a. Minimize x +1 + x23
1
x1 ≥ 8, x2 ≥ 8
The separable function analysis as well as the solution is shown below. The
model was solved using restricted basis entry using the Teach LP add-in. The
solution obtained with the Solver add-in is (2.236, 0). The optimum obtained with
the linear approximation is (2.2, 0). The inaccuracy is due to the approximation..
k x1k f1( a 1 k ) g1( a 1k) a1k x2k f 2 (a 2k) g2(a 2k) a2k
0 0 1 0 0 0 0 0 1
1 1 0.5 1 0 1 1 -2 0
2 2 0.3333 4 0.8 2 8 -16 0
3 3 0.25 9 0.2 3 27 -54 0
4 4 0.2 16 0 4 64 -128 0
5 5 0.1667 25 0 5 125 -250 0
6 6 0.1429 36 0 6 216 -432 0
7 7 0.125 49 0 7 343 -686 0
8 8 0.1111 64 0 8 512 -1024 0
f 1 ( x 1 ) g1(x1) x1 f 2 ( x 2 ) g2(x2) x2
0.3167 5 2.2 0 0 0
0 £ x1 £ 4, 0 £ x2 £ 2, 0 £ x3
The separable function analysis as well as the solution is shown below. Since the
x3 terms enter linearly, they are entered directly into the LP model. The model
was solved using restricted basis entry using the Teach LP add-in. The solution
agrees exactly with the optimum obtained by Solver because the optimum falls
exactly on one of the grid points.
Nonlinear Programming Methods 19
16. Identify the computational steps associated with the one-dimensional search methods
listed below. Include an initialization step and a main step with appropriate
subcomponents. Be sure to specify input parameters and termination conditions.
The main step should be written in terms of iteration k.
a. Dichotomous search
Initialization Step Choose a “small” constant e > 0, and the desired final length of
uncertainty L > 0. Let [a1, b1] be the initial interval of uncertainty for the unimodal
function f(x), let k = 1, and go to the main step.
Main Step
1. If ak – bk < L, stop, the minimum point lies in the interval [ak, bk]. Otherwise,
consider xk- and xk+ defined below, and go to Step 2.
ak + bk ak + bk
xk- = -e xk+ = +e
2 2
2. If f( xk- ) < f( xk+ ), set ak+1 = ak and bk+1 = xk+ . Otherwise, set ak+1 = xk- and bk+1 = bk.
Put k ¨ k + 1 and go to Step 1.
1 1
Lk+1 = bk+1 – ak+1 = b - a1 ) + 2e Ê1 - k ˆ
k ( 1
2 Ë 2 ¯
This formula can be used to determine the number of iterations needed to achieve the
desired accuracy. Because each iteration requires two measurements, the formula can
also be used to determine the number of measurements.
b. Golden section
Initialization Step Choose a the desired final length of uncertainty L > 0. Let [a1, b1]
be the initial interval of uncertainty for the unimodal function f(x), and let x1- = a1 +
(1 – g)(b1 – a1) and x1+ = a1 + g(b1 – a1), where g = 0.618. Evaluate f( x1- ) and f( x1+ ),
let k = 1, and go to the main step.
Nonlinear Programming Methods 21
Main Step
1. If ak – bk < L, stop, the minimum point lies in the interval [ak, bk]. Otherwise, if
f( xk- ) > f( xk+ ), go to Step 2; else go to Step 3.
2. Let ak+1 = xk- and bk+1 = bk. Also, let xk-+1 = xk+ and xk++1 = ak+1 + g(bk+1 – ak+1).
Evaluate f( xk++1 ) and go to Step 4.
3. Let ak+1 = ak and bk+1 = xk+ . Also, let xk++1 = xk- and xk-+1 = ak+1 + (1 – g)(bk+1 –
ak+1). Evaluate f( xk-+1 ) and go to Step 4.
c. Newton’s method
Initialization Step Let e > 0 be an arbitrarily small constant, and let [a1, b1] be the
initial interval of uncertainty for the unimodal function f(x). Evaluate f(a1), f(b1),
f ´(a1) and f ´(b1). If f ´(a1) and f ´(b1) have the same sign, set x* = argmin{f(a1),
f(b1)} and stop; otherwise, let x1 = 0.5(a1 + b1) and go to the main step.
Main Step
1. Evaluate f ¢( xk ) and f ¢¢( xk ) and compute
f ¢( x k )
xk+1 = xk –
f ¢¢( xk )
If |xk+1 – xk| < e (or |f ´(xk)| < e) stop, the minimum point is arbitrarily close to
xk+1 (or the derivative of the function f(x) is arbitrarily close to zero, implying
d. Fibonacci search
Nonlinear Programming Methods 22
Initialization Step Choose a “small” constant e > 0, and the desired final length of
uncertainty L > 0. Let [a1, b1] be the initial interval of uncertainty for the unimodal
function f(x), and choose the number of observation n to be taken such that Fn > (b1 –
a1)/L. Let x1- = a1 + (Fn–2/Fn)(b1 – a1) and x1+ = a1 + (Fn–1/Fn )(b1 – a1). Evaluate
f( x1- ) and f( x1+ ), let k = 1, and go to the main step.
Main Step
1. If f( xk- ) > f( xk+ ), go to Step 2; else go to Step 3.
2. Let ak+1 = xk- and bk+1 = bk. Also, let xk-+1 = xk+ and xk++1 = ak+1 + (Fn–k–1/Fn–k)(bk+1
– ak+1). If k = n – 2, go to Step 5; otherwise, evaluate f( xk++1 ) and go to Step 4.
3. Let ak+1 = ak and bk+1 = xk+ . Also, let xk++1 = xk- and xk-+1 = ak+1 + (Fn–k–2/Fn–k)
(bk+1 – ak+1). If k = n – 2, go to Step 5; otherwise, evaluate f( xk-+1 ) and go to Step 4.
5. Let xn- = xn--1 , and xn+ = xn--1 + e. If f( xn- ) > f( xn+ ), set an = xn- and bn = bn–1.
Otherwise, f( xn- ) £ f( xn+ ) and set an = an–1, bn = xn- . Stop, the optimal solution lies in
the interval [an, bn].
At the first iteration, two measurements are made, and at each subsequent iteration, only
a single measurement is made. Thus at the end of iteration n – 2, we have completed n –
1 function evaluations. Furthermore, for k = n – 1, we have from the two equations on
page 394 for x1k and x2k that x1k = x2k, or using the above notation, xn--1 = xn+-1 =
0.5(an–1 + bn–1). Because either xn--1 = xn+- 2 or xn+-1 = xn-- 2 , theoretically no new
measurements are to be taken at this stage; however, in order to further reduce the
interval of uncertainty, the last measurement is placed slightly to the right or to the left of
the midpoint xn--1 = xn+-1 , so that 0.5(bn–1 – an–1) is the length of the final interval of
uncertainty [an, bn].
Initialization Step Let e > 0 be an arbitrarily small constant, and let [a1, b1] be the
initial interval of uncertainty for the unimodal function f(x). Let x0 = a1 and x1 = b1,
evaluate f(x0), f(x1), f ´(x0), f ´(x1). If f ´(x0) and f ´(x1) have the same sign, set x* =
argmin{f(x0), f(x1)} and stop; otherwise, go to the main step.
Nonlinear Programming Methods 23
Main Step
1. If |xk+1 – xk| < e (or |f ´(xk)| < e) stop, the minimum point is arbitrarily close to
xk+1 (or the derivative of the function f(x) is arbitrarily close to zero, implying
that the minimum has been reached). Otherwise,
Ê x k -1 - x k ˆ
xk+1 = xk – f ¢( xk )Á ˜
Ë f ¢( x k - 1 ) - f ¢( x k ) ¯
and go to Step 2.
2. Put k ¨ k + 1 and go to Step 1.
It is possible to introduce more detail in the Main Step relating to which two of the three
points xk–1, xk, and xk+1 should be used to obtain xk+2. If the point xk–1 is deleted, we
have what is called the secant method. This is the way the algorithm is actually stated. If
the algorithm has been started with two points x0 and x1 whose derivatives have opposite
signs, and if the point (either xk–1 or xk) whose derivative has the same sign as f ¢( xk +1 ) is
deleted, then we have the method of false position. The latter is the preferred because the
minimum always lies between the two points begin used for the interpolation. The secant
method uses extrapolation and can return a point xk+1 outside the initial interval.
17. Write a computer code to implement the methods listed in the preceding exercise.
18. For the following problems of a single variable, use dichotomous search to find the
solution for e = 0.01.
In the following parts the search was stopped when the region of uncertainty
reached 0.02.
The results of the search indicate that the minimum is between 0.2398 and
0.2575.
f. Minimize {f(x) = ex – x : 0 £ x £ 1}
19. Use the golden section method to solve the problems in Exercise 18 with stopping
parameter e = 0.01.
a. Minimize {f(x) = 105x + 8/x – 45 : 0 £ x £ 1}
The results of the search indicate that the minimum is between 0.62 and 0.63.
The results of the search indicate that the minimum is between 0.24 and 0.25.
f. Minimize {f(x) = ex – x : 0 £ x £ 1}
The results of the search indicate that the minimum is between 0 and 0.01.
Nonlinear Programming Methods 30
20. Use Newton’s method to solve the problems in Exercise 18 with e = 0.01.
For part a, we set the lower bound to 0.0001 because the function is not defined
at 0.
The last search point is at 0.273. Note that the procedure did not converge when
stated at 0.5.
Iter a (low) b (up) x f(x) x1 f(x1) x2 f(x2) f'(x) f'(x1) f''(x) new x
0 0 1 0 0 0 0 0 0 0 0 0 0.5
1 0 1 0.5 1.043 0.501 1.044 0.502 1.045 0.881 0.885 3.881 0.273
2 0 1 0.273 0.938 0.274 0.938 0.275 0.938 0.072 0.075 3.135 0.25
3 0 1 0.25 0.938 0.251 0.938 0.252 0.938 0.002 0.005 3.006 0.25
Stop 0 1 0.25 0.938 0.251 0.938 0.252 0.938 0.002 0.005 3.006 0.25
f. Minimize {f(x) = ex – x : 0 £ x £ 1}
21. Use the steepest descent method to find the minimum of the function
2 2
f(x) = 3x1 + 4x2 – x1x2 – 5x1 – 8x2.
Start at the point x0 = (0, 0) and do four iterations. Determine the value of the step
size t at each iteration with the special procedure described in the text for quadratic
functions.
Since the objective function is quadratic the Partan reaches the optimum after
the acceleration step.
b. Newton’s method.
Since the objective function is quadratic Newton’s method reaches the optimum
after a single step. The direction is computed with the inverse of the Hessian
matrix which is constant for a quadratic objective.
Step Type x1 x2 f (x ) Grad1 Grad2 d1 d2 t new x1 new x2 norm
0 0 0 0 0 0 0 0 0 0 0 0
1 Newt 0 0 0 -5 - 8 -1.021 -1.128 1 1.0213 1.1277 1.5214
2 Grad 1.0213 1.1277 - 7 . 0 6 4 0 2E-15 0 2E-15 0 1.0213 1.1277 0
Nonlinear Programming Methods 33
23. Use the steepest descent procedure to find the minimum of the function
2 2 2
f(x) = 2x1 + x2 + 4x3 + 3x1x3 – 3x2x3 + x1 + 2x2 + 3x3.
Start at the point x0 = (1,1,1) and do four iterations. Find the closed form solution
for the step size t that minimizes the function in the search direction and use it in the
computations.
Step Type x1 x2 x3 f(x ) Grad1 Grad2 Grad3 t new x1 new x2 new x3 norm
0 0 0 0 0 0 0 0 0 0 1 1 1 1.7321
1 Grad 1 1 1 13 8 1 11 0.11 0.1185 0.8898 - 0 . 2 1 2 1.503
2 Grad 0.1185 0.8898 - 0 . 2 1 2 2.752 0.8377 4.4159 - 1 . 0 1 1 0.296 - 0 . 1 3 - 0 . 4 1 8 0.0872 1.364
3 Grad - 0 . 1 3 - 0 . 4 1 8 0.0872 -0.39 0.7433 0.9031 4.5618 0.134 - 0 . 2 2 9 - 0 . 5 3 8 - 0 . 5 2 2 0.629
4 Grad - 0 . 2 2 9 - 0 . 5 3 8 - 0 . 5 2 2 -1.87 - 1 . 4 8 3 2.4907 - 0 . 2 5 1 0.306 0.2243 - 1 . 3 - 0 . 4 4 6 0.889
Nonlinear Programming Methods 34
24. Repeat the preceding exercise, but instead of using the closed form solution for t, use
a one–dimensional search procedure to find the optimum step size. Assume the
initial range for t is [0, 1] and e = 0.1.
The table below shows the steepest decent iterations obtained using the Teach
NLP add-in. The line search uses 25 Golden section steps, so the step size is
very close to optimum.
X _ 2 4 Solution
1 0.2243
2 -1.299
3 -0.446
Objective - 3 . 1 6 5
In the search below we use five Golden section steps which should bring the
interval of uncertainty to about 0.1. The number of function evaluations is
considerably reduced and the path has changed slightly. Although one would
expect some decline in performance, it happens that the objective value is better
(lower) for this case after four iterations.
X _ 2 4 Solution
1 0.1773
2 -1.285
3 -0.471
Objective -3.27
Nonlinear Programming Methods 35
The best results occurred there three initial gradient steps rather than two. The
fourth step was an acceleration, and thereafter gradient and acceleration steps
alternated. The termination criterion was reached on step 16.
Step Type x1 x2 x3 f(x ) d1 d2 d3 t new x1 new x2 new x3 norm
0 0 0 0 0 0 0 0 0 0 1 1 1 1.7321
1 Grad 1 1 1 13 8 1 11 0.11 0.1185 0.8898 - 0 . 2 1 2 1.503
2 Grad 0.1185 0.8898 - 0 . 2 1 2 2.752 0.838 4.416 -1.01 0.296 - 0 . 1 3 - 0 . 4 1 8 0.0872 1.364
3 Grad -0.13 -0.418 0.0872 -0.39 0.743 0.903 4.562 0.134 - 0 . 2 2 9 - 0 . 5 3 8 - 0 . 5 2 2 0.629
4 Acc -0.229 -0.538 - 0 . 5 2 2 -1.87 0.347 1.428 0.31 0.893 - 0 . 5 3 9 - 1 . 8 1 3 -0.8 1.341
5 Grad -0.539 -1.813 - 0 . 8 -3.19 -3.55 0.772 0.426 0.318 0.5931 - 2 . 0 5 9 - 0 . 9 3 5 1.166
6 Acc 0.5931 -2.059 - 0 . 9 3 5 -5.33 -0.82 1.521 0.413 0.698 1.1665 -3.12 -1.223 1.24
7 Grad 1.1665 -3.12 - 1 . 2 2 3 -6.03 1.996 -0.57 6.073 0.102 0.9636 - 3 . 0 6 2 - 1 . 8 4 1 0.652
8 Acc 0.9636 -3.062 - 1 . 8 4 1 -8.13 -0.37 1.003 0.905 1.187 1.4034 - 4 . 2 5 3 - 2 . 9 1 5 1.663
9 Grad 1.4034 -4.253 - 2 . 9 1 5 -9.29 -2.13 2.241 -3.36 0.101 1.6187 - 4 . 4 7 9 - 2 . 5 7 7 0.461
10 Acc 1.6187 -4.479 - 2 . 5 7 7 -10.3 -0.66 1.417 0.736 1.925 2.8793 - 7 . 2 0 5 - 3 . 9 9 3 3.321
11 Grad 2.8793 -7.205 -3.993 -12 0.538 -0.43 1.309 0.096 2.8278 - 7 . 1 6 4 - 4 . 1 1 8 0.142
12 Acc 2.8278 -7.164 - 4 . 1 1 8 -12.1 -1.21 2.685 1.542 0.052 2.8907 - 7 . 3 0 4 - 4 . 1 9 9 0.173
13 Grad 2.8907 -7.304 - 4 . 1 9 9 -12.1 -0.03 -0.01 -0.01 0.216 2.8979 - 7 . 3 0 1 - 4 . 1 9 7 0.008
14 Acc 2.8979 -7.301 - 4 . 1 9 7 -12.1 -0.07 0.137 0.079 0.007 2.8984 - 7 . 3 0 2 - 4 . 1 9 8 0.001
15 Grad 2.8984 -7.302 - 4 . 1 9 8 -12.1 1E-04 -0.01 0.019 0.11 2.8984 - 7 . 3 0 1 -4.2 0.002
16 Acc 2.8984 -7.301 - 4 . 2 -12.1 -0 - 0 0.003 0.004 2.8984 - 7 . 3 0 1 -4.2 1E-05
Stop Stop 2.8984 -7.301 - 4 . 2 -12.1 -0.01 -0 - 0 0.219 2.8998 - 7 . 3 0 1 -4.2 0.001
b. Newton’s method.
2 2
26. Use Newton’s method to minimize f(x) = x1 – 4x1 + 2x2 – 2x2 + (x1x2)3/2.
For this non-quadratic function, we take a number of Newton steps. Each step is
based on the Hessian matrix computed at the current point. Since the function is
not quadratic, the Hessian changes and the process takes several steps.
27. Use a computer implementation of steepest descent to solve the problem below.
Start the search at the origin.
2 2
Maximize f(x) = –100ÊËx3 – (0.5(x1 + x2))2ˆ¯ – 25ÊËx1 – x22 + x32ˆ¯
After 20 steps of the Gradient Method (steepest ascent) on the Teach NLP add-
in the solution below is obtained.
After 12 steps of the Conjugate Gradient Method in the Teach NLP add-in the
solution below is obtained.
The solution obtained with the Solver add-in is shown below. It agrees closely
with the solution from the Conjugate Gradient Method.
F_27(X_27) X_27
-30.658929
Nonlinear Programming Methods 38
28. Perform three iterations of steepest descent (ascent) for each of the following
problems. Plot isovalue contours of f(x) and indicate how the method progresses
from one iteration to the next.
2 2
a. Minimize f(x) = 2x1 + x2 – x1x2 – 7x1. Start at x0 = (1, 0).
X _ 2 8 a Solution
1 1.9981
2 0.9946
Objective -7
3 2 2
b. Minimize f(x) = x1 – 9x1 + 5x2 – 20x2. Start at x0 = (1, 1)
X_28b Solution
1 5.95385
2 2.11244
Objective -127.92
X _ 2 8 c Solution
1 -0.788
2 11.55
Objective - 1 6 6 . 6
4 3 2 2
d. Maximize f(x) = –x1 + 8x1 – 10x1 – x2 + 2x2. Start at x0 = (0, 0). Note that
X _ 2 8 d Solution
1 1E-06
2 1
Objective 1
Nonlinear Programming Methods 40
29. Perform three iterations of the PARTAN method for the following problems. In each
case, let x0 = (0, 0).
2 2
a. Minimize f(x) = x1 + x2 – 4x1x2 – 16x1 – 20x2.
2
b. Minimize f(x) = 2x1 + (3 – x2)2.
2 2
c. Minimize f(x) = x1 + x2 – 6x1 – 8x2.
30. Use Newton’s method to solve the problems in the preceding exercise with the same
starting points.
2 2
a. Minimize f(x) = x1 + x2 – 4x1x2 – 16x1 – 20x2.
2
b. Minimize f(x) = 2x1 + (3 – x2)2.
2 2
c. Minimize f(x) = x1 + x2 – 6x1 – 8x2.
Solution to Ex. 2
X02_ Values F02_(X02_ X02_
X02_(1) 1.02128 -7.0638
X02_(2) 1.12766
Solution to Ex. 5
X05_ Values G_(X05_) X05_
X05_(1) 1 -1
X05_(2) 1
32. For each of the objective functions given below solve the problem
Minimize{f(x) : x ≥ 0}
In the following we neglect constant terms that may be in the objective function.
Every stationary point must satisfy the following necessary conditions.
∂f ∂f
x1 = 0, x2 =0
∂x1 ∂x2
∂f ∂f
x1 ≥ 0, x2 ≥ 0, ≥ 0, ≥0
∂x1 ∂x2
f ( x ) = x12 - 10 x1 + x2 2 - 6 x1 - 4 x1 x2 + 34
∂f
= 2 x1 - 4 x2 - 10
∂x1
∂f
= 2 x2 - 4 x1 - 6
∂x2
∂f ∂f Ê -3.6667ˆ
= 0, = 0, x = Á ˜
∂x1 ∂x2 Ë -4.333 ¯
Nonegativity conditions violated.
Nonlinear Programming Methods 44
∂f ∂f
x1 = 0, = 0, x2 = 3, = -22 < 0
∂x2 ∂x1
Nonegativity conditions violated.
∂f ∂f
x2 = 0, = 0, x1 = 5, = -26 < 0
∂x1 ∂x2
Nonegativity conditions violated.
f ( x ) = x12 + 10 x1 + x2 2 - 6 x1 + 34
∂f
= 2 x1 + 10
∂x1
∂f
= 2 x2 - 6
∂x2
∂f ∂f Ê -5ˆ
= 0, = 0, x = Á ˜
∂x1 ∂x2 Ë 3¯
Nonegativity conditions violated.
∂f ∂f
x1 = 0, = 0, x2 = 3, = 10 > 0, f ( x ) = -18
∂x2 ∂x1
Point satisfies the necessary condition. The Hessian is positive definite, so this
point must be a local minimum.
∂f
x2 = 0, = 0, x1 = -5
∂x1
Nonlinear Programming Methods 45
Only (0,3) satisfies the necessary condition, so it must be the global minimum.
f ( x ) = x12 - 6 x1 + x2 2 + 3 x2 + 2 x1 x2 + 34
∂f
= 2 x1 - 6 + 2 x2
∂x1
∂f
= 2 x2 + 3 + 2 x1
∂x2
∂f ∂f
= 0, = 0, x = no solution
∂x1 ∂x2
No solution.
∂f 3
x1 = 0, = 0, x2 = -
∂x2 2
Nonegativity conditions violated.
∂f ∂f
x2 = 0, = 0, x1 = 3, =9>0
∂x1 ∂x2
Point satisfies the necessary condition. The Hessian is positive definite, so this
point must be a local minimum. Since this is the only point satisfying the
necessary conditions it must be the global minimum.
f ( x ) = x12 + 10 x1 + x2 2 + 6 x2 - 6 x1 x2 + 34
∂f
= 2 x1 + 10 - 6 x2
∂x1
∂f
= 2 x2 + 6 - 6 x1
∂x2
∂f ∂f
= 0, = 0, x1 = 1.75, x2 = 2.25
∂x1 ∂x2
The solution satisfies the necessary condition. The Hessian is indefinite, so we
judge the point to be not a local minimum.
∂f
x1 = 0, = 0, x2 = -3
∂x2
Nonegativity conditions violated.
∂f
x2 = 0, = 0, x1 = -5
∂x1
Nonegativity conditions violated.
At the two points that satisfy the necessary conditions, the Hessian function is
indefinite. There are no local minima for this function.
Operations Research Models and Methods
by Paul A. Jensen and Jonathan F. Bard
John Wiley and Sons, Inc.
Copyright 2003 – All rights reserved
2. A truck has four rolling tires and two spares. The tires on the ground are identical
and each may fail while the truck is in motion. The event of a single failure is
denoted by a. When a tire fails it is replaced with a spare providing one is available.
The truck can no longer operate when less than four good tires are available. Draw
the separate state-transition networks under the following operating rules. Denote the
repair operation by d.
a. Whenever a tire fails it is sent to the shop. The truck continues to operate as long
as it has four good tires. Repaired tires are returned to the truck one at a time.
Let s = number of failed tires. States 0, 1 and 2 are operable states, while state 3
is a failed state.
b. Failed tires are sent to the shop only when no spares remain. The truck continues
to operate as long as four good tires are available. Repaired tires are returned to
the truck one at a time.
Let s1 = number of failed tires with truck, s2 = number of failed tires in repair.
States 0, 1,2 and 3 are operable states, while state 4 is a failed state.
c. No repair is possible. The truck continues to operate until there are fewer than
four good tires available.
Let s = number of failed tires. States 0, 1 and 2 are operable states, while state 3
is a failed state.
d
d
If there were some distinguishing characteristic that made some persons
incompatible, the state vector would have as many elements as there were
classes. For example if men and women used the system and only same sex
matching were allowed, then the state variable would have two elements, one
counting the number of men and the other counting the number of women.
Models for Stochastic Processes 5
4. A queueing system has two identical servers. Separate queues form in front of each
with arriving customers joining the shortest line. Customers do not switch lines once
they are in the system (i.e., there is no jockeying). The completion of a service (at
server i ) is called di. The arrival of a customer is called a. Describe the stochastic
process that governs the numbers of persons in the two lines. Draw the
corresponding state-transition network.
The process has two state variables: Let s1 = number of customers at server 1, s2
= number of customers at server 2. We assume if both servers have the same
number, arrivals will go to server 1.
a d d
1 1
d
(0,0) d (1,0) (2,0) (3,0) 1 (4,0)
1
a a a
d d d d
2 2 2 2
a d
(0,1) a (1,1) (2,1) 1 (3,1)
d d a
1 1
d d d
2 2 2
a a
(0,2) (1,2) (2,2)
d d
1 1
d d
2 2
a
(0,3) (1,3)
d
1
d
2
(0,4)
Models for Stochastic Processes 6
5. A production system has three workstations in series. Each station is in one of three
states: idle (i) with no product, idle holding (h) a product, and working (w) on a
product. There is sufficient backlog available so that whenever station 1 is idle with
no product it is immediately provided with a unit to work on. When station 3
completes its operations, the product leaves the system. Stations 1 and 2 cannot pass
a unit on to the next station unless the station is idle and not holding. This restriction
represents a version of blocking. Construct the state-transition network that describes
the overall process.
[w, i, i ]
d1
d3
[w,w, i ]
d1 d2
d3
[h,w, i ] [w, i, w]
d2 d1
d3 d3
d2 d3 d1
[h,h, w ]
Models for Stochastic Processes 7
6. A self-paced course consists of six units, numbered 1 through 6, that must be taken in
sequence. The time it takes to study a unit is a random variable. After completing a
unit, the student takes a test and has a probability p of passing. If the student does not
pass, he must repeat the unit and then retake the test. Passing the test allows him to
go on to the next unit. When all six units are passed the course is complete. Describe
the stochastic process under the following conditions and draw the corresponding
state-transition network. Treat each part separately.
a. There is no limit to the number of tests the student may take.
b. The student fails the course when he fails any three tests (i.e., failing three
different units, the same unit three times, or any combination).
c. Whenever the student fails more than two tests, he must start the course over
again.
d. The student must take a test each week. If he fails a test he must take another test
on the same unit in the following week. To pass the course the student must
finish in 12 weeks; otherwise he fails.
a.
State s = [s] s the number of tests passed
State Space S = {0, 1, 2, …, 6} When s = 6, the course is complete.
Events X = {e, f} The event e is to pass a test, while f is
to fail. We could say that t is the event
of taking the test. Then instead of e we
would use pt as the event of passing
and (1 – p)t as the event of failing.
Here p is the numerical probability of
passing.
e e e e
(0) (2) (3) (6) P
f f f
Models for Stochastic Processes 8
b.
State s = (s1, s2) s1 = number of tests passed
s2 = number of tests failed
State Space S = {(s1, s2)| 0 £ s1 £ 6, All states with s1 = 6 are absorbing
states and represent passing. All states
0 £ s2 £ 3} with s2 = 3 are absorbing and
represent failing. State (6, 3) is
impossible.
Events X = {e, f} The event e is to pass a test, while f is
to fail.
e e e e
(0,0) (1,0) (2,0) (6,0) P
f f f
e e e e
(0,1) (1,1) (2,1) (6,1) P
f f f
e e e e
(0,2) (1,2) (2,2) (6,2) P
f f f
F F F
c.
State and event definition the same as part b, except
S = {(s1, s2)| 0 £ s1 £ 6, 0 £ s2 £ 2}
e e e e
(0,0) (1,0) (2,0) (6,0) P
f f f
e e e e
f (0,1) (1,1) (2,1) (6,1) P
f f f f f
e e e e
(0,2) (1,2) (2,2) (6,2) P
Models for Stochastic Processes 9
d.
State s = (s1, s2) s1 = number of tests passed
s2 = number of weeks
State Space S = {(s1, s2)| 0 £ s1 £ 6, 0 All states with s1 = 6 are absorbing
states and represent passing. All states
£ s2 £ 7+ s1}
with s2 = 7+ s1 are absorbing and
represent failing when s1 < 6.
Events X = {e, f} The event e is to pass a test, while f is
to fail.
(0,0)
e
f
(0,1) (1,1)
e e
f f
e
(0,6) (1,6) (2,6) (6,6) P
f f f
e
(0,7) (1,7) (2,7) (6,7) P
F f f
e
(1,8) (2,8) (6,8)P
F
Models for Stochastic Processes 10
7. In each case below, show the state-transition network that describes this process.
a. A single machine makes some product. To make one unit of product an operator
must load the machine with the raw material and then process it. Raw material is
continuously available. The machine can be in one of two states: loading (0) and
processing (1). There are two activities the loading activity (a) and the processing
activity (b).
b. Expand on the situation of problem a in the following way. When a product is
completed the operator performs a test. The test time is included in the operating
time. The product will pass with probability p. When the product fails the test,
the operator must spend an additional time to repair the failure. Let the activity c
describe the activity of repair. The repair activity is always successful. When
repair is complete, the operator loads the raw material for another unit. Now the
operator has three states: loading (0), operating (1) and repairing (2).
c. Change the situation in problem b. Now the repair activity is not always
successful. The probability of success is q. When it is successful the operator
begins loading raw material. When the repair activity is not successful it is
repeated. The repair continues in the fashion until it is finally successful.
d. Change the situation in problem c so the repair activity is only repeated two times.
The product is discarded after the second attempt.
a. As stated in the problem, the states are loading (0) and processing (1).
Activities are loading that terminates in the event a, and processing that
terminates in the event d. The state-transition diagram showing the states and
events is below.
a
0 1
b. The states are loading (0), processing (1) and repairing (2). Activities are
loading that terminates in the event a, and the processing that terminates in the
events e, success or f failure, and repairing that terminates with event r. The
state-transition diagram showing the states and events is below. Note that you
may want to use pd to refer to event e and (1 – p)d to refer to event f.
Models for Stochastic Processes 11
a f
0 1 2
e
r
c. Add the event w that represents a failed test. We now use r to represent a
successful test.
a f
0 1 2 w
e
d. Add state 3 which represents the second iteration of the test. The transition
from state 3 to 0 occurs whether or not the test is successful.
a f w
0 1 2 3
e
r+w
Models for Stochastic Processes 12
8. Answer the following questions with respect to the IRS auditing problem described in
Section 11.3.
a. What are the implications and plausibility of each of the three assumptions
(properties) needed to treat this problem as a Markov chain.
b. In estimating P, would you prefer more than 10 observations? Explain.
c. Suppose that a year has passed. If an audit were performed in year 11, how would
you update P? Would you say that the history of the stochastic process is relevant
when P is not known a priori? Explain. If so, does collecting more data
necessarily violate the Markovian property? Explain.
d. Let fij represent the number of observations in cell (i,j) of a contingency table for
P. Write down a general expression for calculating all pij.
b. The more observations from the same population the better, so the answer, in
general, is “yes.” The larger the sample size, the smaller the sampling error
in estimating the “true” transition probabilities. If there is a structural change
in the taxpayer’s employment or filing status, though, past data may not be
relevant to the current situation. In such cases, old data may be misleading.
c. If an audit were performed in year 11, there would be one more transition
from “No audit” to “Audit.” The updated state-transition matrix would then be
Models for Stochastic Processes 13
È3 / 6 3 / 6 ˘
P= Í ˙
Î2 / 4 2 / 4 ˚
Yes, it is especially relevant because more data leads to better estimates of
P. Whenever a state is realized it alters the empirical probabilities so the new
information can be used to improve our understanding of the true values. The
Markovian property is not necessarily violated. We would like as much
history as possible to get good estimates.
9. The number of students arriving at a university’s financial aide office was recorded
over a period of 100 hours. The following table indicates the number that arrived
each hour.
a. Let X = random variable representing the number of customers per hour, and
let fx = number of times x customers were recorded. Then the average arrival
rate is
1 5 1
l = Â
100 x =1
xfx =
100
[(0 ¥ 10) + (1 ¥ 20) + (2 ¥ 30) + (3 ¥ 15) + (4 ¥ 15) + (5 ¥ 10)]
= 2.35 / hr
b. The average interarrival time, ma = 1/l = (1/2.35 hr) (60 min/hr) = 25.53 min
Models for Stochastic Processes 15
c.
Relative
frequency
0.30
0.20
0.10
0.0
0 1 2 3 4 5
Students per hour
Based on the diagram, we will try to fit a binomial distribution with parameter p =
0.45 and n = 5 to the data. The Kolmogorov-Smirnov test will be used determine
if this distribution is valid.
Recall that a binomial random variable has the following probability mass
function.
n! x n–x
Pr{N = x} = p (1 – p) , x = 0, 1,…, n
x!(n ± x )!
5! n- x
= p x (1 - p) , x = 0,1,..., 5
x!(5 - x )!
To help organize the data, we construct the following table.
Models for Stochastic Processes 16
10. The following table provides data associated with a repair operation for 550
customers.
c.
Relative
frequency
0.30
0.20
0.10
0.0
1 2 3 4 5
Hours per repair
Based on the diagram, we will try to fit a binomial distribution with parameter p =
0.40 and n = 4 to the data. To do this, we need to perform a simple
transformation on the binomial random variable so that its range is from 1 to 5,
rather than 0 to 4. The appropriate distribution of X is
n! x–1 n–x+1
Pr{X = x} = p (1 – p) for x = 1,…, n + 1
( x - 1)!(n ± x + 1)!
4! 5- x
= p x (1 - p) , x = 1,..., 5
( x - 1)!(5 - x )!
The Kolmogorov-Smirnov test will be used determine if this distribution is valid.
To help organize the data, we construct the following table.
Models for Stochastic Processes 19
11. A manufacturing facility uses two identical machines that are attended to by a single
operator. Each machine requires the operator's attention at random points in time.
The probability that the machine requires service in a period of 5 minutes is p = 0.4.
The operator is able to service a machine in 5 minutes. Let us approximate this
situation by assuming that when service is required, it is always initiated at the
beginning of a 5-minute period. Construct a state-transition network for this
problem and find the transition matrix associated with it. Define all terms.
The state is the number of failed machines. Assuming the machines fail
independently and the operator can only repair one machine in a 5 minute
period. In any five minute period we identify the events can happen with a two
element vector:
(number that fail, number that are fixed)
The possible transitions are indicated on the state-transition network below.
(1,0)
(0,1)
(0,0) 0 1 2
(0,1)
(1,1)
(2,0)
12. Discrete-time Markov chains are frequently used as models for infection. A nonfatal
but tropical disease takes three weeks to run its course. The chance of a healthy
person contracting the disease in any week in 0.1. Two drugs are available to
shorten the length of the disease. The first drug can be used only during week 1, and
it cures 50 percent of the patients immediately. The second drug must be used in
week 2 where the cure rate is also 50 percent.
a. Define the states of the system and write out the transition matrix when no drugs
are taken.
b. Write out the transition matrix when the drugs options are included. If both
drugs are used when appropriate, what fraction of the infected population will
experience a reduction in the length of the disease?
Define states for healthy (H), sick for one week (D1), sick for two weeks (D1) and
sick for three weeks (S3).
a. The transition matrix is below.
È0.9 0.1 0 0˘ H
Í0 0 1 0˙ D1
P=Í ˙
Í0 0 0 1˙ D2
Í1 0 0 0 ˙˚ D3
Î
b. The transition matrix is below.
È0.9 0.1 0 0˘ H
Í0.5 0 0.5 0 ˙ D1
P=Í ˙
Í0.5 0 0 0.5˙ D2
Í1 0 0 0 ˙˚ D3
Î
Given that a person gets the disease the probability that the drugs reduce the
length of the diseases is:
P(first drug works) + P(first drug does not work) ¥ P(second drug works)
13. Gwynne Hodler bought several 1000 shares of a high flying internet stock at $38,
and has given orders to her broker to sell the stock as soon as its price rises to $40 or
above or falls to $37 or below. From observations about this stock over the last few
weeks, Gwynne estimates that the probability of a price rise of $1 is 0.5 and that the
probability of a price decline of $1 is 0.2 per day. Find the transition matrix for this
process. Which states are transient states, and which states are absorbing?
Define states 37, 38, 39, 40 to represent the price of the stock. The transition
matrix is below. States 38 and 39 are transient states and state 37 and 40 are
absorbing states.
È1 0 0 0 ˘ 37
Í0.2 0.3 0.5 0 ˙ 38
P=Í ˙
Í 0 0.2 0.3 0.5˙ 39
Í0 0 0 1 ˙˚ 40
Î
Operations Research Models and Methods
by Paul A. Jensen and Jonathan F. Bard
John Wiley and Sons, Inc.
Copyright 2003 – All rights reserved
1. Louise Ciccone, a dealer in luxury cars, faces the following weekly demand
distribution.
Demand 0 1 2
Probability 0.1 0.5 0.4
She adopts the policy of placing an order for 3 cars whenever the inventory level
drops to 2 or fewer cars at the end of a week. Assume that the order is placed just
after taking inventory. If a customer arrives and there is no car available, the sale is
lost. Show the transition matrix for the Markov chain that describes the inventory
level at the end of each week under the following conditions.
a. The order takes 1 week to arrive.
b. The order takes 2 weeks to arrive. Hint: To determine the state space, consider
what you could possibly see in terms of cars on hand and cars to arrive just after
taking inventory.
Also, compute the steady-state probabilities and the expected number of lost sales
per week for each case.
An order is placed for 3 cars if inventory drops to two cars are fewer. It is
assumed that the order arrives at the end of the week just before the inventory is
taken. If customer arrives and no car is available the sale is lost; i.e., no back
orders.
a. The order takes 1 week to arrive. Define the states as the inventory level at
the end of each week so S = {1,2,…,5}. The transition matrix P is given below.
Inv 0 Inv 1 Inv 2 Inv 3 Inv 4 Inv 5
Inv 0 0 0 0 1 0 0
Inv 1 0 0 0 0.9 0.1 0
Inv 2 0 0 0 0.4 0.5 0.1
Inv 3 0 0.4 0.5 0.1 0 0
Inv 4 0 0 0.4 0.5 0.1 0
Inv 5 0 0 0 0.4 0.5 0.1
Discrete-Time Markov Chains 2
Note that Inv. 0 is a transient state, while the others are recurrent.
b. The order takes 2 weeks to arrive so if we looked at the system at the end of
the week just after an order arrived, we would be able to measure the inventory
and the number of cars on order. Therefore, define the state vector as s = (s1,
s2), where s1 is the inventory level at the end of the week (just after an order
arrives it can be 0, 1, . . . , 5), and s2 is the number of cars that will arrive at the
end of the upcoming week (s2 = 0 or 3). This leads to the following transition
matrix.
2. Do both parts of Exercise 1 under the condition that the demand is assumed to
follow a Poisson distribution with a mean of 1.5 cars per week.
Demand 0 1 2 3 4 ≥5
Probability 0.223 0.335 0.251 0.126 0.047 0.019
a.
With these probabilities the DTMC Matrix for part a has 6 states. No longer is
State 0 transient, because the Poisson has no limit to demand.
Inv 0 Inv 1 Inv 2 Inv 3 Inv 4 Inv 5
Inv 0 0.000 0.000 0.000 1.000 0.000 0.000
Inv 1 0.000 0.000 0.000 0.777 0.223 0.000
Inv 2 0.000 0.000 0.000 0.442 0.335 0.223
Inv 3 0.191 0.251 0.335 0.223 0.000 0.000
Inv 4 0.066 0.126 0.251 0.335 0.223 0.000
Inv 5 0.019 0.047 0.126 0.251 0.335 0.223
The expected lost sales in any state is
E(lost sales) = E(Demand) – E(Sales)
Here the expected sales is a function of the initial inventory:
I -1 •
E (Sales) = Â kP ( k ) + I Â P ( k ) where I is the inventory level
k= 0 k= I
We use this expression to evaluate the expected lost sales in each state. We use
these values (the bottom row of the table) for the economic analysis of the
DTMC.
I 0 1 2 3 4 5
I*Sum(P(k)|k >= I) 0.000 0.777 0.884 0.573 0.263 0.093
Sum(kP(k)|0≤k≤I-1) 0.000 0.000 0.335 0.837 1.213 1.402
E(Sales) 0.000 0.777 1.219 1.410 1.476 1.494
E(lost sales) 1.500 0.723 0.281 0.090 0.024 0.006
We compute the steady-state results for this system.
Average
0 1 2 3 4 5 lost sales
Inv 0 Inv 1 Inv 2 Inv 3 Inv 4 Inv 5 per period
Steady State Dist. 0.089747 0.124368 0.180438 0.417838 0.135785 0.051825 0.3163423
Discrete-Time Markov Chains 4
b. Determining this transition matrix takes some analysis. The state (0, 0) is not
possible and must be included in the transition matrix. The probabilities in the
cells are computed from the Poisson distribution.
The steady-state analysis reveals the state probabilities and expected lost sales
per week.
Average
0 1 2 3 4 5 6 7 8 lost sales
(0, 0) (0, 3) (1, 0) (1, 3) (2, 0) (2, 3) (3,0) (4,0) (5,0) per period
Steady State Dist. 0.072 0.203 0.095 0.065 0.131 0.029 0.361 0.035 0.008 0.606846
Discrete-Time Markov Chains 5
3. A military maintenance depot overhauls tanks. There is room for three tanks in
the facility and one tank in an overflow area outside. At most four tanks can be at
the depot at one time. Every morning a tank arrives for an overhaul. If the depot
is full, however, it is turned away so no arrivals occur under these circumstances.
When the depot is full the entire overhaul schedule is delayed 1 day. In any given
day, the following probabilities govern the completion of overhauls.
These values are independent of the number in the depot, but obviously, no more
tanks than are waiting at the start of the day can be completed.
a. Develop a Markov chain model for this situation. Begin by defining the state
to be the number of tanks in the depot at the start of each day (after the
scheduled arrival). Draw the network diagram and write out the state-
transition matrix.
b. Do the same when the state is defined as the number of tanks in the depot at
the end of each day.
a. The state is the number of tanks in the depot at the start of each day.
The events on the arcs are (a, d) where a indicates the arrival: 1 means arrive
and B means the arrival is blocked. d is the number of tanks completed during
the day.
Network diagram
0
(B, 0)
(1, 0)
(1,1)
(B, 3)
1
4
(B, 2)
(1,3)
(1,2) (1,0)
(1, 0) (B, 1)
(1,2)
3 2
(1, 0)
(1,1) (1,1)
Discrete-Time Markov Chains 6
DTMC Matrix
b. The state is the number of tanks in the depot at the end of each day.
Network diagram
(1, 1)
0 (1,2)
(B, 0)
(1, 0) (1,1)
(B, 3)
1
4
(B, 2)
(1,3)
(1,0)
(1,2)
(1, 0) (B, 1)
(1,2)
3 2
(1, 0)
(1,1) (1,1)
With 0 tanks at the end of the day, one will arrive on the next morning. It will be
still there if it is not finished during the day (0.2 probability). It will be gone if it is
finished (0.8 probability).
States 3 and 4 are the same, except for state 4 no tank arrives at the following
morning, while in the case of state 3, one tank arrives. Either case has the same
probability distribution at the end of the day.
Discrete-Time Markov Chains 7
4. For the situation described in the Exercise 3a, use the Stochastic Analysis Excel
add-in accompanying the book to answer the following questions.
a. Assume that on Monday morning (after the arrival of a tank) there are three
tanks in the maintenance facility while the overflow area is empty. List the
state probabilities for the next 5 days.
a. These are holding power probabilities. Thus p11 = 0.90, p22 = 0.82, p33 = 0.68
indicate the percentage of customers who will not change brands from one week
to the next. Alternatively, there is a 90% that a customer will buy Brand 1 next
week if he purchased Brand 1 this week, and so on.
b. Because p23 > p21, Brand 2 is most likely to lose customers to Brand 3.
c. Given that p11 > p22 > p33, Brand 1 has the most “loyal” customers.
d. Brand 3 has the least “loyal” customers because p33 < p22 < p11.
Discrete-Time Markov Chains 10
6. Add a fourth state to the state space which represents “no purchase of Brands 1, 2,
or 3 in week t.” Construct a new transition matrix given the contingency table
below.
Is this table more comprehensive than Table 12.4? Interpret the meaning of p44.
Identify two explanations for the occurrence of Xt = 4. (Hint: When Xt = 4 does it
necessarily mean that the consumer did not purchase this product on week t?)
È 0.90
0.02
0.05
0.80
0.03
0.16
0.02
0.02
˘
P= Í 0.19 0.11 0.62 0.08 ˙.
Î 0.25 0.50 0.25 0.00 ˚
Yes, this table is more comprehensive than Table 12.4 because Xt = 4
acknowledges the possibility of either “no purchase of the product” or “purchase
of a brand other than the defined three brands” in any given week. Given p44 = 0,
it follows that not one consumer in the sample went for two straight weeks
without purchase of one of these three brands.
Discrete-Time Markov Chains 11
7. Consider the three-brand market presented in the example. Define a state space
which includes the possibilities of zero, one, or two purchases of the product in a
given week.
No. of
Purchases Brand mix
0 (0, 0, 0) For example, (0, 1, 1) means that a
1 (1, 0, 0) customer did not purchase Brand 1
(0, 1, 0) but did purchase one unit each of
(0, 0, 1) Brand 2 and Brand 3 for that week.
2 (1, 1, 0)
(1, 0, 1)
(0, 1, 1)
(2, 0, 0)
(0, 2, 0)
(0, 0, 2)
Discrete-Time Markov Chains 12
8. Calculate by hand expected market shares three weeks into the future using both
formulas given in Eq. (3). Assume q(0) = (0.25, 0.46, 0.29).
1 2 3
1 0.90 0.07 0.03
P= 2 0.02 0.82 0.16
3 0.20 0.12 0.68
Thus when i ≠ j, for example, a price for Brand i in week t that is above the
–
market average of all other prices (that is, sit > sit) will have the effect of
increasing the attraction power of other brands (that is, p^ ij will be greater than pij).
Given expected prices in week t, it follows that the above equation can be used to
construct a new transition matrix. Note, however, that row sums will not be unity,
hence the p^ ij values for each row i must be adjusted to yield a sum of unity. For
example, if unadjusted p^ 11 = 0.9, p^ 12 = 0.5 and p^ 13 = 0.6, then the adjusted values
for the first row would be determined as follows (noting that unadjusted
p^ 11 + p^ 12 + p^ 13 = 2): p^ 11 = 0.9/2 = 0.45, p^ 12 = 0.5/2 = 0.25 and p^ 13 = 0.6/2 =0.3.
Also, if unadjusted p^ ij < 0, then it should be set to zero before normalizing.
a. Reason out changes in pij for the following situations: sit > –sit and i = j; sit < –sit
and i ≠ j; sit < –sit and i = j; sit = –sit. Does the logic of this model reflect the
phenomenon of “price-snobbery”?
a. Decrease in pii, i.e., if the price of Brand i is above average, then its holding
power will decrease;
Decrease in pij, i.e., if the price of Brand i is below average, then the attraction
power of competing brands will decrease;
Increase in pii, i.e., if the price of Brand i is below average, then its holding
power will increase;
No change in pij, i.e., if the price of Brand i equals the market average, then
the status quo for that brand’s transition probabilities is maintained.
Discrete-Time Markov Chains 14
If price snobbery were reflected in the model, the reactions would be exactly
opposite from the above.
b. Construct the new transition matrix (the equivalent of Table 5) given that expected
market prices in week 28 are $1, $3 and $2 for Brands 1, 2 and 3, respectively.
Comment on the changes.
Market segmentation studies attempt to stratify consumers into groups such that
consumers within each group are similar with respect to demographic
characteristics such as age, sex, education, and ethnic background. If such
strata can be defined, then stratified sampling would be more effective, whereby
a transition matrix is constructed for each stratum.
Discrete-Time Markov Chains 16
11. Suppose that the state-transition matrix for the IRS example discussed in Section
12.1 was based on a sample of homogeneous taxpayers. Calculate the proportion
of taxpayers that will be (a) audited next year, (b) two years from now, and (c)
four years from now, given that 10% were audited in the current year. Also, what
are the expected recurrence times for all states?
Given that 10% of the taxpayers were audited in the current year, the
unconditional probability state vector, q(0) = (0.9, 0.1). For the state-transition
Ê 0.6 0.4 ˆ
matrix P = Á ˜ , the calculations are as follows.
Ë 0.5 0.5 ¯
b. q(2) = q(1)P = (0.559, 0.441) 44.1% audited two years from now.
c. q(4) = q(2)P2 = (0.5559, 0.44441) 44.4% audited four years from now.
12. Consider a process in which a single worker must perform five stages of a
manufacturing process, as indicated in the figure below. For purposes of analysis,
divide time into one-hour segments. When the worker is idle raw material enters the
system during the next hour with probability pA. At each stage i, the probability of
completing the stage and moving on to the next during the current hour is p C(i).
Write out the transition matrix for this situation. The goal is to find the efficiency of
the worker and the throughput of the system. Each part should be done
independently of the others.
a d1 d2 d3 d4
0 1 2 3 4 5
d5
The Throughput of the system is the probability that the system is stage 5
multiplied by the probability that the part will be completed, that is p5pc5.
The efficiency of the worker is the percentage time working. Using the steady-
state solution the efficiency is 1 – p0 – p1, where state 0 is the first idle state and
state 1 is the second. The throughput per hour is p6pc5 where p6 is the probability
of being in stage 5.
We must add a second state for each working state. We designated the states
with two state variables. The first is the stage at which the current job is located
and the second is the number waiting. The new matrix will have 11 states. A
portion is shown below.
Discrete-Time Markov Chains 19
13. Allen Konigsberg has four daughters who are of marriageable age. He estimates
that each daughter, operating independently, can find a spouse during a year with
probability p. Because of budget considerations Mr. Konigsberg will allow only
one daughter to be married in any given year. Unfortunately, if not allowed to
marry, the daughter will lose her beau and will be forced to look again the
following year. Find the probability distribution for the number of unmarried
daughters as a function of time. Let the time interval be one year. Use p = 0.6.
For each case below, define a Markov chain model and find the transient
probabilities for 10 years. If the system has a steady-state, find the corresponding
probabilities. Assume that the probabilities do not change over time.
a. Solve the situation as given.
b. How do the results change if Mr. Konigsberg drops the restriction of one
marriage per year.
c. How do the results change if we add the possibility of divorce? A married
daughter divorces during a year with probability pD. For computational
purposes assume that pD = 0.1.
d. Use the conditions in both parts b and c and assume that each marriage costs
$1000 (there is no cost for a divorce). How much should Mr. Konigsberg
budget per year for marriages? Also assume that a daughter can, at most,
either marry or divorce one time in any given year.
a. In this part, only one marriage per year is permitted. We define the states as
the number of unmarried daughters in a given year so S = {0, 1,…, 4}. The
objective is to find the transient probabilities for 10 years and the steady-state
probability if they exist.
0 1 2 3 4
0 1 0 0 0 0
1 1 – B(1, 0) B(1, 0) 0 0 0
2 0 1 – B(2, 0) B(2, 0) 0 0
3 0 0 1 – B(3, 0) B(3, 0) 0
4 0 0 0 1 – B(4, 0) B(4, 0)
Discrete-Time Markov Chains 21
0 1 2 3 4
0 1 0 0 0 0
1 0.6 0.4 0 0 0
2 0 0.84 0.16 0 0
3 0 0 0.936 0.064 0
4 0 0 0 0.9744 0.0256
b. How do the results change if the father drops the restriction of one marriage
per year? Once again, in the matrix below, the states represent the number
of unmarried daughters.
0 1 2 3 4
0 1 0 0 0 0
1 B(1, 1) B(0, 1) 0 0 0
2 B(2, 2) B(2, 1) B(2, 0) 0 0
3 B(3, 3) B(3, 2) B(3, 1) B(3, 0) 0
4 B(4, 4) B(4, 3) B(4, 2) B(4, 1) B(4, 0)
0 1 2 3 4
0 1 0 0 0 0
1 0.6 0.4 0 0 0
2 0.36 0.48 0.16 0 0
3 0.216 0.432 0.288 0.064 0
4 0.1296 0.3456 0.3456 0.1536 0.0256
Let D(n, x) be the probability that x out of n daughters divorce in a given year.
These probabilities are similarly governed by a binomial distribution.
0 1 2 3 4
0 D(4, 0) D(4, 1) D(4, 2) D(4, 3) D(4, 4)
1 D(3, 0) ¥ D(3,0) ¥ B(1,0) + D(3,1) ¥ B(1,0) + D(3, 2) ¥ B(1,0) + D(3,3) ¥
B(1, 1) D(3,1) ¥ B(1,1) D(3,2) ¥ B(1,1) D(3,3) ¥ B(1,1) B(1,0)
2 D(2,0) ¥ D(2,0) ¥ B(2,1) + D(2,0) ¥ B(2,0) + D(2,1) ¥ B(2,0) + D(2,2) ¥
B(2,2) D(2,1) ¥ B(2,2) D(2,1) ¥ B(2,1) + D(2,2) ¥ B(2,1) B(2,0)
D(2,2) ¥ B(2,2)
3 D(1,0) ¥ D(1,0) ¥ B(3,2) + D(1,0) ¥ B(3,1) + D(1,0) ¥ B(3,0) + D(1,1) ¥
B(3,3) D(1,1) ¥ B(3,3) D(1,1) ¥ B(3,2) D(1,1) ¥ B(3,1) B(3,0)
4 B(4, 4) B(4, 3) B(4, 2) B(4, 1) B(4, 0)
0 1 2 3 4
0 0.6561 0.2916 0.0486 0.0036 0.0001
1 0.4374 0.4374 0.1134 0.0114 0.0004
2 0.2916 0.4536 0.2196 0.0336 0.0016
3 0.1944 0.4104 0.3024 0.0864 0.0064
4 0.1296 0.3456 0.3456 0.1536 0.0256
d. Use the assumptions of parts (b) and (c) and assume that each marriage
costs Mr. Konigsberg $1000. How much should the he budget per year for
marriages?
For this scenario, there are no costs for being in a particular state so the
vector CS = 0; however, there are transition costs from each unmarried state
so we must find the CR matrix. To see how the individual components are
determined consider the transition from state 2 to state 2. There are three
different possibilities: 0 marriages and 0 divorces, 1 marriage and 1 divorce, 2
marriages and 2 divorces. The corresponding cost is c22 = 0 ¥ Pr{0
Discrete-Time Markov Chains 23
j= 0
The steady-state probabilities and the total expected cost are given below. As
can be seen, the expected cost that Mr. Konigsberg faces is $335.08 per year.
Average
0 1 2 3 4 Cost
State 0 State 1 State 2 State 3 State 4 per period
Steady State Dist. 0.53978 0.35985 0.08996 0.01 0.00042 335.084378
Discrete-Time Markov Chains 24
14. The figure below shows a two-stage production flow line. At each stage an
operation is performed on the part being processed. Parts are introduced into the
system at stage 1. Processing is serial and each stage can hold only one part at a
time.
Parts Parts
enter leave
Stage 1 Stage 2
Develop a Markov chain model that describes this situation. Draw the
corresponding network and find the steady-state probabilities for the system.
Estimate the idle time for each stage and the throughput in parts per minute.
We now fill in the state-transition matrix that represents the one minute interval.
Discrete-Time Markov Chains 25
E, E E, W W, E W, W B, W
E, E 0.1 0 0.9 0 0
E, W 0.8¥0.1 = 0.08 0.2¥0.1 = 0.02 0.9¥0.8 = 0.72 0.9^0.2 = 0.18 0
W, E 0 0.6 0.4 0 0
W, W 0 0.8¥0.6 = 0.48 0.8¥0.4 = 0.32 0.2¥0.4 = 0.08 0.2¥0.6 = 0.12
B, W 0 0.8 0 0 0.2
We see that stage 1 is idle or blocked in states EE,EW, and BW. Accumulating
the probabilities in these states we find that the probability of 0.4064 for stage 1.
Stage 2 is idle in states EE and WE. Adding these state probabilities we find the
probability that stage 2 is idle is 0.5548.
Discrete-Time Markov Chains 26
15. In a simplified Monopoly game there are four places on the board numbered 0
through 3. The matrix below shows the transition probabilities between each of
them on any one play of the game. Let the places be states.
0 1 2 3
0 0 1 0 0
P= 1 0 0 1 0
2 1/3 1/3 0 1/3
3 1 0 0 0
16. The word processing center at Papers-R-Us.Com has three printers. The probability
that a printer will fail during a given week is 0.1. Assume that failures are
independent events. When one or more printers are in the shop at the beginning of
the week, exactly one is repaired during the week. In each case, construct the
transition matrix for this situation when the time interval is one week and the states
describe the number of printers in the repair shop at the beginning of the week. The
parts are not cumulative.
b. Change the situation so that each printer in the shop at the beginning of the
week will be repaired during the week with a probability of 0.5. Assume that
the repair operation for each printer is independent.
c. Now assume that only one printer can be repaired at a time and it takes
exactly two weeks for the repair. Also, a failed printer must be in the shop at
the beginning of the week in order for the repair work to begin. Printers still
fail according the distribution given.
Part b.
The state probabilities are combinations of repair and failure events. The
number of failures has a binomial distribution with n =3 – s and p = 0.1. The
number of repairs has a binomial distribution with n = s and p = 0.5.
c. This model requires that the state definition be expanded to indicate whether
a repair in progress has just started (indicated by -s) or is about to finish (-f). The
resultant matrix is below.
Discrete-Time Markov Chains 28
Fail 0 Fail 1-s Fail 2-s Fail 3-s Fail 1-f Fail 2-f Fail 3-f
Fail 0 0.729 0.243 0.027 0.001 0 0 0
Fail 1-s 0 0 0 0 0.81 0.18 0.01
Fail 2-s 0 0 0 0 0 0.9 0.1
Fail 3-s 0 0 0 0 0 0 1
Fail 1-f 0.81 0.18 0.01 0 0 0 0
Fail 2-f 0 0.9 0.1 0 0 0 0
Fail 3-f 0 0 1 0 0 0 0
Discrete-Time Markov Chains 29
17. Set up and solve the following variations on Omar’s Barber Shop problem given
in Section 4. Each part should be done independently of the others.
a. You note that sometimes Omar’s haircutting time is not really deterministic as
originally assumed. Actually, there is a probability of d that he completes no
haircuts in a 15-minute period, a probability d that he completes two haircuts,
and a probability 1 – 2d that he completes one. Although the mean value of
this distribution is 1, there is noticeable variability. How much does
variability affect Omar’s steady-state income? Plot a curve of d versus
expected daily revenue.
b. Omar is thinking about removing one of the waiting chairs and putting in
another barber chair. His plan is to hire a retired barber who he will pay $5
per cut, which he believes will also take 15 minutes. As storeowner, Omar
will receive the remaining $5. Whenever there is a single customer in the
shop, Omar will get the business. For this scenario, customers enter whenever
a barber chair is empty but the arrival rate will be reduced by 1/3 for every
waiting chair that is full. How will this affect Omar’s net revenue? How
much will the retired barber earn per day on average? What proportion of the
time will Omar be idle? What proportion of the time will the retired barber
idle? What proportion of the potential arriving customers will be served?
a. When 0 people are in the shop at the beginning of the 15 minute period, no
completions are possible. The probabilities in the first row of the transition matrix
remain the same as in Section 12.4.
p0 = (0.368, 0.368, 0.184, 0.061, 0.015, 0.004)
When the system is in state i up to 5 – i arrivals may occur. We let the probability
of k arrivals be P(k). We let the probability of k service completions be Q(k). The
general transition probability when there is either 0, 1 or 2 service completions is
We have used this expression in Excel to build the transition matrix. The matrix
shown below is for d = 0.1
Discrete-Time Markov Chains 30
The expected return per quarter hour is 0 in state 0, 10*(1- d) in state 1, and
10 in the other states. We plot the expected total revenue for an eight hour day
below as a function of d. The variability in cutting time reduces his expected daily
return. It is interesting to note that although the transition matrix is changed by
this situation, the steady state probabilities are independent of d. The decrease in
expected revenue is entirely due to the decrease in expected revenue while in
state 1. This accounts for the linear reduction noted in the graph below.
Exp. Rev.
290
285
280
275
270
265
260
255
250
245
240
235
0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5
b. The transition matrix has changed as follows. In any quarter hour period up to
two completions will occur.
Discrete-Time Markov Chains 31
State 6 0 1 2 3 4 5
Names idle Omar busy Both Busy 1 waits 2 wait 3 wait
idle idle 0.367879 0.367879 0.18394 0.061313 0.015328 0.00366
Omar busy Omar busy 0.367879 0.367879 0.18394 0.061313 0.018988 0
Both Busy Both Busy 0.367879 0.367879 0.18394 0.080301 0 0
1 waits 1 waits 0 0.513417 0.342278 0.144305 0 0
2 wait 2 wait 0 0 0.716531 0.283469 0 0
3 wait 3 wait 0 0 0 1 0 0
Sum 1.103638 1.617055 1.610628 1.630701 0.034316 0.00366
The revenue depends on the state. With none in the shop the return is 0. With 1
in the shop Omar earns the $10. With 2 or more in the shop Omar earns $15
each quarter hour.
The steady state result for Omar is:
0 1 2 3 4 5 Revenue Revenue
idle Omar busy Both Busy 1 waits 2 wait 3 wait per period per day
Steady State Dist. 0.335236 0.37388 0.20215 0.075269 0.012238 0.001227 8.10205486 259.2658
This is less than the $274.61 Omar expected to earn without the extra barber.
The extra barber earnes $46.54 per day,
Discrete-Time Markov Chains 32
18. Enrollment at Big State’s College of Engineering historically has ranged from
4500 to 6000 students. The lower bound represents a reliable pool of students
within the community who have a hardcore interest in engineering. The upper
bound represents a limit on capacity which is enforced through admission
controls.
The Bureau of Business Research has determined that if the climate is good at the
beginning of one year, there is a 0.7 chance that it will be good at the beginning of
the next year. If the climate is bad at the beginning of one year, there is a 0.6
chance that it will be bad again at the beginning of the next.
Begin by defining the states. Then draw the network diagram and construct the
state-transition matrix for this problem. Find the steady-state probability
distribution for the number of students in the College of Engineering.
The state will indicate the current economic climate and enrollment. We preface
the enrollment number with B- or G- to show the economic climate. The transition
matrix is shown below. The entries compute the joint probability of a change in
enrollment and a change in economic climate. For example
p(B_5500, B_6000) = p(B, B)*P(up|B) = 0.6*0.2 = 0.12.
Discrete-Time Markov Chains 33
19. Archy Leach, a recent graduate of Madame Bouffant’s Beauty College, has
opened his first hair salon. The facility has one stylist’s chair and a waiting sofa
that seats two. In any given minute of the day only one of three things may
happen.
• a customer may arrive at the salon
• a customer may leave the salon
• there are no arrivals or departures
The probability that a customer arrives in a particular minute is 0.01. If she
arrives and finds the sofa full she will not stay. Clearly, a customer may depart
from the salon only if there is a customer in it. In this case, the probability that a
customer departs in a particular minute is 0.02. Assume that during a 1-minute
interval, it is impossible for two or more events to occur.
b. C o m p u t e steady-state S0 S1 S2 S3
probabilities and use them to p = 0.5333 0.2667 0.1333 0.0667
answer the following questions.
c. If Archy earns $5 each time a Average Average
served customer leaves the Revenue Minutes Revenue
salon, what is his expected daily per minute per day per day
earnings? Assume an 8-hour 0.04666667 480 $ 22.40
day.
d. What percent of the time would This is the probability of state 3.
you expect the salon to be full? p3 = 0.0667.
e. What percent of the time would This is the probability of state 0.
you expect to salon to have no p0 = 0.5333.
customers?
Discrete-Time Markov Chains 35
20. A diamond merchant has determined that the following probability distribution
describes the number of a particular type customer who visits his store each day.
Number of customers 0 1 2
Probability 0.6 0.3 0.1
Assume that each of these customers will buy a Peruvian diamond if one is
available. Otherwise the sale is lost. Each morning the merchant looks at his
inventory. If there are 2 or fewer Peruvian diamonds (and none on order), he
orders 3 more from his supplier. They arrive 2 days later (on the second morning
after the order).
a. Model the inventory level as a Markov chain. Define the states for the system
and write out the corresponding transition matrix.
b. If the store has 3 Peruvian diamonds on Monday morning, what is the
probability distribution for the number on hand 5 days later? What is the
probability that some Peruvian diamonds are on order?
c. What is the steady-state probability that the store will have no Peruvian
diamonds in the morning?
d. If the inventory holding cost is $10 per day per diamond, what is the expected
annual inventory cost? Assume 260 workdays per year.
e. What is the expected number of orders that must be placed each year? If the
cost of placing an order is $50, what is the expected annual ordering cost?
f. What is the expected annual cost of lost sales if the per unit cost is $200?
g. Based on the results of parts (d), (e) and (f), experiment with different
ordering policies with the aim of finding some policy that minimizes the sum
of the inventory holding cost plus the ordering cost plus the lost sales cost.
Eight states are required. The states indicate the number in inventory at the
beginning of the day and whether (Y) or not (N) an order is outstanding.
Discrete-Time Markov Chains 36
b. The following shows the transient probabilities for the first five days. Day 5 is
Saturday morning.
0 0_N 1_N 2_N 3 4 5 0_Y 1_Y 2_Y
Initial 0 0 0 1 0 0 0 0 0
1 0 0.1 0.3 0.6 0 0 0 0 0
2 0 0.06 0.18 0.36 0 0 0.07 0.15 0.18
3 0 0.036 0.108 0.364 0.144 0.108 0.042 0.09 0.108
4 0 0.036 0.124 0.361 0.205 0.13 0.025 0.054 0.065
5 0 0.036 0.129 0.345 0.214 0.117 0.027 0.059 0.074
The probability that some diamonds are on order is the sum of the last three
probabilities in the fifth row or 0.16.
c.
Steady State Expected
Analysis 0 1 2 3 4 5 6 7 8 Value
0_N 1_N 2_N 3 4 5 0_Y 1_Y 2_Y per period
Steady State 0 0.034 0.125 0.341 0.228 0.113 0.026 0.058 0.075 29.901
The probability of having no diamonds is the sum of P(0_N) and P(0_Y) or 0.026.
d. If the inventory holding cost is $10 per day per diamond, what is the expected
annual inventory cost? Assume 260 workdays per year.
Specify the economics matrix as shown.
Rate State
0.1 Value
0_N 0
1_N 10
2_N 20
3 30
4 40
5 50
0_Y 0
1_Y 10
2_Y 20
e. What is the expected number of orders that must be placed each year? If the
cost of placing an order is $50, what is the expected annual ordering cost?
Whenever the system is in one of 0-N, 1_N, 2_N, an order is placed. The sum of
the probabilities for the three states is: 0.059. The expected number of orders per
year is 260*0.059 = 41.4 for a cost of $2070 per year.
f. What is the expected annual cost of lost sales if the per unit cost is $200?
There is a lost sale when the store does not have enough inventory to satisfy the
current demand.
For states which experience lost sales we add a state cost of 200*P(1 lost sale) +
400*P(2 lost sales).
For (0_N) and (0_Y) this is 200*.3 + 400*.1 = 100. For (1_N) and (1_Y) this is
200*.1 = 20.
With these state costs assigned, the cost per day is: $4.46 and the cost per year
is $1159.
g. Based on the results of parts (d), (e) and (f), experiment with different
ordering policies with the aim of finding some policy that minimizes the sum of
the inventory holding cost plus the ordering cost plus the lost sales cost.
The total cost for $7774 + $2070 + $1159 = $11003.
Since the holding cost is a majof component of this we might try to wait to order
until the inventory level reaches 1.
Discrete-Time Markov Chains 38
An increase in cost.
Another possibility is leave the reorder point at 2 or less, but only order 2 rather
than 3.
Steady State Expected
Analysis 0 1 2 3 4 5 6 7 8 Value
0_N 1_N 2_N 3 4 5 0_Y 1_Y 2_Y per period
Steady State 0 0.035 0.201 0.348 0.181 0 0.034 0.081 0.121 42.75889
150 80 70 30 40 50 100 30 20 11117.31
21. The office manager in the computer repair example in Section 12.1 has the option
of buying an additional machine to be kept as a spare. It will not be used in
normal operations but will be placed into service when one of the originals fails.
The effect will be to reduce the cost of sending out work to the typing service.
Costs are: computer repair, $80; typing service with one failed computer,
$75/day; typing service with two failed computers, $125/day.
The spare computer is placed in service if one or two computers are in the repair
shop. The state definitions remain the same as in Section 12.1, but the
transitions have changed as in the table below.
We compare the
Transition Matrix Economic Matrices Steady-state probabilities
and cost
Original computer Transition Cost
problem State 0 1 2
Cost S0 S1 S2
S0 S1 S2 0 1 2 Cost
S0 0 0 0 0
S0 0.6 0.3 0.1 S0 S1 S2 per da
S1 75 80 80 0
S1 0.8 0.2 0
S2 125 160 0 0 0.678 0.254 0.068 58.73
S2 1 0 0
Discrete-Time Markov Chains 40
The effect of the added computer is to reduce maintenance costs by about $14
per day. If the cost of ownership is less than this, it is a good investment.
Discrete-Time Markov Chains 41
22. Find the expected lifetime income of the stock broker discussed in Section 12.2 as
a function of the list he starts with. Assume a discount rate of 15% per year.
What observations can you make about the results?
Let the revenue rate vector be CS = (1700, 1450, 1600)T. Putting the discount
rate on a weekly basis gives r = 0.15/52 = 0.0029. The present value of all future
revenue is
È17, 569 ˘
–1 S
[I – aP] C = Í17, 494 ˙ .
Í ˙
ÎÍ17, 617 ˚˙
Because the total discounted returns depend on the initial state we must identify
the appropriate component of the final vector. If the broker starts with list b at
time 0, then the present value of his expected returns would be $17,494, and so
on. Note that the final values differ by only a small percentage suggesting that
the initial state is not particularly important here.
Discrete-Time Markov Chains 42
23. A manufacturing facility uses two identical machines that are attended to by a
single operator. Each machine requires the operator's attention at random points
in time. The probability that the machine requires service in a period of 5 minutes
is p = 0.4. The operator is able to service a machine in 5 minutes. Let us
approximate this situation by assuming that when service is required, it is always
initiated at the beginning of a 5-minute period. Construct a state-transition
network for this problem and find the transition matrix associated with it. Define
all terms. Answer the following numerical questions.
a. If both machines are operating properly at 8 a.m., find the state probabilities
after 5 minutes, 10 minutes, and 40 minutes.
b. Find the steady-state probabilities for this process. What is the long-run
probability that the operator is idle for a 5-minute period? For what fraction
of 5-minute periods is the operator busy? What is the long-run average
number of machines that require service within a 5-minute period?
c. Assume that the opportunity cost in terms of lost production, if a machine is
down or being serviced for a 5-minute period, is $5. What is the long-run
average opportunity cost for an 8-hour shift (ninety-six 5-minute periods)?
From E.11 in chapter 11 we have the transition matrix for this situation.
c. We associate a cost of $5 for state 1 and a cost of $10 for state 2. The steady
state expected cost of a five-minute period is: $3.11. For an 8-hour day the
expected cost is: $298.92.
Discrete-Time Markov Chains 44
24. Discrete-time Markov chains are frequently used as models for infection. A
nonfatal but tropical disease takes three weeks to run its course. The chance of a
healthy person contracting the disease in any week in 0.1. Two drugs are
available to shorten the length of the disease. The first drug can be used only
during week 1, and it cures 50 percent of the patients immediately. The second
drug must be used in week 2 where the cure rate is also 50 percent.
a. Define the states of the system and write out the transition matrix when no
drugs are taken.
b. Write out the transition matrix when the drugs options are included. If both
drugs are used when appropriate, what fraction of the infected population will
experience a reduction in the length of the disease?
Define states for healthy (H), sick for one week (D1), sick for two weeks (D1) and
sick for three weeks (S3).
a. The transition matrix is below.
È0.9 0.1 0 0˘ H
Í0 0 1 0 ˙ D1
P=Í ˙
Í0 0 0 1 ˙ D2
Í1 0 0 0 ˙˚ D3
Î
b. The transition matrix is below.
d. For the two models we assign the cost of $50 for each state involving
sickness, that is D1, D2, D3. Computing the steady state weekly costs of lost
work we find:
For system A with no drugs: $11.54 per person per day.
For system B with drugs: $7.45 per day.
Since the difference of the cost without drugs over the cost with drugs is $4.09,
the cost of the drugs is not justified on this basis alone.
Discrete-Time Markov Chains 46
25. A clothing wholesaler has 700 accounts that are past due. These accounts are
classified 0-30 days, 30-60 days, and 60-90 days overdue. Currently, there are
400 accounts in the 0-30-day category, 200 accounts in the 30-60-day category,
and 100 accounts in the 60-90-day category. After 90 days accounts are written
off as being uncollectable. From past experience, the accounts receivable
manager knows that the payment process behaves like a Markov chain. His
estimate of the 1-month transition matrix is given below. Find the (approximate)
number of accounts that will have to be written off as bad debts.
The Paid state and the Uncollectable state are trapping states and the others are
transient. An absorbing state analysis yields
Paid Uncoll.
Transient D 0-30 0.72 0.28
Transient D 30-60 0.6 0.4
Transient D 60-90 0.5 0.5
Thus of all bills starting in the 0-30 state, 72% will ultimately be paid, while 28%
will be bad depts.
With the given proportions in each category we compute the probabilities for the
portfolio.
P(paid) = (4/7)(0.72) + (2/7)(0.6) + (1/7)(0.5) = 65.4%
P(uncollectable) = 1 – 0.654 = 34.6%.
Discrete-Time Markov Chains 47
26. Heart patients at a local hospital can be found in one of two places: the coronary
care unit or in a regular room. Historical data indicates that of all heart patients,
83 percent leave the hospital alive while the other 17 percent die at some point
during their treatment.
a. If we assume that the number of heart patients remains constant and that the 1-
day transition probabilities are as shown, what are the steady-state
probabilities for an individual patient?
b. If all the new heart patients went to a competing hospital and there was a 25
percent chance for a patient to leave the competing hospital each day, how
would you change the 1-day transition matrix?
c. Referring to part (b), what would the steady-state probabilities be?
It is not clear what these results mean for the individual patient because the true
trapping state is the deceased state. In the long run, the patient must be in the
Gone state.
27. (Photocopier maintenance) Every office worker knows that photocopiers continue
to suffer from a certain amount of downtime despite the great strides that have
been made in technology. Assume that downtime can be modeled as a Markov
chain with a transition period of 1 hour. For a particular office, the 1-step
transition matrix is as shown.
up down
up 0.9 0.1
P=
down 0.60 0.40
up down
up 0.95 0.05
P=
down 0.60 0.40
If the cost of system downtime is estimated at $600 per hour, what is the
monthly break-even cost for the new machine? Assume it is in use 720 hours
per month.
b. The steady state probabilities together with the average cost of operation (per
hour) is shown below. The downtime cost is from part c.
Average
0 1 Cost
up down per hour
Steady State Dist. 0.857 0.143 85.7142857
Discrete-Time Markov Chains 49
c. With the different transition matrix the steady state results are:
Average
0 1 Cost
up down per hour
Steady State Dist. 0.944 0.056 33.3333333
The savings in the hourly and monthly cost due to the improved machine are:
Savings per hour $52
Savings per month $37,714
The breakeven cost is $37,714 per month. This looks like a good deal.
Discrete-Time Markov Chains 50
28. A delicate precision instrument has a component that is subject to random failure.
In fact, if the instrument is operating properly at a given moment in time, then
with probability 0.1 it will fail within the next 10-minute period. If the
component fails, it can be replaced by a new one - an operation that also takes
10-minutes. The present supplier of replacement components does not guarantee
that all replacement components are in proper working condition. The present
quality standards are such that about 1% of the components supplied are
defective. However, this can be discovered only after the defective component
has been installed. If the component is defective, the instrument has to go through
a new replacement operation. Assume that when a failure occurs, it always
occurs at the end of a 10-minute period.
a. Find the transition matrix associated with this process.
b. Given that it was working properly initially, what is the probability that the
instrument in not in proper working condition after 30 minutes? after 60
minutes?
c. Find the steady-state probabilities. For what fraction of time is the instrument
being repaired?
d. Assume that each replacement component has a cost of $0.30, and that the
opportunity cost in terms of losing profit during the time the instrument is not
working is $10.80 per hour. What is the average cost per 10-minute period?
È 0.90 0.10 ˘
P= Í ˙
Î 0.99 0.01 ˚
29. Past records indicate that the survival function for light bulbs in traffic signal has
the following pattern:
a. If each light bulb is replaced after failure, find the transition matrix associated
with this process. Assume that a replacement during the month is equivalent
to a replacement at the end of the month.
b. Determine the steady-state probabilities. What is the long-run average length
of time that a bulb is used prior to being replaced? If an intersection has 40
bulbs, how many bulbs fail on the average per month? If an individual
replacement has a cost of $2, what is the long-run average cost per month?
a. The state is the age of the bulb so S = {0, 1, 2, 3, 4}. The state-transition
matrix is
0 1 2 3 4
0 0.05 0.95 0 0 0
1 0.08 0 0.92 0 0
P= 2 0.12 0 0 0.88 0
3 0.20 0 0 0 0.80
4 1 0 0 0 0
To determine the entries, we made use of the fact that 950 out of 1000 (95%) of
the bulbs survive at least 1 month. Of those that survived 1 month, 874 (92%)
survived 2 months, and so on.
From this data we compute the mean time to failure as: 4.208 months.
Discrete-Time Markov Chains 52
For modeling purposes we assume that failures occur at the end of the month.
Thus p0 is equivalent to the fraction of bulbs that failed in the preceding month.
The expected number of units failing/month = 40 ¥ p0 = 9.504
30. (Group Replacement) Consider the survival function in the preceding exercise.
a. Assume now that all bulbs - regardless of age - are replaced every 3 months
and that individual bulbs are replaced at failure, including those that fail
during the month prior to a scheduled group replacement. On the basis of the
transition matrix for the failure pattern of an individual bulb, determine the
number of bulbs that are replaced at failure between group replacements.
Note that failures in the month just prior to a group replacement are replaced
also at failure. If group replacements cost $0.20 per bulb plus a $5.00 fixed
cost per intersection, find the average cost per month for this policy.
b. Find the least-cost group replacement policy. Is its average monthly cost
lower than that of a policy of individual replacements at failure only?
t q 0 ( t) q 1 ( t) q 2 ( t) q 3 ( t) q 4 ( t) Â q (k )
k =1
0
t 1 2 3 4 Individual replacement
cost $ 17 11.64 10.76 11.49 19.01
1 For each transition matrix below, identify and classify the states of the
corresponding stochastic process. Also, indicate whether or not the process is
irreducible.
a. b.
0 1 2 3 4 0 1 2 3
0 0 0 ¥ ¥ 0 ¥ 0 0 0 0
0 ¥ ¥ 0 0 1 0 ¥ ¥ 0 1
0 ¥ ¥ 0 0 2 0 ¥ ¥ 0 2
¥ 0 0 0 0 3 ¥ 0 0 ¥ 3
¥ 0 0 0 0 4
c. d.
0 1 2 3 0 1 2 3
¥ ¥ ¥ 0 0 0 0 ¥ ¥ 0
0 ¥ 0 ¥ 1 0 0 ¥ 0 1
0 0 ¥ 0 2 0 ¥ 0 0 2
0 ¥ 0 0 3 ¥ ¥ 0 0 3
e. f.
0 1 2 3 0 1 2 3
0 0 ¥ ¥ 0 0 ¥ 0 0 0
0 ¥ ¥ 0 1 0 0 ¥ 0 1
¥ ¥ 0 0 2 0 0 0 ¥ 2
¥ 0 0 0 3 ¥ 0 0 0 3
b S1 S2 S3 S4 Status
S1 1 0 0 0 Class-1 absorbing
S2 0 0.5 0.5 0 Class-2 acyclic
S3 0 0.5 0.5 0 Class-2 acyclic
S4 0.5 0 0 0.5 Transient
c S1 S2 S3 S4 Status
S1 0.3 0.3 0.4 0 Transient
S2 0 0.5 0 0.5 Class-1 acyclic
S3 0 0 0.5 0.5 Transient
S4 0 1 0 0 Class-1 acyclic
d S1 S2 S3 S4 Status
S1 0 0 0.5 0.5 Transient
S2 0 0 1 0 Class-1 cyclic
S3 0 1 0 0 Class-1 cyclic
S4 0.5 0.5 0 0 Transient
e S1 S2 S3 S4 Status
S1 0 0 0.5 0.5 Class-1 acyclic
S2 0 0.5 0.5 0 Class-1 acyclic
S3 0.5 0.5 0 0 Class-1 acyclic
S4 1 0 0 0 Class-1 acyclic
f S1 S2 S3 S4 Status
S1 0 1 0 0 Class-1 cyclic
S2 0 0 1 0 Class-1 cyclic
S3 0 0 0 1 Class-1 cyclic
S4 1 0 0 0 Class-1 cyclic
Mathematics of Discrete-Time Markov Chains 3
2. The following matrices give the state-transition probabilities for a Markov chain.
Classify the states for each matrix. Also, indicate whether the Markov chain is
irreducible.
a. b.
È 00 0 0 0.5 0.5 0
˘ È 00 0 0 0.5 0.5 0
˘
Í0 0
0
0 0 0 1
0 0.1 0.9 0
˙ Í0 0
0
0 0 0 1
0 0.1 0.9 0
˙
Í 0.1 0.01 0.89 0 0 0 ˙ Í 0.1 0.01 0.89 0 0 0 ˙
Í 0.8 0 0.2 0 0 0 ˙ Í 0.8 0 0.2 0 0 0 ˙
Î0 1 0 0 0 0 ˚ Î 0.1 0.9 0 0 0 0 ˚
c. d.
È 00 1
0
0 0
1 0
˘ È 0.2 0.8 0 0 ˘
Í 0.3 0 0 0.7 ˙ Í 00 0.9 0.1 0
0 1 0 ˙
Î0 1 0 0 ˚ Î 0 0 0.1 0.9 ˚
e. f.
È 0.20 0.8 0 0
0.9 0.1 0
˘ È 0.20 0
0.9
0.8 0
0.1 0
˘
Í 0.3 0 0.2 0.5 ˙ Í 0.3 0 0.7 0 ˙
Î0 0 0.1 0.9 ˚ Î0 0 0.1 0.9 ˚
a. Number the states 0 through 5. States 1 and 5 are recurrent. The others are
transient. States 1 and 5 are cyclical.
b. All the states are in a single recurrent class.
c. The states are in a single recurrent class. The states have a cycle of 3.
d. State 2 is an absorbing state. All the others are transient.
e. All the states are in a single recurrent class.
f. States 0 and 2 are recurrent class. States 1 and 3 are transient.
Mathematics of Discrete-Time Markov Chains 4
3. The following problems are based on a single worker performing a series of tasks
on a job. At any time she may either be idle or working. If idle at the beginning
of an hour, he receives a job with probability pA during the hour. If working at
the beginning of the hour, she completes the job with probability pC. Jobs do not
arrive while she is working.
Using a DTMC model, we would like to estimate the efficiency of the
employee measured by the proportion of time she is busy and the throughput rate
of the system in terms of jobs completed per hour. For each case below, define
the states, construct the transition matrix, and identify the states as recurrent,
transient or absorbing. Time is divided into 1-hour segments. Solve each
problem independently of the others.
a. Model the situation as given. Use two states that describe the condition of the
employee: idle and working.
b. Change the conditions so that the probability of completing a job depends on
how many hours the job has been in progress. After the employee has worked
on the problem for 1 hour, the probability that it will be completed is pC1 and
the probability that another hour will be required is (1 – pC1). In the second
and subsequent hours, the probability that it will be completed is pC2, and the
probability that it will take another hour is (1 – pC2). Define three states: idle,
working during the first hour, working during the second (and subsequent)
hour(s). Note that only three states are need if the probability of working the
second and subsequent hours remains the same.
c. Change the situation so that the time between arrivals is exactly 2 hours.
Counting the time begins when the employee becomes idle. Completion
probabilities are still based on a 1-hour period. Use three states: idle/just
started waiting for an arrival, idle/waiting for one hour for arrival, working.
d. Now assume that there is space for one waiting job and define pA1 as the
probability that an arrival occurs while the employee is busy. An arriving job
will wait if the space is empty, otherwise it will balk. Use three states: idle,
working with no jobs waiting, working with one job waiting.
a.
Idle Working
Idle 1 – pA pA
Working pD 1 – pD
b.
Idle 1 – pA pA 0
Working 1 pD1 0 1 – pD1
Working 2 pD2 0 1 – pD2
c.
Idle 1 Idle 2 Working
Idle 1 0 1 0
Idle 2 0 0 1
Working pD 0 1 – pD
d.
Idle 1 – pA pA 0
Working, 0 waiting pD(1 – pA1) (1 – pD)(1 – pA1) (1 – pD)pA1
Working, 1 waiting pD 1 – pD
4. Consider the DTMC with the states numbered 0, 1 and 2. The state-transition
matrix is below.
È0 0.3 0.7
˘
P=Í 1 0 0 ˙
Î1 0 0 ˚
a. Given that the system begins in state 0, compute the state probabilities for four
periods.
b. Compute the n-step transition matrix for n = 2 through 4.
c. Find the steady-state probabilities.
d. Comment on the meaning of the steady-state probabilities in this case.
a. Computing the state probability vector for several time periods we observe
with
Q0 = (1, 0, 0)
the following state probabilities as a function of time.
b.
2 step Transition Matrix
1 0 1 2
State 0 State 1 State 2
State 0 1 0 0
State 1 0 0.3 0.7
State 2 0 0.3 0.7
3 step Transition Matrix
1 0 1 2
State 0 State 1 State 2
State 0 0 0.3 0.7
State 1 1 0 0
State 2 1 0 0
Mathematics of Discrete-Time Markov Chains 7
d. Clearly, the state probability vector is not converging to any steady state.
This example has periodic states. In general if the Markov chain is irreducible
(all states are recurrent and communicate) but not ergodic (the states are
periodic), the equations defining the steady state can be solved, but the
results are not the long-run state probabilities. These do not converge. The
vector p is not without meaning in this case, however. The value of pj is the
probability that the system will be found in state j if the system is observed at
a random point in time (for n some large value). It is also the long-run
proportion of the time the system will be in state j. These alternative
interpretations of pj are also appropriate for the ergodic case. For a periodic
Markov chain, the n -step transition matrix also fails to approach a limit as n
increases indefinitely.
Mathematics of Discrete-Time Markov Chains 8
5. Find the steady-state probabilities for the Markov chain associated with the
following state-transition matrix. Do the calculations by hand.
È 1 0 0
˘
P = Í 0.1 0.7 0.2 ˙
Î 0 0 1 ˚
Since this example contains absorbing states comment on the meaning of the
steady-state probabilities. Compute the probabilities of the absorbing states given
the system starts in state 1 (number the states 0, 1 and 2.)
6. On a trip to Las Vegas, big time gambler Barbara Kitchell is down to her last $20.
Determined to continuing gambling, she finds a game that allows a bet of $10 on
each play where the probability of winning is pW. If she wins she adds $10 to her
cash supply; if she loses her supply drops by $10. Because she only has a short
time left, she adopts a strategy where she will quit when her cash supply reaches
$40 or when all her money is gone.
Develop a Markov chain model for each of the following situations. Assume that
the process is observed after each play and that pW = 0.4. Find the transient
probabilities for 10 plays as well as the steady-state and absorbing state
probabilities when appropriate.
a. For the given situation, let the states be the cash supply: $0, 10, 20, 30 and 40.
In addition to the above, find the first passage probabilities from the initial
state to the state $0, and also to the state $40.
b. Change the model so that whenever Ms. Kitchell reaches $0, she borrows
another $20 from her distraught daughter.
c. Change the model as in part (b) but with the provision that the most Ms.
Kitchell can borrow is $40.
a. The state-transition diagram is below. State 0 is for $0, state 1 for $10, etc.
1 1
0.4 0.4
0.6 0.4
0 1 2 3 4
0.6 0.6
There is no steady state for this case. The absorbing probabilities depend on the
initial state and are shown below.
Class-1 Class-2
S_$0 S_$40
S_$10 0.876923 0.123077
S_$20 0.692308 0.307692
S_$30 0.415385 0.584615
Mathematics of Discrete-Time Markov Chains 11
1
0 1 2 3 4
0 0 0 1 0 0
1 1- pW 0 pW 0 0
2 0 1- pW 0 pW 0
3 0 0 1- pW 0 pW
4 0 0 0 0 1
c. In this case we must have two state variables, one representing the current
cash position and one the amount borrowed.
0.4 0.4
Borrow $0 1 2 3
0.6 0.6
0.6
0.4 0.4 0.4
Borrow $2 1 2 3
0.6 0.6
0.6 0.4 1
Borrow $4
0.4 0.4
0.6 0.4
0 1 2 3 4
0.6 0.6
7. For the computer repair example in Section 12.1 compute f00( 5) and f00( 6 ) .
n PF(i,j,n)
1 0.6
2 0.34
3 0.048
4 0.0096
5 0.00192
6 0.000384
Mathematics of Discrete-Time Markov Chains 13
8. For the computer repair example of Section 12.1, find the first four values of the
first passage probabilities as well as the expected first passage times for the
following.
a. Transition from state 0 to state 1
b. Transition from state 1 to state 0
c. Transition from state 1 to state 1
a.
Probabiliti es from state 0 to state 1
n PF(0,1,n)
1 0.3
2 0.18
3 0.138
4 0.1008
b.
Probabiliti es from state 1 to state 0
n PF(1,0,n)
1 0.8
2 0.16
3 0.032
4 0.0064
c.
Probabiliti es from state 1 to state 1
n PF(1,1,n)
1 0.2
2 0.24
3 0.144
4 0.1104
Mathematics of Discrete-Time Markov Chains 14
9. For a Markov chain with states numbered 0, 1 and 2, use the following transition
matrix to answer the questions below. In each case, write out all equations.
È 0 0.3 0.7
˘
P = Í 0.9 0.1 0 ˙
Î 0.2 0 0.8 ˚
a. Find the transient state probability vector for the first five steps, assuming that
the system starts in state 2.
b. Given that the system is in state 2, find the probability that the first passage to
state 0 will require one step, two steps, three steps.
c. Find the expected first passage time from state 2 to state 0.
d. Find the steady-state probability vector.
e. Let the expected state cost vector C = (121, 47, 98)T and the discount rate r = 5%
per period. Find the total expected discounted cost when the process starts in
each of the three states. What is the long-run average discounted cost when the
initial probability distribution over the three states is q(0) = (0.2, 0.5, 0.3)?
a. q(0) = (0, 0, 1), q(1) = q(0)P, q(2) = q(1)P, q(3) = q(2)P, q(4) = q(3)P
S1 S2 S3
Initial 0 0 1
1 0.2 0 0.8
2 0.16 0.06 0.78
3 0.21 0.054 0.736
4 0.1958 0.0684 0.7358
5 0.20872 0.06558 0.7257
b.
fij(1) = p2j, fij( 2 ) = pij( 2 ) – fij(1) pjj, fij( 3) = pij( 3) – fij(1) p(jj2 ) – fij( 2 ) pjj,
fij( 4 ) = pij( 4 ) – fij(1) p(jj3) – fij( 2 ) p(jj2 ) – fij( 3) pjj for i = 2 and j = 0.
Probabiliti es from state 2 to state 0
n PF(i,j,n)
1 0.2
2 0.16
3 0.128
4 0.1024
Mathematics of Discrete-Time Markov Chains 15
c.
m00 = 1 + 0.3m10 + 0.7m20
m10 = 1 + 0.1m10 + 0m20
m20 = 1 + 0m10 + 0.8m20
Solving: m00= 4.833, m10 = 1.111, m20 = 5.
d.
p0 + p1 + p2 = 1
0.3p0 – 0.9 p1 = 0
0.7p0 – 0.2 p2 = 0
Solving: p0= 0.207, p1 = 0.069, p2 = 0.724
10. The transition matrix for a Markov chain with states numbered 0 through 3 is
given. The time increment in the model is one week. In answering each part of
this exercise, write out the relevant equations.
È 0.20 0.8 0 0
0.9 0.1 0
˘
P = Í 0.3 0 0.2 0.5 ˙
Î0 0 0.1 0.9 ˚
a. Find the expected first passage time from state 3 to state 0.
b. Find the expected first passage time from state 0 to state 3.
c. Find the steady-state probabilities.
d. Find the expected recurrence times for all states.
e. For an expected state cost vector C = (1250, 1400, 900, 0)T find the long-run
average cost of the process per week. For a nominal (annual) interest rate of
20% find the total expected discounted cost of the process when it starts in
each of the four states.
e. For an expected state cost vector C = (1250, 1400, 900, 0)T find the long-run
average cost of the process per week. For a nominal (annual) interest rate of
20% find the total expected discounted cost of the process when it starts in each
of the four states.
Mathematics of Discrete-Time Markov Chains 17
Average
0 1 2 3 Cost
State 0 State 1 State 2 State 3 per period
Steady State Dist. 0.04 0.32 0.106667 0.533333 592
The number of failure events has a Poisson distribution with mean 2 failures per
year. Let Poisson(x) be the probability of x of failure events. Let P(x) be the
number of component failures during the year. This number can’t exceed the
number available.
In state 0: P(0) = Poisson(0), P(1) = Poisson(1), P(2) = 1 - Poisson(0) -
Poisson(1)
In the other states:
P(0) = Poisson(0), P(1) = Poisson(1) , P(2) = Poisson(2),
P(3) = 1 - Poisson(0) - Poisson(1) - Poisson(2)
0 1 2 3
0 P(2) P(1) P(0) 0
1 P(3) P(2) P(1) P(0)
2 P(3) P(2) P(1) P(0)
3 P(3) P(2) P(1) P(0)
Mathematics of Discrete-Time Markov Chains 18
Steady-state probabilities:
0 1 2 3
0-comp 1-comp 2-comp 3-comp
Steady State Dist. 0.443316 0.270671 0.210674 0.075339
State 0 is a critical state because no components remain. There is a high
probability that this will occur.
Starting from the initial state of 3 components available, the first passage
probabilities to state 0 are:
Probabiliti es from state 3 to state 0
n PF(i,j,n)
1 0.323324
2 0.218785
3 0.148047
4 0.10018
5 0.067789
The probability of first passage is one year is almost 1/3, and in the first two
years it is over 1/2.
Mathematics of Discrete-Time Markov Chains 19
Define states 37, 38, 39, 40 to represent the price of the stock. The transition
matrix is below. States 38 and 39 are transient states and state 37 and 40 are
absorbing states.
È1 0 0 0 ˘ 37
Í0.2 0.3 0.5 0 ˙ 38
P=Í ˙
Í 0 0.2 0.3 0.5˙ 39
Í0 0 0 1 ˙˚ 40
Î
a. These questions are answered with the transient probabilities at 4 days.
S $37 S $38 S $39 S $40
q(4)= 0.0788 0.0456 0.0721 0.8035
Gain = -2 -1 0 1
Expected Gain 0.6003
Probability Sold 0.8823
b. For this problem we redefine the transition matrix to combine states 37 and 40
in the Sold state. The transition matrix is now:
S $38 S $39 Sold
S $38 0.3 0.5 0.2
S $39 0.2 0.3 0.5
Sold 0 0 1
A first passage analysis into the state Sold yields the expected first passage
times in to the sold state:
From State 0 1 2
S $38 S $39 Sold
3.076923 2.307692 1
Starting with $39, we expect to sell the stock in 2.308 days.
Mathematics of Discrete-Time Markov Chains 20
13. The market for a product is shared by 4 brands. The table below gives the present
share of the market distribution and the percentage of people who switch from
each brand to the other brands for consecutive purchases.
To brand
Market
1 2 3 4 share
1 60 8 20 12 40%
From brand 2 15 40 25 20 20%
3 25 16 50 9 30%
4 28 12 20 40 10%
q(3) = q(0)P3
3
È 0.60
0.15
0.08
0.40
0.20
0.25
0.12
0.20
˘
= (0.4, 0.2, 0.3, 0.1) Í ˙.
0.25 0.16 0.50 0.09
Î 0.28 0.12 0.20 0.40
˚
= (0.3673, 0.1635, 0.2979, 0.1713)
To determine long-run market share we must solve Eqs. (4) and (5) for p.
c. The expected first passage time from brand 3 to brand 1 is 8.66 steps or
17.32 months.
d. The expected recurrence times are computed as the inverse of the steady-
state probabilities: µ11 = 2.72, µ22 = 6.14, µ33 = 3.36, µ44 = 5.80. These are
measured in steps. Since steps are two months in duration, these numbers
should be doubled to find the values expressed in months.
Mathematics of Discrete-Time Markov Chains 22
14. Let {X t} be a DTMC with state space {a, b, c, d} and transition probabilities
given by
Each time the chain is in state a, a profit of $20 is made; each visit to state b
yields a $5 profit; each visit to state c yields $15; and each visit to state d costs
$10. Letting f(Xn) be a random variable associated with the economic return of
the stochastic process at time n, find the following.
a. E[f(X5) | X3 = c, X4 = d]
b. E[f(X1) | X0 = b]
c. E[f(X1)2 | X0 = b]
d. Var[f(X1) | X0 = b]
e. Var[f(X1)] given that Pr{X0 = a} = 0.2, Pr{X0 = b} = 0.4, Pr{X0 = c} = 0.3
and Pr{X0 = d} = 0.1
f. The long-run average return per period.
E[f(X5) | X3 = c, X4 = d] = Âc p
j ŒJ
j 4j = $5(1) = $5.
E[f(X1)]= Â
j ŒJ
E[f(X1) | X0 = j] Pr{X0 = j}
15. Consider the following transition matrix representing a DTMC with state space
{a, b, c, d, e}.
a
e b
c d
a b c d e
a 1 0 1 1 0
b 0 1 0 0 0
F = c 1 0 1 1 0
d 1 0 1 1 0
e 0.667 0.333 0.667 0.667 0.4
e. Let Ri,j denote the expected number of visits to state j given that X0 = i.
Calculate the R matrix.
a b c d e
a 9999 0 9999 9999 0
b 0 9999 0 0 0
R = c 9999 0 9999 9999 0
d 9999 0 9999 9999 0
e 9999 9999 9999 9 9 9 9 1.667
Note that 9999 implies infinity in the matrix above.
16. Let {Xt}be a DTMC with state space {a,b,c,d,e,f} and transition probabilities
given by
f d e
b. List the recurrent There are two classes of recurrent states: {b,
states. d, f} and {c}.
c. List the irreducible There are two irreducible sets: {b, d, f} and
set(s) {c}.
d. List the transient Transient states: {a, e}
states.
e. Calculate the F a b c d e f
matrix. a 0.3 1 0 1 0 1
b 0 1 0 1 0 1
c 0 0 1 0 0 0
d 0 1 0 1 0 1
e 0.5 0.5 0.5 0.5 0.8 0.5
f 0 1 0 1 0 1
Mathematics of Discrete-Time Markov Chains 27
f. Calculate the R a b c d e f
matrix a 1.429 9999 0 9999 0 9999
b 0 9999 0 9999 0 9999
Note that 9999 c 0 0 9999 0 0 0
implies infinity d 0 9999 0 9999 0 9999
here. e 0.714 9999 9999 9999 5 9999
f 0 9999 0 9999 0 9999
Use the Stochastic Analysis Excel add-in provided with this book to obtain numerical
answers for the modeling problems of this chapter.
1. Consider Omar’s barbershop described in the previous chapter with one chair for
cutting hair and three for waiting (four chairs in all). Assume that the mean time
between customer arrivals is 15 minutes and the mean time for a haircut is 12
minutes. Also assume that both times are exponentially distributed and customers
who arrive and find the shop full balk. If each customer pays $10 for a haircut use
the steady-state probabilities to compute Omar’s earnings in an eight-hour day.
Now make the following changes and compute Omar’s average earnings. The
changes are not cumulative.
a. Add a fourth waiting chair.
b. Change one of the waiting chairs to a barber’s chair and add another barber.
Omar earns $5 for each hair cut the second barber does. When both barbers are
idle, an arrival goes to Omar.
c. When two or more of the waiting chairs are full Omar works faster and reduces
his average cut time to 10 minutes.
d. Change the arrival process. When all the waiting chairs are empty, all the arrivals
enter. When one waiting chair is occupied, 1/3 of the arrivals balk. When two of
the waiting chairs are occupied, 2/3 of the arrivals balk. When all three chairs are
occupied, all the arrivals balk.
Continuous-Time Markov Chains 2
Original problem
Rate Matrix
idle cut wait 1 wait 2 wait 3
idle 0 4 0 0 0
cut 5 0 4 0 0
wait 1 0 5 0 4 0
wait 2 0 0 5 0 4
wait 3 0 0 0 5 0
Economics Matrix
Transition Revenue Matrix
0 1 2 3 4
idle cut wait 1 wait 2 wait 3
idle 0 0 0 0 0
cut 10 0 0 0 0
wait 1 0 10 0 0 0
wait 2 0 0 10 0 0
wait 3 0 0 0 10 0
Steady State
Expected Average
0 1 2 3 4 ransition Revenue
idle cut wait 1 wait 2 wait 3 Time rate
Steady State (Time) 0.297 0.238 0.19 0.152 0.122 0.142 35.13
Transition Time 0.25 0.111 0.111 0.111 0.2 Rev. for 8 hours 281
Steady State
Expected Average
0 1 2 3 4 5 ransition revenue
idle cut wait 1 wait 2 wait 3 wait 4 Time rate
Steady State (Time) 0.271 0.217 0.173 0.139 0.111 0.089 0.137 36.45
Transition Time 0.25 0.111 0.111 0.111 0.111 0.2 Rev. for 8 hours 291.6
With the added chair, Omar earns about $10 more per day.
b. Change one of the waiting chairs to a barber’s chair and add another barber.
Omar earns $5 for each hair cut the second barber does. When both barbers are
idle, an arrival goes to Omar.
Rate Matrix
idle mar cuther cuBoth cut wait 1 wait 2
idle 0 4 0 0 0 0
Omar cuts 5 0 0 4 0 0
Other cuts 5 0 0 4 0 0
Both cut 0 5 5 0 4 0
wait 1 0 0 0 10 0 4
wait 2 0 0 0 0 10 0
Economics Matrix
Transition Revenue Matrix
0 1 2 3 4 5
idle mar cuther cuBoth cut wait 1 wait 2
idle 0 0 0 0 0 0
Omar cuts 10 0 0 0 0 0
Other cuts 5 0 0 0 0 0
Both cut 0 5 10 0 0 0
wait 1 0 0 0 7.5 0 0
wait 2 0 0 0 0 7.5 0
Steady State
Expected Average
0 1 2 3 4 5 ransition Revenue
idle mar cuther cuBoth cut wait 1 wait 2 Time rate
Steady State (Time) 0.435 0.271 0.077 0.139 0.056 0.022 0.128 31.75
Transition Time 0.25 0.111 0.111 0.071 0.071 0.1 Rev. for 8 hours 254
More customers are served, but the extra barber reduces Omar’s revenue.
Continuous-Time Markov Chains 4
c. When two or more of the waiting chairs are full Omar works faster and
reduces his average cut time to 10 minutes.
Rate Matrix
idle cut wait 1 wait 2 wait 3
idle 0 4 0 0 0
cut 5 0 4 0 0
wait 1 0 5 0 4 0
wait 2 0 0 6 0 4
wait 3 0 0 0 6 0
Steady State
Expected Average
0 1 2 3 4 ransition Cost
idle cut wait 1 wait 2 wait 3 Time rate
Steady State (Time) 0.317 0.254 0.203 0.135 0.09 0.137 36.39
Transition Time 0.25 0.111 0.111 0.1 0.167 Rev. for 8 hours 291.1
d. Change the arrival process. When all the waiting chairs are empty, all the
arrivals enter. When one waiting chair is occupied, 1/3 of the arrivals balk.
When two of the waiting chairs are occupied, 2/3 of the arrivals balk. When all
three chairs are occupied, all the arrivals balk.
Rate Matrix
idle cut wait 1 wait 2 wait 3
idle 0 4 0 0 0
cut 5 0 4 0 0
wait 1 0 5 0 2.667 0
wait 2 0 0 5 0 1.333
wait 3 0 0 0 5 0
Steady State
Expected Average
0 1 2 3 4 ransition Revenue
idle cut wait 1 wait 2 wait 3 Time rate
Steady State (Time) 0.348 0.279 0.223 0.119 0.032 0.153 32.59
Transition Time 0.25 0.111 0.13 0.158 0.2 Rev. for 8 hours 260.7
2. A remote air force base in Alaska has a surveillance system consisting of three radars
that are designed to operate continuously. The system can provide proper coverage as
long as two of the three radars are in working order. The time between failures is an
exponentially distributed random variable with a mean of 1000 hours. Whenever a
radar fails, a technician tries to fix it. The repair time is also exponentially
distributed but with a mean time to repair of 500 hours. When either two or three
radars are down, extra help is provided, reducing the repair time to an average of 200
hours. However, only one radar can be repaired at a time. Model this system as a
continuous-time Markov chain and compute the steady-state probabilities.
What is the probability that the system is operating with either two or three
radars? What is the probability that all radars are down? What is the proportion of
the time the repair shop is idle? What is the expected time a radar will spend in the
shop (either waiting or in repair)? Show the rate network with your solution.
Rate Matrix
Failed_0 Failed_1 Failed_2 Failed_3
Failed_0 0 0.003 0 0
Failed_1 0.002 0 0.002 0
Failed_2 0 0.005 0 0.001
Failed_3 0 0 0.005 0
Steady State
0 1 2 3
Failed_0 Failed_1 Failed_2 Failed_3
Steady State (Time) 0.310559 0.465839 0.186335 0.037267
3. A gas station has three self-service pumps. The time for a customer to pump his gas
has an exponential distribution with a mean of 3 minutes. In addition to the space at
the pumps, there is room for two more cars to wait. Cars arrive at random according
to a Poisson process at an average rate of 60 per hour when there is room at the
pumps. When both pumps are in use, the arrival rate drops to 40 per hour. With one
customer is waiting, the arrival rate drops to 20 per hour. When both waiting spaces
are full, no arrivals occur.
a. Compute the steady-state probabilities, the average number of customers either
waiting or in service, and the proportion of the customers lost.
b. Redo the calculations for the case where another pump is added. The number of
waiting spaces remains at two.
0 1 2 3 4 5 6
pump 0 pump 1 pump 2 pump 3 pump 4 wait 1 wait 2
Steady State (Time) 0.0541 0.1623 0.2434 0.2434 0.1826 0.0913 0.0228
The number in the system increases in part b because more customers use the
system. Fewer customers are lost.
Continuous-Time Markov Chains 8
This system has three state variables: s1, s2, s3, indicating the status of each
station. Possible values are I, W, and B; idle, working and blocked respectively.
There are three possible events: arrival, service 1, service 2 and service 3.
Some rules for the system are:
An arrival can occur only when s1 = I. Service k can occur only when xf = W. s3π
B, that is station 3 can’t be blocked. If service k occurs when sk+1 is B or W, s3
becomes B. If service k occurs when sk+1 is I, s3 becomes I and sk+1 becomes W.
These and other rules result in 13 reachable states with the rate matrix below.
I_I_I W_I_I I_W_I W_W_I B_W_I I_I_W W_I_W I_W_W W_W_W B_W_W I_B_W B_B_W W_B_W
I_I_I 0 4 0 0 0 0 0 0 0 0 0 0 0
W_I_I 0 0 6 0 0 0 0 0 0 0 0 0 0
I_W_I 0 0 0 4 0 6 0 0 0 0 0 0 0
W_W_I 0 0 0 0 6 0 6 0 0 0 0 0 0
B_W_I 0 0 0 0 0 0 0 6 0 0 0 0 0
I_I_W 6 0 0 0 0 0 4 0 0 0 0 0 0
W_I_W 0 6 0 0 0 0 0 6 0 0 0 0 0
I_W_W 0 0 6 0 0 0 0 0 4 0 6 0 0
W_W_W 0 0 0 6 0 0 0 0 0 6 0 0 6
B_W_W 0 0 0 0 6 0 0 0 0 0 0 6 0
I_B_W 0 0 0 0 0 6 0 0 0 0 0 0 4
B_B_W 0 0 0 0 0 0 0 6 0 0 0 0 0
W_B_W 0 0 0 0 0 0 6 0 0 0 0 6 0
The steady-state results show that the throughput is 2.16 completions per hour.
5. The figure below shows the rate network for a continuous-time Markov chain. Based
on this figure determine the steady-state probabilities.
(0.6)
(0.1) (0.3)
(1) (0.8)
2 1
(0.2)
0 1 2
State 0 State 1 State 2
Steady State (Time) 0.677966 0.254237 0.067797
Transition Time 1 1 1
6. The figure below shows the state-transition network for a Markov system with two
absorbing states. The following rates are given for the activities.
Activity d1 d2 d3 a1 a2 a3
Construct the rate matrix and the embedded Markov chain matrix. Find the
absorbing state probabilities when the system starts in state 2.
d1 d2 d3
0 1 2 3 4
a1 a2 a3
7. The figure below shows the rate network for a continuous-time Markov chain. Based
on this figure determine the steady-state probabilities.
(2)
0 3
(2)
(1) (1)
2 1
(1)
0 1 2 3
S0 S1 S2 S3
Steady State (Time) 0.1111 0.2222 0.4444 0.2222
8. The figure below shows the rate network for a continuous-time Markov chain. Based
on this figure determine the steady-state probabilities.
(0.5) (0.5)
0 3 6
(0.5)
(1) (0.5) (1) (1)
2 1 5 4
(1) (1)
Note that states 0, 1 and 2 are transient. The steady-state probabilities for these
states are 1. Since rates sum to 1, the analysis yields the same results as the
embedded Markov chain.
Expected
0 1 2 3 4 5 6 Transition
S0 S1 S2 S3 S4 S5 S6 Time
Steady State (Time) 0 0 1E-16 0.3333 0.1667 0.3333 0.1667 1
Transition Time 1 1 1 1 1 1 1
9. A military air base has 3 planes, each with its own repair crew. The planes fail
independently according to an exponential distribution with a mean time to failure of
100 hours. The time to repair each plane takes an average of 30 hours and is also
exponentially distributed.
a. Find the steady-state probabilities for the number of available planes. What is the
average number of planes in working condition at any point in time?
b. Change the situation so that all three repair crews work together on one plane at a
time. The mean repair time is reduced to 10 hours, but planes must now queue up
for service. How does this change affect the average number of planes available?
Is it better to have one crew dedicated to each plane or to combine the crews?
a. Rate Matrix
S_0 S_1 S_2 S_3
S_0 0 0.03 0 0
S_1 0.0333 0 0.02 0
S_2 0 0.0667 0 0.01
S_3 0 0 0.1 0
Stead-state analysis
Expected
0 1 2 3 Transition
S_0 S_1 S_2 S_3 Time
Steady State (Time) 0.4552 0.4096 0.1229 0.0123 21.667
Birth-Death Results
E[Number in Population] 0.6923
E[Arrival Rate(per Hour)] 0.0231
E[Time in System (Hours)] 30
The system constitutes the repair operation and the state is the number in repair.
Since the expected number in repair is 0.6923, the expected number of working
planes is 3 - 0.6923 = 2.3077.
b. Rate Matrix
Continuous-Time Markov Chains 15
Stead-state analysis
0 1 2 3
S_0 S_1 S_2 S_3
Steady State (Time) 0.7321 0.2196 0.0439 0.0044
Birth-Death Results
E[Number in Population] 0.3206
E[Arrival Rate(per Hour)] 0.0268
E[Time in System (Hours)] 11.967
Working together makes the repair crews more efficient. Not the expected
number of working planes is 2.6894.
Continuous-Time Markov Chains 16
10. A truck running on four tires carries two spares in reserve. The tires on the ground
are identical and each may fail while the truck is operating. The mean time to failure
of a tire is one week (5 working days), and the failure time has an exponential
distribution. When a tire fails it is replaced with a spare if one is available. The
truck cannot operate when it has less than four good tires.
Several alternatives for repairing tires are given below. Consider each one
separately and determine the proportion of time the truck is in working condition.
Assume that failures are independent. Repair times are exponentially distributed.
a. Whenever a tire fails it is sent to the shop immediately. The average time to
perform the repair and return the tire to the truck is 2 days.
b. When two tires are no longer in working condition, the failed tires are sent to the
shop. Tires are repaired and returned to the truck in sets of two. This takes 3
days on average.
c. When three tires have failed, the truck is sent to the shop and all tires are
replaced. The repair time in this case takes an average of 4 days. Is there any
benefit to replacing tires that have not failed when the failure time has an
exponential distribution?
d. No repair is possible. The truck continues to operate until there are fewer than
four good tires. What is the probability distribution for the time the truck can be
used?
a.
For this case, we assume both failure and repair operations are independent.
The state gives the number of failed tires in the shop. The arrival rate to the shop
is 4/5 = 0.8 per day. There are 4 tires in operation in any of the working states (0,
1, 2). State 3 is the failed state. No further failures can occur, because the truck
is no longer operating.
Transition matrix
f_0 f_1 f_2 f_3
f_0 0 0.8 0 0
f_1 0.5 0 0.8 0
f_2 0 1 0 0.8
f_3 0 0 1.5 0
SS analysis
f_0 f_1 f_2 f_3
Steady State (Time) 0.219 0.351 0.281 0.15
b.
The arrival process is the same, but tires are repaired two at a time. Thus the
transition caused by a repair operation is from s2 to s0, or s3 to s1.
Transition matrix
f_0 f_1 f_2 f_3
f_0 0 0.8 0 0
f_1 0 0 0.8 0
f_2 0.333 0 0 0.8
f_3 0 0.333 0 0
SS analysis
f_0 f_1 f_2 f_3
Steady State (Time) 0.08 0.271 0.191 0.459
The truck is in working condition about 54% of the time. This is not a good
maintenance policy.
Continuous-Time Markov Chains 18
11. An assembly line consists of three stations in series. Each station is in one of three
states: idle with no product, idle holding a product, and working on a product. There
are sufficient subassemblies available so that whenever station 1 has no product it is
immediately provided with a subassembly to work on. When station 3 completes a
product it leaves the system. Stations 1 and 2 cannot pass a unit to the following
station unless that station is idle and empty. This represents a case of blocking.
Assume the processing time of each station has an exponential distribution with a
mean of one minute. Construct the rate matrix for this problem and find the steady-
state solution. What is the average production rate of the line?
Steady-state
Expected Average
0 1 2 3 4 5 6 7 Transition Completio
wii wwi wiw hwi www whw hhw hww Time rate
Steady State (Time) 0.1026 0.1282 0.1026 0.2051 0.1538 0.0769 0.1538 0.0769 0.5909 0.5641
The system produces 0,564 units per minute. If there were no variability it would
produce at a rate of 1 per minute.
Continuous-Time Markov Chains 19
12. A self-paced course consists of six units, numbered 1 through 6 that must be taken in
sequence. The time it takes to study a unit can be modeled as an exponential random
variable with a mean of one week. After completing a unit, the student takes a test
and passes with probability p. Passing the test allows the student to go on to the next
unit. The student must repeat the unit if he fails the test. When he passes all six
units the course is complete. There is no limit to the number of times the student
may take a test.
Draw the rate network as a function of p. Write an expression for the
cumulative distribution function associated with the time to finish the course. If p =
0.5, what is the probability that the student will complete the course in a 12-week
semester?
The state represents the number of passed tests. The system has a single
trapping state at state 6.
P_0 P_1 P_2 P_3 P_4 P_5 P_6
P_0 0.5 0.5 0 0 0 0 0
P_1 0 0.5 0.5 0 0 0 0
P_2 0 0 0.5 0.5 0 0 0
P_3 0 0 0 0.5 0.5 0 0
P_4 0 0 0 0 0.5 0.5 0
P_5 0 0 0 0 0 0.5 0.5
P_6 0 0 0 0 0 0 1
The process is like a death process with K = 6. Passing a test is moves to the
next lower state. The rate of transition is µn = pµ, where µ is the rate of passing
one test. For the given data, µn = p. The transient solution is the Poisson
distribution.
(pt)ne–pt
p6-n(t ) = for 0 £ n < 6,
n!
6
p0(t ) = 1 - Âpn(t ).
n=1
p0(t) is the c.d.f. for the time to finish the course. The probability of finishing in 12
weeks is 0.55432036
Continuous-Time Markov Chains 20
13. Three placement machines work in parallel populating printed circuit boards. Raw
boards are always available so the machines can run continuously. In the absence of
any misalignments or other faults, the production rate for a machine averages l
boards/min. Each machine operates independently of the others so the production
rate of the system is 3l. The time it takes to populate a board can be modeled as an
exponential random variable.
After all the components are placed (event a) the board is inspected. If no
faults are detected it leaves the system and a new board is transferred to the machine.
The probability of a fault is p. The following rules govern the operation of the
system.
• When a fault is detected, the board is sent to a repair station.
• Only one technician is available, so boards needing repair form a queue.
• The time for repair is exponentially distributed with mean 1/µ.
• A placement machine cannot begin work on a new board until the one in repair
is returned for a touch-up operation. Consequently, it remains idle while
waiting.
• Assume that all transfer and touch-up operations take negligible time.
µ µ µ
0 1 2 3
3lp 2lp lp
The steady-state analysis gives the state probabilities and the completion or
production rate.
Expected Average
0 1 2 3 Transition comp.
p_0 p_1 p_2 p_3 Time rate
Steady State (Time) 0.00439 0.04392 0.21962 0.73206 0.31102 2.14348
14. Consider the various production situations described in Section 11.4. For each case
let the arrival and service processes be Poisson. When queue lengths are limited,
assume arrivals balk when the system if full. For each part below, compute the
proportion of time the system will reside in each state, and the production rate for
each system. Figure references are in Chapter 14.
a. Consider the single server system depicted in Fig. 8. The mean time between
arrivals is 2 minutes. The mean time for service is 10 minutes.
Rate Matrix
s_0 s_1
s_0 0 0.5
s_1 0.1 0
Average
0 1 prod
s_0 s_1 rate
Steady State (Time) 0.1667 0.8333 0.083333
b. Consider the process represented by Fig. 9. The mean time for arrivals is 2
minutes. The means of the five operations are shown in the table below.
Activity d1 d2 d3 d4 d5
Mean time 1 2 3 4 5
Rate Matrix
s_0 s_1 s_2 s_3 s_4 s_5
s_0 0 0.5 0 0 0 0
s_1 0 0 1 0 0 0
s_2 0 0 0 0.5 0 0
s_3 0 0 0 0 0.3333 0
s_4 0 0 0 0 0 0.25
s_5 0.2 0 0 0 0 0
Average
0 1 2 3 4 5 comp
s_0 s_1 s_2 s_3 s_4 s_5 rate
Steady State (Time) 0.1176 0.0588 0.1176 0.1765 0.2353 0.2941 0.05882353
c. Consider the multistage process of Fig. 10, except limit the number in the system
to 5 and the number of operations to 3. Let the mean time between arrivals be 10
minutes, and the three operations have mean times given in the following table.
Continuous-Time Markov Chains 23
Activity d1 d2 d3
Mean time 2 3 4
d. Consider the process shown in Fig. 11, except limit the number in the system to
4. The mean times for the activities are given in the table below.
Activity a d1 d2
Mean time 3 4 8
Rate Matrix
0_0_0 1_0_0 0_1_0 1_1_0 1_1_1 1_1_2 1_1_3
0_0_0 0 0.333 0 0 0 0 0
1_0_0 0.25 0 0 0.333 0 0 0
0_1_0 0.125 0 0 0.333 0 0 0
1_1_0 0 0.125 0.25 0 0.333 0 0
1_1_1 0 0 0 0.375 0 0.333 0
1_1_2 0 0 0 0 0.375 0 0.333
1_1_3 0 0 0 0 0 0.375 0
Continuous-Time Markov Chains 24
0 1 2 3 4 5 6
0_0_0 1_0_0 0_1_0 1_1_0 1_1_1 1_1_2 1_1_3
Steady State (Time) 0.1242 0.1126 0.106 0.1943 0.1727 0.1536 0.1365
Average
production
rate
0.28783563
e. Consider the process depicted in Fig. 12 with two classes of customers. Limit
the number in the each queue to 3 (as shown in the figure). The mean times for
the activities are given in the following table.
Activity a1 a2 d
Mean time 10 10 8
Rate Matrix
0_0 1_0 2_0 3_0 0_1 1_1 2_1 3_1 0_2 1_2 2_2 3_2 0_3 1_3 2_3 3_3
0_0 0 0.1 0 0 0.1 0 0 0 0 0 0 0 0 0 0 0
1_0 0 0 0.1 0 0 0.1 0 0 0 0 0 0 0 0 0 0
2_0 0 0 0 0.1 0 0 0.1 0 0 0 0 0 0 0 0 0
3_0 0 0 0 0 0.1 0 0 0.1 0 0 0 0 0 0 0 0
0_1 0 0 0 0 0 0.1 0 0 0.1 0 0 0 0 0 0 0
1_1 0.125 0 0 0 0 0 0.1 0 0 0.1 0 0 0 0 0 0
2_1 0 0.125 0 0 0 0 0 0.1 0 0 0.1 0 0 0 0 0
3_1 0 0 0.125 0 0 0 0 0 0.1 0 0 0.1 0 0 0 0
0_2 0 0 0 0 0 0 0 0 0 0.1 0 0 0.1 0 0 0
1_2 0 0 0 0 0.125 0 0 0 0 0 0.1 0 0 0.1 0 0
2_2 0 0 0 0 0 0.125 0 0 0 0 0 0.1 0 0 0.1 0
3_2 0 0 0 0 0 0 0.125 0 0 0 0 0 0.1 0 0 0.1
0_3 0 0 0 0 0 0 0 0 0 0 0 0 0 0.1 0 0
1_3 0 0 0 0 0 0 0 0 0.125 0 0 0 0 0 0.1 0
2_3 0 0 0 0 0 0 0 0 0 0.125 0 0 0 0 0 0.1
3_3 0 0 0 0 0 0 0 0 0 0 0.125 0 0 0 0 0
Average
production
rate
0.06792989
This production rate compares the arrival rate of the customers, that is
0.1/minute. Quite a few customers are lost.
Continuous-Time Markov Chains 25
15. Consider the various production situations described in Section 14.8. For each case
let the arrival and service processes be Poisson. When queue lengths are limited,
assume arrivals balk when the system if full. For each part below, compute the
proportion of time the system will reside in each state, and the production rate for
each system. Figure references are in this chapter.
a. Consider the queueing system depicted in Fig. 17. Let p = 0.1 and limit the
queue length to 5. The mean times for the activities are given in the table below.
Activity a d c
Mean time 6 4 10
Rate Matrix
0_i 1_d 1_c 2_d 2_c 3_d 3_c 4_d 4_c 5_d 5_c
0_i 0 0.17 0 0 0 0 0 0 0 0 0
1_d 0.08 0 0.03 0.17 0 0 0 0 0 0 0
1_c 0.1 0 0 0 0.17 0 0 0 0 0 0
2_d 0 0.08 0 0 0.03 0.17 0 0 0 0 0
2_c 0 0.1 0 0 0 0 0.17 0 0 0 0
3_d 0 0 0 0.08 0 0 0.03 0.17 0 0 0
3_c 0 0 0 0.1 0 0 0 0 0.17 0 0
4_d 0 0 0 0 0 0.08 0 0 0.03 0.17 0
4_c 0 0 0 0 0 0.1 0 0 0 0 0.17
5_d 0 0 0 0 0 0 0 0.08 0 0 0.03
5_c 0 0 0 0 0 0 0 0.1 0 0 0
0 1 2 3 4 5 6 7 8 9 10
0_i 1_d 1_c 2_d 2_c 3_d 3_c 4_d 4_c 5_d 5_c
Steady State (Time) 0.012 0.024 0.002 0.05 0.006 0.107 0.014 0.228 0.03 0.381 0.145
A considerable number of the customers are lost. The total probability in state s1
=5 is 0.525. Over half of the customers are turned away.
Average
production
rate
0.07902556
This is substantiated by the production rate which is less than half of the arrival
rate (1/6).
Continuous-Time Markov Chains 26
b. Consider the rework example in Fig. 18. The mean times for the activities are
given in the following table. Let the rework probability be 0.1.
Activity a s1 s2
Mean time 2 4 10
Rate Matrix
s0 s1 s2
s0 0 0.5 0
s1 0.025 0 0.075
s2 0.1 0 0
Average
0 1 2 production
s0 s1 s2 rate
Steady State (Time) 0.102564 0.512821 0.384615 0.05128205
c. Consider the multistage rework shown in Fig. 19. Let the rework probability be
0.1 and the mean times for the activities be as given in the table below.
Activity a d1 d2 d3 d4 d5 r
Mean time 2 1 2 3 4 5 0.5
Rate Matrix
0_i 1_d 1_r 2_d 2_r 3_d 3_r 4_d 4_r 5_d 5_r
0_i 0 0.5 0 0 0 0 0 0 0 0 0
1_d 0 0 0.1 0.9 0 0 0 0 0 0 0
1_r 0 2 0 0 0 0 0 0 0 0 0
2_d 0 0 0 0 0.05 0.45 0 0 0 0 0
2_r 0 0 0 2 0 0 0 0 0 0 0
3_d 0 0 0 0 0 0 0.03 0.3 0 0 0
3_r 0 0 0 0 0 2 0 0 0 0 0
4_d 0 0 0 0 0 0 0 0 0.03 0.23 0
4_r 0 0 0 0 0 0 0 2 0 0 0
5_d 0.18 0 0 0 0 0 0 0 0 0 0.02
5_r 0 0 0 0 0 0 0 0 0 2 0
steady-state probabilities
Continuous-Time Markov Chains 27
0 1 2 3 4 5 6 7 8 9 10
0_i 1_d 1_r 2_d 2_r 3_d 3_r 4_d 4_r 5_d 5_r
0.0115 0.0573 0.0258 0.1146 0.0258 0.1719 0.0258 0.2292 0.0258 0.2865 0.0258
Average Time
production between
rate products
0.051576 19.38889
È-8 3 ? 1˘
Í4 ? 0 5˙
G= Í ˙
Í7 ? -10 1˙
Í4 5 1 ? ˙˚
Î
È-8 3 4 1 ˘
Í 4 -9 0 5 ˙
G =Í ˙
Í 7 2 -10 1 ˙
Í4 5 1 -10 ˙˚
Î
Mathematics of Continuous-Time Markov Chains 2
2. Elaine Johnson runs a hotdog stand at the corner of Broadway and 42nd St. in New
York City. Depending on the local economy his business is in one of four states:
high income, medium income, low income, deficit. Over the years she has
observed that her business moves among these states according to a continuous-
time Markov chain Y with state space S = {h, m, l, d} and generator matrix
We can use Eq. (13) in Property 2 to find the long-run average profit both before
and after the boost in advertising budget. Let CScur = (900, 550, 300, -700) be the
current revenue vector, and from the generator matrix G, compute the current
long-run probabilities:
P
p cur = (0.455, 0.227, 0.227, 0.091)T
S
Then, ccur = CScur p cur
P
= 538.6
The average time spent in the fourth state is 1/l4 where l4 = –g44 = 0.15/week.
Thus 1/l4 = 20/3 weeks so reducing the time spent in the fourth state by half
gives 10/3 weeks. The new generator matrix is
giving p Pnew = (0.476, 0.238, 0.238, 0.048). Combining this result with CSnew = (900,
550, 300, -1400), we get
Mathematics of Continuous-Time Markov Chains 3
S
cnew = CSnew p Pnew = 564.3 (> 538.6)
For both the current and new situations, we use Eq. (16) in Property 4 to find the
total expected discounted profit over an infinite planning horizon. The first step is
to convert the annual discount rate of 20% into a weekly value.
b = 0.2/52 = 0.00385/week
For current situation:
-1
È0.03385 -0.02 -0.01 0 ˘
Í 0 0.04385 -0.03 -0.01 ˙
-1
( bI - G cur ) = Í ˙
Í 0 0 0.05385 -0.05 ˙
Í ˙
Î -0.15 0 0 0.1539˚
È145, 912 ˘
Í135, 239˙
–1 S
(bI – Gcur) Ccur = Í ˙
Í133, 437˙
Í ˙
Î137, 711˚
-1
È0.03385 -0.02 -0.01 0 ˘
Í 0 0.04385 -0.03 -0.01 ˙
-1
( bI - G new ) = Í ˙ =
Í 0 0 0.05385 -0.05 ˙
Í ˙
Î -0.3 0 0 0.3039˚
Mathematics of Continuous-Time Markov Chains 4
Multiplying this matrix on the right by CSnew gives the profit vector
È151, 980 ˘
Í141, 916 ˙
(bI – Gnew)–1 CSnew = Í ˙
Í140, 619˙
Í ˙
Î145, 447˚
For the weekly discount rate of b = 0.00385, we compute the discount factor
Next, we need to find the approximate state-transition matrix P = (pij) for the
corresponding discrete-time Markov chain. This can be done with the scheme
mentioned in Section 14.3 for finding transient solutions to Markov chains.
Letting the time increment ∆ = 1 week, we get the matrix
-1
Ê È1 0 0 0˘ È0.97 0.02 0.01 0 ˘ˆ È 900 ˘
Á Í0 1 0 0˙ Í 0 0.96 0.03 0.01˙˜ Í 550 ˙
(I – aPcur)–1 CScur = ÁÍ ˙ - 0.9962 Í ˙˜ Í ˙
Á Í0 0 1 0˙ Í 0 0 0.95 0.05˙˜ Í 300 ˙
Á Í0 0 0 1 ˙˚ Í0.15 0 0 0.85˙˚˜¯ Í-700 ˙
ËÎ Î Î ˚
-1
È 0.03372 -0.01992 -0.00996 0 ˘ È 900 ˘
Í 0 0.04368 -0.02988 -0.00996˙ Í 550 ˙
= Í ˙ Í ˙
Í 0 0 0.0538 -0.0498 ˙ Í 300 ˙
Í-0.1494 0 0 0.1533 ˙˚ Í-700 ˙
Î Î ˚
È146, 473˘
Í135, 758˙
= Í ˙
Í133, 949 ˙
Í138, 240 ˙
Î ˚
-1
Ê È1 0 0 0˘ È0.97 0.02 0.01 0 ˘ˆ È 900 ˘
Á Í0 1 0 0˙ Í 0 0.96 0.03 0.01˙˜ Í 550 ˙
(I – aPnew)–1 CSnew = ÁÍ ˙ - 0.996 Í ˙˜ Í ˙
Á Í0 0 1 0˙ Í 0 0 0.95 0.05˙˜ Í 300 ˙
Á Í0 0 0 1 ˙˚ Í 0.3 0 0 0.7 ˙˚˜¯ Í-1400 ˙
ËÎ Î Î ˚
-1
È 0.03388 -0.01992 -0.00996 0 ˘ È 900 ˘
Í 0 0.04384 -0.02988 -0.00996˙ Í 550 ˙
= Í ˙ Í ˙
Í 0 0 0.0538 -0.0498 ˙ Í 300 ˙
Í-0.2988 0 0 0.3028 ˙˚ Í-1400 ˙
Î Î ˚
Mathematics of Continuous-Time Markov Chains 6
È152, 564 ˘
Í142, 462 ˙
= Í ˙
Í141,159 ˙
Í ˙
Î146, 006 ˚
Therefore, if we start in state h, the total discounted expect profit is $152,564.
Comparing this value with $146,473, we see again that the extra expense is
worthwhile.
Mathematics of Continuous-Time Markov Chains 7
3. A small convenience store off a major highway has a room for only 5 customers
inside. Cars arrive according to an exponential distribution with a mean
interarrival time of 10 cars per hour. The number of people within each car is a
random variable, N, with distribution Pr{N = 1} = 0.1, Pr{N = 2} = 0.7, and Pr{N
= 3} = 0.2. Arrivals enter the store and stay an exponential length of time when
possible. The mean length of time in the store is 10 minutes and each person acts
independent of the others, leaving singly and waiting in their cars for the
remainder of their party. If a car arrives and the store is too full for everyone in
the car to enter, it will leave with all its passengers. Model the store as a
continuous-time Markov chain Y, where Yt denotes the number of individuals in
the store at time t. Give the generator matrix (Resnick [1992]).
16.
In general, the rate at which the systems goes from state i to state i – 1 is
ri,i–1 = number in the store ¥ number leaving per hour = i ¥ 6, i = 1, . . . ,5
and rij = 0 for all j < i – 1. This last result follows from the assumption associated
with CTMCs that only one transition can take place in a “small” period of time and
that the time between transitions is exponentially distributed.
Using the above logic for the remaining rij, we get the following generator
matrix.
Mathematics of Continuous-Time Markov Chains 8
È-10 1 7 2 0 0˘
Í 6 -16 1 7 2 0˙
Í ˙
Í 0 12 -22 1 7 2˙
G=Í
Í 0 0 18 -26 1 7˙˙
Í 0 0 0 24 -25 1˙
Í ˙
Î 0 0 0 0 30 -30 ˚
Mathematics of Continuous-Time Markov Chains 9
4. A piece of machinery consists of two major components. The time until failure
for component A is exponentially distributed with a mean of 100 hours.
Component B has a mean time to failure of 200 hours and is also described by an
exponential distribution. When one component fails, the machine is turned off
and maintenance is performed. The time to fix either component is exponentially
distributed with a mean of 5 hours for A and 4 hours for B. Let Y be a continuous-
time Markov chain with state space S = {0, 1, 2}, where state 0 denotes that the
machine is working, 1 denotes that component A has failed, and 2 denotes that
component B has failed.
a. Give the generator matrix for Y.
For state 0, the rate at which the system goes to state 1 is equal to the rate at
which component A fails, so r01 = 1/100 = 0.01. Similarly, for r02 = 1/200 =
0.005. Also, l0 = r01 + r02 = 0.015.
For state 1, the rate at which the system goes to state 0 is equal to the repair
rate for component A, so r10 = 1/5hr = 0.2. If the system is in state 1, given that it
is a CTMC, it cannot go to state 2 because only one component can fail in a
“small” period of time, and when either A or B fails, the machine is shut down.
Thus, r12 = 0.
Using the same logic for state 2, we get the following generator matrix.
È-0.015 0.01 0.005˘
G = Í 0.2 -0.2 0 ˙
Í ˙
ÍÎ 0.25 0 -0.25˙˚
We need to find the state-state probability that the machine is in state 0, pP0. One
way to do this is to solve Eq, (8) for the vector pP. Using the Stochastic Analysis
Excel add-in, to three decimal places, we get
pP = (0.942, 0.008, 0.05)
so the long-run probability that the machine is working is 0.942.
c. An outside contractor does the repair work on the components and charges
$100 per hour for time plus travel expenses, which is an additional $500 for
each visit. The company has determined that they can hire and train their own
Mathematics of Continuous-Time Markov Chains 10
repairperson. This option will cost $40 per hour while the machine is running
as well as when it is down. Ignoring the initial training cost and the
possibility that the employee who is hired to perform the repairs can do other
things while the machine is running, is it economically worthwhile to pursue
this option?
To answer this question, we must determine the expected long-run cost per hour
associated with the outside contractor and compare it with the $40/hr option.
To determine the long-run average cost per hour, c , for the outside contractor
we make use of Property 3. The cost rate vector and the cost transition matrix
are as follows.
È 0 ˘ È0 500 500 ˘
C = 100 and C = Í0 0
SÍ ˙ R
0 ˙
Í ˙ Í ˙
ÍÎ100 ˙˚ ÍÎ0 0 0 ˙˚
Also, from part (a) we infer that l = (0.015, 0.2, 0.25), and from part (b) we have
pP = (0.942, 0.008, 0.05).
Using the Stochastic Analysis Excel add-in which implements Eq. (8), we get c =
$12.87. Because this value is less than $40, hiring and training a repairperson
cannot be justified economically.
Mathematics of Continuous-Time Markov Chains 11
5. Let Y be a continuous-time Markov chain with state space S = {0, 1, 2, 3} and rate
matrix
È0 4 0 1˘
Í6 0 4 0˙
R=Í ˙
Í0 0 0 1˙
Í2 0 0 0 ˙˚
Î
Costs are incurred at a rate of $250, $450, $800, and $1500 per unit time while
the process is in states 0, 1, 2, and 3, respectively. Furthermore, each time a
transition occurs from state 3 to state 0 an additional cost of $2000 is incurred.
(No other transitions result in additional costs.) For a maintenance fee of $600
per unit time, all state costs can be cut in half and the “transition” cost can be
eliminated. Based on long-run averages, is the maintenance cost worthwhile?
For the current system, we use Property 3 to find c , the long-run average cost
per unit time. This can be done with the Markov Process Excel add-in with the
following cost data.
È 250 ˘ È 0 0 0 0˘
Í 450 ˙ Í 0 0 0 0˙
S
C = Í ˙ and C = Í
R ˙
Í 800 ˙ Í 0 0 0 0˙
Í ˙ Í2000 0 0 0 ˙˚
Î1500 ˚ Î
Plugging these values along with the rate matrix R into the Markov Process
add-in, we get (rounding to three decimals)
(Recall that the rate vector l is obtained from the equation li =  rij for i Œ S,
j ŒS
giving l = (5, 10, 1, 2). However, it is not needed for the add-in because it is
embedded in the rate matrix.
For the maintenance fee option, we have CS = (125 + 600, 225 + 600, 400 +
600, 750 + 600)T = (725, 825, 1000, 1350)T, and CR is void. Solving with the
add-in, we get
c = $1026
so this option is preferred.
Mathematics of Continuous-Time Markov Chains 12
Let us define the state space as the number of impulses that have arrived: S =
{0, 1, 2, 3}. When the third impulse has arrived, the relay is in the recovery state.
For state 0, the rate at which the relay transitions to state 1 is equal to the
arrival rate, so r01 = 90. Given the Markov assumption, r02 = r03 =0. Using this
logic for the other states, we have
È-90 90 0 0 ˘
Í 0 -90 90 0 ˙
G= Í ˙
Í 0 0 -90 90 ˙
Í 60 0 0 -60 ˙˚
Î
Note that the transition from state 3 to state 0 is equal to the reciprocal of the
expected recovery time, or 1/1sec = 60/min.
b. What is the long-run probability that the relay is in the recovery phase?
To answer this question, we can solve Eq. (8) to get the steady-state
probabilities. Using the Stochastic Analysis Excel add-in, with the rate matrix
derived from the generator matrix in part (a), we get
pP = (2/9, 2/9, 2/9, 1/3)
so the relay is in the recovery phase 1/3 of the time.
c. How many times would you expect the relay to fire each minute?
The relay fires only when it is in state 2, and only when an impulse arrives.
Therefore, the expect firing rate = p 2P ¥ 90 impulses/min = 2/9 ¥ 90/min = 20/min.
Mathematics of Continuous-Time Markov Chains 13
7. Using the data in Table 15.1 as a guide, simulate the continuous-time Markov
chain defined by the following rate matrix with state space S = {0, 1, 2}. Begin
by drawing the rate diagram.
È 0 0.3 0.7˘
R = Í0.1 0 0.1˙
Í ˙
ÍÎ0.3 0.2 0 ˙˚
From the simulation, estimate the probability that the process will be in state 1 at
time t = 10 given that the process started in state 0
Rate diagram
0.7
0.3 0.1
0 1 2
0.1 0.2
0.3
We simulate the process with the Stochastic Analysis add-in to obtain the
following table (similar to Table 15.1). Of the total simulated time, 58.6, , the
system is in state 1 for a cumulative time of 12.8. The estimate of the probability
of state 1 is the ratio of these two times or 0.216. Since the process is stationary,
this is the probability for time 10 as for any time in the future. Of course a better
estimate would be obtained from a longer simulation, or by computing the
steady-state probability.
where t0 is small and t is large. Also, the function I(Yu = j) counts the number of
times the process visits state j. Part of the problem is to determine quantitative
values for “small” and “large.”)
Using the simulation option of the Stochastic analysis add-in we simulated the
CTMC for 1000 transitions. The simulation uses the starting state 0 and t0 =
1000. The value of t is determined by the time it takes to complete 100o
transitions. For this case it is 2384. The cumulative results are shown below
0 1 2
State 0 State 1 State 2
Cumulative Count 369 244 387
State Frequency 0.369 0.244 0.387
Cumulative Time 350.7 1301.9 731.1
Time Frequency 0.147 0.546 0.307
These compare to the steady-state results computed with the same add-in.
0 1 2
State 0 State 1 State 2
Steady State (Time) 0.148148 0.537037 0.314815
The steady-state time results should be compared with the time frequency. The
state-state steps should be compared with the state frequency.
Mathematics of Continuous-Time Markov Chains 15
There are two processes, one associated with state A and one associated with
state B. Let NA(t) be the number of organisms in state A and let NB(t) be the
number of organisms in state B. We can now see that the pair {NA(t), NB(t)} is a
continuous-Markov chain by defining the state space to be {(n, m) : n, m = 0, 1, . .
. , and m = n π 0}. The rate at which the process leaves state (n, m) is
l(n,m) = an + bn
For the process is in (n, m), one possibility is for A to change to B. This occurs at
the rate an so using Eq. (1), we have
an
p(n,m),(n–1,m+1) =
an + bm
The only other possibility is for B to divide into two organisms of type A. This
occurs at the rate bm, so using Eq. (1) again, we have
bm
p(n,m),(n+2,m–1) =
an + bm
The rate diagram can be conveniently viewed as a plot of states in the (n, m)-
plane. A portion of the diagram is shown below. The arc values can be obtained
from Eq. (1).
Mathematics of Continuous-Time Markov Chains 16
m
3
n
0 1 2 3 4 5
Mathematics of Continuous-Time Markov Chains 17
10. Consider two machines that are maintained by a single repair crew. Statistics
indicate that the time between failures for machine i is exponentially distributed
with an average rate of li, i = 1, 2. The repair times for either machine are
exponentially distributed with rate µ. Can this situation be modeled as a birth-
death process? If so, what are the model parameters? If not, how can we analyze
it?
È 0 l1 l2 0 0˘ È-(l1 + l2 ) l1 l2 0 0 ˘
Ím 0 0 l1 ˙ Í ˙
Í
0
˙ Í m -( m + l1 ) 0 0 l1 ˙
R = Ím 0 0 l2 0 ˙ and G = Í m 0 -( m + l 2 ) l 2 0 ˙
Í ˙ Í ˙
Í0 m 0 0 0˙ Í 0 m 0 -m 0 ˙
ÍÎ 0 0 m 0 0 ˙˚ ÍÎ 0 0 m 0 - m ˙˚
l2 l1
p01 = , p02 = 1 – p01 =
l1 + l2 l1 + l2
m l1
p10 = , p14 = 1 – p10 =
m + l1 m + l1
Mathematics of Continuous-Time Markov Chains 18
m l2
p20 = , p23 = 1 – p20 =
m + l2 m + l2
11. There are N persons in a population, some of whom have a certain infection that
spreads as follows. Contacts between two members of the population occur in
accordance with a Poisson process with rate l. When a contact occurs, it is
equally likely to involve any of the ( ) pairs of persons in the population. If a
N
2
contact involves an infected and a noninfected person, then with probability p the
latter gets the infection. No cure exists so once infected, a person remains so
forever.
Let Yt denote the number of infected members of the population at time t.
a. Draw the rate diagram for this situation. Is {Yt : t ≥ 0} a continuous-time
Markov chain? Explain.
This is an example of a pure birth process. Let the state space be S = {1, . . ., N}
representing the number of infected persons, and let the transition rate be li. If i
persons are infected, then contact with between an infected and uninfected
()
person occurs with probability i(N – i)/ N2 . (Note that the numerator in this
expression is the number of pairs that will lead to infection.) It follows that the
birth rates are
pli( N - i )
li = pli(N – i)/ N2 = ()
N ( N - 1) / 2
, iŒS
l1 li lN–1
1 2 ... i i+ 1 ... N–1 N
b. Starting with a single infected individual, what is the expected time until all
members are infected?
Using the notation in Section 15.5, let Ti be the time, starting in state i, required
for the process to enter state i + 1. Thus, E[Ti] = 1/li.so
N
N ( N - 1) N 1
E[time to all infected] = Â 1 / li =
i =1
Â
2 pl i =1 i( N - i )
Mathematics of Continuous-Time Markov Chains 20
12. Consider a birth-death process with birth rates li = (i + 1)l and death rates mi = im
for all i ≥ 0.
a. Determine the expected time to go from state 0 to state 3.
Let Ti be the time, starting in state i, required for the process to enter state i + 1.
Because we have a birth-death process, E[T0] = 1/l0 = 1/l. In general, we have
the recursive relationship
1 m
E[Ti ] = + i E[Ti -1 ]
li li
1
E[T0] =
l
1 m l+m
E[T1] = + E[T0 ] =
2l 2l 2l2
1 2m l2 + m (l + m )
E[T2] = + E[T1 ] =
3l 3l 3l3
1 3m l3 m + m 2 (l + m )
E[T3] = + E[T2 ] =
4l 4l 4l4
3
The solution can be found from  E[T ]
i=0
i
13. The Club A-Go-Go has two sound boards used to control the music it plays
nightly. Since only one is needed to run the equipment the other serves as a spare.
The time between failures are exponentially distributed with mean 1/l. When a
board fails, it is replaced by the spare, if available, and sent immediately to a
nearby repair shop. A single person runs the shop and takes an exponential
amount of time with mean 1/m to effect repairs. A newly failed board enters
service if the repairman is free; otherwise, it waits until he finishes with the other
board. When finished, the repairman begins working on the second board.
Starting with both boards operational, find the following.
a. The expected value of the time until both boards are in the repair facility
This problem can be modeled as a birth-death process where the states are the
number of machines down. The state space S = {0, 1, 2}. Accordingly, the
parameters are
li = l, i = 0, 1
mi = m, i = 1, 2
We must find the expected time for the process to go from state 0 to state 2. Let
Ti be the time, starting in state i, required for the process to enter state i + 1,
where E[T0] = 1/l0 = 1/l for this problem. In general, we have the recursive
relationship
1 mi
E[Ti ] = + E[Ti -1 ]
li li
1 1 m Ê 1ˆ 2 m
E[time to go from 0 to 2] = E[T0] + E[T1] = + + = +
l l l Ë l ¯ l l2
b. The variance of the time until both are in the repair facility.
c. The proportion of time over the long run that a working board is available
To find the proportion of time that at least one working board is available, we
must find the steady-state probabilities, p 0P and p 1P . Using Eq. (22), we compute
1
p 0P = 2
1 + l / m + (l / m )
l P l/m
p 1P = p0 = 2
m 1 + l / m + (l / m )
1+ l / m
Thus, p 0P + p 1P = , which is the desired result.
1 + l / m + (l / m )2
Mathematics of Continuous-Time Markov Chains 24
14. Suppose in Exercise 13 that when both sound boards are down a second
repairperson is called in to work on the one that has most recently failed. Assume
that all repair times remain exponential with rate m. Now find the proportion of
time at least one board is operational, and compare your answer with that obtained
in the preceding exercise.
1
p 0P =
1 + l / m + l2 / 2 m 2
l P l/m
p 1P = p0 =
m 1 + l / m + l2 / 2 m 2
1+ l / m
Therefore, p 0P + p 1P = , indicating, as expected, that the
1 + l / m + (l / m )2 / 2
probability that at least one machine is working is higher with the second
repairperson.
Operations Research Models and Methods
by Paul A. Jensen and Jonathan F. Bard
John Wiley and Sons, Inc.
Copyright 2003 – All rights reserved
1. For each situation below, identify the type of queuing system described, the arrival
rate and the service rate. Use the relationships given in Sections 16.1 – 16.3 to
compute the system performance measures.
a. The time between arrivals of patients to a medical clinic has a normal distribu-
tion with a mean of 12 minutes and a standard deviation of 5 minutes. Three
doctors treat the patients. The treatment time is exponentially distributed with a
mean of 30 minutes. The secretary who has been collecting the relevant statistics
has found that the average time a patient must wait before being seen by a doctor
is 20 minutes.
For Exercise 1 we take the given data and use the results of Section 16.1 to
compute the various measures. The results do not agree with the model results
computed with the methods of sections 16.2 and later.
b. Cars arrive at a stop sign on a two-lane road at an average rate of 220 per hour.
The arrival process is Poisson (i.e., the time between arrivals has an exponential
distribution). The time it takes a car to clear the stop sign once it reaches the
front of one of the lanes also has an exponential distribution with a mean time of
10 sec. The average number of cars at the stop sign (either waiting in the queue
or preparing to cross) is 8.4.
c. The same situation as in part b except that whenever there are 6 cars at the
corner, any additional arriving traffic takes a convenient side street and bypasses
the stop sign.
d. An overseas airline counter has five open positions. The average time to check in
an international passenger is 8 minutes, and is normally distributed with a
standard deviation of 2 minutes. The time between arrivals has an exponential
distribution with a mean rate of 0.6 passengers per minute. The average number
of passengers either being served or waiting in line is 13.
e. Four robots have been installed in a work cell to manufacture parts. Each takes
exactly 4 minutes to make 1 part whose average demand is 50 per hour. The
time between orders for a part has an exponential distribution. The average
number of parts in the queue is 4.1.
Queuing Models 3
2. Three drive-in windows have been installed at a branch office of a bank. Besides the
spaces adjacent to the windows, there is room for three additional cars to wait.
Arriving cars balk when there is no waiting space available and so do not join the
queue. Work sampling has established the following percentages.
What type of queuing model would be appropriate for this system, and what
performance measures can you compute? Show the computations.
Based on the data we compute the following state probabilities. We also show
the numbers in the queue, service and system for each state.
State 0 1 2 3 4 5 6
The state probabilities for all the states except 3 come directly from the data. One
way to compute p3 is to subtract the sum of the others from 1.
Based on the state probabilities we can compute the expected numbers:
Lq = 0.65, Ls = 2.2, L = 2.85. The efficiency of the system is 0.733
Pr{all servers idle} = p0 = 0.1
Pr{no wait} = p0 + p1 + p2 = 0.45
Pr{wait} = 0.55
Pr{lost customer} = p6 = 0.5. This assumes that the rate of arrivals to the system
is independent of the state. Those arriving when the system is in state 6, do not
enter.
Queuing Models 5
3. A finite queue has three servers and two additional spaces for waiting customers.
There is an infinite input source, and the arrival rate to the system is 50/hour. When
arrivals find the queue full, they balk. The following steady-state probabilities have
been determined for the number in the system.
p0 = 0.05, p1 = 0.12, p2 = 0.23, p3 = 0.25, p4 = 0.20, p5 = 0.15.
4. Let p0, p1, p2, ... stand for the steady-state probabilities associated with a queuing
system. In general, pn is the probability that the system is in state n. In each case
below answer the questions in terms of these probabilities and any other symbols
needed. Also indicate what kind of queuing model fits the situation described with
respect to the 5-field notation. All terms introduced in your answer should be
explained; that is, you should explain how the calculations would be performed if
more data were available.
5. A multi-channel queuing system has four servers. The input source is infinite and
the average arrival rate is 3 customers per hour. The mean time required to complete
a service operation is 1 hour. Both arrival and service processes are Poisson. There
is no limit to the number in the queue.
a. What is the probability that more than P(1 or more) = 1-[P( none arrive) + P(only
one customer will arrive in a 15-minute one arrives)] = 0.173, where the number
period? of arrivals follows a Poisson distribution
with mean lt = 3/4
b. What is the probability that the next P( t < 1 hour) = 0.632
service operation will require less than
where the time for service follows an
1 hour?
Exponential distribution with mean 1.
c. What is the probability that each of the The service times are i.i.d random
next two service operations will require variables.
more than 30 minutes?
P(1 takes more than 30 min.) = 0.607
P(both take more 30 min.) = P(one takes
more than 30 min.)^2 = 0.6072 = 0.368
d. Say you are a customer in this system. Due to the memoryless property of the
You have waited for 1 hour in the exponential distribution, you would expect
queue and you have been in service for to wait an hour…the mean of the service
25 minutes. How long should you time.
expect to remain in the system before
completing service?
e. An individual customer arrives to the Before the new customer can enter
system and finds one other person in service, two customers must leave. When
the queue. If the queue discipline is all servers are busy the rate of departures
first-come-first-served, how long is 4m, so the average time between
should the customer expect to spend in
the system? departures is 1/4m. Once the customer
enters service, the expected time before it
is complete is 1/m.
E[system time] =1/4m + 1/4m + 1/m = 1.5
hrs.
f. Assuming that all servers remain busy, The departure process is a Poisson
what is the probability that exactly four process where the departure rate is 4m
customers will complete service in the
next hour? P(X = 4) = exp(-4mt) *[(4mt)^4]/4! = 0.195
g. Assuming that all servers remain busy, Expected number served = 4mt = 4*4 = 16
what is the expected number of
customers served in a 4-hour period?
Queuing Models 8
 P(i) = .863
i=0
fi 11-3 = 8 spots
W = 7.21 min.
e. Repeat part d with one more than the Efficiency = 0.625
minimum number of pumps. i =5
 P(i) = .87
i=0
fi 5-4 =1 spot
W = 3.64 min.
f. Analyze this system if the arrival rate is We analyze the M/M/4/8 system.
45 per hour and 4 pumps are used.
The throughput rate is 44.52 per hour,
Assume that only 4 cars can wait in the
queue. How many customers will be so 0.48 customers are lost per hour.
lost because of this limit?
g. Analyze the system described in part f We do not have analysis procedures
when the service time is normally for this case. It is possible to find the
distributed. This will make it more results through simulation.
uniform. Specifically, assume that the
average service time is still 3 minutes, With a simulation of 200 customers, no
but that the standard deviation is 1 balks were observed. This is not
minute. surprising with these parameters.
Queuing Models 10
10. A family with four children has a single bathroom. Each morning during a 1-hour
period before school, there is a congestion problem related to its use. The parents
minimize the problem by remaining in bed. While lying in bed, the mother, who is
studying queuing theory, makes the following observations. The requirement to use
the bathroom seems to be a random process. The time between the moment when
one child leaves the bathroom and the moment when the same child returns averages
15 minutes, but actually the time is a random variable with an exponential
distribution. All children are assumed to have the same bathroom needs and hence
the same arrival rate. The time spent in the bathroom in any one instance is also
exponentially distributed with a mean of 5 minutes.
A child arriving at the bathroom and finding it occupied will wait in a queue, all the
while taunting the person inside in a loud voice thus disturbing the parents.
11. Faculty members at Big State University must submit an annual report to their
department chairman showing their accomplishments during the previous year. The
reports are usually handwritten and must be retyped by a secretary in the format
required by the dean. During the late spring the reports arrive at the chairman's
office at an average rate of one per day; however, the actual arrival process is
Poisson. The time required to retype the information is about 1.5 days but, in fact, is
highly variable due to the professors' bad writing and different levels of
accomplishment. For purposes of analysis, assume this time is exponentially
distributed. In order to finish the reports promptly, two secretaries are assigned full
time for this job.
The associate chairman of the industrial engineering department is proposing a
different procedure that will require all professors to enter their data on printed
forms. The secretary will then enter the data into a personal computer. It is
estimated that this procedure will not change the arrival process, but the time to enter
the data into the computer and print out the report will now be normally distributed
with a mean of 2/3 days and a standard deviation of 1/3 days. Under this proposal
only one secretary will be required.
Compare the present method with the proposed method in terms of the utilization of
the secretaries and the mean interval between when the professor submits the report
and the time when the secretary finishes it.
System 1: System 2:
r = 0.75 r= 0.677
L = 3.428 days L= 1.5 days
For system 1, the secretaries are utilized 75% of the time, while for system 2, the
one secretary is busy 68% of the time. However, there is a big difference in the
expected amount of time from handing in the report to having it leave. Therefore
system 2 is preferable.
Queuing Models 14
12. A surveillance system requires three working radar to scan the horizon. When three
or more are up, the system is said to be in the “operational” mode. If only two are
working, it is in the “reduced effectiveness” mode. When fewer than two are
working, the system is in the “failed” mode. In order to maintain effectiveness five
radar have been installed, two of which are redundant if all are in good repair.
Each unit fails randomly and at the same average rate, once every 500 hours. When
a failure occurs, the unit is sent to a repair shop where one is worked on at a time. If
more than one has failed, the others must wait in a queue. The repair operation takes
an average of 40 hours but the actual repair time has an exponential distribution.
Compute the proportion of time that the system will be in each of the three modes.
13. A Broadway theatre box office receives telephone calls at the average rate of one
every 10 seconds. Each call takes an average of 3 minutes to complete. If an
operator is free, the call is taken immediately; otherwise it is placed on hold if a
holding line is available. Both the arrival and service processes are Poisson.
The theatre wishes to design the system so that the average time a customer is on
hold is no more than 1 minute and that no more than 1% of the calls are lost.
Determine the minimum number of operators and number of holding lines that are
required to satisfy this service standard.
The analyses below show several systems that meet the 1% restriction on
number of customers lost. The plans with 20 lines and 18 holding lines and 21
lines and 12 holding lines meet the one-minute average queue time restriction.
Some decision maker must choose select the best trade-off.
14. The schematic below represents an inspection area for finished products that arrive
at the average rate of 12 per hour according to a Poisson process. The mean
inspection time is 12 minutes and the variance is 360 min2.
Products randomly
enter 1 of 3 queues Station 1
l = 12/hr
Station 2 To warehouse
Station 3
a. Determine the expected waiting time for a product, the expected length of each
queue, and the expected number of products in the overall system.
b. Same as part a except for a variance of 36 min2.
c. Same as part a for M/D/1 model with a 12-minute inspection time. Does the variance
effect appear significant?
Results a b c
Waiting time ( Wq) 84.00 30.00 24.00
Length of each queue ( Lq) 5.60 2.00 1.60
Number at each station (L) 6.40 2.80 2.40
Number in system (3L) 19.20 8.40 7.20
Variability in the service process increases the queue lengths and residence
times.
Queuing Models 18
15. A power plant operating 24 hours each day has four identical turbine-generators,
each capable of producing 3 megawatts of power. The demand at any time is 6
megawatts, so that when all turbines are in working condition, one is kept on "warm-
standby," one on "cold-standby," and the other two in full operation. If one turbine
is down, then two are operating and one is on warm-standby. If two are down, both
working turbines are operating. If only one turbine is working, then the company
must purchase 3 megawatts of power from another source. If all turbines are down,
the company must purchase 6 megawatts.
If a turbine is in the operating mode, its mean time to failure is 3 weeks. If a
turbine is in warm-standby, its mean time to failure is 9 weeks. The company has
two technicians that can repair failed turbines but it only takes one technician to
effect a repair. On average, a repair can be done in one-half week. If a turbine is in
cold-standby, it cannot fail. (We assume all switchovers from warm standby to
working or cold standby to warm standby are instantaneous.) Assuming that all times
are exponentially distributed, determine the expected megawatt hours that must be
purchased each year. Hint: use the birth-death equations to determine steady-state
probabilities.
We analyzed this system with the Birth-Death model of the Stochastic Models
add-in. We used the Stochastic Analysis add-in to compute steady-state
probabilities. The steady-state probabilities as well as the average number of
MW purchased per week are shown in the table.
Average
0 1 2 3 4 MW
S_0 S_1 S_2 S_3 S_4 rate
Steady State (Time) 0.6765 0.2631 0.0512 0.0085 0.0007 0.0298
Queuing Models 19
16. Martha Stark, M.D., runs a family medical practice in the Washington DC suburbs.
Although she schedules patients every half hour she has noticed that many come a
bit late and a handful arrive much earlier than necessary. In the last few months, she
has also received several subtle complaints about the waiting time.
Having an undergraduate degree in statistics, Dr. Stark decided to collect data
on arrival and service times in an effort to characterize the corresponding
distributions. Using a Chi-square goodness-of-fit test she was able to confirm that
the interarrival times were exponentially distributed with a mean of 30 minutes.
Unfortunately, no closed form distributions provided a good fit for the time she
spends with patients diagnosing and treating their illnesses. The only thing that she
can say for sure is that the sample mean is 25 minutes and the sample standard
deviation is 15 minutes.
a. Assuming steady-state conditions, determine the amount of time a patient can
expect to wait before getting to see Dr. Stark, and the average number of patients
in the office at any time.
Using a single server model with Poisson arrival process and general service
process we compute:
Expected waiting time = 85 minutes
Expected # waiting = 2.83
b. Develop a simulation model that can be used to verify your results in part (a).
Run the model to determine the probability distribution for the number of
patients in the office. If the waiting room has 2 chairs, what is the probability
that an arriving patient will have to stand?
We constructed a queuing simulation with the Queue add-in and compare the
analytical with a simulation of 1000 patients. Data was taken for the first 480
minutes of the simulation.
Analytical Simulation
Mean Number at Station 3.67 3.10
Mean Time at Station 1.83 1.53
Mean Number in Queue 2.83 2.27
Mean Time in Queue 1.42 1.12
Mean Number in Service 0.83 0.83
Mean Time in Service 0.42 0.41
Efficiency 0.83 0.83
The simulation results are similar to the analytical ones. Of course the simulation
results will vary with the random number seeds and the time of the simulation.
To compute the probabilities in the waiting room (queue) we collected data from
the simulation regarding the number of seats used during the 480 minute period.
The following results were obtained.
Queuing Models 20
Number waiting 0 1 2 3
Time in 480 minutes 163.914 81.2808 54.7739 180.032
Probability 0.34149 0.16934 0.11411 0.37507
Quite often patients are standing. In fact the simulation had as many as 12
patients waiting.
Queuing Models 21
17. Simulate an M/M/1/4 queuing system with a mean arrival rate of 8 customers per
hour and mean service rate of 6 per hour, either by hand or better, by using a
spreadsheet program like Excel. Run the simulation for the equivalent of about 10
hours. Start with the system empty and organize the results in a table. A separate
random number must be used to generate each event.
b. Discard the output from the first hour. Now, using the output from the remaining
9 hours, calculate the following steady-state measures; L, Lq, W, Wq, p0, p4.
c. Calculate the same measures listed in part b using the formulas in Fig. 7.
Compare the two sets of results.
–1
X= ln(1 – R).
l
Now, using a uniform random number generator, find a value Ri, and plug it into the
above expression to obtain the corresponding realization Xi for i = 1,2,...
Alternatively, a value of Ri can be obtained from a published table of uniform
random numbers. For this application, it will be necessary to map each random
number into [0, 1] if it is generated over some other range.
We constructed the simulation using the Queue Simulation option of the Queue
add-in.
For these results: arrival seed = 1 and service seed = 10.
First 2 hours
enter service 13
arrivals 18
balks 5
a.
Number of arrivals in first 120 minutes = 18
Number of items entering service = 13
Number of balks = 5
Queuing Models 22
b. We ran the simulation for 100 arrivals but accumulated results only between
60 and 600 minutes, a nine hour period. The results are shown below.
Queueing Simulaton
Next Event-Dynamic
18. Simulate a GI/G/1/4 system for 10 hours. Let the interarrival times and service
times have continuous uniform distributions between 0 and 15 minutes and 0 and 20
minutes, respectively, and assume that the system starts empty.
b. Discard the output from the first hour. Now, using the output from the remaining
9 hours, calculate the following steady-state measures; L, Lq, W, Wq, p0, p4.
c. Compare the results in part b with those obtained in part b of the previous
exercise.
We constructed the simulation using the Queue Simulation option of the Queue
add-in.
For these results: arrival seed = 1 and service seed = 10.
a.
Number of arrivals in first 240 minutes = 17
Number of items entering service = 15
Number of balks = 2
Queuing Models 24
b.
c. Comparing results of Exponential (E17) and Uniform with less variability (E18)
The number and time in queue and the proportion who balk are much greater for
E17 than E18.
Queuing Models 25
Queueing Simulaton
Next Event-Dynamic
Queue Station SimQ_17 SimQ_18
Arrival Distribution TBA1 TBA2
Service Distribution TFS1 TFS2
Number of Servers 1 1
Max. Number in System 4 4
Type G/G/1/4 G/G/1/4
Arrival Seed 1 1
Service Seed 10 10
Number in Simulation 100 100
Start Data Time 60 60
Stop Data Time 600 600 Difference
Mean Number at Station 3.26435614 2.87200351 0.39235263
Mean Time at Station 60.7845626 30.409449 30.3751136
Mean Number in Queue 2.27567316 1.87517547 0.40049769
Mean Time in Queue 42.3746036 19.8547991 22.5198045
Mean Number in Service 0.98868298 0.99682805 -0.0081451
Mean Time in Service 18.409959 10.5546499 7.85530909
Arrival Rate 0.13148148 0.12962963 0.00185185
Throughput Rate 0.0537037 0.09444444 -0.0407407
Efficiency 0.98868298 0.99682805 -0.0081451
Probability Balk 0.5915493 0.27142857 0.32012072
Operations Research Models and Methods
by Paul A. Jensen and Jonathan F. Bard
John Wiley and Sons, Inc.
Copyright 2003 – All rights reserved
a. b.
The mean number in system queues is The mean number in system queues is
11.25. reduced to 5.625.
Queueing Network P_1a
Arrival Rate 3 Queueing Network P_1b
Arrival Rate 3
Type Serial
Mean Number in System 15 COV of Interarrival times 1
Mean Time in System 5
Mean Number in System Queues 11.25
Mean Time in System Queues 3.75 COV of departure times 0.66143783
Type Serial
Mean Number in System 9.375
Mean Time in System 3.125
Mean Number in System Queues 5.625
Mean Time in System Queues 1.875
Note that the COV of the arrivals at
each station was set to 1 for this
analysis.
Queuing Networks and Decision Models 2
2. An alternative to the assembly line in the preceding exercise is a single machine that
performs all five operations. The machine can work on only one unit at a time so all
five operations must be completed before processing can begin on the next unit.
What is the average queue length, average number of units in the system, average
waiting time in the queue, and average waiting time in the system for each case
below?
a. Assume that the time to perform each operation has an exponential distribution
with a mean time of 3 minutes.
Note that this option has quite a bit less time spent in production. Problem 1 has
a total processing time of 1.25 hours, while problem 2 has a total processing time
of 0.25 hours. The systems are really not comparable.
b. Assume that the time to perform each operation has a constant value of 3
minutes.
Queuing Networks and Decision Models 3
3. For the computer center example in Section 17.2, determine the minimum number of
channels required at each station when the arrival rate is increased to 15 per min.
a. Display the results for this situation in a table similar to the one used in the text.
b. Add a channel to the station that would most reduce the average time spent by a
job passing through all three stations.
4. For the job shop example in Section 17.2, show the effect of adding an additional
channel for station B. Redo the two tables for the revised system.
Table 4
Job Shop Example
Queue Station A B C D E F
Independent Arrival Rate 60 0 0 0 0 0
Arrival Rate 60 40 20 30 30 60
Service Rate/Channel 25 22 29 11 23 20
Number of Servers 3 3 1 3 2 4
Type M/M/3 M/M/3 M/M/1 M/M/3 M/M/2 M/M/4
Mean Number at Station 4.98876 2.37595 2.22222 11.0591 2.26974 4.5283
Mean Time at Station 0.08315 0.0594 0.11111 0.36864 0.07566 0.07547
Mean Number in Queue 2.58876 0.55777 1.53257 8.33179 0.96539 1.5283
Mean Time in Queue 0.04315 0.01394 0.07663 0.27773 0.03218 0.02547
Efficiency 0.8 0.60606 0.68966 0.90909 0.65217 0.75
Table 5
Order rate Lead Queue WIP
Product (per mo.) Route time (mo.) time (mo.) (units)
5. For the job shop example in Section 17.2, change the order rate of product 2 to 20
per month. If necessary add additional channels to the stations to allow a steady-
state solution. Compute the steady-state performance measures and display them in
tables similar to those used in the text. Identify the bottleneck station.
Table 4
Job Shop Example
Queue Station A B C D E F
Independent Arrival Rate 70 0 0 0 0 0
Arrival Rate 70 50 20 30 40 70
Service Rate/Channel 25 22 29 11 23 20
Number of Servers 3 3 1 3 2 4
Type M/M/3 M/M/3 M/M/1 M/M/3 M/M/2 M/M/4
Mean Number at Station 15.0735 4.08379 2.22222 11.0591 7.13178 8.66503
Mean Time at Station 0.21534 0.08168 0.11111 0.36864 0.17829 0.12379
Mean Number in Queue 12.2735 1.81106 1.53257 8.33179 5.39265 5.16503
Mean Time in Queue 0.17534 0.03622 0.07663 0.27773 0.13482 0.07379
Efficiency 0.93333 0.75758 0.68966 0.90909 0.86957 0.875
Table 5
Order rate Lead Queue WIP
Product (per mo.) Route time (mo.) time (mo.) (units)
1 30 ABDF 0.78943 0.6241 23.683
2 20 ABEF 0.59909 0.42016 11.9818
3 20 ACEF 0.62853 0.46057 12.5705
Evidently station A is the bottleneck. It has the greatest utilization (efficiency).
Queuing Networks and Decision Models 7
6. For the location example in Section 17.6, find the cost of a single facility placed at
the center of the manufacturing plant.
The location we are considering for the facility is at point D in the figure. The total
flow into the facility is 110 per hour. The expected travel cost from each side is
the same since the facility is located in the center. Relative to the left region we
have a = 500, b = 250, c = 0, d = 250.
1 Èa2 + c2 b2 + d2˘
E[T] = v Î a + c + b+ d ˚ = (1/10000)(750) = 0.075 hours
1000'
500'
D
500'
The queuing analysis for 4, 5 and 6 servers using the arrival rate of 110 and
service rate of 40 yields.
Queue Station A_4 A_5 A_6
Arrival Rate 110 110 110
Service Rate/Channel 40 40 40
Number of Servers 4 5 6
Max. Number in System * * * * * * * * *
Number in Population * * * * * * * * *
Type M/M/4 M/M/5 M/M/6
Mean Number at Station 3.65083337 2.9684851 2.8093915
The economic analysis using the parameters in the chapter gives following table.
Servers 4 5 6
Facilty Cost E[SC] 40 47.5 55 per hour
Waiting Cost E[WC] 73.02 59.37 56.19 per hour
Travel Cost E[TV] 165 165 165 per hour
Total Cost 278.02 271.87 276.19 per hour
The best design uses 5 stations. The cost is smaller than both the alternatives
given in the chapter.
Queuing Networks and Decision Models 8
7. Two operations are required to repair a roof: first the old roof must be removed and
then the new one must be installed. The time between the beginning of the removal
of the old roof and the completion of the installation of the new one is important
because the interior of the house may be damaged if it rains during this period.
Customers call at random to a roofing contractor at an average rate of 12 per
month (4 weeks). It takes on average 0.5 weeks to remove a roof and 1 week to
install a new one. Both times are exponentially distributed. The contractor has two
kinds of crews, a removal crew and an installation crew. When an order arrives, the
customer must wait until a removal crew is available. After the roof is removed, the
customer enters a queue to wait for an installation crew to become available.
a. Model this situation as a queuing network and draw the corresponding diagram.
Show relevant arrival and service rates for each station. Compute the minimum
number of crews required for the two operations.
l = 12 Remove
l = 12 Install
m =8 m =4
b. Compute the average danger period using the minimum number of crews. The
danger period is the time between the moment when the removal crew begins to
remove the roof and the moment when the installation crew completes the
installation of the new roof.
8. Two alternative designs are being considered for the service facility of a finite
queuing system. Alternative A has a single server and alternative B has two servers.
The cost of the service facility has two components: a fixed cost of $50,000 per year
which is independent of the number of servers, and a variable cost of $30,000 per
server per year which is proportional to the number of servers. Simulation analysis
has determined the following steady-state probability distributions for the number of
customers in the system.
Design A Design B
n 0 1 2 3 4 n 0 1 2 3 4
pn 0.12 0.25 0.38 0.15 0.10 pn 0.38 0.30 0.21 0.06 0.05
In addition, the simulation has determined that 10% of the customers balk
with design A while 5% balk with design B. The arrival rate to the system
(including balks) is 1500 customers per year.
Management estimates that a customer who balks costs the company $100 in
lost profits. The cost of persons waiting in the system is $20 per hour (for each
customer in the system). Determine which design alternative minimizes the total
expected cost. Assume that a year has 2000 hours.
Based on the probabilities and parameters given we make the following analysis.
System B is the less expensive. The top analysis assumes the waiting cost is
expended for customers either in service or in the queue. The bottom analysis
charges the waiting cost only for those in the queue. In both cases System B is
the least expensive.
System Information A B
Number servers 1 2
Expected number in system 1.86 1.1
Expected number in queue 0.98 0.16
System flow rate(/yr) 1350 1425
System flow rate(/hr) 0.675 0.7125
Expected Time in System 2.75555556 1.54385965
System balk rate(/yr) 150 75
System balk rate(/hr) 0.075 0.0375
Costs per hour
Fixed Cost $ 25.00 $ 25.00
Variable Cost $ 15.00 $ 30.00
Balking cost $ 7.50 $ 3.75
Waiting Cost $ 37.20 $ 22.00
Total Cost per hour $ 84.70 $ 80.75
Assuming waiting time is queue time
Waiting Cost $ 19.60 $ 3.20
Total Cost per hour $ 67.10 $ 61.95
Queuing Networks and Decision Models 11
8
4
B C
4
A
D E
8
Calls for pizza arrive at random at an average rate of 20 per hour and are distributed
uniformly throughout the entire city. When a call is received, the pizza is prepared
and then delivered to the customer by a driver. The preparation time is constant and
independent of the location of the order. Since it will not affect the location decision,
we consider only the delivery process which is assumed to be Poisson.
The time for delivery is the round-trip time from the shop to the customer.
Assume that all travel is rectilinear with respect to the orientation of the city
boundaries, and that the average speed of travel is 20 miles per hour.
a. Compute the average travel time from the given geometry for both alternatives.
The delivery process is a queuing system because orders must wait for the
availability of a driver.
b. There is a fixed cost of $15,000 per year of establishing a shop. The cost of
hiring a driver and providing a delivery vehicle is also $15,000 per year.
Determine which of the two alternatives is better. The solution must specify the
location of the shops and the number of drivers to hire for each location. To
account for service quality, assign a cost of $20 per hour for the time required for
a customer to receive his pizza. Since this cost is linear with time, the fixed
preparation time can be neglected in the total cost computation. Assume that
there are 2000 hours in a year.
Queuing Networks and Decision Models 12
b. The queuing analysis for the Pizza shops are shown below. Each analysis is
for one shop. In the case of option 1, it is a single shop at A handling the entire
load. For option 2, the shop analyzed is one of the four. Note that the service rate
of the options is the inverse of the expected travel time. In the case of option 1,
this causes quite a penalty in terms of number waiting for delivery. The number
of servers used in each case, minimizes the total cost of the shops. This is two
drivers more than the minimum for option 1, while the minimum number is used
for option 2.
Pizza Shop Option 1 Option 2
Arrival Rate 20 5
Service Rate/driver 2.5 5
Number of drivers 11 2
Max. Number in System *** ***
Number in Population *** ***
Type M/M/11 M/M/2
Mean Number at Station 8.65322113 1.333333373
The cost analysis shows that option 2 is the least costly.
Cost Analysis
Cw (cost of waiting) $ 20.00 $ 20.00 $ per hour
Ct(cost of travel) $ - $ - $ per hour
Cf (fixed cost of service) $ 15,000.00 $ 15,000.00 per year
Cv (variable cost of service) $ 15,000.00 $ 15,000.00 per year
Hours per year 2000 2000
Servers 11 2
Facilty Cost E[SC] $ 90.00 $ 22.50 per hour
Waiting Cost E[WC] $ 173.06 $ 26.67 per hour
Travel Cost E[TV] $ - $ - per hour
Total Cost/shop $ 263.06 $ 49.17 per hour
Number of shops 1 4
Total Cost all shops $ 263.06 $ 196.67 per hour
Queuing Networks and Decision Models 13
10. A blood bank has two kinds of customers, those that donate their blood and those
that sell it. Donors arrive at the blood bank at an average rate of 6 per hour while
sellers arrive at an average rate of 10 per hour. Both arrival processes are random
and independent. There are two receptionists for the two types of customers due to
the need to fill out different forms. The “donation” receptionist can handle an
average of 10 customers per hour, and the “selling” receptionist can handle an
average of 15 customers per hour. The service times for both receptionists are
exponentially distributed.
After filling out the forms both types of customers go to the blood-donation room
and lie on tables where the required amount of blood is drawn. Because of the
different reactions experienced, the time a person spends on the table is
exponentially distributed with a mean of 10 minutes. A sufficient number of tables
is available to handle the total load of the two types of customers without the queue
becoming infinitely large.
a. Draw a diagram that represents this situation showing all relevant queuing
system parameters. What is the minimum number of tables required?
b. What is the average time required for a person to finish the blood-donation
process? Counting begins after processing by the receptionist and includes the
time waiting for a table and the time for giving blood.
c. Both types of customers share a single waiting room when they are not being
processed. What is the average number of persons using the waiting room?
d. What is the probability that the waiting room is empty?
a. Diagram
Donation
l =6
Receptionist
m = 10
Blood Donation
Room
m =6
l = 10 Selling
Receptionist
m = 15
b. Since all the processes are Poisson, we can analyze the network as a
Jackson network. The analysis from the Queue add-in yields the results below.
Queuing Networks and Decision Models 14
11. (Typing Pool Model) Suppose that documents to be typed at an office arrive at the
rate 100 per day and secretaries can type at the rate 50 documents per secretary per
day. Assume both processes are Poisson. Each secretary earns $80 per day and the
cost of holding documents in the system is estimated at $25 per document per day.
a. Let Cs be the cost per secretary per day, Cw the cost of waiting per day, s the
number of secretaries, L the expected number in the system, and z the expected
total cost. Write the expected total cost equation for z using this notation. Find
the optimal number of secretaries, s*, that minimizes the expected total cost per
day if each works with his or her own queue. Make use of the fact that
=ls
Arrival rate to one server : l©
l©
r m l
Number at server : L( s) = = =
1 - r 1 - l© sm - l
m
Cost of system : z( s) = s[Cs + Cw L( s)]
sl l
z( s) = sCs + Cw = sCs + Cw
sm - l m-l s
The analysis for 2 through 4 secretaries is below. The system is unstable with 2
secretaries. Three secretaries are cheaper than 4.
Secretaries divide work 2 3 4
Queue Station E_11a_1 E_11a_2 E_11a_3
Arrival Rate 50 33.3333333 25
Service Rate/Channel 50 50 50
Number of Servers 1 1 1
Max. Number in System * * * * * * * * *
Number in Population * * * * * * * * *
Type M/M/1 M/M/1 M/M/1
Mean Number at Station #NUM! 1.99999964 1
Cost per secretary #NUM! $ 130 $ 105
Cost for system #NUM! $ 390 $ 420
b. Suppose that secretaries are to be combined into a typing pool with one queue.
Determine the optimal number of secretaries and the associated cost by
enumeration; that is, by evaluating the total cost equation for s = 1, 2, 3, . . .
Queuing Networks and Decision Models 16
c. Let L(s*) be the expected number in the system in steady state with s* secretaries,
and z(s*) the expected minimum total cost. Show that
Using the condition that the cost for one more than the optimum number of
servers is greater than the cost for the optimum number of servers, we find:
z( s*) £ z( s * +1)
Css * +Cw L( s*) £ Cs ( s * +1) + Cw L( s * +1)
Cw [ L( s*) - L( s * +1)] £ Cs
L( s*) - L( s * +1) £ Cs C
w
Using the condition that the cost for the optimum number of servers is less than
the cost for one less than the optimum number of servers, we find:
z( s*) £ z( s * -1)
Css * +Cw L( s*) £ Cs ( s * -1) + Cw L( s * -1)
Cw [ L( s*) - L( s * -1)] £ -Cs
L( s*) - L( s * -1) ≥ Cs C
w
Combining the two expressions we find the desired relationship.
d. Is it better to pool the secretaries? Any reservations about the validity of the
analysis?
Queuing Networks and Decision Models 17
The pooled arrangement is less expensive than the arrangement with individual
queues. It is always more efficient to work from a single queue than independent
queues. With independent queues, a server may be idle even when customers
wait in some other server’s queue.
Queuing Networks and Decision Models 18
12. Given the schematic in Exercise 16.14, determine the optimal number of inspection
stations if each station costs $10 per hour to operate and the cost of holding each
product in the system is $2 per hour.
Products randomly
enter 1 of 3 queues Station 1
l = 12/hr
Station 2 To warehouse
Station 3
Cs = 10 /hour
Cw = 2 /hour
System Arrival rate 12 /hour
Service rate 5 /hour
Inspection stations 3 4 5
Queue Station E_12_1 E_12_2 E_12_3
Arrival Rate 4 3 2.4
Service Rate/Channel 5 5 5
Number of Servers 1 1 1
COV of interarrival times 1 1 1
COV of service times 1.58113883 1.58113883 1.58113883
COV of departures 1.40000002 1.24096739 1.16000002
Type M/G/1 M/G/1 M/G/1
Mean Number at Station 6.40000064 2.17500024 1.25538475
Cost 68.4000038 57.4000019 62.5538475
Queuing Networks and Decision Models 19
Cs = 1000 / d a y
Cw = 50000 / d a y
Arrival rate/individual 0.07142857 / d a y
Service rate/ server 1 /day
Queue Station E_13_1 E_13_2 E_13_3 E_13_4 E_13_5
Entity Arrival Rate 0.07142857 0.07142857 0.07142857 0.071428571 0.07142857
Service Rate/Channel 1 1 1 1 1
Number of Servers 1 2 3 4 5
Max. Number in System * * * * * * * * * * * * * * *
Number in Population 5 5 5 5 5
Type M/M/1/5/5 M/M/2/5/5 M/M/3/5/5 M/M/4/5/5 M/M/5/5/5
Mean Number at Station 0.431 0.337 0.333 0.333 0.333
Cost 22572 18874 19673 20667 21667
Queuing Networks and Decision Models 20
14. (Airline Reservation System) Bonzi airlines has four telephone lines at their
reservation desk. During the late shift, incoming phone calls arrive every 6 minutes
on average according to a Poisson process. The time to service a caller is
exponential with a mean of 5 minutes. If a call comes in and all operators are busy,
then it is placed on hold, providing a line is available. Otherwise, the caller receives
a busy signal. Callers encountering a busy signal are assumed to place reservations
elsewhere. It is further assumed that calls on hold never renege.
We analyze this system with a Poisson model with a finite queue. The maximum
number in the system is 4 and the number of servers can vary from 1 to 4. The
results of the model for the 4 options are shown in the table. We want the
smallest number of operators so that the probability that the system is full (the
next to last row) is less than 0.1. That number is two operators.
MTBA 6
MTFS 5
Queue Station E_14a_1 E_14a_2 E_14a_3 E_14a_4
Arrival Rate 0.16666667 0.16666667 0.16666667 0.16666667
Service Rate/Channel 0.2 0.2 0.2 0.2
Number of Servers 1 2 3 4
Max. Number in System 4 4 4 4
Number in Population * * * * * * * * * * * *
Type M/M/1/4 M/M/2/4 M/M/3/4 M/M/4/4
Mean Number at Station 1.64050746 0.92346263 0.83527154 0.82604378
Mean Time at Station 11.371088 5.68442011 5.07059765 5
Mean Number in Queue 0.91915716 0.11118749 0.01162942 0
Mean Time in Queue 6.37108797 0.68442014 0.07059753 0
Mean Number in Service 0.72135025 0.81227511 0.82364213 0.82604378
Mean Time in Service 5 5 5 5
Throughput Rate 0.14427005 0.16245502 0.16472843 0.16520876
Probability full 0.13437971 0.02526988 0.01162942 0.0087475
Efficiency 0.72135025 0.40613756 0.27454737 0.20651095
Again we model the system as a finite queue. In this part we vary the maximum
number in the system. This is the number of operators plus the number of
holding lines. As we increase the maximum number, the first value that results in
the probability of being full less than 0.1 is 6. Then with one operator, we need 5
holding lines.
Queuing Networks and Decision Models 21
c. Discuss the tradeoffs between the two types of decisions indicated in parts a and
b. Specifically, determine the total cost per hour for each of these cases if $20
per hour is the cost of an operator, $2 per hour is the cost of an additional phone
line, $25 is the cost of a rejected call, and $10 per hour per call in the system is
the cost of waiting.
The cost model is involves the number of operators s and the number of holding
lines N.
z(s, N)= 20s +2N +25(arrival rate – throughput rate) +10L per hour
z(s, N)= 0.333s +0.033N +25(arrival rate – throughput rate) +0.167L per minute
We used the latter formula since our queuing analysis was per minute.
We compute the cost of the best alternative of 14a as $1.06 per minute. The best
option of 14b has the cost $1.24 per minute. With these parameters, the option
with 2 operators and 2 holding lines is best.
d. Describe how the optimal joint decision for s and K could be determined.
15. Consider the following tandem queuing system for a product that requires two steps
to assemble.
Station 2
m = 20/hr
Station 1 Station 3
l = 50/hr
m = 60/hr m = 20/hr
Station 4
m = 20/hr
Given that the assumptions for the standard M/M/s model are satisfied, determine the
mean length of each queue and the expected time a product spends on the assembly
line. Assume stations 2, 3 and 4 form an M/M/3 system.
The stations form a serial system of two stations (stations 2, 3 and 4 are
combined into one). This is a simple serial Jackson network. The results fro the
individual stations are shown at the left. The combined network results are on the
right. The mean length of the queue for station 1 is 4.1667 and the mean length
of the queue for the combined station 2 is 3.5112. The expected time in the
system is 0.2202 hours.
Queue Station E_15_1 E_15_2 Queueing Network E_15
Arrival Rate 50 50 Arrival Rate 50
Service Rate/Channel 60 20
Number of Servers 1 3
Type M/M/1 M/M/3 Type Serial
Mean Number at Station 5 6.0112 Mean Number in System 11.011
Mean Time at Station 0.1 0.1202 Mean Time in System 0.2202
Mean Number in Queue 4.1667 3.5112 Mean Number in System Queues 7.6779
Mean Time in Queue 0.0833 0.0702 Mean Time in System Queues 0.1536
Mean Number in Service 0.8333 2.5 Mean Number in System Service 3.3333
Mean Time in Service 0.0167 0.05 Mean Time in System Service 0.0667
Efficiency 0.8333 0.8333
Queuing Networks and Decision Models 23
16. (State Unemployment Compensation) A state agency that handles compensation for
those who are unemployed is considering two options for processing applications.
Option 1: Four clerks process applications in parallel from a single queue. Each
clerk fills out the required form in the presence of the applicant based on
information that is verbally related to the clerk. Processing time is
exponential with mean a 45 of minutes.
Option 2: Each applicant first fills out the form without the help of the clerk. The
time to accomplish this is exponential with mean 65 minutes. When the
applicant finishes, he or she joins a single queue to await a review by one
of the four clerks. The time to review a form is exponential with a mean 5
of minutes.
Given that the arrival of applicants is Poisson with a mean rate of 4.8 per hour,
compare the two options with respect to expected number of applicants in the system
and expected time in the system.
Option 1 describes an M/M/4 queuing system with l = 4.8 and m = 4/3 per hour.
The analysis results show that the average number of applicants in the system is
10.7 and the expected time in the system is 2.23 hours. Of that time 1.48 hours is
spent waiting in the queue.
Queue Station Option 1
Arrival Rate 4.8
Service Rate/Channel 1.33333
Number of Servers 4
Max. Number in System * * *
Number in Population * * *
Type M/M/4
Mean Number at Station 10.6898
Mean Time at Station 2.22704
Mean Number in Queue 7.08978
Mean Time in Queue 1.47704
Mean Number in Service 3.6
Mean Time in Service 0.75
Efficiency 0.9
Option 2 describes a fixed time operation that is 65 minutes or 10.833 hours. The
first step is not a queue since the applicants serve themselves. The average
number in the system in this step is determined by Little’s Law.
L = lW = 4.8*1.0833 = 5.2
The second stap of option 2 is an M/M/4 queuing system with l = 4.8 and m =
60/5 or 12 per hour. The time contributed by this step is 0.834 and the number is
0.400.
Queuing Networks and Decision Models 24
The total time and number for the second option is much less than the first.
The efficiency of the clerks is very low for this option because they have little to
do. The system could probably get by with fewer clerks. There is an advantage to
this option that there is very little queue time. Applicants are busy filling out their
own forms instead of just waiting. That is probably the more acceptable option,
especially since it results in a smaller overall time in the system.
Queue Station Option 2 System
Arrival Rate 4.8 Time in first step 1.0833
Service Rate/Channel 12 Time in second step 0.0834
Number of Servers 4 Total Time 1.1667
Max. Number in System * * *
Number in Population * * * Number in first step 5.2
Type M/M/4 Number in second step 0.4001
Mean Number at Station 0.40009 Total Number in system 5.6001
Mean Time at Station 0.08335
Mean Number in Queue 8.8E-05
Mean Time in Queue 1.8E-05
Mean Number in Service 0.4
Mean Time in Service 0.08333
Efficiency 0.1
Queuing Networks and Decision Models 25
17. The simplest type of queuing network is an M/M/1 system with Bernoulli feedback.
Answer the following questions for the system sketched below.
20 %
g = 15/hr m = 20 / hr
80%
The first step is to determine the net input to the system, call it l, with Eq. (2).
l = g + 0.2l = 15 + 0.2l l = 18.75
Thus, the traffic intensity, r = l/m = 0.9375. The probability that the system is
empty is p0 = 1 – r = 0.0625.
L = r / (1 – r) = 0.9375 / 0.0625 = 15
c. What is the probability that a customer will pass through the server exactly twice?
d. What is the expected number of times that a customer will pass through the
server?
We know Pr{1 pass} = 0.8, Pr{2 passes} = 0.2 ¥ 0.8 = 0.16, and in general, the
Pr{n passes} = 0.8 ¥ 0.2n–1. Note that this is a geometric distribution.
Queuing Networks and Decision Models 26
•
E[number of passes] = 0.8 Â n(0.2) n -1
= 0.8(1 – 0.2)–2 = 1/0.8 = 1.25
n =1
e. What is the expected amount of time that a customer will spend in the system?
For an arrival rate l, Little’s formula gives the expected time spent in the system
per pass through the system.
Wperpass = L / l = 15/18.75 = 0.8 hour = 48 minutes
Windividual = Wperpass ¥ E[number of passes] = 48 ¥ 1.25 = 60 minutes
As an alternative, it is possible to estimate the time in the system with Little’s
formula using g, the arrival rate to the system, instead of l.
18. Consider the queuing network in the diagram below. The first node is an M/M/1
system and the second is an M/M/2 system. Answer the following questions.
Node 1 Node 2
20 %
g1 = 12/hr
m1= 20/hr m2 = 20/hr
80%
g2 = 10/hr
The first thing to do is to determine the effective arrival rates to each node.
Using Eq. (2), we have
l1 = 12 + 0.2l2
l2 = 10 + l1
giving l1 = 17.5 and l2 = 27.5.
Also, r1 = l1/m1 = 0.875 and r2 = l2/2m2 = 0.6875.
Because we have a Jackson network, each node can be analyzed separately.
Thus, Pr{N1 = 0} = p0 = 1 – r1 = 1 – 0.875 = 0.125
First we must calculate the probability that the second node is empty. Using the
equation on page 561 to compute p0 for a M/M/2 system, we get
-1 -1
È (2 r2 )2 ˘ È1 + r 2 ˘ 1 - r2 0.3125
p 0 = Í1 + 2 r2 + ˙ =Í ˙ = = = 0.185
Î 2!(1 - r2 ) ˚ Î1 - r 2 ˚ 1 + r2 1.6875
Thus, Pr{Nsystem = 0} = Pr{N1 = 0} ¥ Pr{N2 = 0}= 0.125 ¥ 0.185 = 0.023
c. What is the probability that there is exactly one job in the queue at node 1?
Queuing Networks and Decision Models 28
We must compute the probability that there are two jobs in the system. Using the
equation in Figure 16.4 for an M/M/1 system, we get
p2 = r22p0 = 0.8752 ¥ 0.125 = 0.0957
d. What is the probability that there is exactly one job within the network?
We must consider the possibility that the job is at either of the two nodes.
Pr{Nsystem = 1} = Pr{N1 = 1} ¥ Pr{N2 = 0} + Pr{N1 = 0} ¥ Pr{N2 = 1}
= p1(M/M/1) ¥ 0.185 + 0.125 ¥ p1(M/M/2)
= 0.1094 ¥ 0.185 + 0.125 ¥ 0.255
= 0.052
r1 2 2 r23p 0 r1 r2
Lsystem = L1 + L 2 = + 2 r2 + 2
= +
1 - r1 2!(1 - r2 ) 1 - r1 1 - r22
0.875 2(0.6875) 1.375
= + 2
= 7+ = 7 + 2.61 = 9.61
0.125 1 - 0.6875 0.5273
f. What is the expected flow time through the system for an arbitrarily selected
job? (Answer this question two different ways; first using Property 3, then
using Little's law.)
È 0 1˘ È1.25 1.25˘
Now, the switching probability matrix F = Í ˙ and W = Í0.25 1.25˙ .
Î0.2 0 ˚ Î ˚
Queuing Networks and Decision Models 29
Using this information, we can calculate the mean flow time through the system
with Eq. (3).
E[Tnet] = W1vW We1 + W2vWWe2
È1.25 1.25˘ Ê 1ˆ È1.25 1.25˘ Ê 0ˆ
= 0.4(0.545, 0.455) Í ˙ Á ˜ + 0.095(0.545, 0.455) Í0.25 1.25˙ ÁË 1˜¯
Î0.25 1.25˚ Ë 0¯ Î ˚
= 0.318 + 0.119 = 0.437 hour
Note that E[Tnet] = Wsystem
g. What is the expected flow time through the system for a job that starts at node
1? Can Little's law be used for this?
To solve this problem, we set the initial probability vector v = (1, 0), and uses the
same data computed in part (f) with Eq. (3)
E[Tnet] = W1vW We1 + W2vWWe2
È1.25 1.25˘ Ê 1ˆ È1.25 1.25˘ Ê 0ˆ
= 0.4(1, 0) Í ˙ Á ˜ + 0.095(1,0) Í ˙Á ˜
Î0.25 1.25˚ Ë 0¯ Î0.25 1.25˚ Ë 1¯
= 0.5 + 0.11875 @ 0.619 hour
Little’s law cannot be used in this example because we are addressing a specific
situation, i.e., a job starting at node 1, rather than a steady-state situation that
applies to all jobs.
h. A cost of $100/hr is associated with each job within the system. A proposal
has been made that a third node could be added after the second. The third
node would be an M/M/s system and would eliminate the existing feedback.
Each server added to the third node would operate at a rate of 20/hr and cost
$200/hr. Is the third node worthwhile? If so, how many servers should it
contain?
The average number of jobs in the system is 9.61 so the current cost is $961/hr.
The first consideration is the minimum number of servers necessary to handle
the arrivals to node 3. The flow rate into node 3 will be 22/hr so to ensure that
the traffic intensity r3 < 1, at least 2 servers will be required.
Queuing Networks and Decision Models 30
Let us compute the cost of operating the serial system with 2 servers at node
3. The data are r1 = 12/20 = 0.6, r2 = 22/40 = 0.55, and r3 = 22/40 = 0.55. The
expected number of jobs at each node is
L1 = r1/(1 – r1) = 12/8 = 1.5
L2 = 2r2/(1 – r22) = 1.1/(1 – 0.3025) = 1.1/0.6975 = 1.577
L2 = 2r3/(1 – r32) = 1.577
Therefore, Lsystem = 4.65 so the total cost is $465 + $400 = $865 which is lower
than the current cost. If we add a third server to node 3, a lower bound on the
total cost taking into account the average number at nodes 1 and 2 only, is $600
+ $100 (1.5 + 1.577) = $937.7. Thus there is no benefit to adding a third server;
two servers at node 3 are optimal.
Queuing Networks and Decision Models 31
19. Patients arrive at a hospital emergency room according to a Poisson process with a
mean rate of 24 per hour. Twenty percent of them first go to the receptionist to fill
out paperwork, 60% are seen by a doctor immediately, and the rest go directly to
surgery. After finishing with the receptionist, 75% are sent to a doctor, 20% to
surgery, and 5% to another facility within the hospital for treatment. After seeing a
doctor, 90% of the patients leave the hospital and the rest go into surgery for a minor
operation (patients suffering major injuries are sent to the operating room in the
hospital). When the surgery is finished the patient leaves the hospital.
The one receptionist takes an exponential amount of time to gather the necessary
information, averaging 5 patients per minute (*** should be “five minutes per
patient” ***). The noncritical patients are seen by one of three doctors, each with an
exponential service time with mean 6 minutes. Two surgeons are available to
perform minor operations. Each can treat 5 patients per hour on average but the
actual time is exponentially distributed. Assuming that the underlying system can be
modeled as a Jackson network, respond to the following.
The emergency room can be modeled with three nodes. The first is associated
with the receptionist and is an M/M/1 queue with parameters g1 = 4.8/hr and m1 =
12/hr. The second is associated with those patients who see a doctor immediate
and is an M/M/3 queue with parameters g2 = 14.4/hr and m2 = 10/hr. The third
node is the surgery unit and is an M/M/2 queue with parameters g3 = 4.8/hr and
m3 = 5/hr.
Node 2
90%
M/M/3
75% m2 = 10/hr
Node 1 10% Node 3
g1 = 4.8/hr M/M/1 M/M/2
20%
m1 = 12/hr m3 = 5/hr
g3 = 4.8/hr
5%
È0 0.75 0.2 ˘
F = Í0 0 0.1˙
Í ˙
ÍÎ0 0 0 ˙˚
Recall that 5% of the arrivals are sent to other departments in the hospital, and
that all patients who finish surgery are sent home, hence the bottom row of F has
all zeros.
c. For a patient who sees a doctor, what is the average amount of time he or she
spends in the queue?
We are asked to find Wq for node 2. To compute this question, we must first
determine the effective arrival rates at each node. Using Eq. (2), we have
l1 = 4.8
l2 = 14.4 + 0.75 l1 = 18
l3 = 4.8 + 0.2 l1 + 0.1l2 = 7.56
Thus, l1 = 4.8 , l2 = 18, l3 = 7.56, and the traffic intensity at node 2 r2 = l2/3m2
= 18/(3¥10) = 0.6. Now, using the formulas in Figure 16.5, the remaining
calculations from are as follows.
-1 -1
È 1 ( sr2 )2 ( sr2 )3 ˘ È 1 (1.8)2 (1.8)3 ˘
p0 = Í1 + ( sr2 ) + + = Í1 + (1.8) + +
Î 2! s!(1 - r2 ) ˙˚ Î 2! 6(1 - 0.6) ˙˚
= [1 + 1.8 + 1.62 + 2.43]-1 = 1/6.85 = 0.146
s s r2s +1p 0 27(0.6)4 (0.146)
Lq = = = 0.532
s!(1 - r2 )2 6(0.4)2
Wq = Lq /l2 = 0532/18/hr = 0.02956 hr 1.77 min
To find Lsystem we must find the average number of patients at each of the three
nodes.
For node 1: r1 =l1/m1 = 4.8/12 = 0.4, and L1 = r1/(1 – r1) = 0.4/0.6 = 0.667
For node 2 (use results from part c): L2 = Lq + sr2 = 0.532 + 3 ¥ 0.6 = 2.332
Queuing Networks and Decision Models 33
e. Compute the mean flow time through the network; that is, compute the
average time that a patient spends inside the emergency room.
The first step is to compute the initial probability vector v, the switching
probability matrix F, and the matrix W defined in Property 3.
g = (4.8, 14.4, 4.8) v = (0.2, 0.6, 0.2)
-1
È1 -0.75 -0.2 ˘ È1 0.75 0.275˘
–1
W = (I – F) = 0 Í 1 -0.1 = Í0
˙ 1 0.1 ˙
Í ˙ Í ˙
ÍÎ0 0 1 ˙˚ ÍÎ0 0 1 ˙˚
From these data, we compute vW W = (0.2, 0.75, 0.315). Now we need to find the
average waiting time at each node. Using the results from part (d), we have
For node 1: W1 = L1/l1 = 0.667/4.8 hr ¥ 60 min/hr = 8.34 min
For node 2: W2 = L2/l2 = 2.332/18 hr ¥ 60 min/hr = 7.77 min
For node 3: W3 = L3/l3 = 3.529/7.56 hr ¥ 60 min/hr = 28 min
Therefore, E[Tnet] = 8.34 ¥ 0.2 + 7.77 ¥ 0.75 + 28 ¥ 0.315 = 16.32 min
g. Surgeons often have to perform other duties during their shift outside the
emergency room. The chief administrator wants to know, on the average, the
amount of time per hour that no more than one surgeon will be absent from
the emergency room.
We assume that a surgeon can leave the emergency room only when there are
no patients requiring attention. Therefore, no more than one surgeon can be
absent when there are 2 or more patients at node 3. The probability is
Pr{no more than one absent} = 1 – p0 – p1
where
-1 -1
È ( sr3 )2 ˘ È (1.512)2 ˘
p0 = Í1 + ( sr3 )1 + = 1 + (1. 512 )1
+
Î s!(1 - r3 ) ˙˚ Í
Î 2(1 - 0.756) ˙˚
= [1 +1.512 + 4.6847]–1 = 1/7.1967 = 0.139
p1 = 0.210
giving
Pr{no more than one absent} = 1 – 0.139 - 0.210 = 0.651
h. Answer parts a through d again with one change in the patient flow dynamics.
Assume that after spending time in surgery, 15% of the patients must see a
doctor while the remaining 85% leave without further consultations. (As
such, a small fraction of patients who first see doctor, are sent into surgery and
then return to see a doctor.)
Node 2
90%
M/M/3
75%
m2 = 10/hr
Node 1 10% Node 3 15%
g1 = 4.8/hr M/M/1 M/M/2
20%
m1 = 12/hr m3 = 5/hr
g3 = 4.8/hr 85%
5%
È0 0.75 0.2 ˘
The new switch probability matrix is F = Í0 0 0.1˙ which is used to set up
Í ˙
ÍÎ0 0.15 0 ˙˚
and solve Eq. (2):
l1 = 4.8
l2 = 14.4 + 0.75l1 + 0.15l3
l3 = 4.8 + 0.2l1 + 0.1l2
-1 -1
È ( sr2 )2 ( sr2 )3 ˘ È (1.914)2 (1.914)3 ˘
p0 = Í1 + ( sr2 )1 + + = 1 + (1. 914 )1
+ +
Î 2! s!(1 - r2 ) ˙˚ Í
Î 2! 6(1 - 0.638) ˙˚
= [1 + 1.914 + 1.832 + 3.228]-1 = 1/7.974 = 0.125
0.125(1.915)3 (0.638)
Lq = = 0.712
6(0.632)2 (more accurately 0.716)
0.712
Wq = = 0.0374 hr 2.24 min
19.151 / hr
The final task is to calculate the average number of patients in the system.
Queuing Networks and Decision Models 37
4.8
For Node 1 (same as before: r1 = = 0.4, thus L1 = 0.667
12
For Node 2 (from above): L2 = 0.712 + 1.915 = 2.627
l3 7.675 1.535
For Node 3: = = 1.535, thus L3 = = 3.736
m3 5 1 - 0.76752
20. After graduating from Big State University with a Bachelor’s degree in operations
research, Norma Jeane Mortenson was hired as a manager of a local Barnes & Noble
book store. With her training in queuing theory she is set on moving quickly to apply
the techniques that she learned in the classroom. One of the biggest complaints she
was told was that it takes too long to go through the check-out line. To get a better
understanding of the waiting time, she asked one of her employees to record
customer arrival times at the cashier between 8:00 A.M. and noon. The following
data were recorded: 8:05, 8:07, 8:17, 8:18, 8:19, 8:25, 8:27, 8:32, 8:35, 8:40, 8:45,
8:47, 8:48, 8:48, 9:00, 9:02, 9:14, 9:15, 9:17, 9:23, 9:27, 9:29, 9:35, 9:37, 9:45, 9:55,
10:01, 10:12, 10:15, 10:30, 10:32, 10:39, 10:47, 10:50, 11:05, 11:07, 11:25, 11:27,
11:31, 11:33, 11:43, 11:49, 12:05.
Another employee was asked to measure how long it takes the cashier to
check out a customer. On average, the service time was found to be 3.5 minutes
with a corresponding standard deviation of 5.0 minutes. The store has two cash
registers but currently employs only one cashier
To find the solution, we must first compute the mean and standard deviation of
the interarrival times. These values are needed to calculate the arrival coefficient
of variation.
Using Eq. (2) in Section 16.3 with r = l/m = ms /ma = 0.612, we have
b. Suppose that Norma Jeane’s knowledge of queuing theory was marginal and that
an M/M/1 model was incorrectly used under the assumption that the arrival rate
was Poisson with the mean estimated from the data and that the service times
were exponential with a mean of 3.5 minutes. Determine the approximate
Queuing Networks and Decision Models 39
difference between the estimates obtained in part (a) and the estimates that would
be obtained using the (incorrect) Markovian assumptions.
r 3.5 ¥ 0.612
Wq = = = 5.52 min giving an error of 26.3% below the
m (1 - r ) 0.388
approximate value, and
r2 0.612 2
Lq = = = 0.965 customers giving an error of 26.3% below the
1 - r 0.388
approximate value.
c. Two alternatives are available to Norma Jeane to reduce the waiting time at the
cashier. The first is to buy a bar code reader that would reduce the standard
deviation of the service time to 1.7 minutes but cost $50 per month for a service
contract. The second is to hire another cashier to operate the second cash
register. The new cashier would work at the same rate as the other and would
cost $500 per month. Assuming that the cost of waiting for a customer is $0.25
per minute on average, Norma Jeane wants to know which is the better
alternative. Assume that the congestion problem only exists for 4 hours per day,
5 days per week.
Cost of Extra cashier: First find the average number of customers that must wait
for an M/M/2 system. For this situation r = 0.612/2 = 0.306. The equation to
approximate Lq is given in Figure 16.12, and is
È p ss r s+1 ˘
Lq (M/M/2) @ Í 0 2˙
= 0.0631
Î s!(1 - r ) ˚
2 2
È c + cs ˘
Lq (G/G/2) = Í a ˙ Lq (M/M/2) = 1.3575 ¥ 0. 0631= 0.0858 customers
Î 2 ˚
CEXTRA = ($0.25/min/customer) (0.0858 customers) = $0.0215/min = $1.29/hr
When random numbers are called for in any of the exercises, use the three-digit numbers
in the following table unless otherwise directed.
The values of the simulated service times are shown in the last column.
Simulation 2
Mean 4
n= 4 Std. 1
Z Y
1 0.005 0.192 0.941 0.72 -0.246 3.754
2 0.596 0.206 0.233 0.711 -0.44 3.5601
3 0.909 0.994 0.624 0.684 2.0975 6.0975
4 0.748 0.187 0.069 0.399 -1.034 2.966
5 0.527 0.291 0.388 0.965 0.2962 4.2962
6 0.599 0.081 0.086 0.757 -0.826 3.1738
7 0.758 0.345 0.845 0.664 1.06 5.06
8 0.775 0.645 0.914 0.326 1.1432 5.1432
9 0.213 0.101 0.662 0.263 -1.318 2.6819
10 0.784 0.995 0.347 0.006 0.2286 4.2286
11 0.344 0.986 0.776 0.312 0.724 4.724
12 0.512 0.435 0.16 0.014 -1.522 2.4775
0.0136 4.0136 Sample Mean
1.11 1.11 Sample Std.Dev.
We hypothesize that the sample comes from a normal distribution with mean 4
and standard deviation 1.
Class Mid Class Start Class End Theoretical Class Relative Theoretical Observed Absolute
probability Count frequency CDF CDF difference,
2.5 2 3 0.136 3 0.25 0.136 0.25 0.1140948
3.5 3 4 0.341 3 0.25 0.477 0.5 0.0227501
4.5 4 5 0.341 3 0.25 0.819 0.75 0.0685946
5.5 5 6 0.136 2 0.1666667 0.954 0.9166667 0.0378332
6.5 6 7 0.021 1 0.0833333 0.976 1 0.0241001
The maximum difference in the theoretical and observed CDF’s do not exceed
the critical value for a = 0.5 and a sample size of 12. The hypothesis that the
sample comes from a normal distribution with mean 4 and standard deviation 1
cannot be rejected. Note that this is a very small sample.
2
Simulation 3
( )
Ï kl ( klx )k -1 e - klx / ( k - 1)! for x ≥ 0
f(x) = Ì
Ó0 otherwise
3
Simulation 4
3. There are three horses in a race. Historical records show that the mean and standard
deviation for the time it takes each horse to complete a race are as shown in the table
below. What proportion of the time will each horse win? Assume that each
completion time random variable is normally distributed. Simulate 10 races.
The table shows 10 simulated races with the Random Variables add-in. The
results are summarized below the table. Of course, the simulation changes with
every recalculation, so the results are highly variable.
Random Variable P18_3_1P18_3_2P18_3_3
Distribution Normal Normal Normal
mean (mu) 10 9.5 10.5
standard deviation (sigma 1 0.5 3
1 2 3 4 5 6 7 8 9 10
Simulate Horse 1 9.3448 10.53 9.8755 8.3503 9.8401 9.7422 9.0945 10.626 9.9635 9.667
Simulate Horse 2 8.2866 8.5925 8.9304 8.9808 9.566 10.094 10.145 8.9668 9.3342 9.0314
Simulate Horse 3 14.408 8.8422 13.156 9.3407 12.638 11.974 9.168 16.436 7.582 15.302
Winning Time 8.2866 8.5925 8.9304 8.3503 9.566 9.7422 9.0945 8.9668 7.582 9.0314
Winning Horse 2 2 2 1 2 1 1 2 3 2
4
Simulation 5
4. Use the second column of the random number table above to generate 6 observations
for each of the following situations.
a. A Bernoulli distribution with p = 0.4. Use the range (0 £ u £ 0.6) for 0 and (0.6
< u £ 1) for 1.
b. A binomial distribution with n = 5 and p = 0.4.
c. A geometric distribution with p = 0.4.
d. A Poisson distribution with l = 2. Use t = 1.
The observations were simulated with the RN_Inverse function from the Random
Variables add-in. We could have used the Monte Carlo disrectly for the discrete
distributions (a through d). For d, we use t = 1. When l defines the Poisson, a
value of t must be specifed.
RN 4a 4b 4c 4d 4e
0.192 0 1 0 0 0.4617
0.684 1 3 2 1 1.0733
0.081 0 1 0 0 0.2906
0.326 0 1 0 0 0.6281
0.986 1 4 8 3 2.0661
0.812 1 3 3 1 1.2928
5
Simulation 6
5. Use each column of the random number table to generate 10 observations from:
a. A standard normal distribution.
1 2 3 4 5 6 7 8 9 10
Z= 0.4031 0.1146 0.8867 0.0976 0.3917 -1.079 -0.436 0.7538 0.8938 0.8782
Note that in this simulation we are adding the numbers from the column and
converting to a standard normal.
m= 100 s= 20
1 2 3 4 5 6 7 8 9 10
Y= 108.06 102.29 117.73 101.95 107.83 78.419 91.288 115.08 117.88 117.56
6
Simulation 7
6. Use each column in the random number table to generate 10 observations from the
following.
a. A binomial distribution with n = 6 and p = 0.4 by simulating Bernoulli trials with
p = 0.4.
7
Simulation 8
Ï x, 0 £ x £1
Ô
f(x) = Ì2 - x, 1 < x £ 2
Ô0, otherwise
Ó
x
F ( x) = Ú f ( y ) dy
0
Ï x 2 2 for 0 £ x £ 1
F ( x) = Ì 2
Ó- x 2 + 2 x - 1 for 1 £ x £ 2
We are using the general expression for the mean of triangular distribution from
the Probability supplement and translating. For a triangular distribution with range
0 to 1 with mode = 0.5:
Ê1 + c ˆ
m = 2Á ˜ =1
Ë 3 ¯
2 1 - 2c + 2c 2 - c 3
s = (4) = 0.1667
18(1 - c )
8
Simulation 9
Ï0 for x £ 0
Ô x2
ÔÔ for 0 < x £ c
c
F(x) = Ì x (2 - x ) - c .
Ô for c £ x < 1
Ô (1 - c )
ÔÓ1 for x > 1
2
If r £ c, set r = y c and solve for y .
y = cr
y (2 - y ) - c
If r > c, set r = and solve for y .
1- c
y = 1 - 1 - (c + r - rc )
When the triangular distribution has a lower limit of a and an upper limit of b:
x = a + (b - a) y
d. Use the first row of the random number table to generate 10 observations.
1 2 3 4 5 6 7 8 9 10
r= 0.005 0.192 0.941 0.72 0.596 0.206 0.233 0.711 0.909 0.994
y= 0.05 0.31 0.828 0.626 0.551 0.321 0.341 0.62 0.787 0.945
x= 0.1 0.62 1.656 1.252 1.101 0.642 0.683 1.24 1.573 1.89
9
Simulation 10
8. Develop a step-by-step generation scheme for the triangular distribution with pdf
Ï 12 ( x - 2), 2 £ x £ 3
ÔÔ x
f(x) = Ì 12 (2 - ), 3 < x £ 6
Ô0, 3
ÔÓ otherwise
Use the bottom row of the random number table to generate 10 observations of X.
Compute the sample mean and compare it to the true mean of the distribution.
10
Simulation 11
9. Develop a random variate generator for random variable X with the following pdf.
Ïe 2 x , -• < x £ 0
f(x) = Ì -2 x
Óe , 0 < x < •
Use the second row of the random number table to generate 10 observations of X.
-• 2
For 0 < x < •
x
e-2 x
F ( x) = Ú e-2y dy = 1 - 2
-•
11
Simulation 12
10. When evaluating investments with costs and benefits realized at different points in
times it is standard practice to compute the net present worth (NPW) of the cash
flows. Consider an investment of the amount P with annual returns Rk for k =
1,…, n, where n is the life of the investment. The NPW is defined to be
n
Rk
NPW = –P + Â (1 + i)
k =1
k .
b. The advisor adds the information that the life of the investment is uncertain, and
is, in fact, uniformly distributed with pn = 0.2 over the range n = 1,…, 5. Use the
random numbers below to simulate 12 replications of the life and compute the
NPW in each case.
Based on your simulation, what is the probability that the investment will yield
the MARR?
Using the 12 random numbers we simulate the life of the project 12 times.
To compute the NPW in each case we accumulate the values that fall below the
simulated life. The values of the NPW are shown in the last row of the table.
12
Simulation 13
1 2 3 4 5 6 7 8 9 10 11 12
RN 0 . 5 7 6 0.5 0.329 0.385 0.678 0.858 0.51 0.682 0.376 0.135 0.256 0.977
Life 3 3 2 2 4 5 3 4 2 1 2 5
-1000 -1000 -1000 -1000 -1000 -1000 -1000 -1000 -1000 -1000 -1000 -1000
417 417 417 417 417 417 417 417 417 417 417 417
347 347 347 347 347 347 347 347 347 0 347 347
289 289 0 0 289 289 289 289 0 0 0 289
0 0 0 0 241 241 0 241 0 0 0 241
0 0 0 0 0 201 0 0 0 0 0 201
NPW = 53 5 3 -236 -236 294 495 53 294 -236 -583 -236 495
c. The advisor now tells you that the annual revenue per year is uncertain.
Although it will be the same each year, the revenue could be negative) is
normally distributed with a mean of $500 and a standard deviation of $200. Use
the random numbers below to simulate 10 observations of the annual revenue.
Combine these results with the results in part (b) to determine the probability that
the investment will yield the MARR.
13
Simulation 14
1 2 3 4 5 6 7 8 9 10 11 12
RN 0 . 5 7 6 0.5 0.329 0.385 0.678 0.858 0.51 0.682 0.376 0.135 0.256 0.977
Life 3 3 2 2 4 5 3 4 2 1 2 5
RN 0 . 5 1 5 0.33 0.681 0.094 0.987 0.634 0.086 0.323 0.529 0.445 0.318 0.156
Rev. 507.7 411.9 593.9 236.1 946.4 568.4 226.6 408.1 514.3 472.4 405.2 298
-1000 -1000 -1000 -1000 -1000 -1000 -1000 -1000 -1000 -1000 -1000 -1000
423 343 495 197 789 474 189 340 429 394 338 248
353 286 412 164 657 395 157 283 357 0 281 207
294 238 0 0 548 329 131 236 0 0 0 172
0 0 0 0 456 274 0 197 0 0 0 144
0 0 0 0 0 228 0 0 0 0 0 120
NPW = 6 9 -132 -93 -639 1450 700 -523 56 -214 -606 -381 -109
14
Simulation 15
11. A company has 18,000 employees at the beginning of the year, each of whom
contributes $125 per month toward the cost of medical insurance. Historical data
suggest that the cost of insurance claims is about $250 per month per employee.
Because the company pays the excess above $125, management wants to estimate
the cost to the company of providing coverage. The number of employees is
expected to increase at the rate of 2% a month and the average claim per employee is
expected to increase by 1% a month. The spreadsheet below computes the annual
cost with these assumptions to be a little over $37 million.
Modify this analysis so that the growth rates each months are random
variables. Assume that the growth rate in the number of employees is uniformly
distributed between 1% to 3%, and that the growth rate for claims is uniformly
distributed between 0.5% to 1.5%. Both growth rates are independent random
variables for each month of the year. Perform a simulation analysis to estimate the
mean and standard deviation of total contributions by the company. Simulate one
year of operation 10 times and average the results.
15
Simulation 16
Month No. Growth Employee Average claim Growth Total Claims Company
Employees Rate contribution per Employee Rate Contribution
Initial 18,000 1.73% $2,250,000 $250 0.87% $4,500,000 $2,250,000
1 18,311 1.64% $2,288,916 252 0.95% $4,617,886 $2,328,970
2 18,612 1.71% $2,326,533 255 0.80% $4,738,427 $2,411,894
3 18,930 1.47% $2,366,269 257 1.47% $4,857,816 $2,491,547
4 19,209 2.19% $2,401,083 260 0.51% $5,001,667 $2,600,583
5 19,629 2.40% $2,453,563 262 1.15% $5,137,200 $2,683,637
6 20,100 1.54% $2,512,561 265 1.11% $5,321,228 $2,808,666
7 20,409 2.15% $2,551,163 268 1.03% $5,463,170 $2,912,007
8 20,848 2.15% $2,606,031 270 0.53% $5,638,328 $3,032,297
9 21,297 2.98% $2,662,157 272 1.22% $5,790,253 $3,128,096
10 21,932 2.86% $2,741,528 275 0.81% $6,035,450 $3,293,921
11 22,560 1.50% $2,820,013 277 1.48% $6,258,770 $3,438,757
12 22,898 $2,862,311 282 0.79% $6,446,748 $3,584,436
Total $32,842,129 $69,806,941 $36,964,812
16
Simulation 17
12. Use the service times found in Exercise 1 to replace those in Table 18.6. With these
numbers, simulate the single-channel queue described in Section 18.5 where now the
service times are, of course, normally distributed. Compute the various statistics for
this modified problem. Is the system better or worse when the service times have
less variability? (Recall that the standard deviation of the exponential distribution is
equal to its mean.)
The comparison between the queuing system with Normal and exponential times
are shown below. The times for the Normal distribution are considerably below
those for the exponential. The smaller variability is partially responsible. The
average service times are coincidentally smaller for the Normal times.
Queueing Simulaton
Next Event-Dynamic Normal Exponential
Service Service
Times Times
Queue Station SimQ1 SimQ1
Arrival Distribution TBA_1 TBA_1
Service Distribution Exer_1 TFS_1
Number of Servers 1 1
Max. Number in System *** * * *
Type G/G/1 G/G/1
Arrival Seed 1 1
Service Seed 10 10
Number in Simulation 12 12
Start Data Time 0 0
Stop Data Time 55.0152262 60.16000151
Mean Number at Station 1.9286056 2.578125051
Mean Time at Station 8.84188943 12.92500058
Mean Number in Queue 1.05316045 1.752659641
Mean Time in Queue 4.8283217 8.786667222
Mean Number in Service 0.87544515 0.82546541
Mean Time in Service 4.01356773 4.138333359
Arrival Rate 0.21812143 0.19946808
Throughput Rate 0.21812143 0.19946808
Efficiency 0.87544515 0.82546541
Probability Balk 0 0
17
Simulation 18
13. Use the arrival and service data from Table 18.6 and simulate a M/M/2/3 queue with
balking. Construct a table similar to Table18.11. Compute the evaluation statistics
for the two-channel system. Compare the results to the steady-state values computed
from the appropriate formulas in Chapter 16.
The simulation constructed by the Simulate Queue command in the Queues add-
in is shown in the table below.
Event Event Arrive
Event Time Name System Queue S1 Cal. S2 Cal. Cal.
0 0 0 0 0 10000 10000 0
1 0 A 1 0 2.58 10000 0
2 0 A 2 0 2.58 2.44 13.44
3 2.44 S 1 0 2.58 100000 13.44
4 2.58 S 0 0 100000 100000 13.44
5 13.44 A 1 0 21.06 100000 19.59
6 19.59 A 2 0 21.06 19.68 23.23
7 19.68 S 1 0 21.06 100000 23.23
8 21.06 S 0 0 100000 100000 23.23
9 23.23 A 1 0 32.68 100000 25.44
10 25.44 A 2 0 32.68 26.13 25.61
11 25.61 A 3 1 32.68 26.13 30.62
12 26.13 S 2 0 32.68 39.71 30.62
13 30.62 A 3 1 32.68 39.71 30.74
14 30.74 Balk 3 1 32.68 39.71 32.52
15 32.52 Balk 3 1 32.68 39.71 36.12
16 32.68 S 2 0 34.69 39.71 36.12
17 34.69 S 1 0 100000 39.71 36.12
18 36.12 A 2 0 43.16 39.71 43.59
19 39.71 S 1 0 43.16 100000 43.59
20 43.16 S 0 0 100000 100000 43.59
21 43.59 A 1 0 44 1 0 0 0 0 0 1E+06
22 44 S 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1E+06
The analytical and simulated results are compared below. This is quite a small
sample size for a simulation.
Type Analytical Simulated
Mean Number at Station 0.811 1.103
Mean Time at Station 4.302 5.342
Mean Number in Queue 0.057 0.059
Mean Time in Queue 0.302 0.287
Mean Number in Service 0.754 1.044
Mean Time in Service 4.000 5.056
Throughput Rate 0.189 0.206
Efficiency 0.377 0.522
Probability Balk 0.057 0.182
18
Simulation 19
14. From the information shown in Table 18.11 for the M/M/1/2 queue, compute the
areas under the curves associated with the number in service and number in the
queue as was done for the single-channel case in Table 18.8. From these data
compute the evaluation statistics and observe the effect of limiting the queue size to
one. Compare the results to the steady-state values computed from the appropriate
formulas in Chapter 16.
The comparison is shown below. The finite queue causes 1/3 of the arrivals to
balk. The ones that do not balk receive better service as measured by time in the
queue and system. It is not surprising that the simulated results do not agree
closely with the analytical results, because 12 is a very small sample size.
19
Simulation 20
15. Consider a network consisting of two queues in series. The first is the single-
channel Markov system (M/M/1) described in the text and the second is a single-
channel system with a mean service time of 3 minutes following an exponential
distribution. The second system receives all its inputs from the first.
a. Simulate the operation of the second system using the information from Table
18.7 to determine the arrival schedule. Use the last 2 columns of the random
number table above to generate the service times. Compute the evaluation
statistics for the network.
The two station analysis is shown below. The system results are the sum of the
station statistics. The arrivals of the station 2 simulation were the departures from
station 1.
Two Station Analysis Station 1 Station 2 System
Mean Number at Station 2.58 1.25 3.82
Mean Time at Station 12.93 6.81 19.74
Mean Number in Queue 1.75 0.61 2.37
Mean Time in Queue 8.79 3.36 12.14
Mean Number in Service 0.83 0.63 1.46
Mean Time in Service 4.14 3.46 7.59
b. Assume that 20% of the departures from the first system leave the network rather
than enter the second system. Also assume that in addition to the remaining 80%
who enter the second system, there is a second process generating arrivals to that
system whose interarrival times are exponentially distributed with mean 10
minutes. Starting with the first column in the random number table, generate 6
arrivals for the second system and then simulate the two queues in series.
Compute the evaluation statistics for the network.
We modeled the process of passing from the 1st to the 2nd station as a Bernoulli
process. We used the 2nd and 3rd columns of the random numbers for this
simulation. The system statistics are shown below.
Two Station Analysis Station 1 Station 2 System
Mean Number at Station 2.58 1.31 3.89
Mean Time at Station 12.93 6.29 19.21
Mean Number in Queue 1.75 0.64 2.39
Mean Time in Queue 8.79 3.08 11.86
Mean Number in Service 0.83 0.67 1.50
Mean Time in Service 4.14 3.21 7.35
20
Simulation 21
16. Simulate a two-channel queueing system given the data below. The system has a
finite queue with a maximum number of waiting spaces equal to two. Customers
arriving when the queue is full will balk. Of course, the time for service given is
irrelevant for a balking customer. The queue discipline is first-come-first-served,
and the first customer arrives at time zero. Compute the evaluation statistics
described in Section 18.5 from the simulation output.
The simulation statistics are shown below. No balking occurs with the given data.
Queue Station Sim_16
Arrival Distribution From E16
Service Distribution From E17
Number of Servers 2
Max. Number in System 4
Type G/G/2/4
Arrival Seed 1
Service Seed 10
Number in Simulation 10
Start Data Time 0
Stop Data Time 39.999
Mean Number at Station 2.57498937
Mean Time at Station 11.4441111
Mean Number in Queue 0.72499312
Mean Time in Queue 3.22211111
Mean Number in Service 1.84999625
Mean Time in Service 8.222
Arrival Rate 0.22500563
Throughput Rate 0.22500563
Efficiency 0.92499812
Probability Balk 0
21
Simulation 22
17. Consider a finite input source system with five machines (M/M/1/5/5), as described
in Section 16.2. The failure rate of each machine when in operation is 0.1 per hour.
When a machine fails, it is sent to the repair shop -- a single-channel queue with a
service rate of 0.3 per hour. The arrival rate to the shop is 0.1n per hour, where n is
the number of machines currently operating.
a. Simulate this system for 50 hours starting with one machine already in the repair
shop.
The queue simulation program in the Queues add-in was modified for the finite
population queuing system. The results for 50 hours for one realization of the
random numbers are shown below.
Event Event Next Next Arrive
Event Time Name Service System Queue TBA TFS S1 Cal. Cal.
0 0 0 0 0 0 0 0 10000 0
1 0 A 1 1 0 1.8673 1.3232 1.3232 1.8673
2 1.3232 S 0 0 0 1.4938 1.3232 100000 2.817
3 2.817 A 1 1 0 1.0058 0.1168 2.9339 3.8228
4 2.9339 S 0 0 0 0.8046 0.1168 1 0 0 0 0 0 3.7385
5 3.7385 A 1 1 0 5.6431 1.8668 5.6053 9.3817
6 5.6053 S 0 0 0 4.5145 1.8668 100000 10.12
7 10.12 A 1 1 0 2.0977 3.4955 13.615 12.218
8 12.218 A 1 2 1 0.2122 3.4955 13.615 12.43
9 12.43 A 1 3 2 2.568 3.4955 13.615 14.998
10 13.615 S 1 2 1 1.712 0.5853 14.201 15.327
11 14.201 S 1 1 0 1.284 3.9843 18.185 15.485
12 15.485 A 1 2 1 0.4901 3.9843 18.185 15.975
13 15.975 A 1 3 2 1.4148 3.9843 18.185 17.39
14 17.39 A 1 4 3 18.517 3.9843 18.185 35.906
15 18.185 S 1 3 2 9.2584 2.6266 20.812 27.443
16 20.812 S 1 2 1 6.1723 3.0907 23.902 26.984
17 23.902 S 1 1 0 4.6292 4.5427 28.445 28.531
18 28.445 S 0 0 0 3.7034 4.5427 100000 32.148
19 32.148 A 1 1 0 0.2553 22.576 54.724 32.404
20 32.404 A 1 2 1 5.5942 22.576 54.724 37.998
21 37.998 A 1 3 2 9.318 22.576 54.724 47.316
22 47.316 A 1 4 3 12.063 22.576 54.724 59.379
23 54.724 S 1 3 2 6.0315 1.373 56.097 60.755
b. Compute the equivalent of the performance measures given in Fig. 16.7 from the
output of the simulation and compare them to their theoretical steady-state
counterparts.
The simulated averages are computed and shown below with the analytical
results.
22
Simulation 23
Analytic Simulated
Mean Number at Station 2.33 1.44
Mean Time at Station 8.73 5.54
Mean Number in Queue 1.44 0.44
Mean Time in Queue 5.39 1.69
Mean Number in Service 0.89 1.00
Mean Time in Service 3.33 3.85
Efficiency 0.89 1.00
23
Simulation 24
18. Use the Queue Simulate option in the Queueing Excel add-in that comes with the
text (or any other program) to simulate the M/M/1 queue discussed in Section 18.5.
Let the initial number in the system be 3 and perform 10 replications. Each
replication should process a total of 200 customers. Record the average number in
the system, L, and the average time in the system, W, in each case. For these
statistics compute the mean and standard deviation over the sample of 10
observations. Assuming the statistics come from normal populations, use the t -
distribution to find confidence intervals for the true steady-state values of L and W.
Compare the values found with the analytic steady-state solution found with the
queueing formulas in Chapter 17.
24
Simulation 25
20. This exercise refers to the inventory system simulated in Section 18.6
a. Calculate the mean, E[D], and variance, Var[D], for demand from Table 11 and
compare to your calculations of the sampled mean ( d ) in Table 13 and unbiased
variance (s√D2 ) to be determined from the data in Table 13 using Eq. (A5). Is
E[D] within a 95% confidence interval constructed from d and s√D2 and based on
the t-distribution?
Distribution
Mean 11.65
Std. Dev 2.59
The data mean and standard deviation with 95% confidence limits:
Data
Lower Upper
Mean Std. Dev. Conf. Conf.
(d ) 10.70 2.49 10.16 11.24
The true mean does not fall within the confidence limits.
Distribution
Mean 2.80
Std. Dev. 0.98
The data (only three values) mean and standard deviation with 95% confidence
limits:
Data
Lower Upper
Mean Std. Dev. Conf. Conf.
(d ) 3.00 1.00 2.44 3.56
The true mean does fall within the confidence limits.
25
Simulation 26
21. Confirm the calculations in Table 18.19 for (a) demand and (b) lead time. Note that
e in (A.8) is absolute error, not percent error; that is, e = (percent error / 100) ¥
(assumed theoretical mean).
26
Simulation 27
22. Confirm the results for C and s√c in Table 18.20 for n = 1,000.
Observations
1 2 3 4 5 Mean Std. Dev.
8.334 8.692 8.488 8.404 8.247 8.433 0.170
27
Simulation 28
23. Calculate the 95% confidence interval for the true mean total cost when n = 2,000,
5,000 and 10,000 from the data in Table 19. Does it make sense that this interval for
n = 10,000 is narrower than the interval calculated for n = 5,000? Explain?
Sim. Run n a t (a, n - 1 ) Mean Std. Dev. Lower Conf. Upper Conf.
2000 5 95% 0.9625195 8.378 0.068 8.349 8.408
5000 5 95% 0.9625195 8.438 0.061 8.412 8.465
10000 5 95% 0.9625195 8.458 0.011 8.454 8.463
Notice that we use the t distribution for 4 degrees of freedom because there are 5
replications of the simulation use to calculate the mean. We would expect the
width of the confidence limit to decrease with sample size because with more
replications the simulation results should be closer to the steady-state and thus
exhibit less variance. For the example we see that when we compare 5000 to
10000 observations. Comparing 2000 to 5000 observations, however, we note
only a slight decrease in the standard deviation and thus a slight reduction in the
width of the confidence interval. This is always possible because of the statistical
variability of simulation results.
28
Simulation 29
24. Compute the mean and variance of the numbers in the column labeled C in Table
18.14. Use Equation A7 in Appendix A1 on the CD to compute the 95% confidence
interval for true C . Explain why this confidence interval is not valid.
Using the data from Table 18.14 we compute the mean and standard deviation of
the daily costs. The associated confidence limits are shown in the table below.
The interval is not valid because the observations from Table 18.14 are not
independent. Generally the observations from a single simulation are not
independent. It is necessary to analyze multiple runs with random starting
conditions to assure independence so that statistical statements are valild.
Lower Upper
Mean Std. Dev. Conf. Conf.
Daily Cost 7.17 7.06 5.65 8.69
n 20
alpha 0.05
t 0.9606
29
Simulation 30
25. Test the null hypothesis that a simulated criterion is consistent with the actual
criterion given the data below.
Time period
1 2 3 4 5 6 7 8 9 10
Actual 10 12 15 20 18 17 24 28 30 25
Simulated 8 14 12 17 20 19 23 30 32 27
30
Simulation 31
26. Jeremy Sitzer is planning to open a restaurant that will operate from 12 noon to 2
PM each day. During this time parties are expected to arrive at random at an
average rate of 6 per hour. Each party will use one table and will spend an average
of 0.5 hours at the table, with a standard deviation of 10 minutes (assume a normal
distribution for this time). Customers already seated will be allowed to remain after
2 PM. How many tables should Mr. Sitzer plan for? If a waiter spends an average
of 10 minutes with a party (assume this time has an exponential distribution), how
many waiters are required?
We analyze the tables without concern for the waiters. With 3 tables, the arrival
rate is exactly matched with the average service rate. We use a queuing
simulation to analyze the situation with 3, 4 and 5 tables. We have modified the
simulation to not allow arrivals after 120 minutes. Note that for this selection of
seeds, three tables are sufficient. Less that 1/2 minute is spent in the queue on
average. The finish time and the number of customers served depend on the
seeds. Since the same seeds were used for all three runs, these numbers remain
the same. A better analysis would make several simulation runs with different
seeds and use statistical tests to compare the results.
Type G/G/3 G/G/4 G/G/5
Arrival Seed 1 1 1
Service Seed 10 10 10
Number in Simulation 20 20 20
Start Data Time 0 0 0
Stop Data Time 120 120 120
Mean Number at Station 2.24 2.19 2.18
Mean Time at Station 24.39 23.94 23.75
Mean Number in Queue 0.06 0.02 0.00
Mean Time in Queue 0.68 0.19 0.00
Mean Number in Service 2.17 2.18 2.18
Mean Time in Service 23.71 23.75 23.75
Arrival Rate 0.09 0.09 0.09
Throughput Rate 0.09 0.09 0.09
Efficiency 0.72 0.54 0.44
Probability Balk 0.00 0.00 0.00
Last Leave 173.13 173.13 173.13
Customers Served 11 11 11
31
Simulation 32
Since the arrival process is Poisson and the waiter time has an exponential
distribution, we use steady-state queuing analysis to select the number of
waiters. The table below shows the analysis with 1 through 4. waiters.
Queue Station 1 waiters 2 waiters 3 waiters 4 waiters
Arrival Rate 0.1 0.1 0.1 0.1
Service Rate/Channel 0.166667 0.166667 0.166667 0.166667
Number of Servers 1 2 3 4
Max. Number in System *** *** *** ***
Number in Population *** *** *** ***
Type M/M/1 M/M/2 M/M/3 M/M/4
Mean Number at Station 1.5 0.659341 0.606164 0.600615
Mean Time at Station 15 6.593407 6.061644 6.006152
Mean Number in Queue 0.9 0.059341 0.006164 0.000615
Mean Time in Queue 8.999998 0.593407 0.061644 0.006152
Mean Number in Service 0.6 0.6 0.6 0.6
Mean Time in Service 6 6 6 6
Efficiency 0.6 0.3 0.2 0.15
Probability All Servers Idle 0.4 0.538462 0.547945 0.548741
Prob. All Servers Busy 0.6 0.138462 0.024658 0.003486
Critical Wait Time 1 1 1 1
P(Wait >= Critical Wait) 0.561304 0.109646 0.016528 0.001978
With 1 waiter, the mean time in the queue, that is the time spent by customers
waiting for the waiter is 9 minutes. That is probably excessive. This would also
considerably increase the average service time used for the table analysis. Two
waiters reduces this time to about 1/2 minute. Although the efficiency of the
waiters is considerably reduced, this is probably necessary to provide adequate
service. Combining with the result from the table analysis, the average customer
must wait 0.68 minutes for a table and about 0.6 minutes for a waiter. Of course
there is probably a good deal of variability associated with the actual values.
This analysis has considered numbers of tables and number of waiters as
independent decisions. A much more complicated simulation would have to
performed to measure the interaction between these two decisions.
32
Simulation 33
27. A bank wants to determine how many drive-up windows to open and how much
room to provide for waiting cars. If the number of cars exceeds the allotted space,
they will be forced to move on. The arrival process is Poisson with an average rate
of 1 car per minute. The average service time is 2.5 minutes with a standard
deviation of 1 minute. This time is normally distributed. Specify one or more
performance measures and use them to determine how many drive-up windows the
bank should open.
33
Simulation 34
28. A shop currently has a machine with a highly variable processing time that is
exponentially distributed with a mean of 20 minutes. Jobs arrive at the machine
irregularly at the rate of 2.5 per hour (the time between arrivals has an exponential
distribution), and long queues have been observed. Management has been
considering the installation of a second machine with the same characteristics to
reduce the queue. The chief industrial engineer has proposed that rather than
purchase a second machine, a robot be installed with much less variability. In fact,
the robot will require exactly 20 minutes for each processing operation. Analyze the
two alternatives.
34
Simulation 35
29. Dr. Stark, who we met in the last chapter, can partially control the rate of arrivals to
her office by keeping an appointment book. Experience indicates that the average
time required to treat a patient is 15 minutes and follows an exponential distribution.
On the other hand, whatever the schedule, the time between arrivals is normally
distributed with a standard deviation of 5 minutes. Discuss how Dr. Stark should
schedule arrivals given that she wishes to spend four hours each morning seeing
patients. To ensure efficient use of her time, she always arranges for two patients to
be waiting when the office opens, but will work overtime, if necessary, until
everyone scheduled for an appointment is treated.
35
Simulation 36
36
Simulation 37
31. Consider the following container port operation. The port has two berths each with
one container crane. Each crane can only work one ship at a time. Ships arrive at
the port and wait for a tug to pilot them to a berth if one is free. There is only one
tug. Once a ship has docked, it will be unloaded by a crane. The containers are
lifted off the ship and placed directly onto flat-deck rail-wagons, of which there is an
unlimited supply. Once all containers have been removed, the ship is loaded with
new containers, also brought to the dock by rail. The number of containers to be
unloaded and loaded varies from ship to ship. Loaded ships clear their berth with
the help of the tug.
In general, the entities in a system have certain attributes associated with them.
The attributes change values as the simulation progresses. For the port
operation, we have the following.
Entities (attributes)
Ships (arrival pattern, number of containers to be unloaded, number of
containers to be loaded)
Tug (berthing and unberthing times)
Berths (speed of crane in terms loading and unloading rates per container)
Activities (attributes)
Berthing process (start, end)
Unberthing (start, end)
Unloading of containers (start, end).
The calendar has to keep track of all events. These include ship arrivals, tug
engagement and berthing, start and end of crane unloading, start and end of
crane loading, tug engagement and release for departure.
37
Simulation 38
Create
arrival Wait
for tug
Ship Tugs
queue idle Load
Railcars
An arrival is created when a ship arrives from outside the port. It enters a queue
and waits, if necessary, until both tug and a berth are free. When it arrives at the
dock, the tug is released and the unloading begins. The ship is then loaded with
new cargo and piloted out of the port as soon as the tug is available. Because
there are an unlimited number of railcars, this aspect of the problem does not
have to be modeled.
38
Simulation 39
32. (Deterministic model) A soft drink manufacturer forecasts the following demand
pattern over the coming 12-month period (in 1000 gallons):
Month 1 2 3 4 5 6 7 8 9 10 11 12
Demand 2500 1800 2000 2800 3500 4800 5600 6000 4500 3200 1200 3600
The manufacturing facilities can be opened with one or two shifts, with or
without overtime. The following table identifies the maximum output capacities and
associated costs.
Goods produced in each period can be used to satisfy the demand in that
period or any subsequent period. Any goods carried forward to later periods incur a
storage cost of $100 per 1000 gallons per month. An increase in the number of
shifts results in a “hiring and training” cost of $18,000, while a decrease from two to
one shift costs the firm $20,000 in severance pay. At the beginning of the planning
horizon there are no goods in stock, and in the preceding period the firm was
operating with only one shift. Overtime cost is proportional to amount of labor used.
a. Simulate this operation, assuming that the plant always runs at the maximum
regular capacity for each production setup. Two shifts are used from periods 5
through 10 only, and overtime is used as necessary. What is the cost of this
schedule?
The following feasible schedule was obtained with some trial and error on
overtime usage.
39
Simulation 40
Alternative Solution
Month 1 2 3 4 5 6
Demand 2500 1800 2000 2800 3500 4800
Shifts 1 1 1 1 2 2
Capacity 2000 2000 2000 2000 4000 4000
Beginning inventory 0 0 200 300 0 1400
Regular production 2000 2000 2000 2000 4000 4000
Overtime production 500 0 100 500 900 1000
Ending inventory 0 200 300 0 1400 1600
Prod. cost ($1000) 165 120 129 165 272 280
Shift change-over 0 0 0 0 18 0
Inventory cost 0 20 30 0 140 160
Total cost / mo ($1000) 165 140 159 165 330 440
40
Simulation 41
Month 7 8 9 10 11 12
Demand 5600 6000 4500 3200 1200 3600
Shifts 2 2 2 2 1 1
Capacity 4000 4000 4000 4000 2000 2000
Beginning inventory 1600 1000 0 0 800 1600
Regular production 4000 4000 4000 4000 2000 2000
Overtime production 1000 1000 500 0 0 0
Ending inventory 1000 0 0 800 1600 0
Prod. cost ($1000) 280 280 240 200 200 200
Shift change-over 0 0 0 20 0 0
Inventory cost 100 0 0 80 160 0
Total cost / mo ($1000) 380 280 240 300 360 200
b. By trial and error, use simulation to determine what you consider is the optimal
production schedule and its cost. Regular production may be at less than full
capacity but at full capacity cost.
Here is one production plan that provides a lower cost than that obtained in part
(a).
Month 1 2 3 4 5 6
Shifts 1 1 1 1 2 2
Production 2500 1800 2300 2500 4900 5000
Ending inventory 0 0 300 0 1400 1600
Cost 165 120 177 165 330 440
Month 7 8 9 10 11 12
Shifts 2 2 2 2 1 1
Production 5000 5000 4500 3200 2300 2500
Ending inventory 1000 0 0 0 1100 0
Cost 380 280 240 220 257 165
41
Simulation 42
42
Simulation 43
Station
Time
A B C D E
R1 R0
8 8:00
8
8:00
10 10
8:20
20 20
8:28
30 30
8:30
40 40
8:42
50 50
8:58 E1
9 9
9:10
10 10
9:12 9:12
20 20
R0 9:22 9:26 R2
30 30
9:40 9:31 9:30
40 40
9:42
50 50
E2 10:00 9:54
10 10
10:06 10:02
10 10:15 10
10:20 10:11 10:14 10:18
20 20
R3 10:23 R1
30 10:28 30
40 10:42 10:42 40
10:40
50 50
10:50 10:57 R4
11 11
11:12 11:02 11:02 11:00
10 10
E1 11:12
20 20
11:26 11:26 11:24
30 30
11:36 11:32 11:36
40 40
R2 11:44 E2
50 50
11:54
12 12
R4 12:02
10 10
12:12 R3
20 20
A B C D E
The vertical grid corresponds to the time of day starting at 8:00 AM and the
horizontal grid is a spatial representation of the five stations. Because all travel
times and switching times are deterministic, the simulation can be carried out
manually by tracing each route. There are five regular trains (labeled R0, . . .,
R4) and three express trains (labeled E1, E2, E3).
In the diagram, the diagonal lines correspond to the trips between two cities. The
normal vertical lines indicate the amount of time required to switch tracks, while
the bold vertical lines indicate forced delays. For example, R0 starts at 8:00 AM
from station D and arrives at Station C at 8:28. It takes 30 minutes to switch
tracks so at 8:58 R0 departs for station B and then A, arriving at 9:40. Similarly,
E1 leaves Station E at 9:10 AM arriving at station D and 9:26. Five minutes are
required to switch tracks but E1 cannot leave at 9:31 because R1 is traveling
43
Simulation 44
from station C to D, arriving at D at 9:42. At that time, E1 can leave for Station C.
After another 5-minute switch, it must wait an additional 53 minutes (10:11 AM to
11:02 AM) before departing for Station B, eventually arriving at A at 11:26 AM.
Note that at no time are there more than 2 trains at any station.
44
Simulation 45
34. Using the random number table, generate 10 random variates for the following
probability mass function.
Value, x 0 1 2 3 4 5 6 7 8
pmf, p(x) 0.156 0.234 0.208 0.161 0.095 0.064 0.036 0.028 0.018
rn Simulated x
0.005 0
0.192 1
0.941 6
0.72 3
0.596 2
0.206 1
0.233 1
0.711 3
0.909 5
0.994 8
45
Simulation 46
35. A firm wishes to investigate the profitability of a new product. Consumer tests on
samples of the product made at a small test plant have given favorable results. From
these tests and the other market surveys, it is estimated that the potential sales should
range from 40 to 100 units in about 9 out of 10 quarters within 3 years of its
introduction.
One of the alternatives considered involves the construction of a plant with a
capacity of 100 units per quarter at a cost of $400,000. Such a plant would be in
operation within 1year of the decision to go ahead with the new product. Since the
product can only be stored for very short periods, production would follow actual
sales very closely. Hence, any potential sales above 100 units per quarter would be
lost. The fixed production cost per quarter is estimated at $30,000, while the
variable production costs per unit are highly nonlinear, as follows:
All ranges are quoted with odds of 9 out of 10, and actual sales are
assumed to be approximately normally distributed. (Note that sales cannot be
negative.) Management would like to determine by simulation the distribution of the
cumulative net cash flow over the first 5 years of operating the plant (after its
construction). Round sales figures to nearest unit.
a. Using the random number table starting in row 1, simulate the cash flow quarter
by quarter over a 5-year period. What is the net cash flow?
46
Simulation 47
b. (More computations) Run the simulation for 10 runs, continuing with the random
number table where you left off in part a. Once you reach the end of the table go
to the upper right and read the numbers from right to left. Find the average net
cash flow and the standard deviation of the net cash flow.
Here we used the RAND() function to generate seeds and rounded them to four
digits. The 10 observations are shown below.
Run 1 2 3 4 5 6 7 8 9 10
Seed 0.2536 0.3659 0.1165 0.0061 0.396 0.2371 0.4333 0.6991 0.6529 0.4355
Total Net Income 1 0 3 5 3 1 - 7 7 1 5 3 4 3 6 8 3 9 8 1 6 0 58707 -65160 10693 65231 48275 141714
47
Simulation 48
(If you need a refresher on discounting, see the material at the end of Section
6.2.) What conclusion do you reach about the profitability of the project,
assuming that 10 years is the productive life of the plant?
We simulated 100 observations of the 10-year simulation. The results are shown
below with a histogram. There was never a NPW less than 0 and the average
NPW was well above 0. This investment should yield the minimum acceptable
rate of return (3% a quarter). The values are in 1000’s of dollars.
48
Simulation 49
36. Canal A is connected to the lower level Canal B by a lock. Boats enter from Canal
A into the lock, the gates are closed, the water level is lowered to the level of Canal
B, the gates toward Canal B are opened, and the boats leave. At this point any
boats in Canal B wanting to be raised to Canal A enter the lock, the gates are
closed, the water level is raised to the level of Canal A, the gates are opened, the
boats leave, and so on. The lock had a capacity of 4 boats, and it takes 4 minutes to
lower or raise the water level. Only one boat may enter the lock at a time, and a
boat takes 1 minute to be moored. However, all boats leave the lock one after the
other taking a total of 2 minutes (regardless of the number of boats).
Boats arrive at the lock in Canal A at a rate of 12 per hour, and in Canal B at a
rate of 15 per hour. Arrivals in both canals follow a Poisson distribution. The
current mode of operation during the busy hours, for which the above arrival rates
hold, is to fill or empty the lock whenever 4 boats have been moored inside the lock.
At 11 AM, the system is in the following state: The lock gates are open to
traffic from Canal A. Three boats are already moored in the lock, and the next
arrival from A is scheduled at 11:02. Five boats are currently waiting in Canal B to
go through the lock to A. The next boat arrival is scheduled at 11:04. Simulate this
system until 11:30 AM. Keep enough detail to determine the number of boats
passing through the lock in each direction, the average time boats spend at the lock
between arrival and departure in each direction, and the number of times the lock
has been raised and lowered. Use the following sequence of 2-digit random numbers
to generate the arrivals: 56 03 09 78 38 47 01 98 03 16 14 56 17 11 98 82
51 97 93 04.
49
Simulation 50
Waiting
Entity at In Next Entity
Time no. Event A B lock scheduled Event no.
11.00 Simulation starts 5 3 arrival at A 11.02 9
11.02 9 arrival at A arrival at B 11.04 10
11.03 9 lock lowered 4 arrival at A 11.06 11
11.04 10 arrival at B 6 lock lowered 11.03 9
11.04 12 arrival at B 7 lock down 11.07
11.04 13 arrival at B 8 arrival at B 11.04 12
11.06 11 arrival at A 1 arrival at B 11.04 13
11.07 – lock down arrival at B 11.10 14
11.08 15 arrival at A 2 arrival at A 11.08 15
11.09 – lock empty lock empty 11.09
11.10 14 arrival at B 9 arrival at A 11.11 16
11.10 17 arrival at B 10 lock raised 11.15
11.11 16 arrival at A 3 arrival at B 11.10 17
11.11 19 arrival at A 4 arrival at B 11.26 18
11.12 20 arrival at A 5 arrival at A 11.11 19
11.13 21 arrival at A 6 arrival at A 11.12 20
11.15 – lock raised 6 arrival at A 11.13 21
11.17 22 arrival at A 7 arrival at A 11.17 22
11.18 23 arrival at A 8 lock up 11.19 –
11.19 24 arrival at A 9 arrival at A 11.18 23
11.19 – lock up arrival at A 11.19 24
11.21 – lock empty arrival at A 11.39 25
11.25 – lock lowered 5 lock empty 11.21 –
11.26 18 arrival at B 7 lock lowered 11.25 –
11.29 – lock down lock down 11.29 –
11.30 simulation ends arrival at B 11.33
lock empty 11.31
50
Simulation 51
37. A job shop has three work centers X, Y, Z. Each job has to go through some or all
centers in a prescribed unique sequence. A work center can only process one job at
a time but the next job can enter immediately after the previous job departs. The
current state of the system is as follows:
Jobs currently
in the system 1 2 3 4 5 6 7 8 9 10
Sequence of centers
left to be entered Z Z X XY XYZ XZ YXZ Y YZ Y
Work center X is currently processing job 1; the scheduled release time from
the center is at simulated time 124 minutes. Work center Y is currently processing
job 2 with a scheduled release time at 180 minutes. Jobs are processed by each
center on a first-come-first served basis. The current order at center X is job 1, 3, 4,
5, 6, and at center Y, 2, 7, 8, 9, 10. Note that center Z is currently idle. Processing
times in minutes at each work center are normally distributed as follows:
Work center
Statistical measure X Y Z
Mean (min) 120 200 180
Standard deviation 40 40 60
(min)
New jobs enter the system at the beginning of each day, at which time they are
added to the file of jobs waiting for processing at each center. Current simulated
time is t = 100 minutes.
a. Identify the components of this system in terms of entities, attributes of the
entities, activities and their associated events, and the calendar.
Entities (attributes)
Jobs (processing sequence)
Work centers (processing time distributions)
b. Draw a flow diagram similar to the one in the text for the inventory system that
depicts the logic of the work center operations.
51
Simulation 52
In the flow diagram, FSE is the “file of scheduled events” or calendar and “file i”
refers to jobs waiting to be processed at work center i.”
UPDATE TIME t
i FILE i
YES NO
FILE i EMPTY
i
YES NO
CENTER i IDLE?
52
Simulation 53
c. Simulate the system with the data given until simulated time t = 480 minutes.
Use the random number table starting at the upper left and go down the columns.
†
B = busy, I = idle
‡
Indicates the status of the job at the specified point in time: in = waiting, out = finished
53
Simulation 54
38. Draw two flow diagrams representing the activities and logic for the problem in
Exercise 31, one for the movement of ships and one for the unloading and loading
operations. The latter should contain the details associated with the load and unload
activities of the former.
54
Simulation 55
39. Bonzi Air operates a 24-hour parcel pick-up service for air freight delivery to East
Coast cities. Customers make pick-up requests by phone to a dispatcher, who fills in
an order form and then assigns the request to the first available driver. After
completing a pick-up, the driver fills in a pick-up report, which he or she files with
the dispatcher, and then waits for a new assignment. A dispatcher will interrupt
assigning a job to a driver to take customer phone calls, and only continues with the
job assignment after having prepared the pick-up order form. There are two
dispatchers who alternate taking customer calls except when a call comes in while a
dispatcher is still engaged with the previous customer. The number of incoming
phone lines is sufficiently large so that no customer ever gets a busy signal. All
pick-up orders are available to both dispatchers for assignment to drivers. Past
records for a particular office show that
∑ The average rate of pick-up requests is 24/hr and follows a Poisson process.
∑ The time required to receive a pick-up request and fill in the order form is normal
with mean 120 sec and standard deviation of 20 sec.
∑ The time to make a job assignment is a constant 60 sec.
∑ The time to make a pickup and file the report is normal with mean of 1500 sec
and standard deviation of 400 sec.
∑ There are 16 drivers.
a. Identify entity classes, and activities, and list all entities jointly engaged in each
activity. Identify the calendar to be used for a next-event simulation.
Entities (attributes)
Requests (arrival process and statistics)
Dispatchers (rate at which requests are processed and job assignments
made)
Drivers (distribution of time to make pick-up and file the report)
55
Simulation 56
Events
Ci in means ‘request i has arrived’ (phone is ringing)
Ci out means “dispatcher finishes with request i’
Asn i means ‘dispatcher assigns job i’
Reasn i means ‘assignment of job i is interrupted and a new time is set
after the completion of the call’
Ji end means ‘driver completes job i’
Entities
Vj refers to driver j
Dk refers to dispatcher k
b. Draw a flow diagram similar to the one in the text for the inventory system
depicting the logic of the dispatch operations.
56
Simulation 57
Customer
source
Call Start
Dispatchers
waits assignment
idle
Pick up End
Drivers job & assignment
idle file report
Calls are initiated from the customer source node and arrive at the company’s
phone bank. A job is created for every call and stored in a job file. When the
pick-up is made and the driver finishes the paperwork, the job file is updated with
this information. Calls wait on hold if both dispatchers are busy with other calls.
If at least one dispatcher is free or in the processes of assigning a job, he is
interrupted to take the call. This is shown in the diagram with the dashed lines.
57
Simulation 58
c. Assume that at 11:00 AM the system is in the following state: (1) no pending
requests; (2) dispatcher 1 is idle; (3) dispatcher 2 is processing a pick-up request
with 80 seconds to go; (4) the next pick-up request will be received at 100
seconds from now; (5) drivers 1, 2, 3, and 4 are idle; (6) busy drivers and pick-up
completion times (including filing a pick-up report) in seconds after 11:00 AM
are: 5 -- 240, 6 --1250, 7 -- 680, 8 -- 560, 9 -- 1650, 10 -- 960, 11 -- 180, 12 --
1140, 13 -- 1370, 14 -- 510, 15 -- 870, 16 -- 1410. Simulate this system for 1
hour. Round all times to the nearest 10 seconds. Collect statistics on the total
idle time of dispatchers and drivers, and on the total time pick-up orders wait in
the office until they are assigned to a driver. Generate all activity times at the
start of each activity only.
The following table can be used to organize the simulation. Only the first few
increments are shown. Of course, the results depend on the random numbers
generated, and the priority rules used for processing events that occur
simultaneously.
58
Simulation 59
†
X = event has been processed, I = idle, B = busy
59