You are on page 1of 623

Operations Research Models and Methods

by Paul A. Jensen and Jonathan F. Bard


John Wiley and Sons, Inc.
Copyright 2003 – All rights reserved

Chapter 1 Problem Solving in Operations Research


1. Why is the object labeled situation in Fig. 1.1 depicted with ambiguous borders?

The problem associated with situation may be unknown in a variety of respects.

2. In Fig. 1.1, why is the object representing the model drawn with straight lines?

The model is an abstraction, eliminating a lot of complexity.

3. In Fig. 1.1, why is the object representing the procedure drawn as an oval with a box
around it?

The procedure is a packaged solution ready for the user.

4. What are the assumptions associated with a model? Why is it necessary to make
assumptions?

Assumptions are the simplifications (or abstractions) made to simplify the


problem for analysis. They are necessary to make the problem tractable.

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

6. What is the meaning of the term systems approach?

A systems approach considers aspects of the situation broader than the


immediate problem.

7. What is meant by the term optimal solution?

The optimal solution maximizes or minimizes some measure of effectiveness.

8. Why is implementation of an operations research solution sometimes difficult?

Solutions to a problem usually involve change to some persons in the


organization. Change is difficult for many.

9. In the title of the book, what is meant by the term methods?

A method is a mathematical procedure for solving a particular model.

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?

An abstraction is an assumption about the situation. Alternatively, an abstraction


is a simplification of the situation. They are necessary to make the problem
tractable (or capable of solution).
Problem Solving in Operations Research 3

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?

A study involves a team so the solution is not be limited by past experience or


talents of a single individual. A team also provides the collection of specialized
skills that are rarely found in single individuals.

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).

15. How is a solution different than a model?

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?

The assumptions are necessary to obtain a model that is tractable.

18. What is the purpose of a control procedure?

The control procedure implements a solution in a situation where the problem


arises on a regular basis. The control procedure solves repeated instances of a
problem as they arise. The procedure should also recognize when a situation has
changed and requires new analyses.

19. How should the value a model be determined?

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

Chapter 2 Linear Programming Models

1. Write the constraints of the x2


linear programming problem Grid size = 1
whose feasible region is
shown in the accompanying
diagram. The axes intercepts
of the lines are:
4 2
Line 1: (0, 1) and (2, 0)
Line 2: (0, 2.5) and (-5, 0) 3
Line 3: (0, -5) and (4, 0)
Line 4: (0, 8) and (6, 0). x1
1

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.

Constraint x1 intercept (j) x2 intercept (k) (0, 0) feasible? Constraint


C1 2 1 No 0.5x1 + x2 ≥ 1
C2 -5 2.5 Yes -0.2x1 + 0.4x2 £ 1
Linear Programming Models 2

C3 4 -5 Yes 0.25x1 - 0.2x2 £ 1


C4 6 8 Yes 0.167x1 + 0.125x2 £ 1
Linear Programming Models 3

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

3. Consider the linear programming model shown below.

a. Graph the feasible region using a Minimize z = 2x1 + x2


2-dimensional grid. Show an
isovalue contour for the objective subject to –x1 + 2x2 £ 10 (1)
function and indicate the direction
x1 – 2x2 £ 4 (2)
of decrease. Identify the optimal
solution on the graph. x1 + x2 ≥ 8 (3)

b. Graphically perform a sensitivity x1 + 2x2 ≥ 20 (4)


analysis for each of the objective
function coefficients and each of the x1 ≥ 0, x2 ≥ 0 (5)
right-hand-side constants.

x2 unbounded
Grid size = 1 feasible region
(1)

10
(2)

(3) (4)

10 x1

Sensitivity Analysis

Variable Analysis Objective Value: 17.5


Objective Range Lower Range Upper
Num. Name Value Status Reduced Cost Coefficient Limit Limit
1 X1 5 . Basic 0. 2. 0.5 ---
2 X2 7 . 5 Basic 0. 1. -4. 4.

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

Exercises 4 – 10 refer to the material in Section 2.6.

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

Linear Obj. Coef.: 18 25 10 12 15


aints
Name Value Rel. RHS Linear Constraint Coefficients
M1 160 <= 160 1.2 1.3 0.7 0 0.5
M2 200 <= 200 0.7 2.2 1.6 0.5 1
M3 160 <= 160 0.9 0.7 1.3 1 0.8
M4 280 <= 280 1.4 2.8 0.5 1.2 0.6

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.

Hours midnight. – 4am – 8am – noon – 4pm. – 8pm –


4am 8am noon 4pm 8pm midnight
Requirements 4 8 10 7 12 4

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.

x0 x4 x8 x12 x16 x20 b


D0: 1 0 0 0 0 1 ≥ 4
D4: 1 1 0 0 0 0 ≥ 8
D8: 0 1 1 0 0 0 ≥ 10
D12: 0 0 1 1 0 0 ≥ 7
D16: 0 0 0 1 1 0 ≥ 12
D20: 0 0 0 0 1 1 ≥ 4

The optimal solution uses 26 drivers. There are a number of alternative


schedules, but one is shown below.

x0 x4 x8 x12 x16 x20 Z


4 10 0 8 4 0 26
Linear Programming Models 11

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.

x0 x4 x8 x12 x16 x20 b


D0: 1 0 0 0 1 1 ≥ 4
D4: 1 1 0 0 0 1 ≥ 8
D8: 1 1 1 0 0 0 ≥ 10
D12: 0 1 1 1 0 0 ≥ 7
D16: 0 0 1 1 1 0 ≥ 12
D20: 0 0 0 1 1 1 ≥ 4

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.

x0 x4 x8 x12 x16 x20 b


D0: 1 0 0 0 1 0 ≥ 4
D4: 0 1 0 0 0 1 ≥ 8
D8: 1 0 1 0 0 0 ≥ 10
D12: 0 1 0 1 0 0 ≥ 7
D16: 0 0 1 0 1 0 ≥ 12
D20: 0 0 0 1 0 1 ≥ 4

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.

Hint: Introduce variables Et and Ft in the model to represent respectively the


increase or decrease in production in month t.

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.

Optimum Solution: z = 868875.


P1 P2 P3 P4 P5 P6 P7
2100 650 775 775 1700 2000 1000
I1 I2 I3 I4 I5 I6
0 250 25 0 0 100
E1 E2 E3 E4 E5 E6 E7
1100 0 125 0 925 300 0
F1 F2 F3 F4 F5 F6 F7
0 1450 0 0 0 0 1000
Linear Programming Models 13

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]

To modify the linear programming model, change the station B


conservation constraint as below and set the upper bound on PB to zero.

Sta–B +xBA +xBC + yBY +yBZ –0.95xAB –0.95xCB – PB = -25.


:

The solution to the revised problem has PA = 42.98 and PC = 100.01.


Nonzero transmissions are shown in the table.
Optimum Solution Z = 61,491.
AX AZ CB CX CY
9.65 33.33 26.32 18.13 55.56
Linear Programming Models 14

11. Consider the following linear program.

Maximize z = 6x1 + 3x2


subject to x1 + 2x2 ≥ 10
2x1 + x2 £ 20
x1 – x2 £ 10
–x1 + x2 £ 3

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

Selling price ($) Maximum sales


Period I II III I II III
1 15 20 14 100 200 150
2 18 17 21 150 300 150

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

Max profit: Z = 15S11 + 20S21 + … sales revenue


- 8PA1 - 7PB1 - … production costs
- 4xA11 - xA21 - … transportation costs
- 1IA - 1IB
Conservation constraints and upper limits on variables.
Linear Programming Models 18

Profit $4450.

PA PB S1 S2 S3 XA1 XA2 XA3 XB1 XB2 XB3 IA IB


Period 1 175 200 100 200 0 100 75 0 0 125 0 0 75
Period 2 150 170 150 95 150 150 0 0 0 9 5 150
Linear Programming Models 19

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)

Period Regular time Overtime Regular time Overtime Demand


1 100 20 14 18 60
2 100 10 17 22 80
3 60 20 17 22 140

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

Limits on regular production


R2 (Regular prod.)
(80) Demand R1 £ 100, R2 £ 100, R3 £ 60
2 O1 £ 20, O2 £ 10, O3 £ 20
O2 (Regular prod.)

Objective: Minimize cost


I2 B3
Z = 14R1 + 17R2 + 17R3 (regular prod.
+ 18O1 + 22O2 + 22O3 (overtime prod.)
R3 (Regular prod.) + 1(I1 + I2) (inventory)
(140) Demand
3 + 2(B2 + B3) (backorder)
O3 (Regular prod.)

Solution: z = 4350. The cost is $15 greater if initial inventory is charged.

Period Regular Overtime Inventory to Backorder to


Production Production Next Period Previous Period
1 100 5 60 ---
2 100 0 80 0
3 60 0 --- 0

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.

Backorder variables: Bk for k = 1…3.

Constraints defining Inventory:


I0 = 15; I0 = I01 + I02 + I03. I1 = I12 + I13. I2 = I23.
Linear Programming Models 21

Production Variables:
Regular time and Over time Production: Rk, Ok, for k = 1…3.
Production used immediately for sales: PSk for k = 1…3.

Constraints for Production


Rk + Ok - PSk – Ik - Bk = 0 for k = 1…3.

Constraints for Sales


PS1+ I01 + B2 = 60
PS2+ I02+ I12 + B3 = 80
PS3+ I03+ I13 + I23 = 140

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.)

This is the same solution as in part a.


Linear Programming Models 22

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.

Eight-hour work schedule


1 2 3 4 5 6 7 8
Work Work Break Work Work Break Work Work

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.

Let xi = Number of drivers called at time i, i = 6, 7, 8, …, 16.

Objective: Minimize the number of drivers called.


Min. Z = x6 + x7 + … + x16.

Subject to the work requirement:


Time 6-7: x6 ≥5

Time 7-8: x6 + x7 ≥ 20

Time 8-9: + x7 + x8 ≥ 25

Time 9-10: x6 + x8 + x9 ≥ 20
Linear Programming Models 23

A similar constraint is constructed for each hour. The variables representing a


particular hour must only be included when the workers are available for that
hour thus x6 only appears in the constraints: 6-7, 7-8, 9-10, 10-11, 12-13, 13-14.
All variables must be nonnegative.

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

Chapter 3 Linear Programming Methods


1. Consider the following linear program.

Maximize z = 5x1 + 3x2


subject to 3x1 + 5x2 £ 15
5x1 + 2x2 £ 10
– x1 + x2 £ 2
x2 £ 2.5
x1 ≥ 0, x2 ≥ 0

a. Show the equality form of the model.


b. Sketch the graph of the feasible region and identify the extreme point solutions.
From this representation find the optimal solution.
c. Analytically determine all solutions that derive from the intersection of two
constraints or nonnegativity restrictions. Identify whether or not these solutions
are feasible, and indicate the corresponding objective function values. Which
one is optimal?
d. Let the slack variables for the first two constraints, x3 and x4, be the axes of the
graph, and sketch the geometric representation of the model. Show an iso-
objective line in these variables, and from it determine the optimal solution.

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

2. You are given the following linear program.

Maximize z = 8x1 + 4x2 + 7x3 – 3x4


subject to 2x1 – 2x2 + 3x3 – 4x4 = 12
3x1 + 8x2 – x3 + 7x4 = 18
xj ≥ 0, j = 1, …, 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.

a. Solving in terms of x1 and x2 we obtain the representation of the problem in terms of


the variables x3 and x4.
Maximize z = 48 + 1x3 – 1.182x4
subject to 1x3 – 0.818x4 £6
– 0.5x3 + 1.182x4 £0
xj ≥ 0, j = 1, 2
The graph on the x3, x4 plane is below. Because of degeneracy there are four basic
solutions at (0,0).

b.
Linear Programming Methods 5

Corner Nonbasic Basic Solution Feasibility Objective


Point Variables Variables (x1, ..,x6) (Yes, No) Value
–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––----
#1 (1, 2) (3, 4) (0, 0, 9.18, 3.88) Yes 52.59
#2 (1, 3) (2, 4) (0, 8.67, 0, -7.33) No 56.67
#3 (1, 4) (2, 3) (0, 3, 6, 0) Yes 54
#4 (2, 3) (1, 4) (6, 0, 0, 0) Yes 48
#5 (2, 4) (1, 3) (6, 0, 0, 0) Yes 48
#6 (3, 4) (1, 2) (6, 0, 0, 0) Yes 48
–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––----
The optimum is #3 with objective value 54.
Linear Programming Methods 6

3. For the linear program

Maximize z = 10x1 + 5x2 + 8x3 – 3x4


subject to -2x1 + x2 + 2x3 –3 x4 ≥ 12
x1 + x2 + x3 + x4 £ 20
xj ≥ 0, j = 1,…, 4

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

b. Number of basic solutions £15.


c. Set of basic solutions:
Corner Nonbasic Basic Solution Feasibility Objective
Point Variables Variables (x1, ..,x6) (Yes, No) Value
–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––----
#1 (1, 2, 3, 4) (5, 6) (0, 0, 0, 0, –12, 20) No 0
#2 (1, 2, 3, 5) (4, 6) (0, 0, 0, –4, 0, 24) No 12
#3 (1, 2, 3, 6) (4, 5) (0, 0, 0, 20, -72, 0) No -60
#4 (1, 2, 4, 5) (3, 6) (0, 0, 6, 0, 0, 14) Yes 48
#5 (1, 2, 4, 6) (3, 5) (0, 0, 20, 0, 28, 0) Yes 160
#6 (1, 2, 5, 6) (3, 4) (0, 0, 14.4, 5.6, 0, 0) Yes 98.4
#7 (1, 3, 4, 5) (2, 6) (0, 12, 0, 0, 0, 8) Yes 60
#8 (1, 3, 4, 6) (2, 5) (0, 20, 0, 0, 8, 0) Yes 100
#9 (1, 3, 5, 6) (2, 4) (0, 18, 0, 2, 0, 0) Yes 84
#10 (1, 4, 5, 6) (2, 3) (0, 28, -8, 0, 0, 0) No 76
#11 (2, 3, 4, 5) (1, 6) (-6, 0, 0, 0, 0, 26) No -60
#12 (2, 3, 4, 6) (1, 5) (20, 0, 0, 0, -52, 0) No 200
#13 (2, 3, 5, 6) (1, 4) (72, 0, 0, –52, 0, 0) No 876
Linear Programming Methods 7

#14 (2, 4, 5, 6) (1, 3) (7, 0, 13, 0, 0, 0) Yes 174


#15 (3, 4, 5, 6) (1, 2) (2.67, 017.33 0, 0, 0, 0) Yes 113.33
–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––----
The solution is optimum for #14.
Linear Programming Methods 8

4. Given the following linear program,

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.

Set of basic solutions: x4 and x5 are slacks.


Corner Nonbasic Basic Solution Feasibility Objective
Point Variables Variables (x1, ..,x5) (Yes, No) Value
–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––----
#1 (3, 4, 5) (1, 2) (0, 10, 0, 0, 0) Yes 25
#2 (2, 4, 5) (1, 3) (10, 10, 0, 0, 0) Yes 20
#3 (2, 3, 5) (1, 4 ) no solution No
#4 (2, 3, 4) (1, 5) (10, 0, 0, 0, -10) No 10
#5 (1, 4, 5) (2, 3) (0, 0, 10, 0, 0) Yes 25
#6 (1, 3, 5) (2, 4) (0, 10, 0, 0, 0) Yes 25
#7 (1, 3, 4) (2, 5) (0, 10, 0, 0, 0) Yes 25
#8 (1, 2, 5) (3, 4) (0, 0, 10, -10, 0) No 10
#9 (1, 2, 4) (3, 5) no solution No
#10 (1, 2, 3) (4, 5) (0, 0, 0, -10, -10) No 0
–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––----
The solution is optimum for #2 with objective 20.
Linear Programming Methods 9

5. The tableau below is not in the simplex form.

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. Write the set of equations described by the tableau as it stands.


b. Using linear operations put the tableau in the simplex form by making x1 and x4
basic. What is the solution corresponding to the new tableau.
c. From the new tableau predict the effects of increasing x5 by 1, by 0.5, and by 2.
d. From the new tableau predict the effects of increasing x3 by 1, by 0.5, and by 2.

a.
z + x1 - x2 - x3 +2x5 = 20
x1 + 5x2 - x3 + x4 +12x5 = 12
+ 8x2 + x3 + 2x4 +16x5 = 16

b. The tableau for B(1)=1 and B(2) = 4 is as follows:

Eq. Basic Coefficients Right


No. var. Z x1 x2 x3 x4 x5 Side
0 Z 1 0 –2 0.5 0 -1 16
1 x1 0 1 1 –1.5 0 4 4
2 x4 0 0 4 0.5 1 8 8

the basic solution is x1 = 4, x2 = 0, x3 = 0, x4 = 8, x5= 0.

c. Increasing x5 changes the objective value x1 and x4.


x5 Z x1 x4
0 16 4 8
0.5 16.5 2 4
1 17 0 0
2 18 -4 -8
Linear Programming Methods 10

d. Increasing x3 changes the objective value x1 and x4.


x3 Z x1 x4
0 16 4 8
0.5 15.75 4.75 7.75
1 15.5 5.5 7.5
2 15 7 7
Linear Programming Methods 11

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.

The tableau found in part b is

Row Basic Basic 1 2 3 4 5 Right


Number Index Variables z X1 X2 X3 X4 X5 Side
0 0 z 1 0 -2 0.5 0 -1 16
1 1 X1 0 1 1 -1.5 0 4 4
2 4 X4 0 0 4 0.5 1 8 8

a Allow x2 to replace x4 as a basic variable. The solution is optimal.

Row Basic Basic 1 2 3 4 5 Right


Number Index Variables z X1 X2 X3 X4 X5 Side
0 0 z 1 0 0 0.75 0.5 3 20
1 1 X1 0 1 0 -1.625 -0.25 2 2
2 2 X2 0 0 1 0.125 0.25 2 2

b. Allow x5 to replace x4 as a basic variable. The solution is not optimal and it is


degenerate.

Row Basic Basic 1 2 3 4 5 Right


Number Index Variables z X1 X2 X3 X4 X5 Side
0 0 z 1 0 -1.5 0.5625 0.125 0 17
1 1 X1 0 1 -1 -1.75 -0.5 0 0
2 5 X5 0 0 0.5 0.0625 0.125 1 1

c. Allow x5 to replace x1 as a basic variable. The solution is not optimal and it is


degenerate. The same solution as b.

Row Basic Basic 1 2 3 4 5 Right


Number Index Variables z X1 X2 X3 X4 X5 Side
0 0 z 1 0.25 -1.75 0.125 0 0 17
1 5 X5 0 0.25 0.25 -0.375 0 1 1
2 4 X4 0 -2 2 3.5 1 0 0
Linear Programming Methods 12

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.

Maximize z = 3x1 + 2x2


subject to –x1 + 2x2 £ 30
2x1 + x2 £ 40
x1 + 2x2 ≥ 10
x1 ≥ 0, x2 ≥ 0

Point #1: x2 and x5 are nonbasic

Row Basic Basic 1 2 3 4 5 Right


Number Index Variables z X1 X2 X3 X4 X5 Side
0 0 z 1 0 4 0 0 -3 30
1 3 X3 0 0 4 1 0 -1 40
2 4 X4 0 0 -3 0 1 2 20
3 1 X1 0 1 2 0 0 -1 10

z 4 x2 – 3 x5 = 30
4 x2 + x3 – x5 = 20
3 x2 + x4 + 2 x5 = 35
x1 +2 x2 – x5 = 5

Feasible region in terms of x2 and x5


Linear Programming Methods 13

Point #2: x1 and x5 are nonbasic


Row Basic Basic 1 2 3 4 5 Right
Number Index Variables z X1 X2 X3 X4 X5 Side
0 0 z 1 -2 0 0 0 -1 10
1 3 X3 0 -2 0 1 0 1 20
2 4 X4 0 1.5 0 0 1 0.5 35
3 2 X2 0 0.5 1 0 0 -0.5 5

z -2x1 – x5 = 10
-2x1 + x3 + x5 = 20
1.5x1 + x4+ 0.5x5= 35
0.5x1 + x2 – 0.5x5 = 5

Point #3; x1 and x3 are nonbasic.

Row Basic Basic 1 2 3 4 5 Right


Number Index Variables z X1 X2 X3 X4 X5 Side
0 0 z 1 -4 0 1 0 0 30
1 5 X5 0 -2 0 1 0 1 20
2 4 X4 0 2.5 0 -0.5 1 0 25
3 2 X2 0 -0.5 1 0.5 0 0 15

z -4x1 + x3 = 30
-2x1 + x3 + x5 = 20
2.5x1 -0.5x3 + x4 = 25
-0.5x1 + x2 + 0.5x3 = 15
Linear Programming Methods 14

Point #4; x3 and x4 are nonbasic.


Row Basic Basic 1 2 3 4 5 Right
Number Index Variables z X1 X2 X3 X4 X5 Side
0 0 z 1 0 0 0.2 1.6 0 70
1 5 X5 0 0 0 0.6 0.8 1 40
2 1 X1 0 1 0 -0.2 0.4 0 10
3 2 X2 0 0 1 0.4 0.2 0 20

z + 0.2x3+ 1.6x4 = 70
+ 0.6x3+ 0.8x4 + x5 = 40
x1 0.2x3+ 0.4x4 = 10
+ x2+ 0.4x3+ 0.2x4 = 20

Point #5; x2 and x4 are nonbasic.


Row Basic Basic 1 2 3 4 5 Right
Number Index Variables z X1 X2 X3 X4 X5 Side
0 0 z 1 0 -0.5 0 1.5 0 60
1 5 X5 0 0 -1.5 -1E-08 0.5 1 10
2 1 X1 0 1 0.5 0 0.5 0 20
3 3 X3 0 0 2.5 1 0.5 0 50

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

a. Let x2 enter the basis and x1 leave the basis.


b. Let x2 enter the basis and x4 leave the basis.
c. Let x3 enter the basis and x1 leave the basis.
d. Let x3 enter the basis and x4 leave the basis.
e. Let x5 enter the basis and x1 leave the basis.
f. Let x5 enter the basis and x4 leave the basis.

a. Let x2 enter the basis and x1 leave the basis.


Var. Eq. Z x1 x2 x3 x4 x5 Rt. side
–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
Z 0 1 2 0 0 0 6 6
x2 1 0 1 1 –1 0 4 4
x4 2 0 –4 0 5 1 –8 –8
––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
This is an infeasible solution.
b. Let x2 enter the basis and x4 leave the basis.
Var. Eq. Z x1 x2 x3 x4 x5 Rt. side
–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
Z 0 1 0 0 2 0.5 2 2
x1 1 0 1 0 –1.25 –0.25 2 2
x2 2 0 0 1 0.25 0.25 2 2
–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
This is the optimal solution.
c. Let x3 enter the basis and x1 leave the basis.
Var. Eq. Z x1 x2 x3 x4 x5 Rt. side
–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
Linear Programming Methods 18

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

10. You are given the following tableau.

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

x1 enters the basis and x2 leaves the basis

b. x4 enters the basis and x3 leaves the basis


Basic 1 2 3 4 5 6 Right
Variables z X1 X2 X3 X4 X5 X6 Side
z 1 -0.6 0 0.6 0 -3.8 0 2.4
X4 0 0.8 0 0.2 1 -0.6 0 0.8
X2 0 4.4 1 0.6 0 -0.8 0 4.4
X6 0 -0.6 0 -0.4 0 -0.8 1 0.4

c. x5 enter the basis and x2 leaves the basis


Basic 1 2 3 4 5 6 Right
Variables z X1 X2 X3 X4 X5 X6 Side
z 1 1 2 -4E-08 -9 1E-07 0 4
X3 0 10 3 1 -4 2E-07 0 10
X5 0 2 1 -1E-08 -3 1 0 2
X6 0 5 2 -3E-08 -4 9E-08 1 6
Linear Programming Methods 20

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.

a. x1 enters the basis and x3 leaves the basis


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

b. x1 enters the basis and x2 leaves the basis


Basic 1 2 3 4 5 6 Right
Variables z X1 X2 X3 X4 X5 X6 Side
z 1 0 1.5 0 -7.5 -0.5 0 3
X3 0 0 -2 1 11 -5 0 0
X1 0 1 0.5 0 -1.5 0.5 0 1
X6 0 0 -0.5 0 3.5 -2.5 1 1

In both cases the solution is degenerate.


Linear Programming Methods 22

12. a. What special property does the tableau below exhibit?

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.

a. The problem is unbounded because column x5 has all nonpositive entries.

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

13. Find all alternate optima in the following tableau.

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

Let x1 = y1 – y1’ and x2 = y2– y2’


Minimize z =3y1 -3y1’ + 2y2 - 2y2’
subject to –y1 +y1’ + y2 –y2’ = 11
y1 –y1’ + 2y2 –2y2’ ≥ 10
–y1 +y1’ £ 3
y1, y2, y1’, y2’ ≥ 0

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

Linear Obj. Coef.: 3 -3 2 -2


ints
Name Value Rel. RHS Linear Constraint Coefficients
Con1 11 = 11 -1 1 1 -1
Con2 13 >= 10 1 -1 2 -2
Con3 3 <= 3 -1 1 0 0

The optimal solution is x1= –3, x2 = 8, with the objective function 7.


Linear Programming Methods 25

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

Linear Obj. Coef.: 1 1 -2

Value Rel. RHS Linear Constraint Coefficie


-20000 <= 20 1 1 -2
0 <= 20 1 -1 0
0 >= -20 1 -1 0
Linear Programming Methods 26

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

Linear Obj. Coef.: 1 1 -2


ints
Name Value Rel. RHS Linear Constraint Coefficie
Con1 -10 <= 20 1 1 -2
Con2 -10 >= -20 1 1 -2
Con3 0 <= 20 1 -1 0
Con4 0 >= -20 1 -1 0
Con5 -5 >= -5 1 0 -1
Con 6 -5 >= -5 0 1 -1

In terms of the original variables, x = y = -5. This should be a unique optimum.


Linear Programming Methods 27

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

Name: x' y'


Values: 0 0
Lower Bounds: 0 0
Upper Bounds: 10000 10000

Linear Obj. Coef.: 1 1


ints
Name Value Rel. RHS Linear Constraint
Con1 0 <= 30 1 1
Con2 0 >= -10 1 1
Con3 0 <= 20 1 -1
Con4 0 >= -20 1 -1

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.

Maximize z = –7x1+ 3x2

subject to 4x1+ 8x2 =30

–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.

Maximize z = 2x1 –3x2 + x3 – 4x4

subject to 2x1 – x2 + 3x3 – 5x4 £ 20

x1 + 2x2 – x3 + 4x4 ≥ 2

x4 £ 20

xj ≥ 0, j = 1,…, 4

Initial Phase 1 tableau, art1 is the artificial variable.


Basic 1 2 3 4 5 6 7 8 Right
Variables z X1 X2 X3 X4 X5 X6 X7 art1 Side
z 1 -1 -2 1 -4 0 1 0 0 -2
X5 0 2 -1 3 -5 1 0 0 0 20
art1 0 1 2 -1 4 0 -1 0 1 2
X7 0 0 0 0 1 0 0 1 0 20

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

Substitute original objective function to begin phase 2.


Basic 1 2 3 4 5 6 7 8 Right
Variables z X1 X2 X3 X4 X5 X6 X7 art1 Side
z 1 -3 1 0 0 0 1 0 9998 -2
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
Linear Programming Methods 30

20. Consider the linear program.

Maximize z = 2x1 + 3x2 + x3 + 4x4

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.

a. x1 =9, x6 =15, x3 =4, x2 =x4 = x5 = 0. z = 22.


b. If x5 were to enter the basis, x1 should leave by the minimum ratio rule. With
the basis change, the value of x5 will increase by 9, the objective will decrease by
Linear Programming Methods 31

2*9 =18, x1 will decrease by 9 to 0, x6 will decrease by 9 to 6, and x3 will not


change.
x5 =9, x6 =6, x3 =4, x1 =x4 = x5 = 0. z = 4.
c. Say x5 were to enter the basis and x6 is chosen to leave. With the basis
change, the value of x5 will increase by 15, the objective will decrease by 2*15
=30, x1 will decrease by 15 to -6, x6 will decrease by 15 to 0, and x3 will not
change.
x5 =15, x1 = -6, x3 =4, x6 =x4 = x5 = 0. z = -8.
Violating the minimum ratio rule has caused the solution to become
infeasible.
d. 0.5x2+ x3 + 0.25x4 + 0.5x7 = 4
e. If x2 enters the basis, it will yield an increase of (1.5)*6 = 9 for the objective
value. If x4 enters the basis, it will yield an increase of (1.25)*6.667 = 8.33 for the
objective value. x2 gives the greatest increase.
f. x2 should enter the basis, and x6 should leave the basis.
g. The variable to leave the basis should be x3 . The new tableau is

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

21. Consider the linear program given below.

Minimize z = 2x1 + x2
subject to –x1 + 2x2 £ 10
x1 – 2x2 £ 4
x1 + x2 ≥ 8
x1 + 2x2 £ 20
x1 ≥ 0, x2 ≥ 0

a. Show the equality form of the model.


b. Give an upper bound on the number of basic solutions for this problem.
c. What selection of basic variables will cause the first and third constraints to be
tight? Give values to the variables for this basic solution?
d. For which set of basic variables is there no solution to the model in equality
form?
e. If the two-phase method is to be used to find a solution, construct the first
tableau for the computations. The tableau should be in the simplex form.
f. Based on this tableau select the variables that should enter and leave the basis.
You don't have to determine the next tableau.

a. The equality form is :


–x1 + 2x2 + x3 = 10
x1 – 2x2 + x4 = 4
x1 + x2 - x5 = 8
x1 + 2x2 + x6 = 20
x1 ≥ 0, x2 ≥ 0, x3 ≥ 0, x4≥ 0, x5 ≥ 0, x6 ≥ 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

d. A selection of x1 x2 x7 x6 as basic variable (setting x3 and x4 at 0) has no


solution. In these case, the first constraint states that – x1 + 2x2 = -10 while
the second one states x1 – 2x2 = 4. These equations are conflicting.
e The Phase I problem is listed below. x7 is the artificial variable.

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

Iteration 1: x1 leaves the basis and x4 enters the basis.


Row Basic Basic 1 2 3 4 Right
Number Index Variables z X1 X2 X3 X4 Side
0 0 z 1 1.5 0.5 -1E-08 0 -11
1 3 X3 0 3 -1 1 0 -8
2 4 X4 0 -0.5 0.5 3E-17 1 2
Dual Ratio --- --- 0.5 --- ---

Iteration 2: x2 leaves the basis and x3 enters the basis.


Row Basic Basic 1 2 3 4 Right
Number Index Variables z X1 X2 X3 X4 Side
0 0 z 1 3 3E-08 0.5 0 -15
1 2 X2 0 -3 1 -1 0 8
2 4 X4 0 1 1E-08 0.5 1 -2
Dual Ratio --- --- --- --- ---

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

Maximize z = –3x1 + 2x2


subject to 6x1 + 2x2 ≥ 4 (C1)
2x1 + x2 £ 4 (C2)
x1 ≥ 0, x2 ≥ 0
with x3 and x4 slacks.

Row Basic Basic 1 2 3 4 Right


Number Index Variables z X1 X2 X3 X4 Side
0 0 z 1 7 0 0 2 8
1 2 X2 0 2 1 0 1 4
2 3 X3 0 -2 0 1 2 4

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.

Row Basic Basic 1 2 3 4 Right


Number Index Variables z X1 X2 X3 X4 Side
0 0 z 1 7 0 0 2 8
1 2 X2 0 2 1 0 1 2
2 3 X3 0 -2 0 1 2 -2
Dual Ratio --- 3.5 --- --- ---

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

b. After the change the top row of the tableau changes.


Linear Programming Methods 36

Basic Basic 1 2 3 4 Right


Index Variables z X1 X2 X3 X4 Side
0 z 1 -8 0 0 -3 8
2 X2 0 2 1 0 1 4
3 X3 0 -2 0 1 2 4
We use the primal simplex to reoptimize. x1 enters and x2 leaves to obtain the
new optimum.
Basic Basic 1 2 3 4 Right
Index Variables z X1 X2 X3 X4 Side
0 z 1 0 4 0 1 24
1 X1 0 1 0.5 0 0.5 2
3 X3 0 0 1 1 3 8

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 x5 to leave the basis and x4 enters. Now x3 is negative.


Basic Basic 1 2 3 4 5 Right
Index Variables z X1 X2 X3 X4 X5 Side
0 z 1 3 0 0 0 2 2
2 X2 0 0 1 0 0 1 1
3 X3 0 -6 0 1 0 2 -2
4 X4 0 2 0 0 1 -1 3
Dual Ratio --- 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.

Maximize z = 2x1 + 5x2 + x3 + 4x4

subject to 3x2 + 2x3 – x4 £ 5

–x1 + 2x2 + 2x3 £ 6

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

a. Change the right-hand sides of the three constraints to 1, 10 and 3, respectively.


Give the updated tableau and state the primal solution.

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).

Basic Basic 1 2 3 4 5 6 7 Right


Index Variables z X1 X2 X3 X4 X5 X6 X7 Side
0 z 1 1.5 0 4 -3E-07 -5E-09 0.5 4 17
2 X2 0 -0.5 1 1 0 0 0.5 0 5
4 X4 0 1.5 0 1E-08 1 -1E-08 -0.5 1 -2
5 X5 0 3 0 -1 0 1 -2 1 -16
Dual Ratio --- --- --- 4 --- --- 0.25 ---

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

Basic Basic 1 2 3 4 5 6 7 Right


Index Variables z X1 X2 X3 X4 X5 X6 X7 Side
0 z 1 2.25 0 3.75 -3E-07 0.25 1E-08 4.25 13
2 X2 0 0.25 1 0.75 0 0.25 1E-08 0.25 1
4 X4 0 0.75 0 0.25 1 -0.25 6E-17 0.75 2
6 X6 0 -1.5 0 0.5 0 -0.5 1 -0.5 8
Linear Programming Methods 39

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.

Maximize z = x1 + x2+ 1.2x3+ 1.2x4 + 0.8x5

subject to 2x1 + 2x3 + x4 + x5 £ 12

2x2 + x3 + 2x4 + x5 £ 15

x1 + x2 + x5 £ 15

5x1 + 7x2 + 4x3 + 5x4 + 6x5 £ 60

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.

a. The primal solution is


Basic Solution
Z 11.2
x2 4
x3 6
xs2 1
xs3 11
xs4 8

Dual Solution
Pi 0.1 0 0 0 1

b. The reduced cost


x1 x2 x3 x4 x5 xs1 xs2 xs3 xs4 xs5
Red. Cost 0.2 0 0 -0.1 0.6 0.1 0 0 0 1

c. After one iteration, the solution is optimal.


Basic Solution
Z 11.4
x2 3
x3 5
x4 2
xs3 12
xs4 9
Linear Programming Methods 42

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˚˙

The simplex tableau is as follows:

Basic Basic 1 2 3 4 5 6 7 8 9 10 Right


Index Variables z x1 x2 x3 x4 x5 xs1 xs2 xs3 xs4 xs5 Side
0 z 1 -0 0 -0 0 0.8 0.2 0.2 0 0 0.6 11.4
2 x2 0 1 1 0 0 -2 -1 -1 0 0 3 3
3 x3 0 2 0 1 0 1 0 -1 0 0 2 5
4 x4 0 -2 0 0 1 2 1 2 0 0 -4 2
8 xs3 0 0 0 0 0 3 1 1 1 0 -3 12
9 xs4 0 0 0 0 0 6 2 1 0 1 -9 9
Linear Programming Methods 43

29. Consider the problem

Maximize z = x1 + x2

subject to x1 + 3x2 ≥ 15

2x1 + x2 ≥ 10

x1 + 2x2 £ 40

3x1 + x2 £ 60

x1 and x2 are unrestricted

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

Chapter 4. Sensitivity Analysis, Duality, and


Interior Point Methods
Notes to the teacher
Exercise 11. The column in the tableau for x4 should be 0,0,1, rather than 0,1,0.
Exercise 13g is not good because constraint 4 is loose. It would be better to use
constraint 3. Exercise 13k is not good because the simple upper bound has no
affect on the current solution.

1. The LP below has optimal solution x* = (5, 0, 0, 0, 2) with z* = 60 and xB = (x1, x2,
x5).

Maximize z = 12x1 + 6x2 + 2x3

subject to 2x1 + 4x2 – x3 + x4 = 10

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.

Relevant ranges are shown in the analysis below.


Sensitivity Analysis, Duality, and Interior Point Methods 2

Sensitivity Analysis for Worksheet P_01

Variable Analysis Objective Value: 60.


Objective Range Lower Range Upper
Num. Name Value Status Reduced Cost Coefficient Limit Limit
1 X1 5 . Basic 0. 12. 4.1667 ---
2 X2 0 . Lower -13.4286 6. --- 19.4286
3 X3 0 . Basic 0. 2. --- 25.5
4 X4 0 . Lower -4.8571 0. --- 4.8571
5 X5 2 . Basic 0. 0. -11.3333 47.

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

2. Consider the linear programming problem.

Maximize z = 5x1 – 3x2 + 4x3 – x4

subject to 3x1 + 4x2 + 3x3 – 5x4 £ 13

5x1 – 3x2 + x3 + 2x4 £ 15

xj ≥ 0, j = 1,…, 4

At optimality, x3 and x4 are basic with basis inverse

Ê 2/11 5/11 ˆ
B–1 = Á –1/11 3/11 ˜
Ë ¯

Perform the following ranging analyses.

a. Find simple ranges on each of the objective function coefficients.


b. Find simple ranges on each of the RHS constants.

Solution to parts a and b are in the tables below.

Sensitivity Analysis for Worksheet P_02

Variable Analysis Objective Value: 33.8182


Objective Range Lower Range Upper
Num. Name Value Status Reduced Cost Coefficient Limit Limit
1 X1 0. Lower -5.1818 5. --- 10.1818
2 X2 0. Lower -1.6364 -3. --- -1.3636
3 X3 9.1818 Basic 0. 4. 2.1613 6.5714
4 X4 2.9091 Basic 0. -1. -5.75 0.3846

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

This problem can be solved by formulating it as a parametric objective coefficient


problem as in Exercise 3. In this formulation, we have objective function z = (c +
lc*)x, where

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.

c j + lc *j ≥ 0 for all j (1)


To compute these values, we first find the dual variables associated with the
two objective functions.
1 È 2 5˘
p = c BB-1 = (4, – 1) Ê ˆ Í = (9/11, 17/11)
Ë 11¯ Î-1 3˙˚
and
1 È 2 5˘
p* = c*BB-1 = (–1, 0) Ê ˆ Í = (–2/11, –5/11).
Ë 11¯ Î-1 3˙˚

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¯

From Eq. (1), we have c1 + lc1* ≥ 0 or 57/11 + l(–42/11) ≥ 0 so

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

This result has no affect on the parameter l so we conclude that the


basis remains optimal for all l £ 1.36.

d. Find the range of parameter variation when for every unit increase in b1 we have
a unit decrease in b2 (see Exercise 4).

This problem can be solved by formulating it as a parametric right-hand-side


problem as in Exercise 4. In this formulation, we have right-hand side b + lb*,
where
b = (13, 15)T and b* = (1, –1)T
At optimality, we require
- -
bi + lb*i ≥ 0 for all i (2)

- 1 È 2 5˘ Ê13ˆ Ê 101 11ˆ


where b = B–1b = Ê ˆ Í-1 3˙ ÁË15˜¯ = ÁË 32 / 11˜¯
Ë 11¯ Î ˚
and
- 1 È 2 5˘ Ê 1 ˆ Ê -3 / 11ˆ
b* = B–1b* = Ê ˆ Í-1 3˙ ÁË -1˜¯ = ÁË -4 / 11˜¯
Ë 11¯ Î ˚
Using Eq. (2), we get
101 -3
b1 + lb1* = + l Ê ˆ ≥ 0 or l £ 33.67
11 Ë 11 ¯
and
32 -4
b2 + lb2* = + l Ê ˆ ≥ 0 or l £ 8.
11 Ë 11 ¯

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

3. Parametric Objective Coefficient Problem –– Proportional Ranging. Let c* be an n-


dimensional row vector and let l be a scalar parameter. Consider the following
parameterized linear program.

zOF(l) = Maximize z = (c + lc*)x


subject to Ax = b, x ≥ 0

For optimal basis B, all reduced costs must be nonnegative; i.e.,


– –
cj + lc*j ≥ 0 for all j (1)

Determine the range over which l can vary and B remain optimal. You must find lB
– –
and lB such that lB £ l £ lB.

For B to remain an optimal basis, it is only necessary that condition (1) be


satisfied; it is not necessary for either c j or c j* to be nonnegative. However, if c j*
= 0, then the optimality of B implies that c j ≥ 0. Otherwise, if c j* > 0, condition (1)
is equivalent to l ≥ -c j / c j* . If c j* < 0, condition (1) is equivalent to l £ -c j / c j* .
To determine the upper and lower bounds on l, we must consider all values of j.
Let
ÔÏ - 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
The closed interval {l : l B £ l £ lB } = [ l B , lB ] is known as the characteristic
interval or optimal interval for the basis B. If l B > lB , the optimal interval is
empty so B can never be an optimal basis. If l B = lB , the optimal interval
contains a single point.
Sensitivity Analysis, Duality, and Interior Point Methods 8

4. Parametric Right-Hand-Side Problem –– Proportional Ranging. Let b* be an m-


dimensional vector and let l be a scalar parameter. Consider the following
parameterized linear program.

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.

Let x1 be the solution to the parametric objective coefficient problem when l = l1


and x2 be the solution when l = l2. We must show that
zOF(al1 + (1 – a)l2) £ azOF(l1) + (1 – a)zOF(l2) for all a Œ [0, 1] (1)

To begin, let x be the solution to the parametric objective coefficient problem


when l = al1 + (1 – a)l2, and note that x is feasible when l = l1 or l2. From
the definition of optimality we have,
(c + l1c*) x £ (c + l1c*)x1 (2)
and
(c + l2c*) x £ (c + l2c*)x2 (3)
Multiplying (2) by a (3) by (1 – a) and summing, we get
(c + [al1 + (1 – a)l2]c*) x £ a (c + l1c*)x1 + (1 – a) (c + l2c*)x2
or
zOF(al1 + (1 – a)l2) £ azOF(l1) + (1 – a)zOF(l2)
which is condition (1).
Sensitivity Analysis, Duality, and Interior Point Methods 10

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.

The dual of the parametric RHS problem is


zRHS(l) = Minimize z = p(c + lc*)
subject to pA ≥ c
which is equivalent to
wRHS(l) = p(c + lc*)
Maximize w = –p
subject to pA ≥ c
From the proof in Exercise 5, we know wRHS(l) is convex. Recognizing that
zRHS(l) = – wRHS(l), and that multiplying a convex function by –1 gives a
concave function proves that zRHS(l) is concave.

b. Prove that zRHS(l) is a concave function of l by making use of the definition of


convexity and not resorting to the dual formulation.

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

c x√ = acx1 + (1 – a)cx2 = azRHS(l1) + (1 – a)zRHS(l2)


and by the definition of optimality, c x ≥ c x√ , so
zRHS(al1 + (1 – a)l2) ≥ azRHS(l1) + (1 – a)zRHS(l2)
which is condition (1).
Sensitivity Analysis, Duality, and Interior Point Methods 12

7. Consider the parametric objective function LP:

Maximize z = –3x1 – (4 + 8l)x2 – 7x3 + x4 – (1 – 3l)x5

subject to 5x1 – 4x2 + 14x3 – 2x4 + x5 = 20

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.

Part a: To find the interval {l : l B £ l £ lB }, if it exists, such that x2 and x3 remain


optimal, we can apply the bounds determined in the solution to Exercise 3

ÏÔ - 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

The data for the problem are as follows.

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¯

We are now able to compute the lower bound


Sensitivity Analysis, Duality, and Interior Point Methods 14

Ï -11.5 -4 ¸ Ï -34.5 -12 ¸


l B = maximum Ì , ˝=Ì , ˝ = -0.75
Ó 44 / 3 16 / 3 ˛ Ó 44 16 ˛

and the upper bound

8.5 ¸
lB = minimum ÏÌ ˝ = -0.57 .
Ó -15 ˛

From these results, we have the interval : –0.75 £ l £ –0.57.

Setting l = –0.6, for example, gives objective coefficients

c + lc* = (–3, –0.8, –7, 1, –2.8)

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.

Maximize z = 2x1 + 4x2 + x3 + x4

subject to x1 + 3x2 + x4 £ 8 (raw material 1)

2x1 + x2 £ 6 (raw material 2)

x2 + 4x3 + x4 £ 6 (raw material 3)

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

Variable Analysis Objective Value: 13.


Objective Range Lower Range Upper
Num. Name Value Status Reduced Cost Coefficient Limit Limit
1 X1 2. Basic 0. 2. 1.25 3.75
2 X2 2. Basic 0. 4. 3.125 6.25
3 X3 1. Basic 0. 1. 0. 12.
4 X4 0. Lower -0.35 1. --- 1.35

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

9. Write the dual of the primal linear program below.

Maximize z = 5x1 – 3x2 + 4x3 – x4

subject to 3x1 + 4x2 + 3x3 – 5x4 £ 13

5x1 – 3x2 + x3 + 2x4 £ 15

xj ≥ 0, j = 1,…, 4

Dual: Minimize zD = 13y1 + 15y2

subject to 3y1 + 4y2 ≥ 5

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

12. Consider the following linear program.

Minimize z = 5x1 + 3x2 – x3


subject to x1 – 2x2 + x3 ≥ 2
–2x1 – x2 – 3x3 ≥ –10
x1 + x2 + x3 = 5
xj ≥ 0, j = 1,…, 3

a. Write the dual problem.


b. Solve the primal problem using the two–phase method and identify the optimal
primal and dual solutions.
c. Solve the dual problem directly using the two–phase method and identify the
optimal primal and dual solutions.

a. Rewrite the primal in canonical form.


Maximize zP =– 5x1 – 3x2 + x3

subject to –x1 + 2x2 – x3 £ –2

2x1 + x2 + 3x3 £ 10

x1 + x2 + x3 = 5

xj ≥ 0, j = 1,…, 3

Dual: Minimize zD =–2y1 + 10y2 + 5y3

subject to –y1 + 2y2+ y3 ≥ –5

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

c. Solution of Dual: We use y3 = y3P - y3M, where y3P ≥ 0, y3M ≥ 0.


We also manipulate the dual to obtain a maximum and make all right-hand-sides
positive.
Row Basic Basic 1 2 3 4 5 6 7 8 Right
Number Index Variables z Y1 Y2 Y3P Y3M YS1 YS2 YS3 art1 Side
0 0 z 1 -2E-07 0 9E-08 - 9 E - 0 8 3 1 1 9998 17
1 1 Y1 0 1 0 0 0 0.6667 - 0 . 3 3 3 - 0 . 3 3 3 0.3333 2.6667
2 4 Y3M 0 1E-07 0 -1 1 2.3333 0.3333 - 1 . 6 6 7 1.6667 14.333
3 2 Y2 0 0 1 - 6 E - 1 7 6E-17 1 0 -1 1 6
Sensitivity Analysis, Duality, and Interior Point Methods 22

13. Consider the following linear program.

Maximize z = 2x1 + x2 – 3x3 + 5x4

subject to 3x1 – x2 + x3 + 2x4 £ 8

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

b. The primal and dual solutions are:


Basic Solution
Z 26
x4 4.8571
s2 9.1429
x2 1.7143
s4 2.1429
DualSolution
C 1 C 2 C 3 C 4
 2 0 1 0
c. Describe the marginal effects of allowing x1 to enter the basis.
We observe:
Entering Variable x1
Red. Cost 6
Entering C 1 1.5714
Column C 2 2.4286
C 3 0.1429
C 4 -0.571
Sensitivity Analysis, Duality, and Interior Point Methods 24

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.

d. How much should x1 increase to obtain the adjacent basic solution?


The ratio test determines the amount x1 may increase.
Basis Ratio
x4 3.0909
s2 3.7647
x2 12
s4 ---

The minimum ratio is for x4, so the adjacent basic solution will included x1 and not
include x4.

e. The new basis inverse:


C 1 C 2 C 3 C 4
 0.3636 0 0.455 0
Basis x1 0.2727 0 0.091 0
Inverse s2 -0.091 1 -0.36 0
x2 -0.182 0 0.273 0
s4 -0.273 0 -0.09 1

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

Since s4 is now negative we perform an iteration of the dual-simplex. The


resultant tableau is shown below after s4 leaves and s1 enters the basis.

Basic Basic 1 2 3 4 5 6 7 8 Right


I n d e x Variables z x1 x2 x3 x4 s1 s2 s3 s4 Side
0 z 1 3.333 0 7.333 0 2E-08 0 0.333 4.667 41.33
4 x4 0 1 0 1 1 0 0 0 1 7
6 s2 0 1.667 0 5.667 0 -0 1 -0.33 1.333 6.667
2 x2 0 0.333 1 -0.67 0 5E-09 0 0.333 -0.33 6.333
5 s1 0 1.333 0 -1.67 0 1 0 0.333 -2.33 0.333

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.
This constraint makes the problem infeasible.
When the new constraint is added, a new slack variable must also be added. The
tableau will appear as below.
Basic Basic 1 2 3 4 5 6 7 8 9 Right
I n d e x Variables z x1 x2 x3 x4 s1 s2 s3 s4 s5 Side
0 z 1 6 0 4 0 2 0 1 0 0 26
4 x4 0 1.571 0 0.286 1 0.429 0 0.143 0 0 4.857
6 s2 0 2.429 0 4.714 0 0.571 1 -0.14 0 0 9.143
2 x2 0 0.143 1 -0.43 0 -0.14 0 0.286 0 0 1.714
8 s4 0 -0.57 0 0.714 0 -0.43 0 -0.14 1 0 2.143
9 s5 0 -1 0 -1 0 0 0 0 0 1 -6

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

14. Give an economic interpretation of duality when the primal is a minimization


problem with inequality constraints and the dual is a maximization problem with
inequality constraints, both in nonnegative variables. Begin by writing out the two
LPs. Assume that the primal represents a government agency that uses a set of n
resources with fixed unit costs to provide m different services, each with a fixed
demand. The agency’s objective is to minimize its costs. Assume that the dual
problem represents a consulting company that can provide the same set of m
services. Define all model coefficients. Also, show how complementary slackness
arises and interpret its meaning in the context of your models.

Matrix definition of primal and dual problems


(P) Minimize zP = cx (D) Maximize zD = pb
subject to Ax ≥ b subject to pA £ c
x≥0 p≥0

Algebraic definition of primal and dual problems

(P) Minimize zP = c1x1 + c2x2 + ... + cnxn (D) Maximize zD = b1p1+b2p2+...+bmpm

subject to a11x1 + a12x2 + … +a1nxn ≥ b1 subject to a11p1+a21p2+...+am1pm £ c1

a21x1 + a22x2 + ... +a2nxn ≥ b2 a12p1+a22p2+...+am2pm £ c2


. . . . . . . .
. . . . . . . .
. . . . . . . .
am1x1 +am2x2+...+amnxn ≥ bm a1np1+a2np2+...+amnpm £ cn

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

15. Consider the following LP.

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 = –x1 – x2 + m[log(x1) + log(x2) + log(x3)] – p(x1 + x2 + x3 – 1)

The optimality conditions are


∂LP m
= –1 + –p = 0 (1)
∂x1 x1

∂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

Rearranging terms, we get the following quadratic in 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

Direction Vectors Ratio Vectors


d(Pi) d(Z) d(X) Ratio(Z) Ratio(X)
1 0.2126 1 -1.264 1 -0.181 1 1.5827 1 5.5354
2 -0.738 2 -0.313 2 -0.312 2 3.1953 2 3.2047
3 -1.789 3 0.0821 3 1.1178 3 - --
4 -0.839 4 0.2135 4 1.1926 4 - --
Min 1.1178 Min 3.2047
Z Step 0.8942 X Step 2.5637
Sensitivity Analysis, Duality, and Interior Point Methods 33

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

Direction Vectors Ratio Vectors


d(Pi) d(Z) d(X) Ratio(Z) Ratio(X)
1 0.0426 1 -0.274 1 -0.261 1 3.1789 1 2.0532
2 -0.158 2 -0.073 2 -0.051 2 9.8752 2 3.9144
3 -0.389 3 0.199 3 1.0277 3 - --
4 -0.188 4 -0.011 4 1.3275 4 135.51
Min 1.0277 Min 2.0532
Z Step 0.8222 X Step 1.6426

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

Direction Vectors Ratio Vectors


d(Pi) d(Z) d(X) Ratio(Z) Ratio(X)
1 -0.023 1 -0.036 1 -0.061 1 18.007 1 1.7531
2 -0.007 2 -0.052 2 -0.068 2 12.764 2 1.7134
3 -0.065 3 0.0354 3 1.2309 3 - --
4 -0.081 4 0.0419 4 1.1772 4 - --
Min 1.1772 Min 1.7134
Z Step 0.9417 X Step 1.3707
Sensitivity Analysis, Duality, and Interior Point Methods 34

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

Direction Vectors Ratio Vectors


d(Pi) d(Z) d(X) Ratio(Z) Ratio(X)
1 -0.003 1 -0.009 1 -0.014 1 66.498 1 1.6709
2 -0.003 2 -0.009 2 -0.014 2 64.742 2 1.6812
3 -0.015 3 0.0085 3 1.22 3 - --
4 -0.016 4 0.0082 4 1.2165 4 - --
Min 1.2165 Min 1.6709
Z Step 0.9732 X Step 1.3367
Sensitivity Analysis, Duality, and Interior Point Methods 35

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)

Zdx + Xdz = µe – XZe (3)

To find dp, we multiply (2) by X and add the result to (3) to get

XATdp + Zdx = XddD + µe – XZe (4)

Multiply (4) by Z–1.

Z–1XATdp + dx = Z–1µe – Z–1XZe + Z–1XddD (5)

Multiply (5) by A and rearrange


AZ–1XATdp = –Adx – AZ–1XZe + AZ–1µe + AZ–1XddD (6)

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)

Multiplying (7) by (AZ–1XAT)–1 gives

dp = (AZ–1XAT)–1(–b + AZ–1µe + AZ–1XddD) (8)

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

and multiplying through by Z–1.


Sensitivity Analysis, Duality, and Interior Point Methods 36

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).

The duality gap as a function of a is

gap(a) = (z0 + adz)T(x0 + adx) = (z0)Tx0 + a[(z0)Tdx + (x0)Tdz] + a2(dz)Tdx

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,

gap(a) = gap(0) + a[(Zdx )Te + (Xdz)Te]

= gap(0) + a[Zdx + Xdz]e

= gap(0) + a[nm – gap(0)]

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

Chapter 5. Network Flow Programming Models


Notes: Exercise 6b. Add – Do as many jobs as possible.

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

[Fixed External Flow]


(Cost)

[10] [-5]
(10)
S1 D1
(10)
(15) (6)
[15] [-3]
(5)
S2 (5) D2
(10)

(12)
[8] (11) [-8]
(8)
S3 D3
(7)
(21)

Heavy arcs have flow [-17]


Shipping cost = $327 D4
Network Flow Programming Models 2

2. Using the shipping costs given for Problem 1 and the production and demand data
given below, find the production schedule that maximizes profit.

Production Data Destination Data

Minimum Maximum Cost Minimum Maximum Unit


no. units no. units per unit sales sales revenue
S1 10 15 $10 D1 5 5 $20
S2 15 15 12 D2 3 10 25
S3 0 8 13 D3 0 8 22
D4 10 20 30

[Fixed External Flow]


(Upper, Cost) (Upper, Cost) [Production] {-Sales}
(Cost)
(Shipments)
[5] [-5]
[15] {-5}
(5, 10) (10)
A D1 A D1
(10) (2)
(6) (8)
[15] (15) [-3] [15] (5) {-10}
(7, -25)
B D2 B (5) D2
(10)

[8] (8) {-8}


(8, 13) (8, -22)
C D3 C D3

[-10] {-15}
(10, -30)
D4 D4

Optimum Profit 190.


Network Flow Programming Models 3

3. Multiperiod Production Scheduling. A company has one manufacturing plant and


three sales outlets (A, B and C). Unit shipping costs from the plant to outlets A, B,
and C are $4, $6 and $8, respectively. The company wishes to develop a production,
shipping and sales plan for three periods. The corresponding data are given below.
The plant has the capability to store up to 100 units of the output it produces in one
period for sale in a later period. The storage cost is $1 per unit per period.. Find a
plan to maximize profit and identify the bottlenecks in the system.

Manufacturing data Selling price at Maximum sales at


outlets outlets
Unit Capacity
Period cost ($) (units) A B C A B C
1 $8 175 units $15 $20 $14 50 100 75
2 10 200 18 17 21 75 150 75
3 11 150 15 18 17 20 80 50

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)

Solution: Profit = $1455


Period Prod. Inventory Sales A Sales B Sale s C
1 175 25 50 100 0
2 200 0 75 75 75
3 100 0 20 80 0
Network Flow Programming Models 4

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

Hours spent by crews


C1 C2 C3 C4 C5
J1 15 0 0 0 0
J2 0 7.7333 2.3117 0 20
J3 5 12.267 0 20 0
Total 20 2 0 2.3117 20 20

Total Cost 8831.17


Network Flow Programming Models 6

5. Solve the 4 ¥ 4 assignment problem given E F G H


in the table. A 3 2 14 3
B 21 20 17 5
C 14 14 16 4
D 14 3 14 4

Transportation model. Cost = 27.


Name E F G H
A 1 0 0 0
B 0 0 0 1
C 0 0 1 0
D 0 1 0 0

Using a min-cost flow model.


Name Flow Origin Term. Cost
A-E 1 1 5 3
B-E 0 2 5 21
C-E 0 3 5 14
D-E 0 4 5 14
A-F 0 1 6 2
B-F 0 2 6 20
C-F 0 3 6 14
D-F 1 4 6 3
A-G 0 1 7 14
B-G 0 2 7 17
C-G 1 3 7 16
D-G 0 4 7 14
A-H 0 1 8 3
B-H 1 2 8 5
C-H 0 3 8 4
D-H 0 4 8 4

Optimal Basic Solutions:


(xAE, xBG, xBH, xCE, xCG xDF, xDG) = (1, 0, 1, 0, 1, 1, 0).
(xAE, xBG, xBH, xCE, xCH xDF, xDG) = (1, 1, 0, 0, 1, 1, 0).
Network Flow Programming Models 7

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?

a. The solution has: Assign A to jobs 2


[External Flow]
and 3, B to jobs 1 and 5, and C to jobs
(Cost) 4 and 6. Cost 26.
[+1] [–1]
(3)
A J1
(2)
[+1] [–1]
(2)
B J2

[+1] [–1]

C J3
Network Flow Programming Models 8

b. The solution has: Assign A to jobs 3, B


[External Flow]
to job 5, and C to job 6. Cost less 300
(Cost) is 11.
(upper, cost)
[+1]
(3) (1, 0)
A J1
(2)
[+1]
(1, 0)
(2)
B J2

[+1]
(1, 0)
C J3

c. The solution has: Assign A to jobs 1, 2


[External Flow]
and 3, B to jobs 4, 5, and 6. Cost is 18.
(Cost)
(upper, cost)
[–1]
(6, 0) (3)
A J1
(2)
[–1]
(6, 0)
(2)
B J2

[–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) (23) (4)


2 4 6 8
4 8 12
(12)

1 (4) 5 (3) 9 (6) 13 (5) 16


1
(7) (3) 15
(2) 3 (7) 7 (1) 11
2
(18) (8) (11)
3 5 7 9
6 10 14

Shortest path tree is shown with heavy arcs.


(4) (23) (4)
2 4 6 8
4 8 12
(12)
(4) 5 (3) 9 (6) 13 (5) 16
1
1
(7) (2) 3 (7) 7 (1) 11 (3) 15
2
(18) (8) (11)
3 5 7 9
6 10 14
Network Flow Programming Models 10

8. You are given the following directed network.

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.

a. Shortest path tree shown with heavy arcs

[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

b. The flows in the maximum flow are shown on the arcs.


Max flow
(flow, capacity)
4 (0,5)
(0,2)
(2,9)
2 7 (3,15)
(3,3) (1,1)
(1,8)
(23,M) (12,12) (16,16) (23,M)
1 5 9
(4,4) (0,6)
(8,9)
(2,13) (4,4)
3 8
(2,12)
(2,2)
All arc costs are 0,
6 except arc leaving node
9. That cost is -1.
Network Flow Programming Models 12

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%.

Year Operating cost Resale value


of ownership during year at year end
1 $800 $2000
2 800 800
3 1000 400
4 1500 200
5 2000 0

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?

c. The economic life of a piece of equipment is the age of replacement that


minimizes the lifetime cost of replacement. Considering the possibility of
replacement in any one of the five years, develop a network model whose
solution will determine the economic life of the machine? How sensitive is the
solution to the costs in your model?

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%.

The cost of this model is x[c0 + c1g1 + c2(g1g2) + c3'(g1g2g3)]


Let x be the flow from arc 0 to 1. By conservation of flow:
1 + x g1g2g3 = x, or x = 1/[1 – g1g2g3]
Network Flow Programming Models 13

For the information given, c0 = 4000, c1 = 800, c2 = 800,


c3' = 600. Net Present worth = 23480.
b. We add arc (2, 0) to allow replacement every 2 years.
[1]

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

Variable Analysis Objective Value: 22170


Reduced Objective Range Upper
Num. Name Value Status Cost Coefficient Lower Limit Limit
1 Y0-Y1 3.1547 Basic 0. 4,000. 2747 4009
2 Y1-Y2 2.8679 Basic 0. 800. -863 810
3 Y2-Y3 2.6072 Basic 0. 800. -1030 811
4 Y3-Y4 2.3702 Basic 0. 1,000. --- 1013
5 Y4-Y5 0. Basic 0. 1,500. 1497 ---
6 Y1-Y0 0. Lower 982.9778 -1,200. -2183 ---
7 Y2-Y0 0. Lower 1,064.2534 0. -1064 ---
8 Y3-Y0 0. Lower 433.6565 600. 166 ---
9 Y4-Y0 2.1547 Basic 0. 1,300. --- 1302
10 Y5-Y0 0. Lower 2.9778 2,000. 1997 ---
The results show that the solution is sensitive to the costs assumed. For
example, the solution changes if the initial cost is greater than 4010.
Network Flow Programming Models 15

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.

Year Operating cost Salvage value


of ownership during year at year end

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.

b. Find the optimal resale time when alternative (2) is chosen.


Network Flow Programming Models 16

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

The solution shows it is optimal to buy B. The optimum replacement time is 6


years. The present worth of cost is $32,284.
Network Flow Programming Models 17

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

LP Model. Use numbers to identify the arcs as in the figure above.


9
Minimize z = Â xk
k =1

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

(4.571,1,2) (1.143,1,2) (4,1,2) (0,1,2)

(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)

(0,1,2) (0,1,2) (0,1,2) (0.571,1,2)


4 5 6 4 5 6
Network Flow Programming Models 18

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.

(upper, cost, gain)

(1000/20, 40/20, 1/20)


wood chairs

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

15. A warehouse facility in a transportation system has a number of incoming and


outgoing links. At least 100 units but no more than 1000 units must pass through the
facility per unit time. A cost of $15 is charged for each of the first 500 units and $20
for each additional unit. Develop a network model for the facility.

One answer is below. There are other correct answers.


(lower, upper, cost)

(0, 500, 15)


(100,1000,0)

(0, 500, 20)


Network Flow Programming Models 20

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.

Demand and price of ingots

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

Processing Storage arcs


(40,200,100) (M,50,1)

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

Solution: Net Profit = 64000


Year 1 2 3 4 5 6 7 8 9 10
Mine Ore 0 0 20 30 40 40 40 40 40 40
Store Ore 0 0 0 0 0 0 0 0 0 0
Make Ingots 0 0 20 30 40 40 40 40 40 40
Store Ingots 0 0 0 0 0 0 0 0 0 0
Sell Ingots 0 0 2000 3000 4000 4000 4000 4000 4000 4000
Network Flow Programming Models 22

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.

Month Demand A Revenue A Demand B Revenue B


1 100 $50 75 $100
2 200 55 135 102
3 176 49 82 110

Several additional restrictions follow.


• The total sales of both items in any month cannot exceed 250 units.
• The amount of labor is fixed at 15 workers whose individual salaries are $600
per month when productively employed. Each worker can produce 12 units of
items A in each month if he works full time on that product. If he works full
time on B, he can produce 8 units. A worker can divide his time between both
items with the amount produced equal to the proportion of time spent. He can
also remain idle for part of the time. If such is the case, his salary is reduced to
$450 per month for the proportion of the time he is idle.
• Items may be produced in one month for sale in another. The cost of storing
one unit from one month to the next is $5; however, there is spoilage of items in
inventory. Of the amount stored at the beginning of a month, 10% must be
discarded. In addition, no more than 20 units of A can be stored, and no more
than 10 units of B can be stored in any month. Items produced and sold in the
same month do not enter inventory.
The problem is to determine the allocation of workers to the manufacture of items in
each month so that profit is maximized. The sales quantities and inventory policy
for each item is also to be determined. Solve using a network flow model.
Network Flow Programming Models 23

(Upper Bound, Cost, Gain)

(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)

(M,0,8 ) (75,-100,1) (M,0,8 ) (135,-102,1) (M,0,8 ) (82,-110,1)


B1 B2 B3
(10,5,0.9 ) (10,5,0.9 )

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.

Distance to parking lots (blocks)


Number of
Building faculty I II III IV V VI
A 15 0 1 3 2 1 4
B 21 1 4 3 2 5 3
C 13 2 1 1 0 2 3
D 7 6 5 5 4 5 7
Capacity of lots 5 12 15 10 3 15

Hint: To give priority to the higher ranks, multiply the associate


professors' travel cost by 10 and the full professors' travel cost by 100.

Network Model
[15] [21] [13] [7]
[fixed flow]
A B C D

(cost) (0) (1) (3) (2) (1) (4)

I II III IV V VI

(upper) (5) (12) (15) (10) (3) (15)


Network Flow Programming Models 25

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

(12) (5) (5) (7)


(flow) (5)
(8) (11)

I II III IV V VI

(flow) (5) (12) (15) (10) (3) (11)

The solution with as a transportation model is shown below.

Name I II III IV V VI Min. Max.


A 0 12 0 0 3 0 15 10000
B 5 0 0 5 0 11 21 10000
C 0 0 8 5 0 0 13 10000
D 0 0 7 0 0 0 7 10000
Min.: 0 0 0 0 0 0
Max: 5 12 15 10 3 15

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

In addition, the following restrictions must be met.

• All demands must be satisfied.


• Suppliers 1 and 2 can together ship no more than a total of 10 units to customer
5 directly.
• No shipping link can handle more than seven units.
• The transshipment terminal can handle no more than 15 units.

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

Solution: Objective value = 153.


S1 S2 S3 S4 T Tot. Rec.
D5 3 7 7 0 0 17
D6 0 3 0 7 5 15
D7 7 5 7 1 0 20
T 5 0 0 0 5
Tot. Shipped 15 15 14 8 5
Network Flow Programming Models 28

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.

Power loss (%)


C1 C2 C3
P1 1 5 2
P2 8 4 9

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.

Power Plant Data


Efficiency Maximum input Processing cost
(MWH/ton) (tons) per ton ($/ton)
P1 1 4000 $10
P2 0.9 3000 $9

The coal must be shipped from the mines to the plant. Shipping costs are given in
dollars per ton in the following table.

Shipping Cost ($/ton)


P1 P2
M1 6 12
M2 3 8

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

Solution: Objective value =126,647.5


Fuel1_1 1200 Plant1 4000
Fuel2_1 1500 Plant2 663.98
Fuel1_2 1500 Tran1_1 938.78
Fuel2_2 463.98 Tran1_2 0
S1_P1 2700 Tran1_3 3061.2
S1_P2 0 Tran2_1 76.752
S2_P1 1300 Tran2_2 520.83
S2_P2 663.98 Tran2_3 0
Network Flow Programming Models 30

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.

Labor hours per Raw material cost ($)


unit of product per unit of product
Plant A B C A B C
P1 0.5 2.0 1.5 10 20 30
P2 0.75 1.2 2.0 15 20 35

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.’

[0,hours available,0] [-Demand] The easiest way to few the arc


(0, 2 products/hour) ($10/product, 1)
P1 P1' A construction is a series of two
Flow in hours Flow in products
arcs, one changing hours to
products and one charging for
[0,hours available,0] [-Demand]
($20/hour, 2 products/hour)
the raw material cost.
P1 A
Flow in hours Any series arrangement of arcs
can be changed into a single
equivalent arc.
The structure for the given problem is shown below
[Fixed Flow]
(Upper, Cost) (Cost, Gain)
[-1000]
(1500, 0) (20,2)
P1 A
(10,0.5)
(20,0.67) (20,1.33)
[-500]
(1500, 0)
P2 B
(16.67,0.83

(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

Table entries are hours spent/units produced. Cost is $41,167.


Operations Research Models and Methods
by Paul A. Jensen and Jonathan F. Bard
John Wiley and Sons, Inc.
Copyright 2003 – All rights reserved

Chapter 6. Network Flow Programming Methods


Notes: Exercises 18, 19 and 20 are easier if initial flows are given as in the
solutions.

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.

The Teach Transportation add-in used to obtain solutions has a minimum of 3


suppliers. For these problems the third supplier has all zero parameters.
Iter: 4 Press the button to restart the Simplex process.
Cost: 435
Status: Optimum Demanders
Enter: 1 2 3 4 Supply Dual(u)
Leave: 1 10 0 15 3 8 0 13 0 10
0 B 0 N 15 B 15 B 30
2 3 0 5 0 7 6 10 4 3
Suppliers 15 B 15 B 0 N 0 N 30
3 0 3 0 1 0 5 0 0 -3
0 N 0 N 0 N 0 B 0
Demand 15 15 15 15
Dual(v) 0 2 -2 3

The program has a minimum of 3 suppliers, so one is a dummy.


Network Flow Programming Methods 2

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.

Iter: 7 Press the button to restart the Simplex process.


Cost: 405
Status: Optimum Demanders
Enter: 1 2 3 4 5 Supply Dual(u
Leave: 1 10 4 15 7 8 0 13 0 0 0 13
0 N 0 N 15 B 5 B 20 B 40
2 3 0 5 0 7 2 10 0 0 3 10
Suppliers 15 B 15 B 0 N 10 B 0 N 40
3 0 7 0 5 0 5 0 0 0 13 0
Key 0 N 0 N 0 N 0 B 0 N 0
Cost Red. Costemand 15 15 15 15 20
Flow N/B Dual(v) -7 -5 -5 0 -13

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.

Iter: 4 Press the button to restart the Simplex process.


Cost: 390
Status: Optimum Demanders
Enter: 1 2 3 4 Supply Dual(u
Leave: 1 10 0 15 3 8 0 13 0 10
10 B 0 N 20 B 0 B 30
2 3 0 5 0 7 6 10 4 3
Suppliers 10 B 20 B 0 N 0 N 30
3 0 3 0 1 0 5 0 0 -3
Key 0 N 0 N 0 N 20 B 20
Cost Red. Costemand 20 20 20 20
Flow N/B Dual(v) 0 2 -2 3
Network Flow Programming Methods 3

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.

Iter: 7 Press the button for iterations of the Simplex.


Cost: 395
Status: Optimum Demanders
Enter: 1 2 3 4 5 6 7 8 Suppl Dual(
Leave: 1 10 0 10 0 15 3 15 3 8 0 8 0 13 1 13 0 7
0 B 5 B 0 N 0 N 15 B 5 B 0 N 5 B 30
2 3 0 3 0 5 0 5 0 7 6 7 6 10 5 10 4 0
Suppliers 15 B 0 N 10 B 5 B 0 N 0 N 0 N 0 N 30
3 0 2 1000 1002 0 0 1000 1000 0 4 1000 1004 0 0 1000 999 -5
Key 0 N 0 N 5 B 0 N 0 N 0 N 15 B 0 N 20
Cost Red. Costemand 15 5 15 5 15 5 15 5
Flow N/B Dual(v) 3 3 5 5 1 1 5 6

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

Iter: 6 Press the button to restart the Simplex process.


Cost: -135
Status: Optimum Demanders
Enter: 1 2 3 4 5 SuppDual
Leave: 1 4 4 6 7 -4 0 -2 0 0 0 0
0 N 0 N 15 B 15 B 0 B 30
2 -1 0 -2 0 -3 2 -3 0 0 1 -1
Suppliers 15 B 15 B 0 N 0 N 0 N 30
3 0 0 0 1 0 4 0 2 0 0 0
Key 0 B 0 N 0 N 0 N 60 B 60
Cost Red. Costemand 1 5 15 15 15 60
Flow N/B Dual(v) 0 -1 -4 -2 0
Network Flow Programming Methods 4

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

Iter: 8 Press the button for iterations of the Simplex.


Cost: 2205
Status: Optimum Demanders
Enter: 1 2 3 4 5 6 7 8 9 SuppDual(
Leave: 1 17 4 22 7 15 0 20 0 18 4 23 7 16 0 21 0 0 2 20
0 N 0 N 15 B 5 B 0 N 0 N 10 B 0 N 0 N 30
2 12 0 14 0 16 2 19 0 13 0 15 0 17 2 20 0 0 3 19
Suppliers 15 B 15 B 0 N 10 B 0 N 10 B 0 N 0 N 0 N 50
3 ### 985 ### 983 ### 983 ### 978 20 4 25 7 18 0 23 0 0 0 22
Key 0 N 0 N 0 N 0 N 0 N 0 N 10 B 0 N 20 B 30
Cost Red. Cost 4 ### 988 ### 986 ### 986 ### 981 13 0 15 0 17 2 20 0 0 3 19
Flow N/B 0 N 0 N 0 N 0 N 20 B 10 B 0 N 20 B 0 N 50
Demand 1 5 15 15 15 20 20 20 20 20
Dual(v) -7 -5 -5 0 -6 -4 -4 1 -22
Network Flow Programming Methods 5

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

Iter: 10 Press the button to restart the Simplex process.


Cost: 2205
Status: Optimum Demanders
Enter: 1 2 3 4 5 6 7 8 9 SuppDual
Leave: 1 17 4 22 7 15 0 20 0 18 4 23 7 16 0 21 0 0 2 20
0 N 0 N 15 B 5 B 0 N 0 N 10 B 0 N 0 N 30
2 12 0 14 0 16 2 19 0 13 0 15 0 17 2 20 0 0 3 19
Suppliers 15 B 15 B 0 N 10 B 0 N 10 B 0 N 0 N 0 N 50
3 22 7 27 10 20 3 25 3 20 4 25 7 18 0 23 0 0 0 22
Key 0 N 0 N 0 N 0 N 0 N 0 N 10 B 0 N 20 B 30
Cost Red. Cost 4 15 3 17 3 19 5 22 3 13 0 15 0 17 2 20 0 0 3 19
Flow N/B 0 N 0 N 0 N 0 N 20 B 10 B 0 N 20 B 0 N 50
Demand 1 5 15 15 15 20 20 20 20 20
Dual(v) -7 -5 -5 0 -6 -4 -4 1 -22
Network Flow Programming Methods 6

8. Consider the data for a transportation problem in the matrix below.

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

a. Find the optimal distribution from sources to destinations.

Iterations starting from the NW Corner solution

Iter: 1 Press the button for iterations of the Simplex.


Cost: 428
Status: Not Optimum Demanders
Enter: 1 2 3 4 Supply Dual(u
Leave: 1 10 0 10 0 6 0 15 7 6
5 B 3 B 2 B 0 N 10
2 5 -9 15 1 10 0 12 0 10
Suppliers 0 N 0 N 6 B 9 B 15
3 11 -12 8 -15 7 -12 21 0 19
0 N 0 N 0 N 8 B 8
Demand 5 3 8 17
Dual(v) 4 4 0 2

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

Iter: 6 Press the button to restart the Simplex process.


Cost: 327
Status: Optimum Demanders
Enter: 1 2 3 4 Supply Dual(u
Leave: 1 10 2 10 3 6 0 15 0 0
0 N 0 N 3 B 7 B 10
2 5 0 15 11 10 7 12 0 -3
Suppliers 5 B 0 N 0 N 10 B 15
3 11 2 8 0 7 0 21 5 1
0 N 3 B 5 B 0 N 8
Demand 5 3 8 17
Dual(v) 8 7 6 15
Network Flow Programming Methods 8

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

Iter: 2 Press the button to restart the Simplex process.


Cost: 302
Status: 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 8 B 2 B 0 N 10
2 5 0 15 11 10 7 12 0 0 4 -3
Suppliers 0 B 0 N 0 N 15 B 0 N 15
3 11 2 8 0 7 0 21 5 0 0 1
0 N 3 B 0 B 0 N 5 B 8
4 4 0 9 6 7 5 13 2 0 5 -4
5 B 0 N 0 N 0 N 0 N 5
Demand 5 3 8 17 5
Dual(v) 8 7 6 15 -1
Network Flow Programming Methods 9

9. Data for an assignment problem are J1 J2 J3 J4 J5


displayed in the accompanying matrix.
The columns represent jobs, and the rows W1 M 8 6 12 1
represent workers. The numbers are the
costs of making an assignment. When M W2 15 12 7 M 10
appears in a cell, that assignment is not
possible. Solve the problem using the 10 M 5 14 M
W3
transportation algorithm.

W4 12 M 12 16 15

W5 18 17 14 M 13

Iterations starting from the NW Corner Solution


Teach Transportation
Name: P_09 Enter transportation data and press the button.
Type: TeachTrans
Supplies: 5
No_Sup: 5
Option: Inst Trans. Cost 1 2 3 4 5
Delay: 1 Name J 1 J2 J3 J4 J 5 Supply
1 W 1 1000 8 6 12 1 1
2 W2 15 12 7 1000 1 0 1
3 W3 1 0 1000 5 1 4 1000 1
4 W4 1 2 1000 1 2 16 15 1
5 W5 18 17 1 4 1000 1 3 1
D e m an 1 1 1 1 1

Iter: 1 Press the button for iterations of the Simplex.


Cost: 1046
Status: Not Optimum Demanders
Enter: 1 2 3 4 5 Suppl Dual(
Leave: 1 1000 0 8 0 6 3 12 0 1 -10 3
1 B 0 B 0 N 0 N 0 N 1
2 15 -989 1 2 0 7 0 1000 984 10 -5 7
Suppliers 0 N 1 B 0 B 0 N 0 N 1
3 10 -992 1000 990 5 0 14 0 1000 987 5
Key 0 N 0 N 1 B 0 B 0 N 1
Cost Red. Cost 4 12 -992 1000 988 12 5 16 0 15 0 7
Flow N/B 0 N 0 N 0 N 1 B 0 B 1
5 18 -984 1 7 7 14 9 1000 986 13 0 5
0 N 0 N 0 N 0 N 1 B 1
Demand 1 1 1 1 1
Dual(v) 997 5 0 9 8
Network Flow Programming Methods 10

Iter: 2 Press the button for iterations of the Simplex.


Cost: 54
Status: Feasible Demanders
Enter: (3, 1) 1 2 3 4 5 Suppl Dual(
Leave: (1, 1) 1 1000 992 8 0 6 3 12 0 1 -10 -2
0 N 1 B 0 N 0 N 0 N 1
2 15 3 12 0 7 0 1000 984 10 -5 2
Suppliers 0 N 0 B 1 B 0 N 0 N 1
3 10 0 1000 990 5 0 14 0 1000 987 0
Key 1 B 0 N 0 B 0 B 0 N 1
Cost Red. Cost 4 12 0 1000 988 12 5 16 0 15 0 2
Flow N/B 0 N 0 N 0 N 1 B 0 B 1
5 18 8 17 7 14 9 1000 986 13 0 0
0 N 0 N 0 N 0 N 1 B 1
Demand 1 1 1 1 1
Dual(v) 10 10 5 14 13

Iter: 3 Press the button for iterations of the Simplex.


Cost: 54
Status: Feasible Demanders
Enter: (1, 5) 1 2 3 4 5 Suppl Dual(
Leave: (4, 5) 1 1000 992 8 0 6 3 12 0 1 0 -4
0 N 1 B 0 N 0 N 0 B 1
2 15 3 12 0 7 0 1000 984 10 5 0
Suppliers 0 N 0 B 1 B 0 N 0 N 1
3 10 0 1000 990 5 0 14 0 1000 997 -2
Key 1 B 0 N 0 B 0 B 0 N 1
Cost Red. Cost 4 12 0 1000 988 12 5 16 0 15 10 0
Flow N/B 0 N 0 N 0 N 1 B 0 N 1
5 18 -2 17 -3 14 -1 1000 976 13 0 8
0 N 0 N 0 N 0 N 1 B 1
Demand 1 1 1 1 1
Dual(v) 12 12 7 16 5

Iter: 4 Press the button to restart the Simplex process.


Cost: 51
Status: Optimum Demanders
Enter: 1 2 3 4 5 Suppl Dual(
Leave: 1 1000 992 8 0 6 3 12 0 1 0 -4
0 N 0 B 0 N 0 N 1 B 1
2 15 3 12 0 7 0 1000 984 10 5 0
Suppliers 0 N 0 B 1 B 0 N 0 N 1
3 10 0 1000 990 5 0 14 0 1000 997 -2
Key 1 B 0 N 0 B 0 B 0 N 1
Cost Red. Cost 4 12 0 1000 988 12 5 16 0 15 10 0
Flow N/B 0 N 0 N 0 N 1 B 0 N 1
5 18 1 17 0 14 2 1000 979 13 3 5
0 N 1 B 0 N 0 N 0 N 1
Demand 1 1 1 1 1
Dual(v) 12 12 7 16 5

Assignment: J1 -W3, J2 - W5, J3 - W2, J4 - W4, J5 - W1


Network Flow Programming Methods 11

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

Iter: 3 Press the button to restart the Simplex process.


Cost: 26
Status: Optimum Demanders
Enter: 1 2 3 4 5 6 SuppDual
Leave: 1 3 0 2 0 2 0 6 2 4 2 6 5 -1
0 N 1 B 1 B 0 N 0 N 0 N 2
2 4 0 3 0 7 4 5 0 3 0 3 1 0
Suppliers 1 B 0 B 0 N 1 B 0 B 0 N 2
3 9 1 9 2 7 0 9 0 7 0 6 0 4
0 N 0 N 0 N 0 N 1 B 1 B 2
Demand 1 1 1 1 1 1
Dual(v) 4 3 3 5 3 2

Assignment: J1-B, J2-A, J3-A, J4- B, J5- C, J6-C


Network Flow Programming Methods 12

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

Iter: 6 Press the button to restart the Simplex process.


Cost: 11
Status: Optimum Demanders
Enter: 1 2 3 4 5 6 SuppDual
Leave: 1 3 1 2 0 2 0 6 4 4 2 6 4 2
0 N 0 N 1 B 0 N 0 N 0 N 1
2 4 1 3 0 7 4 5 2 3 0 3 0 3
Suppliers 0 N 1 B 0 N 0 N 0 B 0 N 1
3 9 3 9 3 7 1 9 3 7 1 6 0 6
Key 0 N 0 N 0 N 0 N 0 N 1 B 1
Cost Red. Cost 4 0 0 0 0 0 0 0 0 0 0 0 0 0
Flow N/B 1 B 0 N 0 B 1 B 1 B 0 B 3
Demand 1 1 1 1 1 1
Dual(v) 0 0 0 0 0 0

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

Shortest Path Problems

Use Dijkstra’s algorithm for Exercises 11 - 16.

11. In the directed network below find the short path from the root node 1 to all other
nodes.

(4) (23) (4)


(distance) 2 4 6 8
4 8 12
(12)
(4) 5 (3) 9 (6) 13 (5) 16
1
1
(7) (2) 3 (7) 7 (1) 11 (3) 15
2 (18) (8) (11)
3 5 7 9
6 10 14

[11] [15] [36] [40]


(4) (4)
2 4 6 8
4 12

[0] (4) 5 (6) 13

1
(7) (7) 7
2
(8) (11)
3 5 7 9
10 14
[7] [22] [30] [41]

Order of entry of the nodes into the tree: 1, 3, 2, 4, 5, 7, 6, 8, 9.


Network Flow Programming Methods 14

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

The Path is {D-B, B-C, C-E} with length 20.


Network Flow Programming Methods 16

14. Find the shortest path tree for the network below when the origin is node L. All
links are two-way.

(16) (87) (45)


I J K L

(20) (27) (11) (28)

E (42) F (30) G (17) H

(9) (38) (50) (20)

A (30) B (23) C (76) D

Shortest Path Tree


[148] [132] [45] [0]
(16) (87) (45)
I J K L

(28)
[157] [120] [45] [28]
E F (75) G (17) H

(9) (50) (20)

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

Origin Node A [2] [5]


(3)
B C

(2)
[0] (7) [7]
(7)
A D

(10)

F E

[9] [10]

Origin Node C [3] [0]


(3)
B C

(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).

Linear Programming Model


Maximize Z = Âc ij x ij (1)
{( i, j )ΠA }
Subject to:.

Â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

Maximum Flow Problems


For Exercises 18 - 20, use the flow augmenting algorithm to both solve and identify a
minimal cut.

18. We are seeking (capacity)


the maximum (21)
flow from A to B E
4
G. (20) (4) (2) (24)
1 3 7 9
Source Sink
A D G
(4) (10)
(15) (10)
5 8
2 10
(9)
C F
6

We start with the (flow, capacity)


initial solution at (16,21)
B E
the right. 4
(20,20) (4,4) (2,2) (18,24)
1 3 7 9 Sink
Source
A D G
(4,4) (6,10)
(7,15) (9,10)
5 8
2
10
(3,9)
C F
6

Augment the flow in path: {2, 6, -8, -3, 4, 9} D = 4


Network Flow Programming Methods 21

New Solution (flow, capacity)


[label] (20,21)
B E
4
(20,20) (0,4) (2,2) (22,24)
1 3 7 9 Sink
Source
A D G
[0] (4,4) [-8] (2,10)
(11,15) (9,10) [10]
5 8
2
10
(7,9)
C F
[2] 6
[6]

Flow Augmenting Path: {2, 6, 10} D = 4


New Solution (flow, capacity)
[label] (20,21)
B E
4
(20,20) (0,4) (2,2) (22,24)
1 3 7 9 Sink
Source
A D G
[0] (4,4) (2,10)
(12,15) [-8] (10,10)
5 8
2
10
(8,9)
C F
[2] 6
[6]

Nonbreakthrough. Max Flow = 32


Labeled Nodes: S = {A,C, D, F}
Cut is ( S, S ) = {1, 7, 10}. Capacity of Cut is 32.
Network Flow Programming Methods 22

19. We are seeking


the maximum
flow from node 2 8
1 to node 14. 7

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

All arcs have All arcs have All arcs have


capacity 1 capacity 9999 capacity 1

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

We start with the 2


[-7]
8 [16]

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

Breakthrough: Path: {21, 8, -7, 9, 2}, D = 1


Network Flow Programming Methods 23

New Solution 2 8 [16]


7

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

Breakthrough Path: {20, 15, -14, 16, 6}, D = 1


New Solution 2 8
7

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

Nonbreakthrough Max Flow = 5. Labeled nodes: S = {1, 3, 5, 10}


Cut is ( S, S ) = {1, 3, 5, 6, 19}. Capacity of Min Cut = 5.
Network Flow Programming Methods 24

20. The source is (Capacity)


node 1 and the (4)
sink is node 6. 2 4
Find the 3
maximum (5) (7)
(2)
flow. 1 4 7

1 6
(2)
(5) 5 (3)
2 8
(3)
3 5
6

Initial Solution (Flow, Capacity)

(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

Breakthrough. Path: {2, 5, 7} D = 2

New Solution [-4] (3, 4) [3]


2 4
3
(5,5) (2, 2) (5, 7)
1 4 7
[7]
1 6
(2, 2)
[0] (3, 5) 5 (3, 3)
2 8
(1, 3)
3 5
[2] 6 [6]

Labels from labeling algorithm are shown on the figure.


Breakthrough: Path: {7, 3, -4, 6, 2} D = 1
Network Flow Programming Methods 25

New Solution [-4] (4, 4)


2 4
3
(5,5) (6, 7)
(1, 2)
1 4 7

1 6
(2, 2)
[0] (4, 5) 5 (3, 3)
2 8
(2, 3)
3 5
[2] 6 [6]

Nonbreakthrough: Max Flow = 9. Labeled nodes: S = {1, 2,


3, 5}
Cut is ( S, S ) = {3, 5, 8}. Capacity of Min Cut =9
Network Flow Programming Methods 26

21. Give a linear programming formulation for the maximum flow problem based on the
minimum cost flow model (4a) - (4c).

Linear Programming Model


Maximize Z = v (1)
Subject to:.

Â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

Minimum Cost Flow Problems

22. Consider the following network flow diagram.

[fixed external flow]


[1]
(upper bound, cost)
2
(2,-1)
(2,-1) (3,5)
7 [2] 1 4 [–5]
(3, 1)
5 1 (1,2) 3 4
8
(3, 3) (6, 4)
5
2 (5,3)
6

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}.

[Fixed External Flow, p] [1,-1]


(Flow, Upper Bound, Cost)
2

(1,2,-1) (0,3,5) (2,2,-1)


[–,0] 7 [2,1] 1 4 [-5,8]
(1,3,1)
5 1 (0,1,2) 3 4
8
(3,6,4)
(0,3,3) 5
6 2 (3,5,3)

3
[0,5]

Marginal costs: d1 = 7, d3 = -4, d4 = -10, d6 = 8. The solution is feasible, but not


optimal. Arc 3 is a candidate to enter the basis.
Network Flow Programming Methods 28

(ii) nB = {8, 1, 2, 4}, n0 = {6, 7}, n1 = {3, 5}.

[Fixed External Flow, p] [1,6]


(Flow, Upper Bound, Cost)
2

(0,2,-1) (0,3,5) (0,2,-1)


[–,0] 7 [2,1] 1 4 [-5,5]
(2,3,1)
5 1 (1,1,2) 3 4
8
(4,6,4)
(0,3,3) 5
6 2 (5,5,3)

3
[0,5]

Marginal costs: d3 = 3, d5 = 3, d6 = 8, d7 = -7. The solution is feasible, but not


optimal. Arcs 3, 5 and 7 are candidates to enter the basis.

(iii) nB = {–2, 1, –6, 4}, n0 = {3, 5, 7, 8}.

[Fixed External Flow, p]


[1,-2]
(Flow, Upper Bound, Cost)
2

(0,2,-1) (4,3,5) (5,2,-1)


[–,0] 7 [2,-7] 1 4 [-5,-3]
(0,3,1)
5 1 (0,1,2) 3 4
8
(-2,6,4)
(-2,3,3) 5
6 2 (0,5,3)

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?

[fixed external flow] [0]


(flow, upper bound, cost)
2
(1, 3, 3) (0, 1, 2)

(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.

[fixed external flow] [–8]


(flow, upper bound, cost) (10, 4 ) (11, 23 ) (12, 4 )
2 4 6 8
4 8 12
2)
,1

(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]

x1 = x2 = x4= x6= x8= x10= x12= x14= 8, x17 = 16

p = (0, 12, 7, 16, 25, 39, 33, 43, 44, 0)

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

Chapter 7. Integer Programming Models


1. Consider the integer program

Maximize 2x1 + 5x2


subject to x1 + x2 £ 15
–x1 + x2 £ 2
x1 – x2 ≥ 2
x1 + x2 ≥ 2
x1, x2 ≥ 0 and integer

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

x1 = x11 + 2x12 + 4x13 + 8x14 and x2 = x21 + 2x22 + 4x23 + 8x24

Maximize 2x11 + 4x12 + 8x13 + 16x14 + 5x21 + 10x22 + 20x23 + 40x24

Subject to x11 + 2x12 + 4x13 + 8x14 + x21 + 2x22 + 4x23 + 8x24 £ 15

- x11 - 2x12 - 4x13 - 8x14 + x21 + 2x22 + 4x23 + 8x24 £ 2

+ x11 + 2x12 + 4x13 + 8x14 - x21 - 2x22 - 4x23 - 8x24 ≥ 2

x11 + 2x12 + 4x13 + 8x14 + x21 + 2x22 + 4x23 + 8x24 ≥ 2


Integer Programming Models 2

x1i, x2i = 0 or1, i = 1,…,4

b. Change signs of objective function and the last two constraints.

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

2. A company is considering three major Project


research projects labeled A, B and C. Each
Year A B C
of the projects can be selected for any of
1 7 6 4
the next three years or may be omitted
2 5 4 4
from the portfolio entirely. The total
3 8 7 5
return for each project based on the year it
is selected is given in the accompanying Cost 5 3 5
table. This return captures all relevant cash flows, including investments. It also
includes the effects of the time value of money. The investment required for each
project occurs entirely within the year for which it is selected.
The goal is to maximize the total return. The problem has the following
constraints. No more than two projects can be selected in any year. Total investment
in any year cannot exceed 9. Project B must be selected after project A. Project A
and B cannot be selected in the same year. A project can be selected at most once.
Formulate the problem as an integer program and solve. Define all notation.

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

3. A computer service company needs to


establish communications between five City 1 2 3 4 5
cities. An analysis of various media has 1 –– 15 13 19 21
determined that the monthly cost of 2 15 –– 10 24 14
connecting a pair of cities i and j with a 3 13 10 –– 14 17
link is cij as shown in the accompanying 4 19 24 14 –– 12
5 21 14 17 12 ––
matrix. The connection allows commu-
nications in both directions. There is a
cost of establishing interconnection
facilities at each city that depends on the number of links incident to the city. Note
that these are node costs rather than arc costs.
∑ If one link touches the city the cost is d1.

∑ The second link touching the city adds the cost d2.

∑ The third link touching the city adds the cost d3.

∑ These costs are related as: d1 > d2 > d3.


Formulate and solve a 0-1 integer linear programming model that incorporates the
following information.
(i) The objective is to minimize monthly cost.
(ii) Each city must be touched by at least one connection.
(iii) The links selected must form a tree.
(iv) No more than three links can touch a city.
(v) d1 = 5, d2 = 3, d3 = 1

VARIABLE DEFINITIONS

A variable must be defined for each potential link between ciy pairs.

Ï1 if a link is included between cities i and j


Let xij = Ì i = 1,º, 4; j = i + 1,º, 5
Ó0 if not

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 determining the number of links touching each city.

NODE1: x12 +x13 +x14 +x15 –y12 –y13 = 1

NODE2: x12 +x23 +x24 +x25 –y22 –y23 = 1

Similarly for nodes 3, 4, and 5.


Constraints that require that at least one link leaves each city pair. This
eliminates the possibility that the solution will include cycles.
PAIR1,2: x13 +x14 +x15 +x23 +x24 +x25 ≥ 1

PAIR1,3: x12 +x14 +x15 +x23 +x34 +x35 ≥ 1

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.

PREC: yj2 ≥ yj3 j = 1,...,5

OBJECTIVE FUNCTION

Min z = 3y12 + 1y13 + 3y22 + 1y23 + 3y32 + 1y33 +3y42 + 1y43 + 3y52 + 1y53 +

15x12 + 13x13 + 19x14 + 21x15 +10x23 + 24x24 + 14x25+ 14x34 + 17x35 +

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

Road network between cities A and B

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

cj = cost of establishing an inspection station on road j.

Ï1 if a station is established on road j


xj = Ì
Ó0 otherwise

xT = {x1, x2,…, xn}

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

b. This would be more efficiently solved as a maximum flow/minimum cut


problem. The costs on the arcs would be identified as capacities. The maximum
flow would also determine the minimum cut. Identified as costs, this is the cut
with the minimum cost.
To set the problem up this way, each road is represented by two arcs to allow
passage in either direction. For simplicity, we only use arcs passing from left to
right in the figure, except road 15 which we represent in both ways as arcs 15
and 19. Arc 20 enters A and arc 21 leaves B. We assign the latter a cost of –1 to
encourage the maximum flow solution. As expected the maximum flow is 14. The
minimal cut is identified by the reduced costs in the last column. The arcs on the
minimal cut have a reduced cost of –1, arcs 17 and 18.
Integer Programming Models 9

Arc Data and Flows


Num. Name Flow OriginTerm. LowerUpper Cost Red.
1 A-C 6 1 3 0 9 0 0
2 A-D 8 1 4 0 8 0 0
3 D-E 1 4 5 0 4 0 0
4 D-G 1 4 7 0 1 0 0
5 D-F 6 4 6 0 6 0 0
6 C-E 0 3 5 0 8 0 0
7 E-G 0 5 7 0 3 0 0
8 E-H 1 5 8 0 1 0 0
9 C-H 4 3 8 0 7 0 0
10 C-I 2 3 9 0 2 0 0
11 I-H 0 9 8 0 1 0 0
12 I-J 2 9 10 0 5 0 0
13 H-J 2 8 10 0 3 0 0
14 G-J 0 7 10 0 6 0 0
15 G-H 0 7 8 0 7 0 0
16 G-F 4 7 6 0 7 0 0
17 F-B 10 6 2 0 10 0 -1
18 J-B 4 10 2 0 4 0 -1
19 H-G 3 8 7 0 7 0 0
20 0-A 14 0 1 0 100 0 0
21 B-0 14 2 0 0 100 -1 0
Integer Programming Models 10

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.

To formulate this problem as an IP, we need additional set of variables. Let yj =


1 if city j lines in the optimal subtour and yj = 0 otherwise for j ΠN.

Maximize – Â ce xe + Âfy j j (1)


e ŒE j ŒN

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).

Let S Ã N and consider constraint C1 in the text.

n
Exactly one successor: Âx
j =1
ij = 1, i = 1,…,n (1)

Now sum constraint (1) for i ΠS, to get

 Â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)

Further manipulation of (3) gives

Ê 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 π ∆

which is the desired result.


Integer Programming Models 13

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

xj ≥ 0 and integer, j = 1,…,n


Integer Programming Models 14

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

Total Waste is zero. Total number of rolls cut is 75.

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.

b. Minimize the number of cuts.

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

Total Number of cuts = 107. Total number of rolls is 64.


Integer Programming Models 15

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)

Well targets for off-shore drilling

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.

Platform Set Platform Set


I 1, 2, 3 X 14, 15, 18
II 4, 5, 6 XI 12, 13, 14, 15
III 7, 8, 9 XII 18, 19, 20
IV 6, 8, 9 XIII 16, 17, 18, 19, 20
V 7, 8, 9, 10, 11 XIV 10, 11, 16, 17
VI 10, 11 XV 1, 2, 3, 4, 5, 6, 7, 8, 9
VII 16, 17 XVI 1, 2, 3, 4, 5
VIII 12, 13 XVII 19, 20
IX 14, 15 XVIII all
Integer Programming Models 16

Solve the problem for a = 1, d = 0.5 and ck as given below. Specific values of h
must be computed

No. of wells (k) 1 2 3 4 5 6 7 8 9 20


Platform cost (ck) 10 19 27 34 40 45 49 52 54 90

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.,

h4 = (x4 – xc)2 + (y4 – yc)2 = (2/3)2 + (1/3)2 = 0.745

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

This problem requires a number of calculations, so set up a spreadsheet program to


automate the calculations.

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

cj = C|Sj| + a Â(hij + d)2


i ŒSj

Ï1 if platform j is constructed
Let xj = Ì
Ó0 otherwise

x = {x1, x2, ...., x17, x18}


We set up the problem with a partitioning model.
Min cx
st Ax = e
xj = 0 or 1, j = 1,...,18

The A matrix is below.


P 1 P 2 P 3 P 4 P 5 P 6 P 7 P 8 P 9 P10 P11 P12 P13 P14 P15 P16 P17 P18
W1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 1
W2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 1
W3 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 1
W4 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 1
W5 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 1
W6 0 1 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 1
W7 0 0 1 0 1 0 0 0 0 0 0 0 0 0 1 0 0 1
W8 0 0 1 1 1 0 0 0 0 0 0 0 0 0 1 0 0 1
W9 0 0 1 1 1 0 0 0 0 0 0 0 0 0 1 0 0 1
W10 0 0 0 0 1 1 0 0 0 0 0 0 0 1 0 0 0 1
W11 0 0 0 0 1 1 0 0 0 0 0 0 0 1 0 0 0 1
W12 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 1
W13 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 1
W14 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 1
W15 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 1
W16 0 0 0 0 0 0 1 0 0 0 0 0 1 1 0 0 0 1
W17 0 0 0 0 0 0 1 0 0 0 0 0 1 1 0 0 0 1
W18 0 0 0 0 0 0 0 0 0 1 0 1 1 0 0 0 0 1
W19 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 1 1
W20 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 1 1

The platform costs are:

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. Define the following variables:

Ï1 if the product is produced in month i and


i = 1,…,12
xij =Ì covers the demand through j months,
j = i,…,12
Ó0 otherwise;

Formulate the minimum cost production plan as a set partitioning problem.

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.

The cost of production and inventory is


i + j -1
cij = 50 + 2 Â ( k - i )dk
k =i

where (k - i) is the number of months demand for period k is in inventory.


(A more complicated computation that is easier to implement is as follows.)
Èi + j -1 i -1
Ê i + j -1 i -1
ˆ˘
cij = 50 + 2 Í Â kdk - Â kdk - Á Â idk - Â idk ˜ ˙
Î k =1 k =1 Ë k =1 k =1 ¯˚

Define column vectors with 12 elements (rows) as follows:


Integer Programming Models 20

Ï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

xij = 0 or 1, for all i and j

where b is a vector of 1’s. This is an interesting model because the constraint


matrix is totally unimodular. The matrix has the consecutive 1’s property that was
mentioned relative to the scheduling problem. Because the matrix is totally
unimodular, the 0,1 requirement can be replaced with 0 £ xij £ 1 and the problem
solved as an LP. This is much more efficient than the approach in part b.

The solution has: x1,3 = 1, x4,3 = 1, x7,2 = 1, x9,2 = 1, x11,2 = 1, z* = 408

b. Define the variables:


vj = amount of production in period j

yj = 1 if there is nonzero production in period j; 0 otherwise

zj = inventory remaining at the end of period j

Give a mixed-integer linear programming formulation for the problem.

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

For the mathematical programming model:


Integer Programming Models 21

Ï1 if production in month j
Let yj = Ì
Ó0 if not

xj = amount of production in month j.

Ij = amount of inventory at the end of month j.

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

This model must be solved as a MIP. Although it is a more natural formulation


that part a, it is much more difficult to solve.

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.

c. This model is equivalent to the model of part a. The network consists of 13


nodes. The first 12 represent the beginning of months 1 through 12. Node 13 is
the end of month 12. An arc carries the cost of producing and holding inventory
for the months that are covered by the production. There are 78 arcs and the
costs are the same as for the variables in part a. The solution is the shortest path
from 1 to 13. Again this is a totally unimodular problem and is easy to obtain.

[+1] [-1]
1 2 3 4 . . . . 13
Integer Programming Models 22

12. An electronic system has n components operating in series. The reliability of a


component is the probability that it will not fail while it is in use. The reliability of
component i is given as ri. The reliability of the system is the probability that none
of the components fail; that is, the product of the component reliabilities.
To increase the reliability of the system, extra components may be included
for backup. These are called redundant components, since they are not required
unless the originals fail. Thus the reliability of a component type with x redundant
components is
Ri = 1 – (1 – ri)(1 + x)
The reliability R of the system is the product of the component type reliabilities:
n
R = Pi=1Ri.

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

subject to cost and weight constraints

To develop a linear model, we must introduce additional various corresponding to


the pieces of the ln Ri functions. The break points are given in the following
table.

xi ln (R1) ln (R2) ln (R3) ln (R4)


0 –0.1053605 –0.2231436 –0.0512933 –0.287682
1 –0.0100503 –0.04082199 –0.00250313 –0.0645385
2 –0.0010005 –0.008032172 –0.00012501 –0.015748356
3 –0.0001000 –0.00160128 –0.00000625 –0.003913899
4 –0.0000100 –0.00032005 –3.125E-07 –9.77E-04
5 –0.000001 –0.000064002 –1.562E-08 –2.4417E-04

5 5
Letting xi = Â jxij and
j =1
Âx
j =0
ij = 1, for i = 1,…,4, the objective function to be

minimized can be written as

z = –0.1053605x10 – 0.0100503x11 – … –0.287682x40 – … –0.00024417x45

Also, the cost and weight constraints with respect to redundant components only
are as follows.
Integer Programming Models 24

Cost constraint: 100x1 + 50x2 + 40x3 + 200x4 £ 1000

Weight constraint: 8x1 + 12x2 + 7x3 + 5x4 £ 80

The optimal solution is x1 = 2, x2 = 3, x3 = 1, x4 = 3.

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

x11 x12 x13

For each problem variable xi , i = 1,…,4, we now introduce a set of binary


variables segment to correspond to each segment of the piecewise linear
function. Let x1 = x11 + x12 + x13 + x14 + x15, and so on. The restriction that no
more than 5 redundant components can be used for each i is
5

Â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.

Solving the new model gives the following results.


Integer Programming Models 25

Optimal solution: x1 = 2 z* = 0.6583


x2 = 3 Reliability = 0.991021736
x3 = 1 Cost = $990
x4 = 3 Weight = 74 pounds
Integer Programming Models 26

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.

Power will be supplied by


(3) (10) (17) (5) generators constructed at the nodes. The
maximum size of a plant in terms of power
output is 100 MW. The cost of a plant in
(10) (15) (20) (8) scaled terms, consists of a fixed charge of
$100 plus a variable cost of $2 per MW
supplied. In the model all costs are
(8) (10) (18) (12)
expressed as lifetime figures so no
adjustment need be made to account for
time value of money or the differences
(10) (12) (12) (5)
between operating and investment costs.
Power is transmitted along the
lines that connect the nodes (all parallel to the grid axes). The cost of transmission is
$1.5 per MW per mile. Note the distance between adjacent nodes is 1 mile. Power
may flow in either direction along a line and is delivered to the customers at the
nodes. Excess power arriving at a node may be transshipped along the lines to other
nodes. The problem is to select the nodes at which generators should be built, as
well as determine the size of the generators. The solution must satisfy the following
environmental restrictions.
(i) No two generators may be closer than 1.5 miles.
(ii) No more that two generators can be built on any coordinate line. For instance,
of the four locations on the vertical axis x = 1, at most two can be used.
(iii) If a generator is built at location (3,3), one must also be built at location (0,0).

Set up and solve a mathematical programming model for this problem.

Index the nodes from 1 to 16.


13 14 15 16
3

9 10 11 12
2

5 6 7 8
1

1 2 3 4

0 2 3 x
1
Integer Programming Models 27

Ï1 if a plant is built at location j


yj = Ì j = 1º16
Ó0 if not
z j = amount of power delivered at location i
xij = flow from node i to node j for (i, j ) ΠA
Note that only certain xij are defined, the segments in the figure. Flow is allowed
in both directions. If xij is defined the xji is also defined. There are 48 flow
variables. A is the set of xij variables.
16 16
z = 100 Â y j + 2 Â z j + 1.5 Â xij
j =1 j =1 ij ŒA

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

Pollution control in a river basin

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)

C0.95 = 5,000,000 + 300,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)

c0.95 = 0.20 ($/lb)


Integer Programming Models 29

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

[30] [15] [45] [20] [30] [50]

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

For the 90% removal plant, j = 2, 4, 6, 8, 10, 12.


hfj = 5,000,000i = hf(0.95) = $34.25/hr
where i is the interest rate per hour; i = 0.06/8760 = 6.85 ¥ 10 -6

hvj = 100,000i = hv(.95) = $2.055/hr


Integer Programming Models 30

CRF/hr = CRF(0.06, 20)/8760 = 0.0872/8760 = 10–06


C0.9 = 10 + x ($/hr) and C0.95 = 50 + 3x ($/hr)

Min Â[hf(0.9)yj + (hv(0.9) + 0.1)xj+6] + Â[hf(0.95)yj + (hv(0.95) + 0.2)xj+6]


j=odd j=even
Subject to
Conservation of pollution flow at Plant input.
x19 + x7 + x8 = 30
x20 + x9 + x10 = 15
x21 + x11 + x12 = 45
x22 + x13 + x14 = 20
x23 + x15 + x16 = 30
x24 + x17 + x18 = 50

Conservation of pollution flow at river.


x19 + .1x7 + .05x8 – x1 = 0
x20 + .1x9 + .05x10 –x2 + x1 = 0
x21 + .1x11 + .05x12 –x3 + x2 = 0
x22 + .1x13 + .05x14 –x4 + x3 = 0
x23 + .1x15 + .05x16 –x5 + x4 = 0
x24 + .1x17 + .05x18 –x6 + x5 = 0

Concentration Limit.
x1 / 3 £ 10
x2 / 4 £ 10
x3 / 5 £ 10
x4 / 6 £ 10
x5 / 7 £ 10
x6 / 10 £ 10

Fixed Charge Implication.


x7 £ 30 y1 x8 £ 30 y2
x9 £ 15 y3 x10 £ 15 y4
x11 £ 45 y5 x12 £ 45 y6
x13 £ 20 y7 x14 £ 20 y8
x15 £ 30 y9 x16 £ 30 y10
x17 £ 50 y11 x18 £ 50 y12
Solving with Excel we optain the following solution:
Waste treatment plants:
Integer Programming Models 31

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

a. Assume warehouse capacities are limited to shipments of 70 units per month.


Set up the associated linear model and solve as both a linear and mixed-integer
linear program. Use the software accompanying the text. Of course you must
neglect the integrality constraints for the linear program. Comment on the
results and indicate the deficiency of the linear programming solution.

Warehouse Location Problem

c11
1 1 [-d1]

x1 c12

x2 2 2 [-d2 ]

x
3
3 3 [-d3 ]

xm

m n [-dn ]

xij = amount shipped from warehouse i to location j, i = 1,..., m.; j = 1,...,n

zi = capacity at warehouse i, i = 1,...,m


Integer Programming Models 33

Ï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

For the data given, when solved as an LP we obtain:


Cost = 3885.7
WH y z flow 1 2 3 4 5 Sum
1 0.7143 50 1 20 30 0 0 0 50
2 0.5714 40 2 0 0 40 0 0 40
3 0.7143 50 3 0 0 0 50 0 50
4 0.2857 20 4 0 0 0 0 20 20
20 30 40 50 20
With integrality required for the yj , we find:
Cost = 4660
WH y z flow 1 2 3 4 5 Sum
1 1 50 1 20 30 0 0 0 50
2 1 40 2 0 0 40 0 7E-10 40
3 1 70 3 0 0 0 50 20 70
4 0 2E-11 4 0 0 0 0 -4E-15 -4E-15
20 30 40 50 20

b. Assume there is no limit on warehouse capacities. Set up three separate models


using the three formulations in Section 8.4. Recall that in the first formulation,
xij is defined to be the number of units shipped from i to j, in the second (and
third) the definition of xij was altered to be the proportion of units shipped from i
to j, and in the third, implication constraints of the form xij £ yi were introduced.
Integer Programming Models 34

Solve each formulation as both a linear and mixed-integer linear program.


Provide the same type of comments as in part a.

No Solution: LP Bounds should be better.


Integer Programming Models 35

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?

We defined the variables A, B, . . . , H to represent the eight different food types.


In parts a and b we are maximizing utility. In part c we maximize vitamin intake.

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

Linear Obj. Coef.: 9 12 6 8 10 3 6 7


aints
Name Value Rel. RHS Linear Constraint Coefficients
Vita. 40 >= 40 10 8 13 12 4 6 9 6
Fat 35 <= 35 8 9 10 6 18 9 10 5
Sugar 29 <= 30 7 7 2 14 13 9 8 4

b. LP Solution. Utility is 44.51. The objective value is greater than the IP


objective when noninteger values are allowed.
Integer Programming Models 36

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

Linear Obj. Coef.: 9 12 6 8 10 3 6 7


aints
Name Value Rel. RHS Linear Constraint Coefficients
Vita. 40 >= 40 10 8 13 12 4 6 9 6
Fat 35 <= 35 8 9 10 6 18 9 10 5
Sugar 30 <= 30 7 7 2 14 13 9 8 4

c. Maximizing vitamins results in a vitamin value of 48. The utility is 29.


A B C D E F G H
1 0 2 1 0 0 0 0
Integer Programming Models 37

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

Proposed locations of convenience stores

(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

Ï1 if a store is placed at location j


Let y j = Ì j = 1,º,10
Ó0 if not
Integer Programming Models 38

CONSTRAINTS

No two stores can be on the same street.


ST1: y1 + y2 £1 ST2: y3 + y4 £1
ST3: y5 + y6 £1 ST4: y7 + y8 +y9 £1
STA: y3 + y7 £1 STB: y5 + y10 £1
STC: y4 + y8 £1 STE: y2 + y6 +y9 £1
Stores must be at least three miles apart (combinations eliminated with previous
constraints are not included).
S1–4: y1 + y4 £1 S3–5: y3 + y5 £ 1
S4–5: y4 + y5 £1 S5–7: y5 + y7 £ 1
S5–8: y5 + y8 £1 S7–10: y7 + y10 £ 1
S8–10: y8 + y10 £1
Every grid point must be at least three mile from a store:
A1: y1 + y3 +y4 +y5 +y7 ≥1
B1: y1 + y2 +y3 +y4 +y5 ≥1
There are 25 constraints of this type, one for each grid point.

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 ˙

where Èx˘ denotes the smallest integer greater than or equal to x.

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

where pi are the dual variables. Somewhat surprisingly, an optimal solution to


this linear program is a feasible solution to the primal (original) days-off
scheduling problem. Moreover, the value of the optimal objective function value
W is the same for the two problems.
To solve the dual we allocate the unit resource (right-hand side = 1)
among the dual variables so as to maximize the value of W, which is a linear
combination of the labor demand. There are three possible solutions, depending
on the given values of r1, …,r7.
(1) The most obvious solution is to allocate the entire unit resource to the
maximum demand; i.e., if rk = max{ri : i = 1,…,7}, set pk = 1 and all other dual
variables to zero. In this case, W = rk = rmax. The solution is better than the
average that would result from assigning a value of 1/m to any m dual variables,
where m = 2,…,7. Nevertheless, the structure of the problem makes it possible
to assign a value of 1/m to more than m dual variables. There are only two
cases in which this is possible. The first is discussed next. For the second, see
Alfares [1998].
(2) Because each structural constraint in the dual contains only 5
variables, it is possible to divide the unit right-hand side of each constraint among
those 5 variables. Thus it is feasible to assign a value of 1/5 to all 7 dual
7
variables. In this case, the workforce size W = 15 Â i =1 ri , or W = 75 r , where r =
average labor demand.
This gives us two feasible solutions to the dual. These solutions
respectively corresponding to the two bounds derived in Exercise 18a.
Integer Programming Models 41

20. Consider the following nonlinear program.

Maximize f1(x1) + f2(x2) + f3(x3)


subject to x1+ 2x2 + 3x3 £ 13
2x1 – x3 ≥ 0
0 £ x1 £ 5 and integer, 0 £ x2 £ 9, 0 £ x3 £ 5

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

This is a separable programming problem. Define the variables to represent


each piece of the nonlinear terms.
CONSTRAINTS TO DEFINE VARIABLES
CX1 x1 = y11+ y12 + y13 + y14 + y15
CX2 x2 = x21 + x22 + x23
Integer Programming Models 42

CX3 x3 = x31 + x32

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

CX31 x31 £ 1.5z31

CX32 x32 £ 3.5z32

CZ31 1.5z32 £ x31

ORIGINAL CONSTRAINTS
x1 + 2x2 +3x3 £ 13

2x1 –x3 ≥ 0

BOUNDS AND RESTRICTIONS

y1j = 0 or 1 for j = 1,...,5; 0 £ x21 £ 3, 0 £ x22 £ 3, 0 £ x23 £ 3

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

and the cost is Z = 8(1000) = 8000.


Integer Programming Models 44

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.

c. When b=1/2 we use three segments for a piecewise linear approximation. A


MIP model is necessary to find the optimal solution.

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

c0 = 0, c1 = 1414, c2 = 2000, c3 = 2828;


a0 = 0, a1 = 2, a2 = 4 a3 = 8
s1 = 707, s2 = 292, s3 = 207

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

Relate radial flow to piecewise linear approximation:

y j - y j1 - y j 2 - y j 3 = 0 for j = 1,…,8

Conservation of flow at the wells:


Node 1: x1 - x2 + x10 - x9 - y1 = 1
Node 2: x2 - x3 + x11 - x10 - y2 = 1
M
Node 8: x8 - x1 + x9 - x16 - y8 = 1

Define variables to control order of the entry of the pieces in the approximation:

Let zj2 = 1 if piece 2 is used and let zj3 = 1 if piece 3 is used.

Constraints to control order and place bounds on the pieces:


2 z j 2 £ y j1 £ 2
2 z j 3 £ y j 2 £ 2 z j 2 for j = 1,…,8
0 £ yj3 £ 4z j3

Bounds and integrality


x j ≥ 0, for j = 1,º,16
y j ≥ 0, y j1 ≥ 0, y j 2 ≥ 0, y j 3 ≥ 0, for j = 1,º, 8
0 £ z j 2 £ 1, 0 £ z j 3 £ 1, for j = 1,º, 8

Numerical solution is not available.


Integer Programming Models 46

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.

Part b. The constraints are as follows.


m

(Bounds on assignment to car pools) L £ Âx


i =1
ik £ U, k = 1,…,n
n

(Each person must be assigned) Âx


k =1
ik = 1 , i = 1,…,m

(Binary requirement) xik = 0 or 1, i = 1,…,m, k = 1,…,n

Part c. There are at least two ways to do this.


Integer Programming Models 47

Option 1: x1k + x2k £ 1, k = 1,…,n

Option 2: (x1k)(x2k) = 0, k = 1,…,n

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.

Option 1: x3k = x4k, k = 1,…,n

Option 2: (not as good)

Ï1 if persons 3 and 4 are assigned to car pool k


Let wk = Ì
Ó0 otherwise

x3k + x4k = 2wk, k = 1,…,n


Integer Programming Models 48

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.)

a. Let xij be a binary decision variable equal to 1 if customer i immediately


precedes j on any route, 0 otherwise. Write out your model and explain the
objective function and the meaning of all the constraints.

To develop a mathematical formulation, we make the assumption that each


customer can be visited by only one vehicle (no split deliveries). To account for
the load on the vehicle, we introduce the variable yi which is the weight on truck
immediately after visiting customer i.
Objective Function
n n
Minimize  Âc x
i=0 j =0
ij ij
(1a)

Constraints
n
(exactly 1 successor) Âx
j =0
ij
= 1 i = 1,...,n (1b)

n n

(route continuity) Â x – Âx ij ji = 0 i = 0,...,n (1c)


j=0 j=0
jπ i jπ i

(subtour elim - weight) yj ≥ yi + dixij – Qj(1 – xij) i π j = 1,...,n (1d)

(simple bounds) di £ yi £ Q i = 1,...,n (1e)


Integer Programming Models 49

(integrality) xij Œ {0,1} i π j = 0,1,...,n (1f)

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)

Finally, it is possible, but not necessary, to add subtour eliminate constraints


similar to those used for the TSP. They would have the following form.

 Â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

Chapter 8. Integer Programming Methods


1. Find the minimal spanning tree for the network in the figure below starting from node
1 and then from node 5. Are your answers the same?

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

Applied to the example, we get the following solution.


Item 4 6 10 1 9 2 7 5 8 3
Benefit 8 15 6 10 19 12 9 3 2 2
Weight 2 4 2 5 10 10 14 5 9 12
Benefit/Weight 4 3.75 3 2 1.9 1.2 0.64 0.6 0.22 0.17
Sorted Index 1 2 3 4 5 6 7 8 9 10
Weight Available 40 38 34 32 27 17 7 7 2 2
Weight used 1 1 1 1 1 1 0 1 0 0

The heuristic, LP Solution and IP solution are shown below.

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?

When the heuristic procedure of problem 4 creates a solution that is a sequence


of 1’s followed by a sequence of 0’s and all the weight capacity is used, the
solution is optimum. Under these conditions the LP will also yield the optimum
solution.

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

We have not modeled the problem as an IP.

Solved as a minimal spanning tree problem we obtain:

Sq Node Link Length


––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
1 A -
2 E A-E 90
3 B E-B 40
4 D E-D 70
5 C D-C 110
––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
310
Integer Programming Methods 5

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.

Minimize 3x1 + 7x2 + 4x3 + 5x4

subject to 2x1 + x2 + 3x3 + 4x4 ≥ 6

x1 + 2x2 + 4x3 + 2x4 ≥ 6

3x1 + 4x2 + x3 + x4 ≥ 6

xj = 0 or 1, j =1,2,3,4

Node, k Level, l Pk zk xk jk Action


0 0 Ø –– –– 1 Separate on x1
1 1 (1) –– –– 2 Separate on x2
2 2 (1, 2) –– –– 3 Separate on x3
3 3 (1, 2, 3) 4 Separate on x4
4 4 (1, 2, 3, 4) 19 (1, 1, 1, 1) –– Feasible solution,
zB=19, backtrack
5 4 (1, 2, 3, -4) 14 (1, 1, 1, 0) –– Feasible solution,
zB=14, backtrack
6 3 (1, 2, -3) –– –– 4 Separate on x4
7 4 (1, 2, -3, 4) –– –– –– Infeasible solution,
backtrack
8 4 (1, 2, -3, -4) –– –– –– Infeasible solution,
backtrack
9 2 (1, –2) –– –– 3 Separate on x3
10 3 (1, –2, 3) –– –– 4 Separate on x4
11 4 (1, –2, 3, 4) –– (1, 0, 1, 1) –– Infeasible solution,
backtrack
12 4 (1, –2, 3, -4) –– (1, 0, 1, 0) –– Infeasible solution,
backtrack
13 3 (1, –2, -3) –– –– 4 Separate on x4
14 4 (1, –2, -3, 4) –– (1, 0, 0, 1) –– Infeasible solution,
backtrack
15 4 (1, –2, -3, -4) –– (1, 0, 0, 0) –– Infeasible solution,
backtrack
16 1 (-1) –– –– 2 Separate on x2
The process continues for a total of 32 nodes.
Integer Programming Methods 6

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.

Pk = (–6, +5, +9, –4, +3)

a. Identify the problem variables as either fixed to 1, fixed to 0, or free.


b. Sketch the current path in the search tree showing which alternative branches
have already been explored and which have yet to be explored.
c. Starting from Pk, separate on x8 in the direction x8 = 0. Show the next path
vector Pk+1.
d. Again starting from Pk, backtrack and show the new Pk+1.

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

10. Consider the problem

Maximize z = 3x1 + 5x2 + 8x3 + x4 + 3x5 + 10x6

subject to 2x1 + 2x2 + 5x3 + 3x4 + x5 + 8x6 £ 12

xj = 0 or 1, j = 1,…, 6

A feasible solution is xB = (1, 1, 0, 0, 0, 1) with zB = 18. Determine the relaxed


solution for each case below. Apply the fathoming rules described in Section 8.3
whenever possible. Solve the LP relaxations by hand.

a. All variables are free.


– +
b. S = {2}, S = {5}.
– +
c. S = {1,6}, S = ∆.
– +
d. S = ∆, S = {3, 6}.
– +
e. S = {4, 6}, S = {3}.

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.

Node Level Variable Value Up/Down Visit Relax


0 0 0 0 0 0 21.5 Branch X(6) down at 0
1 1 6 0 -1 1 19.6667 Branch X(4) up at 1
2 2 4 1 1 1 18.5 Branch X(1) up at 1
3 3 1 1 1 1 18.4 Branch X(3) up at 1
4 4 3 1 1 1 17.5 Branch X(2) up at 1
Integer: Replace incumbent:
Backtrack Level 5 : Branch X(2)
5 5 2 1 1 1 17 down at 0
Fathom: Backtrack Level 5 4 :
6 5 2 0 -1 2 15 Branch X(3) down at 0
Fathom: Backtrack Level 4 3 :
7 4 3 0 -1 2 12 Branch X(1) down at 0
Fathom: Backtrack Level 3 2 :
8 3 1 0 -1 2 17 Branch X(4) down at 0
Integer: Replace incumbent:
Backtrack Level 2 1 : Branch X(6)
9 2 4 0 -1 2 19 up at 1
Fathom: Backtrack Level 1 0
10 1 6 1 1 2 19.6 :Finished

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.

Maximize z = 10x1 + 30x2 + 20x3 + 20x4 + 10x5

Subject to 8x1 + 12x2 + x3 + 8x4 + 2x5 £ 15

9x1 + 7x2 + 4x3 + 10x4 + 5x5 £ 20

x1 + x2 + 8x3 + 3x4 + 7x5 £ 11

xj = 0 or 1, j = 1,…, 5

Node Level Variable Value Up/Down Visit Relax


0 0 0 0 0 0 56 Branch X(4) down at 0
1 1 4 0 -1 1 54.4444 Branch X(5) down at 0
2 2 5 0 -1 1 52.5 Branch X(1) down at 0
Integer: Replace incumbent:
Backtrack Level 3 : Branch X(1)
3 3 1 0 -1 1 50 up at 1
Fathom: Backtrack Level 3 2 :
4 3 1 1 1 2 45 Branch X(5) up at 1
Fathom: Backtrack Level 2 1 :
5 2 5 1 1 2 48.0952 Branch X(4) up at 1
6 1 4 1 1 2 53.8947 Branch X(2) up at 1
Infeasible: Backtrack Level 2 :
7 2 2 1 1 1 Infeasible Branch X(2) down at 0
Fathom: Backtrack Level 2 1 0
8 2 2 0 -1 2 45.2941 :Finished

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.

Maximize 4x1 + 2x2 + x3

subject to 14x1 + 10x2 + 11x3 £ 32

–10x1 + 8x2 + 9x3 ≥ 0

x1, x2, x3 ≥ 0 and integer

After relaxing the integrality requirements and solving the resulting linear program,
the following solution is obtained.

Var. no. Name Value Status


––––––––––––––––––––––––––––––––––––––––––––
1 x1 1.208 BASIC–1
2 x2 1.509 BASIC–2
3 x3 0 ZERO
4 SLK–1(x4) 0 ZERO
5 SLK–2(x5) 0 ZERO
––––––––––––––––––––––––––––––––––––––––––––
Objective value = 7.849

The basis and basis inverse for this solution are

ÈÍ 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?

a. The Gomery cuts in terms of the nonbasic variables are:


G1. 0.9906x3 + 0.0377x4 + 0.0472x5 ≥ 0.2075
G2. 0.1132x3 + 0.0472x4 + 0.934x5 ≥ 0.5094
Integer Programming Methods 13

b. The Gomery cuts in terms of the original structural variables are:


G1. -1x1 + 0x2 + 1x3 ≥ -1
G2. -10x1 + 7x2 + 8x3 ≥ -1

c. Dantzig cut
D. x3 + x4 + x5 ≥ 1

d. Dantzig cut in terms of original variables


D. -24x1 –2x2 -1x3 ≥ -31

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.

Row Basic Coefficients


no. variables z x1 x2 x3 x4 x5 x6 RHS
0 z 1 0.1 0.3 0 0.2 0 0 23.1
1 x6 0 1.3 –0.3 0 –1.0 0 1 5.3
2 x3 0 0 1.1 1 0.4 0 0 1.6
3 x5 0 –0.8 –0.2 0 –0.5 1 0 3.7

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.

a. Gomory cuts that can be derived


0.3x1 + 0.7x2 ≥ 0.3
0.1x2 + 0.4x4 ≥ 0.6
0.2x1 + 0.8x2 + 0.5x4 ≥ 0.7
From Obj: 0.1x1 + 0.3x2 + 0.2x2 ≥ 0.1

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 --- --- ---

Let x7 leave the basis. x2 will enter.


Integer Programming Methods 15

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

15. Find the relaxed LP solution to the following integer program.

Maximize 2x1 + 5x2

subject to x1 + x2 £ 5

–x1 + x2 £ 2

x1 – x2 £ 2

x1 + x2 ≥ 3

x1, x2 ≥ 0 and integer

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.)

a. Valid, but does not cut off LP solution.


b. Does not eliminate LP optimum.
c. Not valid. Cuts off LP but also cuts of integer point (2, 3).
d. Not valid. Cuts off LP but also cuts of integer point (2, 3).
Integer Programming Methods 17

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.)

a. We have not written the math programming model.

b. The model can be interpreted as sequencing problem with penalties. This


allows a greedy solution.

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

The optimum sequence is: 5, 1, 6, 7, 2, 8, 4, 3.


Integer Programming Methods 19

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+

A relaxation to this problem can be created by multiplying each constraint, say in


the first group, by a nonnegative number (a weight) and adding the result to the
objective function. Let l be an m1-dimensional, nonnegative row vector. The
relaxed problem as a function of l is

l) =
zLR(l Maximize cx + l(b1 – A1x)

subject to A2x £ b2
n
x ΠZ+

a. Why is the above problem considered a relaxation of the original integer


program?

Definition (Wolsey [1998]) A problem (RP) zR = Maximize{f(x) : x Œ T Õ ¬n} is a


relaxation of (IP) z = Max{c(x) : x Œ X Õ Zn} if:
(i) X Õ T, and
(ii) f(x) ≥ c(x) for all x Œ X.

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.

c. To find the “best” value of l, it is necessary to solve the Lagrangian dual:

zLD = l) : l ≥ 0}
Minimize {zLR(l

Explain why zLD ≥ zIP. Under what circumstances might zLD = zIP?

l) for all l ≥ 0. Also, in part (b) we showed that zLR(l


By definition, zLD ≥ zLR(l l) ≥
zIP so the result follows.
The difference zLD – zIP is called the duality gap. There are a number of
circumstances in which zLD = zIP; i.e., the gap is zero. In technical terms, this
n
circumstances depend on the convex hull of the set Q = {x Œ Z+ : A2x £ b2},
usually written conv(Q). It can be shown (Nemhauser and Wolsey [1988]), for
example, that
n
1. zLD = zIP for all c if all extreme points of {x Œ ¬+ : A2x £ b2} are integral.
2. zLD = zIP if and only if there exists l* ≥ 0 and x* Œ X such that l(b1 – A1x*) = 0
l*) = cx* + l*(b1 – A1x*).
and zLR(l
Integer Programming Methods 23

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.

a. Explain why this approach is considered a relaxation of the TSP?

The following model for a directed TSP is given in Section 7.6.

(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)

  xij £ |S| – 1, S à N, 2 £ |S| £ n – 2 (C3)


iŒS jŒS
(integrality)
xij = 0 or 1, i π j =1,…, n (C4)

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

b. Interpret the assignment problem solution in terms of a TSP.

In TSP terminology, a solution to an assignment problem usually has subtours.


This means that there may be several cycles in the solution such that each one
starts at a particular node and returns to that node without visiting all the nodes in
the graph. Only one of the cycles will start at the origin. For example, consider
the following AP solution with C1 the origin.

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

There are two tours: C1  C5  C2  C1 and C3  C4  C3. Note that in an


AP solution each node is visited once and only once.
Integer Programming Methods 25

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?

a. Write out the steps.

Branch and cut is a procedure that incorporates cutting planes in an implicit


enumeration algorithm at each node of the search tree. Rather than reoptimize
quickly at each new node, an effort is made to develop as tight a bound as
possible by adding cuts (constraints) that eliminate fractional solutions but not
integral solutions. Dantzig or Gomory cuts are examples of constraints that could
be added.
Generic Algorithm (depth-first search)
Initialization:
n
Let X = {x Œ Z+ : Ax £ b} be the feasible region of the IP to be solved and
let X be the relaxed feasible region associated with the LP. Let z be the
an upper bound on the optimal solution zIP.
Set X 0 ¨ X , S = {0}, and k = 0
Iteration k:
Step 1: Solve the LP relaxation
zk = Max{cx : x ΠX k}
to obtain xk.
If no solution exists, fathom node, set Sk+1  Sk \ {k}, and go to Step 4.
If zk ≥ z , fathom node, set Sk+1 = Sk \ {k}, and go to Step 4.

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

Step 3: Check branching conditions. If possible to extend search tree,


set Sk+1 = Sk » {k + 1}, put k ¨ k + 1, and go to Step 1;
otherwise, fathom node by setting Sk+1 = Sk \ {k}, backtrack,
and go to Step 4.
Step 4: If Sk+1 = ∆, stop with zIP = z ; otherwise, put k ¨ k + 1,
backtrack, remove cuts from formulation that are not valid at
current node k, and go to Step 1.

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).

Consider the linear problem


Maximize{cx : x ΠS}
n
where S = {x Œ ¬+ : Ax £ b} be the set of feasible points. Suppose that we have
a representation of S given by

-
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

The nonnegative requirement xj ≥ 0 for all j implies that

Î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)

Multiplying (S1) by Îh ˚ and then subtracting (S3) yields


Integer Programming Methods 28

 (Î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

is also valid for S because xj ≥ 0 for all j. Finally, the inequality

 Î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

Theorem (Wolsey [1998]) Every valid inequality for X can be obtained by


applying the Chvátal-Gomory procedure a finite number of times.
Integer Programming Methods 29

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.)

We consider two cases. First, let y ≥ Èb ˘ so Èb ˘ – y £ 0. From the definition of


the set X≥ we have that x ≥ b – y. Combining these inequalities, we see that x ≥
0 ≥ ( b – Îb˚)( Èb˘ – y) = f ( Èb˘ – y).

Next, let y < Èb ˘ . Then


x ≥ b – y = f + (Îb˚ – y)
≥ f + f ( Îb˚ – y) because Îb˚ – y ≥ 0 and f < 1
= f ( Èb˘ – y) I
(Try to draw a graph that demonstrates this cut.)

1
b. Let X£ = {(x, y) Œ ¬+ ¥ Z1 : –x + y £ b}, and f = b – Îb˚ > 0. Prove that the
inequality
x
– 1–f + y £ Îb˚

is valid for X£. (See note in part a).

First we note that if y = 0,the result is always true so assume y ≥ 1. Rearranging


the inequality we get

y – fy – Îb˚ + f ( Îb˚) £ x
or ( y – Îb˚) – f ( y + Îb˚) £ x (1)
Integer Programming Methods 30

On the other hand, we are given y – b £ x or

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

suppose that f1 £ f £ f2. Prove that

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.)

We know that any (x, y) Œ XMIR satisfies Îa1˚y1 + Èa2˘y2 £ b + x + (1 – f2)y2


because y1 ≥ 0 and a2 = Èa2˘ – (1 – f2). Now, the inequality in part (b) gives

Îa1˚y1 + Èa2˘y2 £ Îb˚ + [x + (1 – f2)y2] / ( 1 – f) (3)

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.

a. za* = Maximize 4x1 + 3x2 + x3

subject to 2x1 – x2 + 4x3 £ 5

3x1 + 2x2 – x3 £ 3

xj = 0 or 1, j = 1, 2, 3

b. zb* = Maximize 4x1 +3 x2 + x3

subject to 2x1 – x2 + 4x3 £ 5

3x1 + 2x2 – x3 £ 3

0 £ xj £ 1 for j = 1, 2, 3

c. z*c = Maximize 4x1 +3x2 + x3

subject to 5x1 + x2 + 3x3 £ 8

xj = 0 or 1, j = 1, 2, 3

d. zd* = Maximize 4x1 + 3x2 + x3

subject to 5x1 + x2 + 3x3 £ 8

0 £ xj £ 1 for j = 1, 2, 3

Zd ≥ Zc* ≥ Za*and Zd ≥ Zb*≥ Za*


Integer Programming Methods 33

25. Consider the following 0-1 knapsack problem.

Maximize 14x1 + 10x2 + 8x3

subject to 8x1 + 6x2 + 5x3 £ 10

xj = 0 or 1, j = 1, 2, 3

a. Solve the with the cutting plane method.


b. Solve using branch and bound with LP relaxation to provide bounds.

a. Solve the with the cutting plane method.


We show the solution at optimality. Five cuts were added. The simple upper
bounds were represented in the constraint set, because the Teach IP cutting
plane option does not allow simple upper bounds on the variables.
Objective: Max
Press to setup. Objective Value: 14
LP Status: Optimal
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: 0 0 0
Upper Bounds: 9999 9999 9999

straints Constraint Bounds


Name Value Lower Upper Constraint Coefficients
Cut 5 1 -9999 1 1 1 1
Cut 4 6 -9999 6 6 4 3
Cut 3 7 -9999 8 7 5 4
Cut 2 2 -9999 2 2 1 1
Cut 1 2 -9999 2 2 1 0
Con 1 8 -9999 10 8 6 5
Con 2 1 -9999 1 1 0 0
Con 3 0 -9999 1 0 1 0
Con 4 0 -9999 1 0 0 1

b. Solve using branch and bound with LP relaxation to provide bounds.


The problem is solved with the Teach IP add-in.
Integer Programming Methods 34

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

Original Lower Bounds 0 0 0


Original Upper Bounds 1 1 1
Incumbent IP Solution 1 0 0
Incumbent Objective 14

straints Constraint Bounds


Name Value Lower Upper Constraint Coefficients
Con 1 8 -9999 10 8 6 5

The sequence of steps are shown below.


Node Level Variable Value Up/Down Visit Relax
0 0 0 0 0 0 17.3333 Branch X(2) down at 0
1 1 2 0 -1 1 17.2 Branch X(3) down at 0
2 2 3 0 -1 1 14 Integer: Replace incumbent: Backtrack Level 2 : Branch X(3) up at 1
3 2 3 1 1 2 16.75 Branch X(1) up at 1
4 3 1 1 1 1 InfeasibleInfeasible: Backtrack Level 3 : Branch X(1) down at 0
5 3 1 0 -1 2 8 Fathom: Backtrack Level 3 2 1 : Branch X(2) up at 1
6 1 2 1 1 2 17 Branch X(1) up at 1
7 2 1 1 1 1 InfeasibleInfeasible: Backtrack Level 2 : Branch X(1) down at 0
8 2 1 0 -1 2 16.4 Branch X(3) up at 1
9 3 3 1 1 1 InfeasibleInfeasible: Backtrack Level 3 : Branch X(3) down at 0
10 3 3 0 -1 2 10 Fathom: Backtrack Level 3 2 1 0 :Finished
Integer Programming Methods 35

26. Shown below is an integer programming model and the optimal tableau of its linear
programming relaxation.

Maximize z = 2x1 + x2 – 3x3 + 5x4

subject to 3x1 – x2 + x3 + 2x4 £ 8

x1 + x2 + 4x3 – x4 £ 6

2x1 + 3x2 – x3 + x4 £ 10

x1 + x3 + x4 £ 7

xj ≥ 0 and integer, j = 1,…, 4

Row Basic Coefficients


no. variables z x1 x2 x3 x4 xs1 xs2 xs3 xs4 RHS
0 z 1 6 0 4 0 2 0 1 0 26
1 x4 0 11/7 0 2/7 1 3/7 0 1/7 0 34/7
2 xs2 0 17/7 0 33/7 0 4/7 1 –1/7 0 64/7
3 x2 0 1/7 1 –3/7 0 –1/7 0 2/7 0 12/7
4 xs4 0 –4/7 0 5/7 0 –3/7 0 –1/7 1 15/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.

a. Dantzig cut x1 + x3 + xs1 + xs3 ≥ 1

b. Gomory cut with the greatest right-hand-side value.


0.5714 x1 + 0.2857 x3 + 0.4286 xs1 + 0.1429 xs3 ≥ 0.8571

c. Write the Gomory cut that can be derived from row 0.


Integer Programming Methods 36

No cut can be written from row 0 because it has no fractions.

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

straints Constraint Bounds


Name Value Lower Upper Constraint Coefficients
Cut 2 4 -9999 4 1 -6E-17 0 1
Cut 1 12 -9999 13 3 2 -1 2
Con 1 6 -9999 8 3 -1 1 2
Con 2 -2 -9999 6 1 1 4 -1
Con 3 10 -9999 10 2 3 -1 1
Con 4 4 -9999 7 1 0 1 1
Integer Programming Methods 37

27. Consider the IP


Maximize x1 + x2

subject to –2x1 + 5x2 £ 5

4x1 – 3x2 £ 4

x1, x2 ≥ 0 and integer

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

b. Only one Gomery Cut is available from the LP solution:

0.2143x3 + 0.3571x4 ≥ 0.5

Adding the cut and re-solving we obtain:


Name: X 1 X 2
Values: 2 1.8
Linear Obj. Coef.: 1 1
Lower Bounds: 0 0
Upper Bounds: 9999 9999

straints Constraint Bounds


Name Value Lower Upper Constraint Coeff
Cut 1 2 -9999 2 1 0
Con 1 5 -9999 5 -2 5
Con 2 2.6 -9999 4 4 -3
Integer Programming Methods 38

28. An integer program is given below.


Maximize z = x1 + x2

subject to –11x1 + 4x2 – x3 =4

2x1 + x2 + x4 =3

–6x1 + 4x2 + x5 = 7

xj ≥ 0 and integer, j = 1,…, 5

After solving the linear programming relaxation we obtain the following tableau.

Basic Basic Coefficients


var. variables z x1 x2 x3 x4 x5 RHS
0 z 1 0 0 0 0.714 0.071 2.64
1 x2 0 0 1 0 0.428 0.142 2.28
2 x1 0 1 0 0 0.285 –0.071 0.36
3 x3 0 0 0 1 –1.42 1.35 1.21
a. Show that 3x4 + x5 ≥ 2 is a valid cut that can be derived from this tableau.

b. What other cuts can be derived from the 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.

Row 1 yields the cut constraint: 0.4286 x4 + 0.1429 x5 ≥ 0.2857


Dividing by 0.1429 yields: 3x4 + x5 ≥ 2

b. Other cuts that can be derived are:


From row 2 we obtain the cut: 0.286 x4 + 0.929 x5 ≥ 0.357
From row 3 we obtain the cut: 0.571 x4 + 0.357 x5 ≥ 0..214
Since the objective is integer from row 0 we obtain: 0.714 x4 + 0.071 x5 ≥ 0..643
Integer Programming Methods 39

29. Solve the problem below with branch and bound. Perform several iterations by hand
and then use the accompanying Excel add-ins.

Maximize 2x1 + 3x2 + 4x3 + 7x4

subject to 4x1 + 6x2 – 2x3 + 8x4 = 20

x1 + 2x2 – 6x3 + 7x4 = 10

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

Chapter 9 Nonlinear Programming Models


1. Plot the following functions and indicate whether each is convex, concave, or
neither. Provide a mathematical explanation for your conclusions.
a. f(x) = 4x2 – 20x + 10

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

b. f(x) = –4x2 – 20x

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

c. f(x) = 8x3 + 15x2 + 9x + 6

f(x) is neither convex nor concave.

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.

Contour for f(x) = 1

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

Contour for f(x) = 2

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

for all x1 and x2.


Nonlinear Programming Models 5

Contour for f(x) = 0

20
x1
15

10

0
-10 -5 0 5 x2 10
-5

-10

-15

-20
Nonlinear Programming Models 6

3. Determine whether the following functions are convex, concave or neither.


2 2
a. f(x) = x1 + x1x2 + x2

È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

a. 0 £ x £ 12. Convex region because it is linear.

b. |x | ≥ 6. |x | is a convex function. Inequality is in the wrong direction. The


constraint does not define a convex region.
c. |x | £ 6. |x | is a convex function. The region is convex.

d. 4x 2 – 20 x ≥ 0. The function on the left is convex, but the inequality is in the


wrong direction. The region is not convex.

e. ln x > 1. Change to -ln x £ 1. ln x is a concave function, so -ln x is convex


and the inequality is in the right direction. The region defined is convex.
The plot of ln x is below. ln x is a concave function, and the inequality is in the
right direction. The region defined is convex.

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

f. Construct the Hessian.


Nonlinear Programming Models 9

È-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.

a. c(x) = ax + b d. c(x) = aln(bx)


e. c(x) = 1 + ae–x + bx2
b. c(x) = axb

c. c(x) = abx

a. This function is a linear so it is convex for all a, b Œ (–•, •).

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

is abx(bln a)2. Convex if a Œ (0, •) and b Œ (–•, •).

d. The second derivative of the function is –a/x2. Convex if a Œ (–•, 0) and b Œ


(0, •).

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

8. Consider the functions defined below.

a(x) = 2x12 – 30x1 +10 d(x) = 5 x21 + 3x22


2
b(x) = –4x2 + 20x2 e(x) = – 2 x21 + x1 x2 – 4x22

c(x) = ln(x1 + 1) + ln(x2 + 1) f(x) = x1 + x2

Classify the following mathematical programs based on the problem types described
in Section 9.5.

a. Minimize{a(x) – b(x) : f(x) £ 10}

b. Maximize{b(x) + c(x) : d(x) £ 10, x ≥ 0}

c. Maximize{ d(x) : c(x) ≥ 4, e(x) ≥ –5, f(x) £ 10, x ≥ 0}

d. Minimize{d(x) : c(x) ≥ 4, e(x) ≥ –5, f(x) ≥ 2, a(x) ≥ 8, x ≥ 0}

e. Maximize{d(x)/f(x) : f(x) ≥ 4}

a(x) = 2x12 – 30x1 +10: convex d(x) = 5x12 + 3x22: convex

b(x) = –4x22 + 20x2: concave e(x) = – 2 x21 + x1 x2 – 4x22: concave


c(x) = ln(x1 + 1) + ln(x2 + 1) : concave f(x) = x1 + x2: convex and concave

a. Minimize{a(x) – b(x) : f(x) £ 10}

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. Maximize{b(x) + c(x) : d(x) £ 10, x ≥ 0}

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.

c. Maximize{ d(x) : c(x) ≥ 4, e(x) ≥ –5, f(x) £ 10, x ≥ 0}


Nonlinear Programming Models 15

d(x) is convex, but the objective is to maximize. Thus this is a nonconvex


programming problem. c(x) and e(x) are concave, but since the constraints are ≥,
these constraints define a convex region. The constraint with f(x) also defines a
convex region. The model is not separable because of the e(x) constraint. This is
a nonconvex programming model with a convex feasible region.

d. Minimize{d(x) : c(x) ≥ 4, e(x) ≥ –5, f(x) ≥ 2, a(x) ≥ 8, x ≥ 0}

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}

The objective function is convex and the constraint is linear. It is a convex


programming problem.
Nonlinear Programming Models 16

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.

a. Maximize f(x) = –2x12 + 4x1x2 – 4x22 + 4x1 + 4x2

b. Maximize f(x) = ln(x1 + 1) + ln(x2 + 1)


2 2
c. Maximize f(x) = x1 + 4x2 – 3x1x2 + 10x1 + 20x2

d. Minimize f(x) = x12 + 4x22 – 10x1 + 20x2

e. Minimize cost:
n
f (x) = Â fj(xj) where fj(xj) = aj xj–b, with aj > 0 and 0 <b < 1
j=1

f. Maximize profit = revenue – cost:


n n
–bjxj
f (x) = Â rj(xj) – Â c(xj) where rj(xj) = aj(1 – e ) , with aj > 0 and bj > 0
j=1 j=1
and cj(xj) = dj xjh with dj > 0 and h > 1

a. Maximize f(x) = –2 x21 + 4x1x2 – 4 x22 + 4x1 + 4x2

Construct the Hessian.


È-4 4 ˘
H=Í ˙ H1 = -4, H2 = 16. The function is concave. The associated
Î 4 -8˚
minimization objective is convex. The function is not separable. No

b. Maximize f(x) = ln(x1 + 1) + ln(x2 + 1)

ln(x1 + 1) is a concave function of x. The corresponding minimum will be convex.


The function is separable. Yes.

c. Maximize f(x) = x12 + 4 x22 – 10x1 + 20x2. Note that c is not the same above.

The function is convex, but the minimization is not convex. No.

d. Minimize f(x) = x12 + 4 x22 – 10x1 + 20x2

The function is convex and separable. Yes.


Nonlinear Programming Models 17

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.

f. Maximize profit = revenue – cost:


n n
f (x) = Â rj(xj) – Â c(xj) where rj(xj) = aj(1 – exp(–bjxj)) , with aj > 0 and bj > 0
j=1 j=1
and cj(xj) = djxjh with dj > 0 and h > 1

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

10. Determine whether the objective function is convex, concave or neither.

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.

Analysis determines that the Hessian of the objective function is negative


definite, so the objective is concave. Since the constraints are linear, a stationary
point will be a global maximum.

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.

Name: E_10 Objective Terms Solver: Excel Solver


Type: NLP1 Linear: 206.13 Type: Nonlinear
Goal: Max NonLinear 1: - 1 9 4 . 2 Sens.: No
P r o f i t : 130.47 NonLinear 2: 118.49 Side: No

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

Linear Obj. Coef.: x1*x2 x1*x3 x2*x3 10 15 20


Nonlinear Obj. Terms: 21.073 31.241 14.139 46.561 9.5372 20.962
Nonlinear Obj. Coef.: 4 2 -2 -2 -4 -3

Value Rel. RHS NL Terms Linear Constraint Coefficie


14.49 <= 15 0 0 0 1 1 1
26 <= 26 0 0 0 2 4 0
7.6667 <= 10 0 0 0 0 1 1
Nonlinear Programming Models 19

11. Use the definition of convexity to prove Lemma 1.

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.

f( x ) £ lf(x1)+ (1– l)f(x2), where x = lx1 + (1 - l )x 2 (1)

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.

By the convexity of f1 and f2 we have

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)

which is exactly Eq. (1).

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.

Let x = lx1 + (1 - l )x 2 . For any l Π[0, 1), we have

f( x ) £ lf(x1)+ (1– l)f(x2) (by convexity of f(x))

< lf(x1)+ (1– l)f(x1) (because f(x2) < f(x1))

= 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

the inequality is valid. Then


f(x1) ≥ f( x ) + —Tf( x )(x1 – x ) (1)

f(x2) ≥ f( x ) + —Tf( x )(x2 – x ) (2)

Multiplying (1) by l and (2) by (1 – l) and adding, we get

lf(x1)+ (1– l)f(x2) ≥ f( x ) + —Tf( x )( lx1 + (1 - l )x 2 – x ) = f (lx1 + (1 - l )x 2 )

which is the definition of convexity.

Now we prove the “only if” part. Suppose f is convex. Then for all l Œ [0, 1],

f (lx1 + (1 - l )x 2 ) £ lf(x1)+ (1– l)f(x2)

and for 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

—Tf(x2)(x1 – x2) £ f(x1) – f(x2) (4)

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

differentiable, its directional derivative is equal to its gradient.)


Nonlinear Programming Models 23

15. Five oil wells located in the (x,y)-plane have the coordinates (ai,bi) given by

(a1,b1) = (5,0) (a2,b2) = (0,10) (a3,b3) = (10,10)

(a4,b4) = (50,50) (a5,b5) = (–10,50)

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

The optimum location of the collection point is (7.6188, 11.215).


The total amount of pipe is 121.95
Nonlinear Programming Models 24

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

The decision variables are: wt = number of employees in period t.


ht: number of employees hired at the beginning of period t.
ft: number of employees layed off at the beginning of period t.

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

Â1000w t + 500 ht + 1000 f t


t =1

The demand is a random variable with a uniform distribution in each month.


Production in month t has the maximum value of 5wt. If demand is below that
value, the workers are idle. The cost of idle workers is included in the cost of
employees and there is no extra expense. If the demand is above 5wt there is a
cost of lost sales. The expect cost is:
Nonlinear Programming Models 25

Et = E(cost of lost sales in month t ) = 200 Ú ( y - 5wt ) ft ( y)dy


5 wt

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.

The nonlinear programming model has 31 variables and 12 constraints. It is a


separable quadratic model with a convex objective function. The solution
obtained with Solver is a global minimum and is shown below.
t 1 2 3 4 5 6
w 20 20 20 20 25 20
h 0 0 0 0 5 0
f 0 0 0 0 0 5
u 0 0 0 0 0 0
v 20 20 20 20 25 20
production 100 100 100 100 125 100
Nonlinear Programming Models 26

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

Arc Data and Flows


Num. Name Flow Origin Term. Lower Upper Cost NL Coef. NL Terms
1 Arc1 -76.86 1 2 -10000 10000 0 1 5907.9
2 A r c 2 26.363 2 3 -10000 10000 0 2 694.99
3 Arc3 194.1 1 4 -10000 10000 0 1 37677
4 A r c 4 109.12 3 4 -10000 10000 0 2 11907
5 Arc5 -17.24 1 3 -10000 10000 0 1 . 4 297.27
6 A r c 6 96.774 2 4 -10000 10000 0 2 . 8 9365.2
Nonlinear Programming Models 28

18. A company wants an aggregate production plan for the next 6 months. Projected
sales for its product are listed below.

Sales goals Production


Month (units) cost ($/unit)
1 1300 100
2 1400 105
3 1000 110
4 800 115
5 1700 110
6 1900 110

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.

Set up the mathematical programming model that minimizes production,


inventory and goal penalty costs. Classify the model and solve for the case where each
penalty weight is equal to 20.

Let Pt = Production in month t, St = Sales in month t, It = inventory at the end of


month t.
Objective: Minimize Z = 100P1 + 105P2 + … + 4I1 + 4I2 + …

+ 20(S1 - 1300)2 + 20(S2 - 1400) … + 20(I1 - 100)2 + 20(I2 - 100)2 + …


Nonlinear Programming Models 29

+ 20(P2 - P1)2 + 20(P3 - P2 )2 + …

Conservation of flow constraints:


Pt + It-1 – St – It = 0 for t = 1,…,6. Assume I0 = 100, I6= 100, P0= 1000.

Since the objective is convex, we should get a global optimum.

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

19. (Economic Order Quantity with Shortages Backordered) A variation of the


inventory problem is to allow shortages, as shown in the accompanying figure. The
shortage, equal to Q – S, is “backordered” at a cost p per unit and satisfied when the
replenishment is received.

S
Inventory level

0
Time
S–Q
Q/d 2Q/d

Lot-size model with shortages

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.

cost/time = setup cost + product cost + holding cost + backorder cost

f(Q,S) = dK/Q + dc + hS2/2Q + p(Q – S)2/2Q

The cost function is f(Q,S) = aK/Q + ac + hS2/2Q + p(Q-S)2/2Q


Nonlinear Programming Models 31

∂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.

b. Solve the optimization problem.

Geographic grid (2 miles) ¥ (4 miles)


1 2 3 4

8 10 15 7

5 6 7 8

12 8 2 10

Definition for variables

Assignment of flows to stations.


x i2 = average rate of calls sent from i to the cell 2 ( i = 1,2,…,7)
x i8 = average rate of calls sent from i to the cell 8 ( i = 1,3,…,8)

Total flows to stations.


y2 = total rate assigned to station 2
y8 = total rate assigned to station 8

Parameters
Nonlinear Programming Models 35

c i2, c i8 = travel times from cell i to cell 2 and cell 8, respectively.


(For example, c12 = 1/6, c22 = 0, c72 = 2/6 where time units are in hours.)
di = average number of calls for cell i

According to the average time formula we know

W (average time waiting and in service) = 1/m(1 – r) = 1/ (m – l)

Thus average time spent by an arrival at cells 2 and 8 are

W2 = 1/ (30 – y2), W8 = 1/ (60 – y8).

Thus total time spent by all arrivals at cells 2 and 8 are

T2 = y2/ (30 – y2), T8 = y8/ (60 – y8).

The travel times for cell 2 and cell 8 are Âc


i
x + Â ci 8 xi 8 , so the model is:
i 2 i2
i

Minimize z = y2/ (30 – y2) + y8/ (60 – y8) + Âc


i
x + Â ci 8 xi 8
i 2 i2
i

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)

y8 £ 30 (Necessary for stability at 2)


y8 £ 60 (Necessary for stability at 2)
x i2 ≥ 0 and integer for i =1,2,…,7
x i8 ≥ 0 and integer for i =1,3,…,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

Since the objective function is convex, this should be a global minimum.

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:

x i2 £ dizi, i =1,2,…,8 (either cell 2 processes the call)

x i8 £ d i(1 – zi), i =1,2,…,8 (or cell 8 processes the call from i)

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

22. The regression problem when p = 1 is


n
Minimize Âi =1
yi ± (b0 + b1 x1i + b2 x2 i +º + bm xmi ) .

Write this unconstrained nonlinear program as an LP.

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- )

subject to (1) and (2)


Note that in the solution, at most one of the variables in the pair (ui+ , ui- ) will be
positive. Why?
Nonlinear Programming Models 38

23. The regression problem when p = • is

Minimize{Maximumi = 1,…, n (|yi – (b0 + b1x1i + b2x2i + … + bmxmi)|)}.

Write this unconstrained nonlinear program as an LP.

We begin with the same transformation used in Exercise 22. 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)
The next step is to replace the ith absolute value term with the sum ui+ + ui- . This
gives the following optimization problem.

Model 1

Minimize {Maximumi = 1,…, n (ui+ + ui- ) }


subject to (1) and (2)

One more transformation is necessary. We must replace the inner maximization


problem with a variable, and then restrict the value of that variable to be greater or
equal each of the n terms. This gives,

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.

b. Solve the full least squares regression model


y = b0 + b1x1 + b2x2 + b3x3.
2
What are the values of b0, b1, b2, b3, R2 and Ra .

c. Let p = 1 and solve the corresponding LP developed in Exercise 22 to find the


regression coefficients and R2 values.

d. Let p = • and solve the corresponding LP developed in Exercise 23 to find the


regression coefficients and R2 values.

e. Repeat part b when each deviation ai = yi – (b0 + b1x1i + b2x2i + b3x3i) is


weighted by 1/yi. The corresponding problem is to
20
ÔaiÔ2
Minimize  ÔÔ y ÔÔ .
i
i=1
Nonlinear Programming Models 40

Data for regression exercise


i yi x1 x2 x3
1 99 85 76 44
2 93 82 78 42
3 99 75 73 42
4 97 74 72 44
5 90 76 73 43
6 96 74 69 46
7 93 73 69 46
8 130 96 80 36
9 118 93 78 36
10 88 70 73 37
11 89 82 71 46
12 93 80 72 45
13 94 77 76 42
14 75 67 76 50
15 84 82 70 48
16 91 76 76 41
17 100 74 78 31
18 98 71 80 29
19 101 70 83 39
20 80 64 79 38

a. The result is b0 = 11.028, b1 = 1.095, R2 = 0.532.

b. The result is b0 = 39.320, b1 = 1.070, b2 = 0.164, b3 = –0.936, R2 = 0.747.


c. See the example on pages 562-563. First, change the model to a linear
program as follows:
n
Minimize z = Âe i =1
i

subject to ei ≥ ai " i = 1,2,…,20


ei ≥ – a i " i = 1,2,…,20
ai = yi – (b0 + b1 x1i +b2x2i + b3x3i) " i = 1,2,…,20

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.

d. Again it is necessary to transform the model to its linear program equivalent


as follows:
Nonlinear Programming Models 41

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

Using the LP solver, the results are b0 = 0, b1 = 1.1258, b2 = 0.0907, b3 = 0.

e. The result is b0 = 53.756, b1 = 1.006, b2 = 0.048, b3 = –0.976, R2 = 0.682.


Operations Research Models and Methods
by Paul A. Jensen and Jonathan F. Bard
John Wiley and Sons, Inc.
Copyright 2003 – All rights reserved

Chapter 10 Nonlinear Programming Methods


For Exercises 1 – 5, find the stationary points of f(x) by setting the first partial derivatives
to zero and solving the resulting equations. If possible, determine whether the points
obtained are local or global maxima or minima. Justify your conclusions.

1. f(x) = –2x3 + 3x2 + 72x + 30

The first derivative is f ’(x) = -6 x2+6x + 72


Setting it zero, we have x2 - x- 12 = 0 and the solutions are x = 4 or x = -3
The second derivative is f’’(x) = -12 x + 6
As f’’(4) = -12¥ 4 + 6 = - 42 £ 0, x =4 is a local maximum
As f’’(-3) = -12¥ (-3) + 6 = 42 ≥ 0, x =-3 is a local minimum

2. f(x) = 3x12 + 4x22 – x1 x2 – 5x1 – 8x2

The first partial derivatives are


∂f
= 6 x1 - x 2 - 5
∂x1
∂f
= 8 x 2 - x1 - 8
∂x 2

Setting the partials equal to zero we obtain the solution:


x1 = 48/47=1.021, x2 = 53/47 =1.128
È 6 - 1˘
The Hessian Matrix H is Í- 1 8 ˙
Î ˚

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

3. f(x) = –2x12 – x22 – 4x32 – 3x1x3 + 3x2x3 – x1 – 2x2 – 3x3

The first partial derivatives are


∂f
= -4 x1 - 3 x 3 - 1
∂x1
∂f
= -2 x 2 + 3 x 3 - 2
∂x 2
∂f
= -3 x1 + 3 x 2 - 8 x 3 - 3
∂x 3
Setting the partials equal to zero we obtain the solution:
x1 = 2.9, x2 = - 7.3, x3 = - 4.2
È-4 0 -3˘
The Hessian Matrix H is Í 0 -2 3 ˙ .
Í ˙
ÍÎ -3 3 -8˙˚

The Hessian is negative definite. So, we have a local maximum.


Nonlinear Programming Methods 3

4. f(x) = –2x12 – x22 – 4x32 – 8x1x3 + 4x2x3 – x1 – 2x2 – 3x3

The first derivatives are:


∂f
= -4 x1 - 8 x 3 - 1
∂x1
∂f
= -2 x 2 + 4 x 3 - 2
∂x 2
∂f
= -8 x1 + 4 x 2 - 8 x 3 - 3
∂x 3
Setting the partials equal to zero we obtain the solution:
x1 = - 0.875, x2 = - 0.375, x3 = 0.3125

È-4 0 -8˘
H = Í 0 -2 3 ˙
Í ˙
ÍÎ -8 3 -8˙˚

H is indefinite, and we have a saddle point

5. f(x) = 100x14 + 100x22 – 200x12x2 + x12 – 2x1

The first partial derivatives are


∂f 3
= 400 x1 - 400 x1 x 2 + 2 x1 - 2
∂x1
∂f 2
= 200 x 2 - 200 x1
∂x 2
Setting the partials equal to zero we obtain the solution:

x1 = 1, x2 = 1

È-802 -400 ˘
H = Í ˙
Î-400 200 ˚

H is positive definite and we have a global minimum


Nonlinear Programming Methods 4

6. Solve the following problem using the Lagrangian technique.

Maximize{x1 + 2x2 + 3x3 : x12 + x22 + x32 = 14}

Constructing the Lagrangian function, we have

L(x,l) = x1 + 2x2 + 3x3 – l( x21 + x22 + x23 – 14)

È 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.

Constructing the Lagrangian function, we have

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:

Point (x, y, z) Lagrangian


1 1 1 1 Saddle point
, ,
3 3 3
2 1 1 1 Strong local minimum
– , ,
3 3 3
3 1 1 1 Strong local minimum
,– ,
3 3 3
4 1 1 1 Strong local minimum
, ,–
3 3 3
5 Strong local maximum
– 1 ,– 1 , 1
3 3 3
6 Strong local maximum
– 1 , 1 ,– 1
3 3 3
7 1 ,– 1 ,– 1 Strong local maximum
3 3 3
8 Strong local minimum
– 1 ,– 1 ,– 1
3 3 3
Nonlinear Programming Methods 6

8. Find the point in the set

{(x,y,z) : x2 – xy + y2 – z2 = 1, x2 + y2 = 1}
nearest the origin in the (x,y,z)-space.

The objective is to minimize x2 + y2+ z2


Constructing the Lagrangian function, we have
L(x,l) = x 2 + y 2 + z 2 + l1 ( x 2 - xy + y 2 - z 2 - 1) + l2 ( x 2 + y 2 - 1)

È∂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

Point f(x, y, z) (x, y, z) Lagrangian


1 1.5 1 1 1 Saddle point
– , ,
2 2 2
2 1.5 1 1 1 Strong local maximum
,– ,
2 2 2
3 1.5 1 1 1 Saddle point
,– ,–
2 2 2
4 1.5 1 1 1 Saddle point
– , ,–
2 2 2
Nonlinear Programming Methods 7

All stationary points of the Lagrangian have the same objective value.

9. Consider the problem of maximizing f(x) subject to x ΠS, where

S = {(x1, x2) : x1 + x2 £ 4, –x1 + x2 £ 1, x1 ≥ 0, x2 ≥ 0}.

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.

a. f(x) = (x1 – 3)2 + (x2 – 5)2

b. f(x) = (x1 – 3)2 + (x2 – 2.5)2

c. f(x) = (x1 – 3)2 + (x2 – 0.5)2

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)

The KKT conditions are


∂L
1. = -2( x1 - 3) + l1 - l 2 ≥ 0
∂x1

∂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

Point 1, (1.5, 2.5)


Constraints (3) and (4) are satisfied. As x1 and x2 are greater than 0, we must
have
∂L
= -2( x1 - 3) + l1 - l2 = 0
∂x1
∂L
= -2( x 2 - q ) + l1 + l 2 ≥ 0
∂x 2

Thus, we have l1 = x1 - 3 + x 2 - q , and l 2 = -( x1 - 3) + ( x 2 - q ) .


For q = 5, we have l1 = – 4. This does not satisfy 9, so it is not a local maximum.

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.

Point 2, (3, 0.5)


As equation (3) and (4) are not binding, then l1 = l2= 0.
Also, as x1 and x2 are greater than 0, we should have
∂L
= -2( x1 - 3) + l1 - l2 = 0
∂x1
∂L
= -2( x 2 - q ) + l1 + l 2 = 0
∂x 2
For q = 5 and 2.5, the above equations are not satisfied, so it not local maximum
For q = 0.5, the above equations are satisfied, so it is a stationary point. Actually,
it is a local minimum if we examine the Hessian

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

region. Since we are maximizing a convex function over a convex region on of


these must be the global maximum.

Maximize
SOL1 OBJ1 OBJ2 OBJ3
x1 0 34 15.25 9.25
x2 0

x1 4 26 7.25 1.25
x2 0

x1 1.5 8.5 2.25 6.25


x2 2.5

x1 0 25 11.25 9.25
x2 1
Nonlinear Programming Methods 10

10. Consider the following quadratic programming problem

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

a. Write out the KKT conditions and solve by hand.


b. Alternatively, set up the linear programming model that can be used to find the
solution and solve with the software accompanying the book (you must control
the entering variables to assure that complementarity is satisfied at each
iteration).

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

–4x1 + 8x2 + 2x3+ m1 +4m2 + m3 – y2 = 15

–2x1 + 2x2+ 6x3 + m1 +3m3 – y3 = 20

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.

Minimize 2x12 + 2x22 + 3x32 + x1 – 3x2 – 5x3 + 2x1x2 + 2x2x3

subject to x1+ x2 + x3 ≥ 1, 3x1 + 2x2 + x3 £ 6, x1 ≥ 0, x2 ≥ 0, x3 ≥ 0

Also solve with a general NLP code and compare the results.

The data and variable definitions are given below.


1 4 2 0
Ê ˆ È ˘ È –1 –1 –1 ˘ Ê –1 ˆ
cT = Á –3 ˜ , Q = Í 2 4 2 ˙ , A = Í ˙, b=Á ˜
Î 3 2 1 ˚ Ë 6 ¯
Ë –5 ¯ Î 0 2 6˚
x = (x1, x2, x3), y = (y1, y2, y3), µ = (m1, m2), v = (v1, v2)

The KKT conditions are


4 x1 +2 x2 – m1 +3m2 – y1 = –1

2 x1 +4 x2 +2 x3 – m1 +2m2 – y2 = 3

+2 x2+6 x3 – m1 +m2 – y3 = 5

–x1– x2– x3 + v1= –1

3x1+ 2x2 + x3 + v2 = 6

x1 y1+ x2 y2+ x3 y3 = 0 and m1 v1 + m2 v2 = 0

and all x, y, u, v are nonnegative.

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

12. Consider the following problem.


2
Minimize (x1 – 5) – x22 – x32

subject to x12 + x22 + x32 £ 9

(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)

The KKT conditions are


∂L
1) = 2( x1 - 5) + l1 (2 x1) + l 2 ( 5 - 2) ≥ 0
∂x1
∂L
2) = -2 x2 + l1 (2 x2 ) ≥ 0
∂x2
∂L
3) = -2 x3 + l1 (2 x3 ) - 2l 2 ≥ 0
∂x3

4) x12 + x22 + x32 £ 9

5) ( 5–2) x1 – 2x3 £ – 4

6) l1 ( x12 + x22 + x32 – 9 ) = 0

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.

e) for x = (3, 0, 0))


The point is not feasible, as (2 – 5 )x1 + 2x3 ≥ 4 is not satisfied
Note that we have not yet determined the global minimum.
Nonlinear Programming Methods 15

13. Consider the following problem.

Minimize (x1 – 4)2 + (x2 – 4)2 + (x3 – 4)2

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.

f(x) = (x1 – 4)2 + (x2 – 4)2 + (x3 – 4)2

g1(x) = –x1 – x2 – x3 +1

g2(x) = x1 + x2 + x3 –6

L = ( x1 - 4)2 + ( x2 - 4)2 + ( x3 - 4)2 + m1 ( - x1 - x2 - x3 + 1) + m2 ( x1 + x2 + x3 - 1)


∂L
= 2( x j - 4) - m1 + m2
∂x j

For the point (1, 0, 0) we compute:


g1 ( x ) = 0, g2 ( x ) = -5
From m2 g2 ( x ) = 0, we find m2 = 0.
∂L
From = -6 - m1 = 0, we find m1 = -6 π 0
∂x1
So KKT are not satisfied.

For the point (1, 1, 1) we compute:


g1 ( x ) = -1 < 0, g2 ( x ) = -4 < 0
From m1g1 ( x ) = m2 g2 ( x ) = 0, we find m1 = m2 = 0.
∂L
We compute = -6 π 0
∂x1
So KKT are not satisfied.
Nonlinear Programming Methods 16

For the point (0, 0, 6) we compute:


g1 ( x ) = -5 < 0, g2 ( x ) = 0
From m1g1 ( x ) = 0, we find m1 = 0.
∂L
From = -8 + m2 = 0, we compute m2 = 8 > 0
∂x1
∂L
From = 4 + m2 = 12 π 0
∂x3
So KKT are not satisfied.

For the point (2, 2, 2) we compute:


g1 ( x ) = -5 < 0, g2 ( x ) = 0
From m1g1 ( x ) = 0, we find m1 = 0.
∂L
From = -4 + m2 = 0, we compute m2 = 4 > 0
∂x1
∂L ∂L
= -4 + m2 = 0, = -4 + m2 = 0
∂x2 ∂x3
So KKT are satisfied. The point satisfies the necessary condition for a stationary point.
Since the objective function is convex and the constraints are linear, this is sufficient for a
global minimum.

b. Using the restricted bases entry rule, set up and solve the associated linear
program.

The LP model representing the quadratic programming problem is shown below.


The solution was obtained using restricted basis entry using the Teach LP add-
in.

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.

k x1k f 1 (a 1k) a1k f2( a 2 k ) a2k f 3 (a 3k) a3k


0 0 16 0 16 0 16 0
1 0.5 12.25 0 12.25 0
12.25 0
2 1 9 0 9 0 9 0
3 1.5 6.25 0 6.25 06.25 7E-16
4 2 4 1 4 1 4 1
5 2.5 2.25 0 2.25 02.25 0
6 3 1 0 1 0 1 0
f1(x1) x1 f1(x1) x1 f1(x1) x1
4 2 4 2 4 2
Nonlinear Programming Methods 18

15. Use separable programming approach to solve the following problems. Pick a
suitable grid for the variables.

1
a. Minimize x +1 + x23
1

subject to x12 – 2x23 £ 5

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

b. Minimize ex1 + x12 +3x1 + 2x22 – 5x2 + 2x3

subject to –2x12 + ex2 – 6x3 £ 12

x14 – 3x2 + 5x3 £ 23

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

k x1k f 1 (a 1 k ) g11(a 1k g12(a 1 k a1k x2k f2( a 2 k ) g21(a 2 k g22( a 2 k a2k


0 0 1 0 0 1 0 0 1 0 0
1 0.5 3.3987 - 0 . 5 0.0625 0 0.25 - 1 . 1 2 5 1.284 -0.75 0
2 1 6.7183 -2 1 0 0.5 - 2 1.6487 -1.5 0
3 1.5 11.232 - 4 . 5 5.0625 0 0.75 -2.625 2.117 -2.25 0
4 2 17.389 -8 16 0 1 - 3 2.7183 -3 0
5 2.5 25.932 - 1 2 . 5 39.063 0 1.25 -3.125 3.4903 -3.75 1
6 3 38.086 -18 81 0 1.5 -3 4.4817 -4.5 0
7 3.5 55.865 - 2 4 . 5 150.06 0 2 -2 7.3891 -6 0
8 4 82.598 -32 256 0 f2(x2) g21(x2) g22(x2) x2
f 1 ( x 1 ) g11(x1) g12(x1) x1 -3.125 3.4903 -3.75 1.25
1 0 0 0 f(x3) g31(x3) g32(x3) x3
0 0 0 0
Nonlinear Programming Methods 20

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.

Note that the length of uncertainty at the beginning of iteration k +1 is given by

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.

4. Put k ¨ k + 1 and go to Step 1.

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

that the minimum has been reached); otherwise, go to Step 2.


2. Put k ¨ k + 1 and go to Step 1.

Of course, the procedure can only be applied to twice-differentiable functions.


Furthermore, it is only well-defined when f ¢¢( xk ) π 0 for each k.

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.

4. Put k ¨ k + 1 and go to Step 1.

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].

e. Method of false position

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.

We leave these as exercises for the students.


Nonlinear Programming Methods 24

18. For the following problems of a single variable, use dichotomous search to find the
solution for e = 0.01.

a. Minimize {f(x) = 105x + 8/x – 45 : 0 £ x £ 1}

In the following parts the search was stopped when the region of uncertainty
reached 0.02.

Iter a (low) b (up) x1 f(x1) x2 f(x2) new a new b


0 0 0 0 0 0 0 0 1
1 0 1 0.495 23.137 0.505 23.867 0 0.505
2 0 0.505 0.2475 13.311 0.2575 13.105 0.2475 0.505
3 0.2475 0.505 0.3713 15.53 0.3813 16.015 0.2475 0.3813
4 0.2475 0.3813 0.3094 13.343 0.3194 13.583 0.2475 0.3194
5 0.2475 0.3194 0.2784 12.968 0.2884 13.022 0.2475 0.2884
6 0.2475 0.2884 0.263 13.034 0.273 12.969 0.263 0.2884
7 0.263 0.2884 0.2707 12.976 0.2807 12.974 0.2707 0.2884
Stop 0.2707 0.2884 0.2746 12.966 0.2846 12.992 0.2707 0.2884
The results of the search indicate that the minimum is between 0.2707 and
0.2884.

b. Minimize {f(x) = 3x2 – 5x – 4 : 10 £ x £ 2}

Iter a (low) b (up) x1 f(x1) x2 f(x2) new a new b


0 0 0 0 0 0 0 1 2
1 1 2 1.495 -4.77 1.505 -4.73 1 1.505
2 1 1.505 1.2475 -5.569 1.2575 -5.544 1 1.2575
3 1 1.2575 1.1238 -5.83 1.1338 -5.813 1 1.1338
4 1 1.1338 1.0619 -5.927 1.0719 -5.913 1 1.0719
5 1 1.0719 1.0309 -5.966 1.0409 -5.954 1 1.0409
6 1 1.0409 1.0155 -5.984 1.0255 -5.973 1 1.0255
7 1 1.0255 1.0077 -5.992 1.0177 -5.981 1 1.0177
Stop 1 1.0177 1.0039 -5.996 1.0139 -5.986 1 1.0177
The results of the search indicate that the minimum is between 1 and 1.0177.

c. Minimize {f(x) = 2x4 – 2x – 1 : 0 £ x £ 2}


Nonlinear Programming Methods 25

Iter a (low) b (up) x1 f(x1) x2 f(x2) new a new b


0 0 0 0 0 0 0 0 2
1 0 2 0.995 -1.03 1.005 -0.97 0 1.005
2 0 1.005 0.4975 -1.872 0.5075 -1.882 0.4975 1.005
3 0.4975 1.005 0.7463 -1.872 0.7563 -1.858 0.4975 0.7563
4 0.4975 0.7563 0.6219 -1.945 0.6319 -1.945 0.6219 0.7563
5 0.6219 0.7563 0.6841 -1.93 0.6941 -1.924 0.6219 0.6941
6 0.6219 0.6941 0.653 -1.942 0.663 -1.94 0.6219 0.663
7 0.6219 0.663 0.6374 -1.945 0.6474 -1.943 0.6219 0.6474
8 0.6219 0.6474 0.6296 -1.945 0.6396 -1.944 0.6219 0.6396
Stop 0.6219 0.6396 0.6258 -1.945 0.6358 -1.945 0.6219 0.6396
The results of the search indicate that the minimum is between 0.6219 and
0.6396.

d. Maximize {f(x) = 4x3 – 7x2 + 14x + 6 : 0 £ x £ 1}

Iter a (low) b (up) x1 f(x1) x2 f(x2) new a new b


0 0 0 0 0 0 0 0 1
1 0 1 0.495 11.7 0.505 11.8 0.495 1
2 0.495 1 0.7425 14.173 0.7525 14.276 0.7425 1
3 0.7425 1 0.8663 15.475 0.8763 15.584 0.8663 1
4 0.8663 1 0.9281 16.162 0.9381 16.276 0.9281 1
5 0.9281 1 0.9591 16.517 0.9691 16.633 0.9591 1
6 0.9591 1 0.9745 16.698 0.9845 16.816 0.9745 1
7 0.9745 1 0.9823 16.789 0.9923 16.907 0.9823 1
Stop 0.9823 1 0.9861 16.835 0.9961 16.954 0.9823 1
The results of the search indicate that the maximum is between 0.9823 and 1.

e. Minimize {f(x) = 3x2 – 2x3/2 + 1 : 0 £ x £ 1}

Iter a (low) b (up) x1 f(x1) x2 f(x2) new a new b


0 0 0 0 0 0 0 0 1
1 0 1 0.495 1.0385 0.505 1.0473 0 0.505
2 0 0.505 0.2475 0.9375 0.2575 0.9376 0 0.2575
3 0 0.2575 0.1238 0.9589 0.1338 0.9558 0.1238 0.2575
4 0.1238 0.2575 0.1856 0.9434 0.1956 0.9418 0.1856 0.2575
5 0.1856 0.2575 0.2166 0.9391 0.2266 0.9383 0.2166 0.2575
6 0.2166 0.2575 0.232 0.938 0.242 0.9376 0.232 0.2575
7 0.232 0.2575 0.2398 0.9377 0.2498 0.9375 0.2398 0.2575
Stop 0.2398 0.2575 0.2436 0.9376 0.2536 0.9375 0.2398 0.2575
Nonlinear Programming Methods 26

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}

Iter a (low) b (up) x1 f(x1) x2 f(x2) new a new b


0 0 0 0 0 0 0 0 1
1 0 1 0.495 1.1455 0.505 1.152 0 0.505
2 0 0.505 0.2475 1.0333 0.2575 1.0362 0 0.2575
3 0 0.2575 0.1238 1.008 0.1338 1.0094 0 0.1338
4 0 0.1338 0.0619 1.002 0.0719 1.0026 0 0.0719
5 0 0.0719 0.0309 1.0005 0.0409 1.0008 0 0.0409
6 0 0.0409 0.0155 1.0001 0.0255 1.0003 0 0.0255
7 0 0.0255 0.0077 1 0.0177 1.0002 0 0.0177
Stop 0 0.0177 0.0039 1 0.0139 1.0001 0 0.0177
The results of the search indicate that the minimum is between 0 and 0.0177.
Nonlinear Programming Methods 27

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}

Iter a (low) b (up) x1 f(x1) x2 f(x2) new a new b


0 0 0 0 0 0 0 0 1
1 0 1 0.382 16.051 0.618 32.838 0 0.618
2 0 0.618 0.2361 13.676 0.382 16.051 0 0.382
3 0 0.382 0.1459 25.152 0.2361 13.676 0.1459 0.382
4 0.1459 0.382 0.2361 13.676 0.2918 13.055 0.2361 0.382
5 0.2361 0.382 0.2918 13.055 0.3262 13.777 0.2361 0.3262
6 0.2361 0.3262 0.2705 12.977 0.2918 13.055 0.2361 0.2918
7 0.2361 0.2918 0.2574 13.108 0.2705 12.977 0.2574 0.2918
8 0.2574 0.2918 0.2705 12.977 0.2786 12.968 0.2705 0.2918
9 0.2705 0.2918 0.2786 12.968 0.2837 12.987 0.2705 0.2837
Stop 0.2705 0.2837 0.2755 12.966 0.2786 12.968 0.2705 0.2837
The results of the search indicate that the minimum is between 0.2705 and
0.2837.

b. Minimize {f(x) = 3x2 – 5x – 4 : 10 £ x £ 2}

Iter a (low) b (up) x1 f(x1) x2 f(x2) new a new b


0 0 0 0 0 0 0 1 2
1 1 2 1.495 -4.77 1.618 -4.236 1 1.618
2 1 1.618 1.304 -5.419 1.382 -5.18 1 1.382
3 1 1.382 1.186 -5.71 1.2361 -5.597 1 1.2361
4 1 1.2361 1.113 -5.849 1.1459 -5.79 1 1.1459
5 1 1.1459 1.0679 -5.918 1.0902 -5.885 1 1.0902
6 1 1.0902 1.0401 -5.955 1.0557 -5.935 1 1.0557
7 1 1.0557 1.0229 -5.976 1.0344 -5.962 1 1.0344
8 1 1.0344 1.0122 -5.987 1.0213 -5.977 1 1.0213
9 1 1.0213 1.0056 -5.994 1.0132 -5.986 1 1.0132
Stop 1 1.0132 1.0016 -5.998 1.0081 -5.992 1 1.0132
The results of the search indicate that the minimum is between 1 and 1.01.

c. Minimize {f(x) = 2x4 – 2x – 1 : 0 £ x £ 2}


Nonlinear Programming Methods 28

Iter a (low) b (up) x1 f(x1) x2 f(x2) new a new b


0 0 0 0 0 0 0 0 2
1 0 2 0.7639 -1.847 1.2361 1.1966 0 1.2361
2 0 1.2361 0.4721 -1.845 0.7639 -1.847 0.4721 1.2361
3 0.4721 1.2361 0.7639 -1.847 0.9443 -1.298 0.4721 0.9443
4 0.4721 0.9443 0.6525 -1.942 0.7639 -1.847 0.4721 0.7639
5 0.4721 0.7639 0.5836 -1.935 0.6525 -1.942 0.5836 0.7639
6 0.5836 0.7639 0.6525 -1.942 0.695 -1.923 0.5836 0.695
7 0.5836 0.695 0.6262 -1.945 0.6525 -1.942 0.5836 0.6525
8 0.5836 0.6525 0.6099 -1.943 0.6262 -1.945 0.6099 0.6525
9 0.6099 0.6525 0.6262 -1.945 0.6362 -1.945 0.6099 0.6362
10 0.6099 0.6362 0.62 -1.944 0.6262 -1.945 0.62 0.6362
Stop 0.62 0.6362 0.6262 -1.945 0.63 -1.945 0.62 0.6362

The results of the search indicate that the minimum is between 0.62 and 0.63.

d. Maximize {f(x) = 4x3 – 7x2 + 14x + 6 : 0 £ x £ 1}

Iter a (low) b (up) x1 f(x1) x2 f(x2) new a new b


0 0 0 0 0 0 0 0 1
1 0 1 0.382 10.549 0.618 12.923 0.382 1
2 0.382 1 0.618 12.923 0.7639 14.393 0.618 1
3 0.618 1 0.7639 14.393 0.8541 15.343 0.7639 1
4 0.7639 1 0.8541 15.343 0.9098 15.956 0.8541 1
5 0.8541 1 0.9098 15.956 0.9443 16.346 0.9098 1
6 0.9098 1 0.9443 16.346 0.9656 16.592 0.9443 1
7 0.9443 1 0.9656 16.592 0.9787 16.747 0.9656 1
8 0.9656 1 0.9787 16.747 0.9868 16.843 0.9787 1
9 0.9787 1 0.9868 16.843 0.9919 16.903 0.9868 1
Stop 0.9868 1 0.9919 16.903 0.995 16.94 0.9868 1
The results of the search indicate that the minimum is between 0.987 and 1.

e. Minimize {f(x) = 3x2 – 2x3/2 + 1 : 0 £ x £ 1}


Nonlinear Programming Methods 29

Iter a (low) b (up) x1 f(x1) x2 f(x2) new a new b


0 0 0 0 0 0 0 0 1
1 0 1 0.382 0.9656 0.618 1.1742 0 0.618
2 0 0.618 0.2361 0.9378 0.382 0.9656 0 0.382
3 0 0.382 0.1459 0.9524 0.2361 0.9378 0.1459 0.382
4 0.1459 0.382 0.2361 0.9378 0.2918 0.9402 0.1459 0.2918
5 0.1459 0.2918 0.2016 0.9409 0.2361 0.9378 0.2016 0.2918
6 0.2016 0.2918 0.2361 0.9378 0.2574 0.9376 0.2361 0.2918
7 0.2361 0.2918 0.2574 0.9376 0.2705 0.9381 0.2361 0.2705
8 0.2361 0.2705 0.2492 0.9375 0.2574 0.9376 0.2361 0.2574
9 0.2361 0.2574 0.2442 0.9376 0.2492 0.9375 0.2442 0.2574
Stop 0.2442 0.2574 0.2492 0.9375 0.2523 0.9375 0.2442 0.2574

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}

Iter a (low) b (up) x1 f(x1) x2 f(x2) new a new b


0 0 0 0 0 0 0 0 1
1 0 1 0.382 1.0832 0.618 1.2372 0 0.618
2 0 0.618 0.2361 1.0302 0.382 1.0832 0 0.382
3 0 0.382 0.1459 1.0112 0.2361 1.0302 0 0.2361
4 0 0.2361 0.0902 1.0042 0.1459 1.0112 0 0.1459
5 0 0.1459 0.0557 1.0016 0.0902 1.0042 0 0.0902
6 0 0.0902 0.0344 1.0006 0.0557 1.0016 0 0.0557
7 0 0.0557 0.0213 1.0002 0.0344 1.0006 0 0.0344
8 0 0.0344 0.0132 1.0001 0.0213 1.0002 0 0.0213
9 0 0.0213 0.0081 1 0.0132 1.0001 0 0.0132
Stop 0 0.0132 0.005 1 0.0081 1 0 0.0132

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.

a. Minimize {f(x) = 105x + 8/x – 45 : 0 £ x £ 1}

In the following we modified Newton’s method so that when it suggested a move


outside the range of the lower and upper limits, the search went to the limit. We
used a numerical method to find first and second derivative with D = 0.001. The
search was terminated when successive points were within 0.01.

For part a, we set the lower bound to 0.0001 because the function is not defined
at 0.

Iter a b x f(x) x1 f(x1) x2 f(x2) f'(x) f'(x1) f''(x) new x


0 0.001 1 0.1 45.5 0 0 0 0 0 0 0 0.3
1 0.001 1 0.3 13.17 0.301 13.18 0.302 13.2 16.41 16.99 586.7 0.272
2 0.001 1 0.272 12.97 0.273 12.97 0.274 12.97 -2.706 -1.92 786.1 0.275
Stop 0.001 1 0.272 12.97 0.273 12.97 0.274 12.97 -2.706 -1.92 786.1 0.275

The last search point is at 0.273. Note that the procedure did not converge when
stated at 0.5.

b. Minimize {f(x) = 3x2 – 5x – 4 : 10 £ x £ 2}

Iter a b x f(x) x1 f(x1) x2 f(x2) f'(x) f'(x1) f''(x) new x


0 1 2 0 0 0 0 0 0 0 0 0 1.5
1 1 2 1.5 -4.75 1.501 -4.746 1.502 -4.742 4.003 4.009 6 1
2 1 2 1 -6 1.001 -5.999 1.002 -5.998 1.003 1.009 6 1
Stop 1 2 1 -6 1.001 -5.999 1.002 -5.998 1.003 1.009 6 1

The last search point is at 1.

c. Minimize {f(x) = 2x4 – 2x – 1 : 0 £ x £ 2}

Iter a b x f(x) x1 f(x1) x2 f(x2) f'(x) f'(x1) f''(x) new x


0 0 2 0 0 0 0 0 0 0 0 0 1
1 0 2 1 -1 1.001 -0.994 1.002 -0.988 6.012 6.036 24.05 0.75
2 0 2 0.75 -1.867 0.751 -1.866 0.752 -1.864 1.382 1.395 13.54 0.648
3 0 2 0.648 -1.943 0.649 -1.943 0.65 -1.943 0.181 0.191 10.11 0.63
Stop 0 2 0.648 -1.943 0.649 -1.943 0.65 -1.943 0.181 0.191 10.11 0.63
Nonlinear Programming Methods 31

The last search point is at 0.648.

d. Maximize {f(x) = 4x3 – 7x2 + 14x + 6 : 0 £ x £ 1}

Iter a b 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 -11.75 0.501 -11.76 0.502 -11.77 -9.999 -9.997 1.976 1
2 0 1 1 -17 1.001 -17.01 1.002 -17.02 -12.01 -12.02 -10.02 0
3 0 1 0 -6 0.001 -6.014 0.002 -6.028 -13.99 -13.98 13.98 1
4 0 1 1 -17 1.001 -17.01 1.002 -17.02 -12.01 -12.02 -10.02 0

The search did not converge.

e. Minimize {f(x) = 3x2 – 2x3/2 + 1 : 0 £ x £ 1}

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

The last search point is at 0.25.

f. Minimize {f(x) = ex – x : 0 £ x £ 1}

Iter a b 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.149 0.501 1.149 0.502 1.15 0.65 0.651 1.65 0.106
2 0 1 0.106 1.006 0.107 1.006 0.108 1.006 0.113 0.114 1.113 0.005
3 0 1 0.005 1 0.006 1 0.007 1 0.006 0.007 1.006 0
Stop 0 1 0.005 1 0.006 1 0.007 1 0.006 0.007 1.006 0

The last search point is at 0.005.


Nonlinear Programming Methods 32

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.

Step x1 x2 f(x) Grad1 Grad2 t new x1 new x2 norm


0 0 0 0 0 0 0 0 0 0
1 0 0 0 -5 - 8 0.1529 0.7646 1.2234 1.4427
2 0.7646 1.2234 - 6 . 8 0 5 - 1 . 6 3 6 1.0223 0.134 0.9839 1.0863 0.2585
3 0.9839 1.0863 - 7 . 0 5 4 - 0 . 1 8 3 - 0 . 2 9 3 0.1529 1.0119 1.1312 0.0529
4 1.0119 1.1312 - 7 . 0 6 3 - 0 . 0 6 0.0375 0.134 1.0199 1.1261 0.0095

22. Repeat the preceding exercise using the following.


a. The PARTAN method.

Since the objective function is quadratic the Partan reaches the optimum after
the acceleration step.

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 Grad 0 0 0 -5 -8 -5 - 8 0.1529 0.7646 1.2234 1.4427
2 Grad 0.7646 1.2234 - 6 . 8 0 5 - 1 . 6 3 6 1.0223 - 1 . 6 3 6 1.0223 0.134 0.9839 1.0863 0.2585
3 Acc 0.9839 1.0863 - 7 . 0 5 4 - 0 . 1 8 3 - 0 . 2 9 3 - 0 . 9 8 4 - 1 . 0 8 6 0.038 1.0213 1.1277 0.0557
4 Grad 1.0213 1.1277 - 7 . 0 6 4 0 0 0 0 0 1.0213 1.1277 0

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.

Gradient search for minimization of F_24 as a function of X_24.


Start D1 X_241 D2 X_242 D3 X_243 D4 X_244
Obj. 13 2.7524 -0.39 -1.872 -3.165
X_24(1) 1 0.5866 0.1185 0.1818 -0.13 0.1579 - 0 . 2 2 9 -0.51 0.2243
X_24(2) 1 0.0733 0.8898 0.9585 - 0 . 4 1 8 0.1918 - 0 . 5 3 8 0.856 -1.299
X_24(3) 1 0.8066 - 0 . 2 1 2 - 0 . 2 1 9 0.0872 0.9687 - 0 . 5 2 3 - 0 . 0 8 6 -0.446
Step Norm. -1.503 -1.364 -0.629 -0.889
Evaluations 31 31 31 31

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.

Gradient search for minimization of F_24 as a function of X_24.


Start D1 X_241 D2 X_242 D3 X_243 D4 X_244
Obj. 13 2.7611 -0.73 -2.228 -3.27
X_24(1) 1 0.5866 0.1442 0.2331 - 0 . 2 3 6 0.0507 - 0 . 2 7 3 - 0 . 6 1 7 0.1773
X_24(2) 1 0.0733 0.893 0.9613 - 0 . 6 7 5 0.0949 - 0 . 7 4 4 0.7419 -1.285
X_24(3) 1 0.8066 - 0 . 1 7 7 - 0 . 1 4 7 0.0632 0.9942 - 0 . 6 6 2 - 0 . 2 6 2 -0.471
Step Norm. -1.459 -1.631 -0.729 -0.729
Evaluations 12 12 12 12

X _ 2 4 Solution
1 0.1773
2 -1.285
3 -0.471
Objective -3.27
Nonlinear Programming Methods 35

25. Repeat Exercise 23 using the following.


a. The PARTAN method.

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.

Newton’s method converged on the first step.

Step f (x ) Grad1 Grad2 Grad3 d1 d2 d3 t


new x1 new x2 new x3 norm
0 0 0 0 0 0 0 0 1 0 1 1 1.7321
1 13 8 1 11 -1.9 8.3 5.2 1 2.9 -7.3 - 4 . 2 9.977
2 -12.2 1E-14 0 1E-14 1E-14 0 1E-14 0.108 2.9 -7.3 - 4 . 2 2E-15
Nonlinear Programming Methods 36

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.

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 1 1 0
1 Newt 1 1 -2 -0.5 3.5 -0.281 0.8699 1 1.2808 0.1301 0.9141
2 Newt 1.2808 0.1301 -3.64 -1.36 -0.7 -0.16 -0.078 1 1.4411 0.2083 0.1783
3 Newt 1.4411 0.2083 -3.85 -0.95 0.017 -0.121 0.0243 1 1.5623 0.1839 0.1236
4 Newt 1.5623 0.1839 -3.95 -0.73 -0.01 -0.093 0.0139 1 1.6548 0.17 0.0935
5 Newt 1.6548 0.17 -4.01 -0.56 -0 -0.071 0.0102 1 1.7253 0.1597 0.0713
6 Newt 1.7253 0.1597 -4.05 -0.42 -0 -0.054 0.0074 1 1.7791 0.1523 0.0543
7 Newt 1.7791 0.1523 -4.07 -0.32 -0 -0.041 0.0054 1 1.8201 0.1469 0.0413
8 Newt 1.8201 0.1469 -4.08 -0.25 -0 -0.031 0.004 1 1.8513 0.1429 0.0315
9 Newt 1.8513 0.1429 -4.09 -0.19 -0 -0.024 0.003 1 1.875 0.1399 0.0239
10 Newt 1.875 0.1399 -4.09 -0.14 -0 -0.018 0.0022 1 1.8931 0.1376 0.0182
Nonlinear Programming Methods 37

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ˆ¯

– (10 – x1 + x2 – x3)2 – (x1x2x3)2

After 20 steps of the Gradient Method (steepest ascent) on the Teach NLP add-
in the solution below is obtained.

X_27 Solution Gradient


1 2.39176834 15.0794871
2 -1.6016576 3.23706248
3 0.3214088 2.3401398
Objective -33.969003

After 12 steps of the Conjugate Gradient Method in the Teach NLP add-in the
solution below is obtained.

X_27 Solution Gradient


1 2.78703177 -0.0011047
2 -1.7590893 0.00345382
3 0.48081807 -0.0019342
Objective -30.658929

The solution obtained with the Solver add-in is shown below. It agrees closely
with the solution from the Conjugate Gradient Method.

X_27 Values -100 0.00225738


X_27(1) 2.78697 -25 0.00580067
X_27(2) -1.759059 -1 24.7325349
X_27(3) 0.480789 -1 5.55563911

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).

Gradient search for minimization of F_28a as a function of X_28a.


Start D1 X_28a1 D2 X_28a2 D3 X_28a3
Obj. -5 -6.953 -6.999 -7
X_28a(1) 1 - 0 . 9 7 1.9189 - 0 . 2 4 3 1.9764 - 0 . 9 7 1.9981
X_28a(2) 1 0.2425 0.7703 -0.97 1 0.2427 0.9946
Step Norm. -0.947 -0.237 -0.022
Evaluations 29 29 29

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)

Gradient search for minimization of F_24b as a function of X_28b.


Start D1 X_28b1 D2 X_28b2 D3 X_28b3
Obj. -23 -106.52 -127.02 -127.92
X_28b(1) 1 -0.8321 5.16023 - 0 . 5 9 1 2 6.22965 0.80653 5.95385
X_28b(2) 1 -0.5547 3.77348 0.80652 2.31459 0.59119 2.11244
Step Norm. -5 -1.8089 -0.3419
Evaluations 29 29 29

X_28b Solution
1 5.95385
2 2.11244
Objective -127.92

c. Repeat part b starting at x0 = (–1, 1).


Nonlinear Programming Methods 39

Gradient search for minimization of F_28c as a function of X_28c.


Start D1 X_28c1 D2 X_28c2 D3 X_28c3
Obj. 23 -61.72 -124.3 -166.6
X_28c(1) - 1 - 0 . 3 7 1 0.8569 - 0 . 4 1 3 2.9206 0.7418 - 0 . 7 8 8
X_28c(2) - 1 - 0 . 9 2 8 3.6424 - 0 . 9 1 1 8.1966 - 0 . 6 7 1 11.55
Step Norm. -5 -5 -5
Evaluations 29 29 29

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

there are local optima at (0, 1) and (5, 1).

Gradient search for maximization of F_28d as a function of X_28d.


Start D1 X_28d1 D2
Obj. 0 1
X_28d(1) 0 1E-06 1E-06 1E-06
X_28d(2) 0 1 1 1
Step Norm. 1 1
Evaluations 29 4

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.

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 Grad 0 0 0 -16 -20 -16 - 2 0 -0.53 -8.41 - 1 0 . 5 1 13.46
2 Grad - 8 . 4 1 - 1 0 . 5 1 172.4 9.2308 - 7 . 3 8 5 9.2308 - 7 . 3 8 5 0.169 - 9 . 9 7 4 - 9 . 2 6 2 2.003
3 Acc - 9 . 9 7 4 - 9 . 2 6 2 160.6 1.0985 1.3732 9.9741 9.2617 -0.06 - 9 . 3 3 3 - 8 . 6 6 7 0.874
4 Grad - 9 . 3 3 3 - 8 . 6 6 7 161.3 0 0 0 0 0 -9.333 -8.667 0

2
b. Minimize f(x) = 2x1 + (3 – x2)2.

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 Grad 0 0 9 0 -6 0 -6 0.5 0 3 3
2 Grad 0 3 0 0 0 0 0 0 0 3 0
Stop Stop 0 3 0 0 0 0 0 0 0 3 0

2 2
c. Minimize f(x) = x1 + x2 – 6x1 – 8x2.

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 Grad 0 0 0 -6 -8 -6 -8 0.5 3 4 5
2 Grad 3 4 -25 0 0 0 0 0 3 4 0

d. Minimize f(x) = (1 – 2x1)2+ (2 – 3x2)2 + x1x2.

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 Grad 0 0 5 -4 -12 -4 - 1 2 0.059 0.2353 0.7059 0.744
2 Grad 0.2353 0.7059 0.294 - 2 . 8 2 4 0.9412 - 2 . 8 2 4 0.9412 0.333 1.1765 0.3922 0.992
3 Acc 1.1765 0.3922 -1.18 - 1 . 2 5 5 - 3 . 7 6 5 - 1 . 1 7 6 - 0 . 3 9 2 0.457 1.7143 0.5714 0.567
4 Grad 1.7143 0.5714 -1.86 1E-15 0 1E-15 0 0 1.7143 0.5714 0
Nonlinear Programming Methods 41

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.

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 -16 - 2 0 9.3333 8.6667 1 - 9 . 3 3 3 - 8 . 6 6 7 12.74
2 Grad - 9 . 3 3 3 - 8 . 6 6 7 161.3 0 0 0 0 0 -9.333 -8.667 0

2
b. Minimize f(x) = 2x1 + (3 – x2)2.

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 0 -6 0 -3 1 0 3 3
2 Grad 0 3 -9 0 0 0 0 0 0 3 0

2 2
c. Minimize f(x) = x1 + x2 – 6x1 – 8x2.

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 -6 -8 -3 -4 1 3 4 5
2 Grad 3 4 -25 0 0 0 0 0 3 4 0

d. Minimize f(x) = (1 – 2x1)2+ (2 – 3x2)2 + x1x2.

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 -4 - 1 2 -1.714 -0.571 1 1.7143 0.5714 1.807
2 Grad 1.7143 0.5714 -6.86 - 7 E - 1 6 - 1 E - 1 5 - 7 E - 1 6 - 1 E - 1 5 0 1.7143 0.5714 0
Nonlinear Programming Methods 42

31. Find the minimum of the functions in Exercises 2 – 5 using a multidimensional


search method.

All are solved with the Teach NLP add-in.

Solution to Ex. 2
X02_ Values F02_(X02_ X02_
X02_(1) 1.02128 -7.0638
X02_(2) 1.12766

Minimize X02_ Solution Hessian Diagonalized Hessian


1 1.02128 6 -1 6 0
2 1.12766 -1 8 0 7.83333333
Objective -7.0638 Var. Linear Transformation
1 1 -0.1666667
2 0 1

The Hessian matrix is positive definite. It is a strong local minimum.


Solution to Ex. 3
X03_ Values F03_(X03_ X03_
X03_(1) 2.90002 12.15
X03_(2) -7.3
X03_(3) -4.2

Maximize X03_ Solution Hessian Diagonalized Hessian


1 2.90002 -4 -0 -3 -4 0 0
2 -7.3 -0 -2 3 0 -2 0
3 -4.2 -3 3 -8 0 0 -1.25
Objective 12.15 Var. Linear Transformation
1 1 7E-09 0.75
2 0 1 -1.5
3 0 0 1

The Hessian matrix is negative definite. It is a strong local maximum.


Exercise 4. Both maximizing and minimizing objectives are unbounded.

Solution to Ex. 5
X05_ Values G_(X05_) X05_
X05_(1) 1 -1
X05_(2) 1

Minimize X05_ Solution Hessian Diagonalized He


1 1 802 -400 802 0
2 1 -400 200 0 0.499
Objective -1 Var. Linear Transfor
1 1 -0.5
2 0 1
Nonlinear Programming Methods 43

The Hessian matrix is positive definite. It is a strong local minimum.

32. For each of the objective functions given below solve the problem

Minimize{f(x) : x ≥ 0}

using the conditions given in Theorem 3.

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

a. f(x) = (x1 – 5)2 + (x2 – 3)2 – 4x1x2

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

Investigating the points that solve the first two conditions.


∂f ∂f
x1 = 0, x2 = 0, = -10 < 0, = -6 < 0
∂x1 ∂x2
Nonegativity conditions violated.

∂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.

No points satisfy the necessary conditions, so there is no solution to this


problem. It is unbounded.

b. f(x) = (x1 + 5)2 + (x2 – 3)2

f ( x ) = x12 + 10 x1 + x2 2 - 6 x1 + 34
∂f
= 2 x1 + 10
∂x1
∂f
= 2 x2 - 6
∂x2

Investigating the points that solve the first two conditions.


∂f ∂f
x1 = 0, x2 = 0, = 10 > 0, = -6 < 0
∂x1 ∂x2
Nonegativity conditions violated.

∂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

Nonegativity conditions violated.

Only (0,3) satisfies the necessary condition, so it must be the global minimum.

c. f(x) = (x1 – 5)2 + (x2 + 3)2 + 2x1x2 + 4x1 – 3x2

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

Investigating the points that solve the first two conditions.


∂f ∂f
x1 = 0, x2 = 0, = -6 < 0, =3>0
∂x1 ∂x2
Nonegativity conditions violated.

∂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.

d. f(x) = (x1 + 5)2 + (x2 + 3)2 – 6x1x2


Nonlinear Programming Methods 46

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

Investigating the points that solve the first two conditions.


∂f ∂f
x1 = 0, x2 = 0, = 10 > 0, =6>0
∂x1 ∂x2
The solution satisfies the necessary condition. The Hessian is indefinite, so we
judge the point to be not a local minimum.

∂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

Chapter 11 Models for Stochastic Processes


1. A military air base has K airplanes. The planes fail independently and each has its
own repair crew. Denote the event of a failure by a and the event of a repair by d.
Construct the state-transition network for the corresponding stochastic process.
Define all terms.

We need a single state variable representing the number of failed planes. In


state n there will be n repair operations proceeding simultaneously. Use d to
represent the event of a repair, thus nd is on the transition leading to the state n -
1. In state n there are (K - n) planes available to fail. With a the event of failure
there are (K-n)a, events leading to a transition from state n to state n + 1.
d 2d Kd
0 1 2 … K –1 K
Ka (K–1) a a
Models for Stochastic Processes 2

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.

(0) (1) (2) (3)


4a 4a 4a
0 1 2 3
d d d

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.

(0,0) (1,0) (0, 2) (0, 3)


4a 4a 4a
0 1 2 4
4a d
d (0,1)
d
3
Models for Stochastic Processes 3

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.

(0) (1) (2) (3)


4a 4a 4a
0 1 2 3
Models for Stochastic Processes 4

3. An apartment service has hired a specialist to match students up as roommates.


Individuals arrive independently, fill out the necessary forms, and wait for a
matching. The arrival event is a and the matching event is d. A matched pair departs
from the system. Describe the stochastic process that determines the number of
individuals awaiting service and draw the corresponding state-transition network.

We assume there is no compatibility problem. Any pair of individuals may be


matched. The process matching process simply notifies the individuals.
The state variable is the number in the system. An arrival increases the number
in the system by 1, while a matching decreases the number by 2.
(0) (1) (2) (3)
a a a
0 1 2 3

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.

State s = [s1, s2, s3] Each component of s has three possible


values: si Œ{i, h, w}
State Space S = {[w, i, i], [w, w, i], …} Although there are 27 combinations of
the state variables, only some are
reachable. For example s1 will never be
i since material is always available.
Events X = {d1, d2, d3} d1, d2, d3 are the completion of
operation 1, 2 and 3 respectively.

[w, i, i ]
d1
d3
[w,w, i ]
d1 d2

d3
[h,w, i ] [w, i, w]
d2 d1
d3 d3

[h,w,w ] d1 [w,w,w ] d2 [w,h, w ]

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

(0,3) (1,3) (2,3)

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

(0,2) (1,2) (2,2)

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.

a. The three properties constitute Definition 4.


1. The assumption of a discrete state space seems reasonable because a
taxpayer is either audited or not in a given year. A more elaborate model
might consider the extent or depth of the audit.
2. The Markovian property defined by Eq. (1) may be hard to justify. It says
that the probability of an audit only depends on what happened in the
previous year. Taxpayers who have a history of filing questionable returns
may be more likely to be audited than those with clean records.
Nevertheless, this property might hold up empirically.
3. The idea of stationary transition probabilities is also suspect. Taxpayers
who are self-employed with many deductions are more likely to get audited
than taxpayers who take the standard deduction. A shift in employment
status in this regard could change the likelihood of an audit from year to year.
Over time, taxpayers many change income brackets or filing status, and the
IRS may change its audit policies. All this undermines the assumption of
stationary increments.

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.

d. Let n be the number of states. Then pij can be approximated as follows.


f
pij = n ij , i, j = 1, . . . , n
 j =1 fij
Models for Stochastic Processes 14

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.

Customers per hour Number of times recorded


0 10
1 20
2 30
3 15
4 15
5 10
Total 100

a. Compute the average arrival rate per hour.


b. Compute the average interarrival time in minutes.
c. Construct a frequency diagram of arrivals. Try to fit the resultant curve to some
well known distribution. Use statistical methods to determined the goodness of
fit.

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

Kolmogorov-Smirnov Test Applied to Student Arrivals


Absolute
Theoretical Relative Theoretical Observed difference,
Class probability frequency CDF, F(x) CDF, SN(x) |SN(x) – F(x)|
0 0.0503 0.10 0.0503 0.10 0.0497
1 0.2059 0.20 0.2562 0.30 0.0438
2 0.3369 0.30 0.5931 0.60 0.0069
3 0.2757 0.15 0.8688 0.75 0.1188  largest
4 0.1128 0.15 0.9816 0.90 0.0816 value
5 0.0184 0.10 1.0 1.00 0.0
1.0 1.0

For a sample size of 100 and a level of significance of a = 0.05, the


Kolmogorov-Smirnov statistic d0.05(100) = 1.35/10 = 0.135 (from Appendix A,
Table A-4). Because d0.05(100) > 0.1188 the implication is that the null
hypothesis that X is binomially distribution with p = 0.45 cannot be rejected.
Models for Stochastic Processes 17

10. The following table provides data associated with a repair operation for 550
customers.

Hours per repair Number of times recorded


1 110
2 165
3 165
4 85
5 25
Total 550

a. Compute the average repair time in hours.


b. Compute the average number of repairs per day (24 hours).
c. Construct a frequency diagram of service times. Try to fit the resultant curve to
some well known distribution. Use statistical methods to determined the
goodness of fit.

a. Because of the data, we treat repair time as a discrete rather than as a


continuous random variable. It appears that repairs are made in one hour
increments only. Therefore, let X = random variable representing hours per
repair, and let fx = number of times x repairs were recorded in an hour. Then the
average repair time is
1 5
ms = Â xfx
550 x =1
1
=
550
[(1 ¥ 110) + (2 ¥ 165) + (3 ¥ 165) + (4 ¥ 85) + (5 ¥ 25)]
= 2.545 hr

b. The average number of repairs per day is


m = 1/ ms = (1/2.545 hr) (24 hr/day) = 9.43 / day
Models for Stochastic Processes 18

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

Kolmogorov-Smirnov Test Applied to Repair Time with p = 0.4


Absolute
Theoretical Relative Theoretical Observed difference,
Class probability frequency CDF, F(x) CDF, SN(x) |SN(x) – F(x)|
1 0.1296 0.20 0.1296 0.20 0.0704  largest
2 0.3456 0.30 0.4752 0.50 0.0248 value
3 0.3456 0.30 0.8208 0.80 0.0208
4 0.1536 0.1545 0.9744 0.9545 0.0199
5 0.0256 0.0455 1.0 1.0 0.0
1.0 1.0

For a sample size of 550 and a level of significance of a = 0.05, the


Kolmogorov-Smirnov statistic d0.05(550) = 1.35 / 550 = 0.0576 (from Appendix
A, Table A-4). Because d0.05(550) < 0.0704 the implication is that the null
hypothesis that X is a translated binomially distribution with p = 0.4 must be
rejected. After some trial and error we find that at p = 0.37 yields a satisfactory
result.

Kolmogorov-Smirnov Test Applied to Repair Time with p = 0.37


Absolute
Theoretical Relative Theoretical Observed difference,
Class probability frequency CDF, F(x) CDF, SN(x) |SN(x) – F(x)|
1 0.1575 0.20 0.1575 0.20 0.0425
2 0.3701 0.30 0.5276 0.50 0.0276
3 0.3260 0.30 0.8536 0.80 0.0536  largest
4 0.1276 0.1545 0.9813 0.9545 0.0267 value
5 0.0187 0.0455 1.0 1.0 0.0
1.0 1.0

For the same Kolmogorov-Smirnov statistic d0.05(550) = 1.35 / 550 = 0.0576,


we have d0.05(550) > 0.0536. Thus the null hypothesis that X is a translated
binomially distribution with p = 0.37 is accepted.
Models for Stochastic Processes 20

As alternative, it might be interesting to try to fit the data in the problem to a


continuous distribution. The lognormal and beta are two possibilities. To do this,
however, it would be necessary to make an assumption about the range of repair
times; e.g., we could say that a value of 1 hour corresponded to the interval (0,
1], 2 hours to the interval (2, 3], and so on.
Models for Stochastic Processes 21

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)

Assuming failure events are independent we derive P.

È0.36 0.48 0.16˘ 0 failed


P = Í 0.6 0.4 0 ˙ 1 failed
Í ˙
ÍÎ 0 1 0 ˙˚ 2 failed
Models for Stochastic Processes 22

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)

P(drugs help) = 0.5 + 0.5 ¥ 0.5 = 0.75.


Models for Stochastic Processes 23

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

Chapter 12. Discrete-Time Markov Chains


Note:
Exercise 26. The meaning of this exercise is not clear.

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.

To find the steady-state probability vector we solve the equation p = pP to get


p = (0, 0.152, 0.261, 0.380, 0.178, 0.029).
Lost sales occur when the demand during the week is for 2 cars and only 1 is in
inventory. Let Pr{demand for 2 cars} = P(2) = 0.4. Then the expected number of
lost sales per week is p1 ¥ P(2) ¥ 1 = 0.152 ¥ 0.4 = 0.0608.

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.

(0, 3) (1, 0) (1, 3) (2, 0) (2, 3) (3,0) (4,0) (5,0)


(0, 3) 0 0 0 0 0 1 0 0
(1, 0) 0.9 0 0.1 0 0 0 0 0
(1, 3) 0 0 0 0 0 0.9 0.1 0
(2, 0) 0.4 0 0.5 0 0.1 0 0 0
(2, 3) 0 0 0 0 0 0.4 0.5 0.1
(3,0) 0 0.4 0 0.5 0 0.1 0 0
(4,0) 0 0 0 0.4 0 0.5 0.1 0
(5,0) 0 0 0 0 0 0.4 0.5 0.1

The steady-state probability is


p = (0.195, 0.137, 0.104, 0.180, 0.018, 0.342, 0.023 0.002).
The expected loss per week depends on the demand and the number of cars in
stock in the upcoming week. The computations are as follows

E[No. lost sales] = p(0,3) ¥ (P(2) ¥ 2 + P(1) ¥ 1 ) + (p(1,0) + p(1,3) ) ¥ P(2) ¥ 1


= 0.195 ¥ (0.4 ¥ 2 + 0.5 ¥ 1) + (0.137 + 0.104) ¥ 0.4 ¥ 1
= 0.35 cars/week
Discrete-Time Markov Chains 3

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.

With a Poisson distribution the demand has the probability distribution:


e-q(q)k
Px(k) = k! for k ≥ 0, where q = 1.5 .
Probabilities for demand are in the table below. The distribution allows an
unbounded demand.

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.

(0, 0) (0, 3) (1, 0) (1, 3) (2, 0) (2, 3) (3,0) (4,0) (5,0)


(0, 0) 0 1 0 0 0 0 0 0 0
(0, 3) 0 0 0 0 0 0 1 0 0
(1, 0) 0 0.777 0 0.223 0 0 0 0 0
(1, 3) 0 0 0 0 0 0 0.777 0.223 0
(2, 0) 0 0.442 0 0.335 0 0.223 0 0 0
(2, 3) 0 0 0 0 0 0 0.442 0.335 0.223
(3,0) 0.191 0 0.251 0 0.335 0 0.223 0 0
(4,0) 0.066 0 0.126 0 0.251 0 0.335 0.223 0
(5,0) 0.019 0 0.047 0 0.126 0 0.251 0.335 0.223

State E(lost sales)


(0, 0) 1.5
(0, 3) 1.5
(1, 0) 0.72313
(1, 3) 0.72313
(2, 0) 0.280956
(2, 3) 0.280956
(3,0) 0.089802
(4,0) 0.02416
(5,0) 0.005584

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.

Number of tanks completed 0 1 2 3


Probability 0.2 0.4 0.3 0.1

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

0 tanks 1 tank 2 tanks 3 tanks 4 tanks S t a t u s


0 tanks 0 1 0 0 0 Transient
1 tank 0 0.8 0.2 0 0 Class-1
2 tanks 0 0.4 0.4 0.2 0 Class-1
3 tanks 0 0.1 0.3 0.4 0 . 2 Class-1
4 tanks 0 0.1 0.3 0.4 0 . 2 Class-1

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

Z 0 tanks 1 tank 2 tanks 3 tanks 4 tanks


0 tanks 0.8 0.2 0 0 0
1 tank 0.4 0.4 0.2 0 0
2 tanks 0.1 0.3 0.4 0.2 0
3 tanks 0 0.1 0.3 0.4 0.2
4 tanks 0 0.1 0.3 0.4 0.2
Discrete-Time Markov Chains 8

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.

b. Compute the steady-state probabilities. Use these probabilities to estimate the


number of days in the year (assume 200 working days) on which a delay in
the schedule is necessary.

c. From the steady-state probabilities, estimate the utilization of the depot in


terms of percentage of the capacity that is used. Assume that the maintenance
capacity is three tanks.

These answers use the model of 3a.


a. The transient probabilities for 5 days assumming the system starts with 3
tanks is:
Initial 0 0 1 0
1 0.1 0.3 0.4 0.2
2 0.26 0.32 0.3 0.12
3 0.378 0.306 0.232 0.084
4 0.4564 0.2928 0.1876 0.0632
5 0.50732 0.28364 0.15888 0.05016
b. A delay occurs whenever the system begins the day in state 3 (4 tanks).
Average
0 1 2 3 Delay
1 tank 2 tanks 3 tanks 4 tanks per period
Steady State Dist. 0.6 0.266667 0.106667 0.026667 0.02666667
The expected number of delays in a year is 200*0.2667 = 5.333.
c. The utilization is the expected number of tanks being worked on per day
divided by the capacity. We call the utilization the efficiency.
p + 2p 2 + 3(p 3 + p 4 )
E= 1 = 0.51111
3
Here pi is the steady-state probability of i tanks in the facility at the beginning of
the day.
Discrete-Time Markov Chains 9

Exercises 5 – 10 refer to the brand switching example in Section 12.1.

5. With respect to the data in Table 5:


a. Interpret the meanings of p11 = 0.90, p22 = 0.82, and p33 = 0.68.

b. To which brand is Brand 2 most likely to lose customers?


c. Which brand has the most “loyal” customers?
d. Which brand has the least “loyal” customers?

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.

Brand (j) 1 2 3 4 Total


(i)
1 90 5 3 2 100
2 5 200 40 5 250
3 25 15 80 10 130
4 5 10 5 0 20
Total 125 230 128 17 500

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?)

The new transition matrix is

È 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.

There are 10 possible states for this situation.

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).

The state-transition matrix is

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

For the calculations, we start with q(0) = (0.25, 0.46, 0.29).


(3) (3)
q(3) = q(0)P = ( 0.25, 0.46, 0.29 )P = ( 0.356, 0.388, 0.256 )
(4) (4)
q(4) = q(0)P = ( 0.25, 0.46, 0.29 )P = ( 0.435, 0.342, 0.223 )
(5) (5)
q(5) = q(0)P = ( 0.25, 0.46, 0.29 )P = ( 0.467, 0.324, 0.209 )
(•) (•)
q(•) = q(0)P = ( 0.25, 0.46, 0.29 )P = (0.474, 0.321, 0.205 )
Discrete-Time Markov Chains 13

9. (Marketing strategies) To illustrate how price adjustments can affect consumer


switching behavior in a Markov model, suppose that the following relationship is
empirically valid.

p^ ij = pij + a(sit – –sit)


where
pij = current (stationary) transition probability

p^ ij = new (stationary) unadjusted transition probability

sit = selling price of Brand i in week t



sit = mean selling price of all brands other than Brand i in week t

a = parameter (a = 0.01 when i ≠ j and a = –0.05 when i = j)

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.

È 0.9333 0.053 0.014 ˘


The new transition matrix is: P = Í 0.037 0.780 0.183 ˙
Î 0.200 0.120 0.680 ˚
The changes conform to predictions in part (a).
Discrete-Time Markov Chains 15

10. (Homogeneity assumption) Table 4 and the resulting matrix of transition


probabilities represent the aggregate switching behavior in a sample of the
defined population. They do not represent individual consumer behavior in the
sense of predicting what a particular person would do. The purchasing pattern for
a particular consumer represents a stochastic process which could be modeled by
a Markov chain. To gain a better understanding, construct P for the following
nine-week purchasing pattern of a specific consumer: {2, 2, 2, 1, 1, 3, 1, 1, 1}.
For practical reasons firms are interested in aggregate rather than individual
behavior. The act of aggregating consumers, however, implicitly assumes that
they are homogeneous with respect to their transition matrices. Put another way,
the construction of empirical probabilities as point estimates for true probabilities
requires the experiments (that is, consumers in the sample) be performed under
“identical” conditions (that is, homogeneous consumers). Can you think of any
sampling procedures that would better guarantee homogeneity?

The empirical state-transition matrix is

È 3/4 0/4 1/4 ˘ È 0.75 0 0.25 ˘


P= Í 1/3 2/3 0/3 ˙ = Í 0.33 0.67 0 ˙.
Î 1/1 0/1 0/1 ˚ Î 1 0 0 ˚

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 ¯

a. q(1) = q(0)P = (0.59, 0.41) 41% audited next year.

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.

Output from the Stochastic Analysis add-in


No audit Audit
Initial 0.9 0.1
1 0.59 0.41
2 0.559 0.441
3 0.5559 0.4441
Discrete-Time Markov Chains 17

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

a. Model the situation as given. Use six states.


b. Change the scenario so that the time between arrivals is exactly two hours.
Counting begins when the worker becomes idle. Completion probabilities are
still based on a one-hour period.
c. Change the scenario so that there is a space for one waiting job. Now define
pA1 as the probability that an arrival occurs while the worker is busy. An
arrival will wait if the space is empty, otherwise it will balk.

a. Using six states, we have

Idle Stage1 Stage2 Stage3 Stage4 Stage5


Idle 1 – pA pA
Stage1 1 – pC1 pC1
Stage2 1 – pC2 pC2
Stage3 1 – pC3 pC3
Stage4 1 – pC4 pC4
Stage5 pC5 1 – pC5

All three states are recurrent.


The efficiency of the worker is the percentage time working. Using the steady-
state solution the efficiency is 1 – p0, where state 0 is the idle state.
Discrete-Time Markov Chains 18

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.

b. Time between arrivals is exactly two hours.

Idle 1 Idle 2 Stage 1 Stage 2 Stage 3 Stage 4 Stage 5


Idle 1 1
Idle 2 1
Stage 1 1 – pC1 pC1
Stage 2 1 – pC2 pC2
Stage 3 1 – pC3 pC3
Stage 4 1 – pC4 pC4
Stage 5 pC5 1 – pC5

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.

c. Space for one waiting customer.

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

Idle (1,0) (1,1) (2,0) (2,1) … (5,0) (5,1)


Idle 1-pA pA

(1,0) (1-pA)* pA* (1- pA)* pA* pC1 …


(1-pC1) (1-pC1) pC1
(1,1) 1-pC1 pC1 …
(2,0) (1- pA)* pA* …
(1-pC2) (1-pC2)
(2,1) 1-pC2 …
… …
(5,0) (1-pA)* pA* pC5 … (1-pA)* pA*
pC5 (1-pC5) (1-pC5)
(5,1) pC5 … 1 – pC5
Discrete-Time Markov Chains 20

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.

Mr. Konigsberg has four daughters of marriageable age. The probability of


finding a spouse in any given year is p = 0.6.

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.

Let B(n, k) be the probability that n daughters receive k proposals in a given


year. These probabilities are governed by the binomial distribution wish gives
rise to the following state-transition matrix P.

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

With p = 0.6, the transition matrix is:

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

The steady-state probability p = (1, 0, 0, 0, 0).

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)

With p = 0.6, the transition matrix is:

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

The steady-state probability p = (1, 0, 0, 0, 0).

c. How do the results change if we add the possibility of divorce? A married


daughter divorces during a year with probability pD. For numerical
computations assume that pD = 0.1 and if a daughter divorces in a given year
she does not get married in that year.
Discrete-Time Markov Chains 22

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.

The states represent the number of unmarried daughters. Symbolically, the


new transition matrix P is given below. It is assumed that a daughter can
either marry or divorce at most once per year.

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)

The numerical values for the matrix are:

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

The steady-state probability vector is


p = (0.539775, 0.35985, 0.089963, 0.009996, 0.000416).

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

marriages | state 2 to 2} + 1000 ¥ Pr{1 marriage | state 2 to 2}+ 2000 ¥ Pr{2


marriages | state 2 to 2}).

In particular, the matrix entries CRij are shown below.

Transition Cost Matrix


State Combined 0 1 2 3 4
Cost Cost S0 S1 S2 S3 S4
S0 0 0 0 0 0 0 0
S1 0 600 1000 333.33 142.86 52.632 0
S2 0 1113.6 2000 952.38 426.23 142.86 0
S3 0 1800 3000 2052.6 1142.9 333.33 0
S4 0 2400 4000 3000 2000 1000 0
The Combined cost is computed using Eq. (7).
4
With c i = 0 for all i, we have c i = Â c ijR pij .
S

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

For purposes of analysis, discretize time into one-minute intervals. At the


beginning of an interval, stage 1 is either empty, working or blocked while stage 2
is either working or empty. The system operates with the following rules.

• If stage 1 is empty at the beginning of an interval, a new part is introduced


into stage 1 with probability 0.9. Work begins on the part; however, it
cannot be completed during the minute it is introduced. If stage 1 is
working or blocked, no part enters.

• If stage 2 is working at the beginning of an interval, the part will be


completed and leave the system with probability 0.8. Alternatively, it will
remain in stage 2 with probability 0.2.

• If stage 1 is working at the beginning of an interval, the part will be


completed with probability 0.6. A completed part will move to stage 2 if
stage 2 is empty. Otherwise it is blocked and remains in stage 1 until stage
2 becomes empty.

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.

To analyze this system with a DTMC we identify five states.

E, E: Both stages are empty.


E, W: stage 1 is empty, stage 2 is working
W, E: stage 1 is working, stage 2 is empty
W, W: stage 1 is working, stage 2 is working
B, W: stage is blocked, stage 2 is working

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 will measure throughput by placing a 1 in every cell of the economics matrix


that results in a production of 1 unit. The Economics matrix appears below. TP
stands for TP.
Transition TP Matrix
State Combined 0 1 2 3 4
TP TP E,E E,W W,E W,W B,W
E,E 0 0 0 0 0 0 0
E,W 0 0.8 1 0 1 0 0
W,E 0 0 0 0 0 0 0
W,W 0 0.8 0 1 1 0 0
B,W 0 0.8 0 1 0 0 0
The steady-state analysis shows the proportion of the on-minute periods that the
system is in the several states as well the expected throughput per minute.
Average
0 1 2 3 4 TP
E,E E,W W,E W,W B,W per period
Steady State Dist. 0.0323 0.3634 0.5225 0.0711 0.0107 0.35616

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

a. Find the steady-state probabilities for p = (2/9, 1/3, 1/3, 1/9)


the corresponding Markov chain.
Note that all the states are all recurrent.
b. If you receive $3 every time you The expected profit is
reach state 2 and pay $1 when you
32 – 1(1 – 2) = $0.3333
reach any of the other states, what is
your expected profit per play (in
steady state).
c. If you start in state 0, what is your The long run expected return is 0.3333 per period.
long-run expected return? How does One can compute the expected NPW for an interest
this result change if there is a rate of 0.01 per play. This is shown in the first line
discount rate of 1% per play due to below. We convert that to a value per play in the
fatigue? second line by multiplying by the interest rate (0.01).

Expected NPW 32.47432 33.80906 35.15715 31.15279

Disounted per play 0.324743 0.338091 0.351572 0.311528

d. A modification of the transition States 0, 1 and 2 are transient. State 3 is absorbing.


matrix above is The transient probabilities (states 0, 1, 2) will all go to
È0 1 0 0˘ zero. The probability of state 3 goes to 1.
Í ˙
0 0 1 0˙
P =Í
Í1 / 3 1 / 3 0 1 / 3˙
Í ˙
Î0 0 0 1˚
Classify each state of this chain as either
recurrent, transient or absorbing. If the
system starts in state 0, what can you say
about the transient probabilities after a
large number of iterations?
Discrete-Time Markov Chains 27

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.

a. Solve the problem as given.

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.

a. Transition probabilities come from the Binomial distribution with n = 3 – s, and


p = 0.1. For example p00 = B(3, 3, 0.1).

Fail 0 Fail 1 Fail 2 Fail 3


Fail 0 0.729 0.243 0.027 0.001
Fail 1 0.81 0.18 0.01 0
Fail 2 0 0.9 0.1 0
Fail 3 0 0 1 0

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.

Fail 0 Fail 1 Fail 2 Fail 3


Fail 0 0.729 0.243 0.027 0.001
Fail 1 0.405 0.495 0.095 0.005
Fail 2 0.225 0.475 0.275 0.025
Fail 3 0.125 0.375 0.375 0.125

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

pij = P(j – i)*Q(0) + P(j – i + 1)*Q(1) + P(j – i +2)*Q(2)


where P(k) = 0 for negative arguments.

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

idle 0 wait 1 waits 2 wait 3 wait 4 wait


idle 0.367879 0.367879 0.18394 0.061313 0.015328 0.00366
0 wait 0.331091 0.367879 0.202334 0.073576 0.023221 0.001899
1 waits 0.036788 0.331091 0.349485 0.19197 0.082635 0.00803
2 wait 0 0.036788 0.331091 0.357516 0.248181 0.026424
3 wait 0 0 0.036788 0.357516 0.542484 0.063212
4 wait 0 0 0 0.1 0.8 0.1

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

Arrival distribution with none waiting


Random Variable Arr0
Distribution Poisson
mean (theta) 1

Arrival distribution with 1 waiting


Random Variable Arr1
Distribution Poisson
mean (theta) 0.666667

Arrival distribution with 2 waiting


Random Variable Arr2
Distribution Poisson
mean (theta) 0.333333

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.

To gain a better understanding of the numbers, the Dean's office has


commissioned a study to assess the variability in Fall enrollment each year. An
analysis of past data indicates that the fluctuations are primarily a function of the
economic climate that can be described by two states: good and bad.

In an effort to develop a model of the underlying process, assume that the


enrollment in any one-year will either increase by 500 students, stay the same, or
decrease by 500 students. As such, divide the range 4500 – 6000 into intervals of
500 students each. In a year in which the economic climate is good, enrollment
will go up with probability 0.5, stay the same with probability 0.2, or go down by
500 with probability 0.3. In a year with a bad economic climate, enrollment will
go up with probability 0.2, stay the same with probability 0.4, or go down with
probability 0.4. These probabilities are based on the economic condition at the
beginning of the year. The only exception occurs when the enrollment reaches
6000 students. At that point, the control measures will kick in to reduce
enrollment to 5500 students at the beginning of the next year. When the
enrollment is 4500 at the beginning of one year, it may not decrease further. In
this case the probability of decrease is combined with the probability that the
enrollment doesn't change.

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

B_4500 B_5000 B_5500 B_6000 G_4500 G_5000 G_5500 G_6000


B_4500 0.48 0.12 0 0 0.32 0.08 0 0
B_5000 0.24 0.24 0.12 0 0.16 0.16 0.08 0
B_5500 0 0.24 0.24 0.12 0 0.16 0.16 0.08
B_6000 0 0 0.6 0 0 0 0.4 0
G_4500 0.15 0.15 0 0 0.35 0.35 0 0
G_5000 0.09 0.06 0.15 0 0.21 0.14 0.35 0
G_5500 0 0.09 0.06 0.15 0 0.21 0.14 0.35
G_6000 0 0 0.3 0 0 0 0.7 0

The steady-state distribution is:


Average
0 1 2 3 4 5 6 7 enrollment
B_4500 B_5000 B_5500 B_6000 G_4500 G_5000 G_5500 G_6000 per period
Steady State Dist. 0.1291 0.1256 0.1306 0.0433 0.1477 0.1647 0.1841 0.0749 5137.17909

The expected enrollment is 5137 students.


Discrete-Time Markov Chains 34

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.

a. Construct the transition matrix È0.99 0.01 0 0 ˘0


that describes a 1-minute Í0.02 0.97 0.01 0 ˙1
interval. The states are the P=Í ˙
Í 0 0.02 0.97 0.01˙ 2
number of people in the salon Í 0
(not counting Archy). Î 0 0.02 0.99˙˚ 3

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?

Use steady-state probabilities for parts (d) through (g).

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

0.1 0.1 0.1

0.6 0.6 0.6

0.3 0.3 0.3


0,N 1,N 2,N 3 4 5
0.4 0.1
0.6 0.3 0.6
1

0.4 0.1 0.3

0,Y 1 1,Y 0.6 2,Y 0.6

Names 0_N 1_N 2_N 3 4 5 0_Y 1_Y 2_Y


0_N 0_N 0 0 0 0 0 0 1 0 0
1_N 1_N 0 0 0 0 0 0 0.4 0.6 0
2_N 2_N 0 0 0 0 0 0 0.1 0.3 0.6
3 3 0 0.1 0.3 0.6 0 0 0 0 0
4 4 0 0 0.1 0.3 0.6 0 0 0 0
5 5 0 0 0 0.1 0.3 0.6 0 0 0
0_Y 0_Y 0 0 0 1 0 0 0 0 0
1_Y 1_Y 0 0 0 0.4 0.6 0 0 0 0
2_Y 2_Y 0 0 0 0.1 0.3 0.6 0 0 0

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.

Use steady-state probabilities for parts (d) through (g).


Discrete-Time Markov Chains 37

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

The annual holding cost is 260*29.01 = $7774 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?
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

Names 0_N 1_N 2 3 4 5 0_Y 1_Y 2_Y


0_N 0_N 0 0 0 0 0 0 1 0 0
1_N 1_N 0 0 0 0 0 0 0.4 0.6 0
2 2 0.1 0.3 0.6 0 0 0 0 0 0
3 3 0 0.1 0.3 0.6 0 0 0 0 0
4 4 0 0 0.1 0.3 0.6 0 0 0 0
5 5 0 0 0 0.1 0.3 0.6 0 0 0
0_Y 0_Y 0 0 0 1 0 0 0 0 0
1_Y 1_Y 0 0 0 0.4 0.6 0 0 0 0
2_Y 2_Y 0 0 0 0.1 0.3 0.6 0 0 0
Steady State Analysis yields
0_N 1_N 2 3 4 5 0_Y 1_Y 2_Y per period
Steady State 0.028 0.116 0.276 0.333 0.104 0 0.074 0.07 0 42.57227
150 80 20 30 40 50 100 30 20 11068.79

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

The cost again increases.


Another possibility is to order at 1 but only order 2. The new steady state is
Steady State Expected
Analysis 0 1 2 3 4 5 6 7 8 Value
0_N 1_N 2 3 4 5 0_Y 1_Y 2_Y per period
Steady State 0.046 0.153 0.464 0.138 0 0 0.108 0.092 0 46.10092
150 80 20 30 40 50 100 30 20 11986.24

Another increase in cost.


I haven't found a better policy than the original.
Discrete-Time Markov Chains 39

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.

Index Current state Events Probability Next state


0 s0 = (0) Neither computer 0.6 s = (0)
no typing service fails.
One computer fails. 0.3 s = (1)
Both computers fail. 0.1 s = (2)
1 s1 = (1) No computer fails. 0.6 s = (0)
spare in operation, no
typing service
One computer fails. 0.3 s = (1)
Two computers fail. 0.1 s = (2)
2 s2 = (2) No computers fail 0.8 s = (0)
one computer in
operation, typing
service for $75
One computer fails 0.2 s = (1)

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

Computer problem with Transition Cost


spares 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 0 80 80 80
S1 0.6 0.3 0.1
S2 75 160 160 0 0.618 0.291 0.091 44.64
S2 0.8 0.2 0

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.

È0.36 0.48 0.16˘ 0 failed


P = Í 0.6 0.4 0 ˙ 1 failed
Í ˙
ÍÎ 0 1 0 ˙˚ 2 failed

a. Transient analysis yields


Failed 0 Failed 1 Failed 2
Initial 1 0 0
1 0.36 0.48 0.16
2 0.4176 0.5248 0.0576
3 0.465216 0.467968 0.066816
4 0.448259 0.477307 0.074435
5 0.447757 0.480521 0.071721
6 0.449505 0.478853 0.071641
7 0.449134 0.478945 0.071921
8 0.449055 0.479083 0.071861
Since each period represents 5-minutes we have:
Probabilities after 5 minutes: q(1) = (0.36, 0.48, 0.16)
Probabilities after 10 minutes: q(2) = (0.418, 0.525, 0.058)
Probabilities after 40 minutes: q(8) = (0.449, 0.479, 0.072)
Discrete-Time Markov Chains 43

We state probabilities to 3-decimal accuracy. Probabilities may not sum to 1


because of rounding.

b. From steady-state analysis we find:


0 1 2
Failed 0 Failed 1 Failed 2
Steady State Dist. 0.449102 0.479042 0.071856
We assume the purpose of the operator is to service failed machines. Thus the
operator is idle if the system is in state 0 with 0 failed machines.
P(idle) = p0 = 0. 450
The operator is busy whenever 1 or 2 machines are failed.
P(busy) = p1 + p2 = 0.550
Expected number of machines requiring service is the expected value of the
state index.
E(in service) = 0.623.

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?

c. What fraction of the population is infected at any time if no drugs are


available?
d. The cost of the drug program per week for each individual in the population is
$5. If the cost due to lost work as a result of the disease is assessed at $50 per
week per person, will the program pay for itself?

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
Î
c. With no drugs available we use the transition matrix for part a and find the
steady-state results.
0 1 2 3
H D1 D2 D3
Steady State Dist. 0.769 0.077 0.077 0.077
The fraction of the population that is infected is 1 – P(H) = 0.231.
Discrete-Time Markov Chains 45

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.

One-month transition matrix


0-30 30-60 60-90
days days days Paid Uncollectable
0-30 days overdue 0 0.7 0 0.3 0
30-60 days overdue 0 0 0.8 0.2 0
60-90 days overdue 0 0 0 0.5 0.5
Paid 0 0 0 1 0
Uncollectable 0 0 0 0 1

The transition matrix for this situation is:


D 0-30 D 30-60 D 60-90 Paid Uncoll.
D 0-30 0 0.7 0 0.3 0
D 30-60 0 0 0.8 0.2 0
D 60-90 0 0 0 0.5 0.5
Paid 0 0 0 1 0
Uncoll. 0 0 0 0 1

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?

One-day transition probabilities — heart patients


Hospital Discharged
CCU rehabilitation or deceased
Coronary care unit (CCU) 0.700 0.200 0.100
Hospital rehabilitation 0.050 0.800 0.150
Discharged or deceased 0.015 0.005 0.980

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?

a. We assume the transition matrix below.


CCU Hospital Gone
CCU 0.7 0.2 0.1
Hospital 0.05 0.8 0.15
Gone 0.015 0.005 0.98

The steady-state probabilities for this matrix are below.


0 1 2
CCU Hospital Gone
Steady State Dist. 0.0563 0.0779 0.8658

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.

b and c. It’s not clear what part b means.


Discrete-Time Markov Chains 48

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

a. If the photocopier is currently up (running), what is the probability that it will


be up after 3 hours of operations?
b. What are the steady-state probabilities for the copier being up or down?
c. The office manager is contemplating the replacement of the current copier
with a newer, more reliable model whose one-step transition matrix is as
follows.

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.

a. The transient analysis for three periods is shown below.


up down
Initial 1 0
1 0.9 0.1
2 0.87 0.13
3 0.861 0.139
After three hours, there is a 0.139 probability that the system is down.

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?

a. Let state 1 be “instrument working properly” and state 2 be “instrument


failed”

È 0.90 0.10 ˘
P= Í ˙
Î 0.99 0.01 ˚

b. p12( 3) = 0.09181, p12( 6 ) = 0.091743

c. The steady-state probabilities are (p1, p2) = (0.908257, 0.091743).


The fraction of time instrument is being repaired = p2.

d. The long-run average cost per 10-min transaction = $(10.80 + 0.30)p2


= $0.193.
Discrete-Time Markov Chains 51

29. Past records indicate that the survival function for light bulbs in traffic signal has
the following pattern:

Age of bulbs in months, n 0 1 2 3 4 5


Number surviving to age n 1000 950 874 769 615 0

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.

b. Using Eqs. (4) and (5), we get


p = (0.2376, 0.2257, 0.2077, 0.1828, 0.1462).
From the original failure data we find the probability of failure at each age. This
assumes that failures occur at the end of the month.
Age 0 1 2 3 4 5
Surviving 1000 950 874 769 615 0
P(replace) 0 0.05 0.076 0.105 0.154 0.615

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

The expected cost per month = $2/bulb ¥ 9.504bulbs/mo = $19.01/mo.


Discrete-Time Markov Chains 53

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?

a. We need to determine the total expected cost over t months if a group


replacement occurs every t months. The cost is made up of the fixed
cost of group replacement, the cost of replacing the bulbs that fail prior
to the next group replacement, and the cost of the failing devices.
The cost of group placement is cUN + cF where cU is the unit cost,
N is the number of bulbs to be replaced, and cF is the fixed cost. Here,
cU = $0.2, N = 40 and cF = $5. To find the expected number of
individual replacements at failure between group replacements, we
perform a transient analysis. For state 0, we interpret q0(t), the first
component of the q(t) vector, to be the average fraction of bulbs that
failed in month t. To find the average fraction of bulbs that fail over the
t months between group replacements, we need to sum the state
probabilities for state 0 over the t months. The easiest way to do this is
to use Eq. (3) to compute q(t) = q(0)Pt, where P is given in the
previous exercise. The results for t = 1,…,4 are given in the table
below. The expected number of bulbs that fail for the 3 weeks
3
between group replacements is N Â k =1 q0 ( k ) = 40(0.2411) = 9.64.

t q 0 ( t) q 1 ( t) q 2 ( t) q 3 ( t) q 4 ( t) Â q (k )
k =1
0

1 0.05 0.95 0 0 0 0.05


2 0.0785 0.0475 0.8740 0 0 0.1285
3 0.1126 0.0746 0.0437 0.7691 0 0.2411 
4 0.1707 0.1070 0.0686 0.0385 0.6153 0.4118

Expected cost for 3 months = $2 ¥ (expected number replaced


Discrete-Time Markov Chains 54

at failure) + cost of group replacement

= $2 (40) (0.2411) + ($0.20)(40) + $5


= $32.288

Average cost per month = $32.288/3 = $10.76

b. To find the least-cost group replacement policy we perform that same


analysis as in part a for replacement at the end of months 1, 2 and 4.
The results are given in the following table, as well as the value for
individual replacement at failure only (from previous exercise).

t 1 2 3 4 Individual replacement
cost $ 17 11.64 10.76 11.49 19.01

The optimal policy is group replacement every 3 months.


Operations Research Models and Methods
by Paul A. Jensen and Jonathan F. Bard
John Wiley and Sons, Inc.
Copyright 2003 – All rights reserved

Chapter 13 Mathematics of Discrete-Time Markov


Chains
Errata and notes
Ex. 10.e. Make the expected cost vector be: C = (1250, 1400, 900, 0)T.
Ex. 12.a. Add to the problem statement of part a: The stock price is currently $39.
Ex. 13. Labels on parts d and c are switched.

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

Processes e and f are irreducible. Process e is ergodic.


Mathematics of Discrete-Time Markov Chains 2

Problem 13.1 analyses


a S1 S2 S3 S4 S5
S1 0 0 0 0.5 0.5 Class-1 cyclic
S2 0 0.5 0.5 0 0 Class-2 acyclic
S3 0 0.5 0.5 0 0 Class-2 acyclic
S4 1 0 0 0 0 Class-1 cyclic
S5 1 0 0 0 0 Class-1 cyclic

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

Both states are recurrent.


Mathematics of Discrete-Time Markov Chains 5

b.

Idle Working 1 Working 2

Idle 1 – pA pA 0
Working 1 pD1 0 1 – pD1
Working 2 pD2 0 1 – pD2

All three states are recurrent.

c.
Idle 1 Idle 2 Working

Idle 1 0 1 0
Idle 2 0 0 1
Working pD 0 1 – pD

All three states are recurrent.

d.

Idle Working, 0 waiting Working, 1 waiting

Idle 1 – pA pA 0
Working, 0 waiting pD(1 – pA1) (1 – pD)(1 – pA1) (1 – pD)pA1
Working, 1 waiting pD 1 – pD

All three states are recurrent.


Mathematics of Discrete-Time Markov Chains 6

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.

Period Qt(0) Qt(1) Qt(2)


1 0 0.3 0.7
2 1 0 0
3 0 0.3 0.7
4 1 0 0
5 0 0.3 0.7
6 1 0 0
7 0 0.3 0.7

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

4 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

c. To find the steady-state probabilities, set up the equations


(1) p1 + p2 = p0
(2) 0.3p0 = p1
(3) 0.7p0 = p2
(4) p0 + p1 + p2 = 1
Dropping Eq. (1) and using Eq. (2) and (3) to substitute for p1 and p2 in Eq. (4) we
find that
p0+ 0.3p0+ 0.7p0= 1 or p0= 0.5 .
Substituting this result into (2) and (3) yields
p1 = 0.15 and p2= 0.35.

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.)

To find the steady-state probabilities, set up the equations


(1) p0 + 0.1p1 = p0
(2) 0.7p1 = p1
(3) 0.2p1 + p2 = p2
(4) p0 + p1 + p2 = 1
From the first three equations we see that p1 = 0 and from equation (4)
(4) p0 + p2 = 1
The equations ascertain that p1 is zero, but do not provide sufficient information
to determine p0 and p2. This example illustrates a Markov chain with more than
one absorbing state. In this case there is no steady state because the long-run
state of the system depends on the initial state. When the system begins in state
0 it will remain in state 0 for all t.
We can compute the absorbing probabilities with the methods of described in
this chapter There the transient states were listed first and the transition matrix
partitioned according to the following scheme.
È Q R ˘
P=Î 0 I ˚

The matrix A of absorbing probabilities is computed as A = [I – Q]-1R.


To use this method for this example, we must renumber the states so that the
transient state is state 0. The reordered matrix is
È 0.7 0.1 0.2 ˘
Í 0 ˙˙ with Q = [0.7] and R = [0.1, 0.2]
P=Í 0 1
Î 0 0 1 ˚

The matrix A of absorbing probabilities is computed as A = [I – Q]-1R.


A = (1/0.3)[0.1, 0.2] = (1/3, 2/3).
Mathematics of Discrete-Time Markov Chains 9
Mathematics of Discrete-Time Markov Chains 10

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

The Transition matrix is below.


0 1 2 3 4
0 1 0 0 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

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

b. When she is allowed to borrow the state-transition diagram and transition


matrix are shown.
1
0.4 0.4
0.6 0.4
0 1 2 3 4
0.6 0.6

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

The steady-state probabilities have p4 = 1. Barbara will surely go home a winner,


but her daughter may not be too happy.

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

There is no steady state. Absorbing state probabilities are below.


Class-1 Class-2
S $0 S $4
1,0 0.4203 0.5797
1,2 0.607101 0.392899
1,4 0.876923 0.123077
2,0 0.331816 0.668184
2,2 0.47929 0.52071
2,4 0.692308 0.307692
3,0 0.19909 0.80091
3,2 0.287574 0.712426
3,4 0.415385 0.584615
Mathematics of Discrete-Time Markov Chains 12

7. For the computer repair example in Section 12.1 compute f00( 5) and f00( 6 ) .

Probabiliti es from state 0 to state 0

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

e. Output from the Stochastic Analysis add-in:


Average
0 1 2 Cost
S1 S2 S3 per period
Steady State Dist. 0.206897 0.068966 0.724138 99.2413793

Expected NPW 1101.312 1042.881 1093.542


Exp. NPW
q0 = 0.2 0.5 0 . 3 1069.76546
Mathematics of Discrete-Time Markov Chains 16

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.

a. Find the expected first passage time from state 3 to state 0.


m30 = 30
b. Find the expected first passage time from state 0 to state 3.
m03 = 20

c. Find the steady-state probabilities.


0 1 2 3
State 0 State 1 State 2 State 3
Steady State Dist. 0.04 0.32 0.106667 0.533333

d. Find the expected recurrence times for all states.


0 1 2 3
Expected Recurrence Time 25 3.125 9.375 1.875

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

Expected NPW 11307.53 11070.97 6741.937 3370.969

11. A submarine, operating clandestinely in the Atlantic, is resupplied at yearly


intervals. At that time failed parts are replaced. One critical part, in particular,
fails at random according to a Poisson distribution with a mean-time-between-
failure of 1/2 year. As a hedge against failure, the ship carries 2 spares on board
(3 in all). Two replacements are delivered at the time of resupply. If the delivery
results in more than 3 working parts, the excess is returned. Develop a Markov
chain model for this situation. Define the states as the number of parts operating
at the end of the year just before the delivery. Construct the transition matrix and
analyze the system. Compute all relevant statistics such as the probability that all
parts fail, various steady-state probabilities, and first passage times.

State: Number operating at the end of year


Next state: Number operating at the end of year + Deliveries - Discards - Number
of failures. Number operating at the end of year + Deliveries - Discards £ 3.

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

For the given data the transition matrix is:


0-comp 1-comp 2-comp 3-comp
0-comp 0.593994 0.270671 0.135335 0
1-comp 0.323324 0.270671 0.270671 0.135335
2-comp 0.323324 0.270671 0.270671 0.135335
3-comp 0.323324 0.270671 0.270671 0.135335

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

12. Referring to Exercise 13 in Chapter 11 on stock price fluctuations, answer the


following questions.
a. What is the probability that Ms. Hodler sells the stock within 4 days? What is
the expected net gain or loss per share when she sells within these 4 days if
the selling conditions are met or if she sells at the current price at the end of
the fourth day? The stock price is currently $39.
b. What is the mean time before Ms. Hodler sells the stock?

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

The expected gain is $0.60


There is an 88.23% probability that the stock has been sold.

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%

a. If one purchase is made every 2 months on average, predict the distribution of


the share of the market after 6 months.
b. What is the long-run average share of the market for each brand if current
purchase patterns are not altered?
c. What is the expected first passage time from brand 3 to brand 1?
d. What are the expected recurrence times for each brand?

a. The entries in the table are percentages so the state-transition matrix is


comprised of the fractional equivalents. If a purchase is made every 2 months, 3
transitions are required to reach the end of month 6. Also, assuming that percent
market share represents the current state probabilities, the market share after 6
months is

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.

– 0.4p1 + 0.15p2 + 0.25p3 + 0.28p4 = 0


0.08p1 – 0.6p2 + 0.16p3 + 0.12p4 = 0
Mathematics of Discrete-Time Markov Chains 21

0.2p1 – 0.25p2 – 0.5p3 + 0.2p4 = 0


p1 + p2 + p3 + p4 = 1

Average shares are: p1 = 0.3675, p2 = 0.1628, p3 = 0.2973, p4 = 0.1724.

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

0.1 0.3 0.6 0.0

P= 0.0 0.2 0.5 0.3


.
0.5 0.0 0.0 0.5
0.0 1.0 0.0 0.0

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.

a. Because of the Markovian property, E[f(X5) | X3 = c, X4 = d] = E[f(X5) |


X4 = d]. Also, from the P matrix, the conditional probability distribution
given the system is in state d is p4j, j ΠJ = {a, b, c, d}. Letting cj be
the profit or cost of being in state j, we have

E[f(X5) | X3 = c, X4 = d] = Âc p
j ŒJ
j 4j = $5(1) = $5.

b. E[f(X1) | X0 = b] = $20(0.0) + $5(0.2) + $15(0.5) – $10(0.3) = $5.5

c. E[f(X1)2 | X0 = b] = $202(0.0) + $152(0.2) + $152(0.5) + (–$10)2(0.3) =


147.5
d. Var[f(X1) | X0 = b]= E[f(X1)2 | X0 = b] – (E[f(X1) | X0 = b])2

= 147.5 – (5.5)2 = 117.25


Mathematics of Discrete-Time Markov Chains 23

e. Var[f(X1)] = E[f(X1)2] – (E[f(X1)])2 Let us first compute the


unconditional expected value of f(X1):

E[f(X1)]= Â
j ŒJ
E[f(X1) | X0 = j] Pr{X0 = j}

= 12.5(0.2) + 5.5(0.4) + 5(0.3) + 5(0.1) = 6.7


Now we compute:
E[f(X1)2] = 182.5(0.2) + 147.5(0.4) + 250(0.3) + 25(0.1) = 173.0

Combining these results, we have Var[f(X1)] = 173 – 6.72 = 128.11


f. To find the long-run average return per period we must first find the
steady-state probabilities using Eqs. (4) and (5). The result is
p = (0.1466, 0.3519, 0.2639, 2376)
while C = ($20, $5, $15, –$10)T.
Using Property 6, the expected cost is pC = $6.276.
Mathematics of Discrete-Time Markov Chains 24

15. Consider the following transition matrix representing a DTMC with state space
{a, b, c, d, e}.

0.3 0.0 0.0 0.7 0.0


0.0 1.0 0.0 0.0 0.0
P= 1.0 0.0 0.0 0.0 0.0 .
0.0 0.0 0.5 0.5 0.0
0.0 0.2 0.4 0.0 0.4

a. Draw the state diagram.


b. List the transient states.
c. List the irreducible set(s).
d. Let Fi,j denote the first passage probabilities of reaching (or returning to) state j
given that X0 = i. Calculate the F matrix.
e. Let Ri,j denote the expected number of visits to state j given that X0 = i.
Calculate the R matrix.
f. Calculate the limnƕ p(n) matrix.

a. Draw the state diagram.

a
e b

c d

b. List the transient states.


State e is the only transient state
c. List the irreducible set(s).
The irreducible sets are {a, c, d} and {b}
d. Let Fi,j denote the first passage probabilities of reaching (or returning to) state
j given that X0 = i. Calculate the F matrix.
Mathematics of Discrete-Time Markov Chains 25

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.

f. Calculate the limnƕ p(n) matrix.


After 310 iterations we compute:
310 step Transition Matrix
10 0 1 2 3 4
a b c d e
a 0.322581 0 0.225806 0.451613 0
b 0 1 0 0 0
c 0.322581 0 0.225806 0.451613 0
d 0.322581 0 0.225806 0.451613 0
e 0.215054 0.333333 0.150538 0.301075 0
Mathematics of Discrete-Time Markov Chains 26

16. Let {Xt}be a DTMC with state space {a,b,c,d,e,f} and transition probabilities
given by

0.3 0.5 0.0 0.0 0.0 0.2


0.0 0.5 0.0 0.5 0.0 0.0

0.0 0.0 1.0 0.0 0.0 0.0


P=
.
0.0 0.3 0.0 0.0 0.0 0.7

0.1 0.0 0.1 0.0 0.8 0.0

0.0 1.0 0.0 0.0 0.0 0.0

a. Draw the state


diagram.
b
a c

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

g. Calculate the limnƕ p(n) matrix.

102 step Transition Matrix


10 0 1 2 3 4 5
a b c d e f
a 0 0.540541 0 0.27027 0 0.189189
b 0 0.540541 0 0.27027 0 0.189189
c 0 0 1 0 0 0
d 0 0.540541 0 0.27027 0 0.189189
e 0 0.27027 0 . 5 0.135135 0 0.094595
f 0 0.540541 0 0.27027 0 0.189189
Operations Research Models and Methods
by Paul A. Jensen and Jonathan F. Bard
John Wiley and Sons, Inc.
Copyright 2003 – All rights reserved

Chapter 14. Continuous-Time Markov Chains


Errata:
Ex. 14. c, d, e the columns of data are not in the correct place. Exercise is
usable.
Ex. 15. c, d, e the columns of data are not in the correct place. . Exercise is
usable.

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

Omar earns$281 per day.

a. Add a fourth waiting chair.


Rate Matrix
idle cut wait 1 wait 2 wait 3 wait 4
idle 0 4 0 0 0 0
cut 5 0 4 0 0 0
wait 1 0 5 0 4 0 0
wait 2 0 0 5 0 4 0
wait 3 0 0 0 5 0 4
wait 4 0 0 0 0 5 0
Continuous-Time Markov Chains 3

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

Same Economics matrix as original

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

Working faster earns Omar about $10 more per day.

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

Same Economics matrix as original


Continuous-Time Markov Chains 5

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

Balking causes a considerable reduction in revenue.


Continuous-Time Markov Chains 6

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

Steady State (Steps) 0.227273 0.454545 0.272727 0.045455

P{2 or three working} 0.776398


P{all are down} 0.037267
P{repair shop is idle} 0.310559
E[number in shop] 0.950311
State 0 1 2 3
Flow rate into shop 0.003 0.002 0.001 0
E[flow rate into shop] 0.00205
E[time in shop] 463.6364 hours -From Little's Law
Continuous-Time Markov Chains 7

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.

a. Steady-state probabilities with original system


0 1 2 3 4 5
pump 0 pump 1 pump 2 pump 3 wait 1 wait 2
Steady State (Time) 0.05882 0.176471 0.264706 0.264706 0.176471 0.058824

Average number in system 2.5


Proportion lost 5.88%

b. Steady-state probabilities with additional pump.

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

Average number in system 2.7033


Proportion lost 2.28%

The number in the system increases in part b because more customers use the
system. Fewer customers are lost.
Continuous-Time Markov Chains 8

4. A service system is composed of three sequential stations. Customers arrive


according to a Poisson process at an average rate of 4 per hour. The service time at
each station is exponentially distributed with a mean of 10 minutes. There is room in
the system for three customers, one at each station. No waiting is permitted; i.e.,
customers cannot queue between stations or before the first station. A customer who
completes service at one station and finds the next one busy must wait until it empties
before moving on. A customer arriving to find the first station busy is turned away.
Compute the steady-state probabilities and the throughput rate for the system.

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

A product is delivered whenever whenever station 3 completes its service. This is


modeled with the economics matrix below.
Transition Throughput Matrix
0 1 2 3 4 5 6 7 8 9 10 11 12
t 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 0 0 0 0 0 0 0 0 0 0 0 0
W_I_I 0 0 0 0 0 0 0 0 0 0 0 0 0
I_W_I 0 0 0 0 0 0 0 0 0 0 0 0 0
W_W_I 0 0 0 0 0 0 0 0 0 0 0 0 0
B_W_I 0 0 0 0 0 0 0 0 0 0 0 0 0
I_I_W 1 0 0 0 0 0 0 0 0 0 0 0 0
W_I_W 0 1 0 0 0 0 0 0 0 0 0 0 0
I_W_W 0 0 1 0 0 0 0 0 0 0 0 0 0
W_W_W 0 0 0 1 0 0 0 0 0 0 0 0 0
B_W_W 0 0 0 0 1 0 0 0 0 0 0 0 0
I_B_W 0 0 0 0 0 1 0 0 0 0 0 0 0
B_B_W 0 0 0 0 0 0 0 1 0 0 0 0 0
W_B_W 0 0 0 0 0 0 1 0 0 0 0 0 0
Continuous-Time Markov Chains 9

The steady-state results show that the throughput is 2.16 completions per hour.

I_I_I W_I_I I_W_I W_W_I B_W_I I_I_W W_I_W


Steady State (Time) 0.1719 0.1916 0.153 0.058 0.0651 0.1146 0.0771

I_W_W W_W_W B_W_W I_B_W B_B_W W_B_W


0.0633 0.0141 0.007 0.038 0.0267 0.0197

Prob. Station 3 working 0.3605

Throughput rate 2.1628 per hour


Continuous-Time Markov Chains 10

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

Steady State (Steps) 0.677966 0.254237 0.067797


Continuous-Time Markov Chains 11

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

Rate 0.1 0.5 1 0.75 0.5 0.2

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

The rate matrix is


S0 S1 S2 S3 S4
S0 1 0 0 0 0
S1 0.1 0 0.75 0 0
S2 0 0.5 0 0.5 0
S3 0 0 1 0 0.2
S4 0 0 0 0 1

The embedded Markov Chain transition matrix is


S0 S1 S2 S3 S4
S0 1 0 0 0 0
S1 0.118 0 0.882 0 0
S2 0 0.5 0 0.5 0
S3 0 0 0.833 0 0.167
S4 0 0 0 0 1

Absorbing State Probabilities. The requested answer is in the second row.


S0 S4
S1 0.482759 0.517241
S2 0.413793 0.586207
S3 0.344828 0.655172
Continuous-Time Markov Chains 12

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

Transition Time 0.25 1 1 1

Steady State (Steps) 0.3333 0.1667 0.3333 0.1667


Continuous-Time Markov Chains 13

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

Steady State (Steps) 0 0 1E-16 0.3333 0.1667 0.3333 0.1667


Continuous-Time Markov Chains 14

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

Transition Time 33.333 18.75 13.043 10

Steady State (Steps) 0.2959 0.4734 0.2041 0.0266

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

S_0 S_1 S_2 S_3


S_0 0 0.03 0 0
S_1 0.1 0 0.02 0
S_2 0 0.1 0 0.01
S_3 0 0 0.1 0

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

Transition Time 33.333 8.3333 9.0909 10

Steady State (Steps) 0.4098 0.4918 0.0902 0.0082

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

The truck is in working condition about 85% if the time.


Continuous-Time Markov Chains 17

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?

This problem is similar to 4, except that material immediately is supplied to


station 1 when it would otherwise be idle.
Rate Matrix
wii wwi wiw hwi www whw hhw hww
wii 0 1 0 0 0 0 0 0
wwi 0 0 1 1 0 0 0 0
wiw 1 0 0 0 1 0 0 0
hwi 0 0 0 0 1 0 0 0
www 0 1 0 0 0 1 0 1
whw 0 0 1 0 0 0 1 0
hhw 0 0 0 0 1 0 0 0
hww 0 0 0 1 0 0 1 0

The economics matrix evaluates a completion whenever there is a transition


caused by a completion of station 3.
Transition Completion Matrix
0 1 2 3 4 5 6 7
n wii wwi wiw hwi www whw hhw hww
wii 0 0 0 0 0 0 0 0
wwi 0 0 0 0 0 0 0 0
wiw 1 0 0 0 0 0 0 0
hwi 0 0 0 0 0 0 0 0
www 0 1 0 0 0 0 0 0
whw 0 0 1 0 0 0 0 0
hhw 0 0 0 0 1 0 0 0
hww 0 0 0 1 0 0 0 0

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.

a. Draw the rate network for the problem.

3l(1-p) 2l(1-p) l(1-p)

µ µ µ
0 1 2 3
3lp 2lp lp

b. Construct the rate matrix for l = 1/min, µ = 2/min and p = 0.2.


p_0 p_1 p_2 p_3
p_0 0 2 0 0
p_1 0.2 0.8 2 0
p_2 0 0.4 1.6 2
p_3 0 0 0.6 2.4
Sum 0.2 3.2 4.2 4.4

Lambda 1 per min


Mu 2 per min
p_fault 0.2
Continuous-Time Markov Chains 21

c. Find the steady-state probabilities. What is the production rate of this


system?
To measure the production rate, we value a transition from state i to state i as a
completion in the Economics Matrix.
p_0 p_1 p_2 p_3
p_0 0 0 0 0
p_1 0 1 0 0
p_2 0 0 1 0
p_3 0 0 0 1

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

With no faults the completion rate would be 3.


Continuous-Time Markov Chains 22

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

Rate Matrix. This model takes16 states.


0_0 1_1 1_2 1_3 2_1 2_2 2_3 3_1 3_2 3_3 4_1 4_2 4_3 5_1 5_2 5_3
0_0 0 0.1 0 0 0 0 0 0 0 0 0 0 0 0 0 0
1_1 0 0 0.33 0 0.1 0 0 0 0 0 0 0 0 0 0 0
1_2 0 0 0 0.33 0 0.1 0 0 0 0 0 0 0 0 0 0
1_3 0.25 0 0 0 0 0 0.1 0 0 0 0 0 0 0 0 0
2_1 0 0 0 0 0 0.33 0 0.1 0 0 0 0 0 0 0 0
2_2 0 0 0 0 0 0 0.33 0 0.1 0 0 0 0 0 0 0
2_3 0 0.25 0 0 0 0 0 0 0 0.1 0 0 0 0 0 0
3_1 0 0 0 0 0 0 0 0 0.33 0 0.1 0 0 0 0 0
3_2 0 0 0 0 0 0 0 0 0 0.33 0 0.1 0 0 0 0
3_3 0 0 0 0 0.25 0 0 0 0 0 0 0 0.1 0 0 0
4_1 0 0 0 0 0 0 0 0 0 0 0 0.33 0 0.1 0 0
4_2 0 0 0 0 0 0 0 0 0 0 0 0 0.33 0 0.1 0
4_3 0 0 0 0 0 0 0 0.25 0 0 0 0 0 0 0 0.1
5_1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.33 0
5_2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.33
5_3 0 0 0 0 0 0 0 0 0 0 0.25 0 0 0 0 0

From the steady-state analysis, the production rate is


Average
production
rate
0.08719261
7.6 % of arriving customers balk.

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

Without rework, a product would be produced every 12 minutes on the average.


Rework expands that time to almost 20 minutes.
Operations Research Models and Methods
by Paul A. Jensen and Jonathan F. Bard
John Wiley and Sons, Inc.
Copyright 2003 – All rights reserved

Chapter 15 Mathematics of Continuous-Time Markov


Chains
1. Fill in the missing entries of the following generator matrix for a continuous-time
Markov chain. What are the mean sojourn rates and the state-transition matrix for
the embedded Markov chain?

È-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

h È-0.03 0.02 0.01 0 ˘


m Í 0 -0.04 0.03 0.01 ˙
G= Í ˙
l Í 0 0 -0.05 0.05 ˙
d ÍÎ 0.15 0 0 -0.15˙˚

While in state h, m, l, or d the hotdog stand produces a profit at a rate of $900,


$550, $300, or -$700 per week. Elaine would like to reduce the time spent in the
fourth state and has determined that by doubling the cost (i.e., from $700 to
$1400) incurred by advertising in the subway while in state d the mean time spent
in d can be cut in half. Is the additional expense worthwhile?
a. Use the long-run average profit for the criterion.

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

È-0.03 0.02 0.01 0 ˘


Í 0 -0.04 0.03 0.01˙
G new = Í ˙
Í 0 0 -0.05 0.05˙
Í 0.3 0 0 -0.3˙˚
Î

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)

Therefore, the additional expense is worthwhile.

b. Use a total discounted-profit criterion assuming an annual discount rate b of


20%, and that you start in state h.

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˚

Multiplying this matrix on the right by the vector CScur gives

È145, 912 ˘
Í135, 239˙
–1 S
(bI – Gcur) Ccur = Í ˙
Í133, 437˙
Í ˙
Î137, 711˚

Thus, if we start in state h, the expected long-run discounted profit is $145,912.


For new situation:

-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˚

so if we start in state h, the total discounted expect profit is $151,980.


Comparing this value with $145,912, we see that the extra expense is
worthwhile. In fact, it doesn’t matter which state we start in, the conclusion is still
the same.

c. Model the problem as a discrete-time Markov chain with one-week


increments. Use a total discounted-profit criterion assuming that the company
expects a 20% annual rate of return.

For the weekly discount rate of b = 0.00385, we compute the discount factor

a = 1/(1+ b) = 1/(1+ 0.00385) = 0.9962

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

È0.97 0.02 0.01 0 ˘


Í 0 0.96 0.03 0.01˙
Pcur = Í ˙
Í 0 0 0.95 0.05˙
Í0.15 0 0 0.85˙˚
Î

Equation (9) in Chapter 12 allows us to compute the discounted profit vector:


Mathematics of Continuous-Time Markov Chains 5

-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 ˙
Î ˚

For the new situation,

È0.97 0.02 0.01 0 ˘


Í 0 0.96 0.03 0.01˙
Pnew = Í ˙
Í 0 0 0.95 0.05˙
Í 0.3 0 0 0.7 ˙˚
Î

which is the same as Pcur. From Eq. (9) in Chapter 12 we get

-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]).

The state space for the system is S = { 0, 1, . . . , 5} corresponding to the number


of customers in the store. For state 0, the rate at which the system goes to state
1 is r01 = cars per hour ¥ Pr{N = 1} = 10 ¥ 0.1 = 1. Similarly, r02 = 10 ¥ Pr{N = 2}
= 10 ¥ 0.7 = 7, r03 = 10 ¥ Pr{N = 3} = 10 ¥ 0.2 = 2, and r04 = r05 = 0. Noting that
5
l0 = Âr
j =0
0j = 1 + 7 + 2 + 10, we now have the first row, g1, of the generator matrix;

i.e., g1 = (–10, 1, 7, 2, 0, 0).


For state 1, the rate at which the system goes to state 0 is r10 = expected
number of customers leaving per hour = 1/10 min = 6/hr. The value of r12 = cars
5
per hour ¥ Pr{N = 1} = r01 = 1. Similarly, r1j = r0,j–1 (j = 3, 4, 5), and l1 = Âr
j =0
1j =

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˙˚

b. What is the long-run probability that the machine is working?

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)

pP = (0.233, 0.093, 0.372, 0.302) and c = $2061.

(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

6. An electronic relay in a communications device works as follows: Electric


impulses arrive at the relay according to a Poisson process with a mean
interarrival rate of 90 impulses per minute. An impulse is “stored” until a third
one arrives, then the relay “fires” and enters a “recovery” phase. If an impulse
arrives during the recovery phase, it is ignored. The length of time that the relay
resides in the recovery phase follows an exponential random variable with a mean
of 1 second. After the recovery phase is over, the cycle is repeated; that is, the
third arriving impulse will instantaneously fire the relay (Resnick [1992]).
a. Give the generator matrix for a CTMC model of the dynamics of this relay.

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.

Steps Time State Interval Steps Time State Time


1 1.244171 1 1.244171 11 37.87028 0 27.87028
2 14.36668 2 13.36668 12 38.429 2 27.429
3 15.82642 0 13.82642 13 40.43727 1 28.43727
4 16.01891 2 13.01891 14 46.68118 2 33.68118
5 18.24531 0 14.24531 15 56.32487 1 42.32487
6 20.39871 2 15.39871 16 56.6891 2 41.6891
7 35.78512 0 29.78512 17 57.70029 0 41.70029
8 36.25504 2 29.25504 18 58.26711 2 41.26711
9 36.87363 0 28.87363 19 58.5295 0 40.5295
10 37.38097 1 28.38097 20 58.68822 1 39.68822
Mathematics of Continuous-Time Markov Chains 14

8. For Exercise 7, write a computer program to determine the long-run probability of


being in each of the three states. (Remember that the long-run probability for a
particular state j can be estimated by the fraction of time that the process spends
in that state. The estimate can be improved slightly if the initial conditions are
ignored. In other words,
Êt ˆ
p j @ ÁÛ
P
ı u I(Y = j)du ˜ / (t – t )
0
Á ˜
Ë t0 ¯

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

Steady State (Steps) 0.358744 0.26009 0.381166

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

9. Suppose that a one-celled organism can be in either of two states A or B. An


organism in state A will change to state B at an exponential rate of a ; an organism
in state B divides into two new organisms of type A at the exponential rate of b.
Define an appropriate CTMC model for a population of such organisms and
determine the corresponding parameter values. Also, draw the rate diagram.

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?

A birth-death process is a special case of a CTMC that can be represented by a


serial network diagram in which transitions can only be between adjacent nodes.
The ATM problem in Chapter 14 is a good example. The problem here cannot
be represented but such a diagram (even after transformations) so is not a birth-
death process. It is, however, a CTMC. To see this, let us define the following
states.

0: both machines working


1: machine 1 working, machine 2 down
2: machine 2 working, machine 1 down
3: both down, machine 1 being repaired
4: both down, machine 2 being repaired

The rate matrix and generator matrix are, respectively,

È 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 ˙˚

From these matrices, we can determine the state-transition probabilities.

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

p31 = 1, p42 = 1, all other pij = 0


Mathematics of Continuous-Time Markov Chains 19

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

which can be used to successively compute E[Ti] for i = 1, 2, 3, 4.

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

b. Determine the expected time to go from state 2 to state 5.

We must continue the iterations begun in part (a) to get


5
1 4m 1 5m
E[T4] = + E[T3 ] and E[T5] = + E[T4 ] and then find  E[Ti ] .
5l 5l 6l 6l i=2
Mathematics of Continuous-Time Markov Chains 21

c. Determine the variances in parts (a) and (b).

We must use the recursive formula in Section 15.5,


1 mi mi
Var[Ti] = + Var[Ti–1] + (E[Ti–1] + E[Ti])2
li(li + mi) li li + mi
where Var[T0] = 1/l02 = 1/l2. Because of the Markov assumption, it follows that
j ±1
Var[time to go from i to j] = Â Var[T ]
k =i
k

which can be used to find the requested variances.


Mathematics of Continuous-Time Markov Chains 22

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

which can be used to successively compute E[Ti] for i = 0, 1. Thus,

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.

Using the formula at the end of Section 15.5, we have

Var[time to go from 0 to 2] = Var[T0] + Var[T1]


2
1 1 m m Ê2 mˆ
= 2+ + 3+ + 2
l l (l + m ) l m + l Ë l l ¯
Mathematics of Continuous-Time Markov Chains 23

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 )

and from the general relationship for p kP , we have

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.

The corresponding birth-death process has parameters


li = l, i = 1, 2
mi = im, i = 1, 2

Using these values in Eq. (22), we get

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

Chapter 16. Queuing Models


Notes
Exercise 17 would be better if the arrival rate were less than the service rate.

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.

Given: s = 3, 1/l = 12 minutes, Ws = 30 minutes, Wq = 20 minutes


Type: G/M/3 system
l = 1/12 = 0.0833/min. m = =1/ Ws = 0.0333/min.
Ws = 30 (given), Wq = 20 (given), W = Ws + Wq = 50 (all in minutes)
Ls = lWs = 2.5, Lq = lWq = 1.667, L = lW = 4.167
E = Ls/s = 0.833

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.

Given: s = 2, l = 220/hour, Ws = 10 seconds, L = 8.4 cars


Queuing Models 2

Type: M/M/2 system


l = 220/60 = 3.667/min., m = 60/10 = 6/min.
W= L/l = 2.291, Ws = 10/60 = 0.1667, Wq =W - Ws = 2.124 all in minutes
Ls = lWs = 0.611, Lq = lWq = 7,789, L = Ls + Lq = 8.4 (checks with the given)
E = Ls/s = 0.306

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.

This is an M/M/2/6 system


Given: s = 2, l = 220/hour, Ws = 10 seconds
There’s nothing much that can be said about this system, because the average
number waiting or in service cannot be the same as part b.

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.

Given: s = 5, Wq = 8 minutes, l = 0.6/min., L = 13


Type M//G/5
Computed: µ = 1/ Ws = 0.125/minute,
Wq = 8 (given), W= L/l = 21.667, Wq = W – Wq = 13.667 all in minutes
Ls = lWs = 4.8, Lq = lWq = 8.2, L = Ls +Ls = 13 (checks with the given value)
E = 0.96

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

Given: s = 4, Ws = 4 minutes, l = 50/hour = 0.833/min., Lq =4.1


Type M//D/4
Computed: µ = 1/ Ws = 0.25/minute,
Ws = 4 (given), Wq = Lq/l = 4.92., W= Wq + Ws =8.92 All in minutes
Ls = lWs =3.333, Lq = lWq = 4.1 (checks with given), L = Ls +Ls = 7.433.
Queuing Models 4

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.

Number of busy windows 0 1 2 3


Percent of the time 10 15 20 55

Number of waiting cars 0 1 2 3


Percent of the time 60 20 15 5

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

State Probability pk 0.1 0.15 0.2 0.15 0.2 0.15 0.05


Number in queue 0 0 0 0 1 2 3
Number in service 0 1 2 3 3 3 3
Number in system 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.

Find each of the following values.

a. Expected number of customers in the


queue Lq = 0 .2*1+ 0.15*2 = 0.5
b. Expected time in the queue Because this is a finite queue, only85%
of the arrivals actually enter and pass
through the system. Thus the rate of
customers passing through the system
is
le = 0.85*50 = 42.5
Expected time in the queue:
Wq = Lq / le = 0.5 / 42.5 = 0.01176
c. Expected number of customers in the L = 2.88
system
d. Expected time in the system
Wq = Lq / le = 0.5 / 42.5 =0.01176
e. Expected number of customers in
service Ls = 2.38
f. Expected time in service
Ws = Ls / le = 2.38 / 42.5 =0.056
g. Proportion of customers who balk p5 = 0.15
h. Percent utilization of the servers
Ls/s = 2.38 / 3 = 0.7933
i. Probability that there will be fewer p0 + p1 = 0.17
than two in the system
j. Probability that there will be four or p4 + p5 = 0.35
more in the system
k. Probability that an arriving customer p0 + p1 + p2 = 0.4
will obtain immediate service (rather
than having to wait in a queue)
Queuing Models 6

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.

a. The system has an infinite queue with M/M/3 system p0 + p1 + p2


three servers. What is the probability
that an arriving customer will spend no
time in the queue?
b. The system has a finite queue with two M/M/2/5 system
servers and three spaces in the queue.
Customers finding the queue full will Lq = p3 + 2*p4 + 3*p5
balk. The arrival rate to the system is
20 per hour. What is the average time le = 20*(1- p5)
spent in the queue?
Wq = Lq / le
= (p3 + 2*p4 + 3*p5)/ (20*(1- p5))
c. The queuing system represents a repair M/M/1/5/5 system
shop for a taxicab company. The shop
Average number not in shop =
services only the five cabs owned by
the company and there is a single 5*p + 4*p + 3*p + 2*p + p
0 1 2 3 4
repairman to do the work. The state of
the system represents the number of
cabs in the shop. What is the average
number of cabs not in the repair shop?
Queuing Models 7

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

6. For the system described in Exercise 5, find the following values.

a. Expected number of customers in the 1.53


queue
b. Expected time in the queue 0.51 hrs.
c. Expected number of customers in the 4.53
system
d. Expected time in the system 1.51 hrs.
e. Expected number of customers in 3
service
f. Expected time in service 1 hour
g. Proportion of customers that balk 0
h. Percent utilization of the servers 0.75
i. Probability that there will be fewer than P(0) + P(1) = 0.151
two in the system
j. Probability that there will be four or 1-[P(0) + P(1) + P(2) + P(3)] = 0.51
more in the system
k. Probability that an arriving customer 1-P( four or more) = 1-.51 = 0.49
will obtain immediate service (rather
than having to wait in a queue)
Queuing Models 9

7. Customers arrive at random to a self-service gasoline station at an average rate of 12


per hour. The station has a single pump. The time spent by a motorist at the pump
has an exponential distribution with a mean of 3 minutes. In parts a – e, assume
there is no limit to the number of cars that can wait.

a. What proportion of the time is the 1-P(0) = E = 0.6


pump busy?
b. How many spaces for waiting cars We want the sum of the steady state
should be made available on the station probabilities to be less than 85%
property to assure that there is
sufficient room to wait 85% of the P(0) +P(1) +P(2)+P(3) = 0.87 fi 2
time? spots.
c. What is the average time required for a W = 7.5 min.
customer to get gas?
d. If the arrival rate changes to 50 per We need: 5/6 < n/3 fi n ≥ 3
hour, what is the minimum number of
pumps required to handle the load? Efficiency = .8333 is the probability
Answer parts a, b and c using this that any one pump will be busy.
number of pumps. P(all pumps busy) = 0.702
i =11

 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

8. A company plans to advertise a new product with orders to be taken by phone.


Currently, the company has two phone lines. Using data collected during a dry run
of the system, it is determined that the average time to take a customer's order is 1.5
minutes. If the advertising campaign has the desired effect, orders will arrive at a
rate of 2 per minute on average. If a customer receives a busy signal the order is
assumed to be lost. For each case below, assume that the arrival and service
processes are Poisson and compute the average time in the system, the percent
utilization of the phones, and the proportion of customers lost.

a. Leave the phone system as it is. M/M/2/2


W = 1.5 minutes = expected service
time…no queuing
Efficiecncy = 0.705
Proportion of customers lost = P(sys. is
full) = P(2) = 0.53
b. Install an additional phone with an M/M/3/3
operator.
W = 1.5 minutes
Efficiency = 0.653
Proportion of customers lost = P(sys. is
full) = P(3) = 0.346
c. Have three phones with operators and M/M/3/4
one holding line. W =1.67 minutes
Efficiency = 0.74
Proportion of customers lost = P(sys. is
full) =P(4) = 0.257
d. Have three phones but add a call holding M/M/3
facility that can handle any number of This system is unstable since the
waiting customers. arrival rate is equal to the service rate.
2 = 3*2/3 … no steady state
distribution!
e. Have four phones but add a call holding W = 2.26 minutes
facility that can handle any number of
Efficiency = 0.75
waiting customers.
Proportion lost = 0
Queuing Models 11

9. A microcomputer laboratory in a Mechanical Engineering Department has six Super-


X computers for use by students. During the busy time of the day, students arrive at
the lab according to a Poisson process at an average rate of 12 per hour.
Unfortunately, many times a student will find all the computers busy. In such
circumstances, she will not wait but will rush off to one of the other computer labs
on campus. The average time a student spends on a computer is 1/2 hour, but the
time is actually exponentially distributed.

a. Sketch the rate network for this M/M/6/6


situation.

b. What is the average number of students None since there is no queue.


waiting?
c. What proportion of the arriving Proportion servered = 1-P(busy)
students will be served by this = 1 - 0.265 = 0.735
computer lab?
d. What is the utilization for the Efficiecny = 0.735
computers in the lab; i.e., what
proportion of time are the computers in
use?
Queuing Models 12

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.

a. Although this is clearly a transient M/M/1/4/4


situation, determine the steady-state
P(0) = 0.206
probabilities associated with the
number in the system. P(1) = 0.275
P(2) = 0. 275
P(3) = 0.183
P(3) = 0.061
b. When there is no queue the house is P(no queue) = P(0) + P(1) = 0.498
relatively calm. Using the results from
E(quiet minutes/hour) = 60*0.498 =
part a how many minutes in the 1-hour
period should the parents expect to 28.9 min.
have peace and quiet??
Queuing Models 13

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.

This is an M/M/1/5/5 system.


The mean time for service, ms = 40 hours. Then µ = 0.025/hour.
For each radar, ma = 500 hours. Then the individual arrival rate is: l = .002/hour.
Analyzing this system we find the following steady-state results:
Type M/M/1/5/5
Mean Number at Station 0.49218215
Mean Time at Station 54.5920639
Mean Number in Queue 0.13155672
Mean Time in Queue 14.5920622
Mean Number in Service 0.36062543
Mean Time in Service 40
Efficiency 0.36062543
P(0) 0.63937455
P(1) 0.25574983
P(2) 0.08183995
P(3) 0.01964159
P(4) 0.00314265
P(5) 0.00025141
P(6) 0

Operational P(0, 1, 2) 0.97696433


Reduced Effectiveness P(3) 0.01964159
Failed P(4, 5) 0.00339407
Note that the state probabilities refer to the number in the system, not the
number working. Thus the reduced effectiveness mode with 2 working refers to
state 3, or 3 failed.
Queuing Models 15

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.

Queue Station E_13_3 E_13_4 E_13_5 E_13_6


Arrival Rate 6 6 6 6
Service Rate/Channel 0.33333333 0.33333333 0.33333333 0.33333333
Number of Servers 18 19 20 21
Max. Number in System 115 48 38 33
Number in Population * * * * * * * * * * * *
Type M/M/18/115 M/M/19/48 M/M/20/38 M/M/21/33
Mean Time in Queue 7.76580514 1.26193656 0.52211137 0.24194979
Efficiency 0.99029189 0.9382199 0.89196181 0.84908974
Prob. System Full 0.00970808 0.00965672 0.00893123 0.00939533
Queuing Models 16

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?

We analyze each station as an independent queue with a single server and an


arrival rate of 4/hour or 0.0667/minute. All times in the tables are expressed in
minutes.
Queue Station a b c
Arrival Rate 0.06666667 0.06666667 0.06666667
Service Rate/Channel 0.08333333 0.08333333 0.08333333
Number of Servers 1 1 1
COV of interarrival times 1 1 1
COV of service times 1.58113883 0.5 0
COV of departures 1.40000002 0.72111025 0.59999998
Type M/G/1 M/G/1 M/G/1
Mean Number at Station 6.40000064 2.80000024 2.40000019
Mean Time at Station 96.000005 42.0000018 36.0000014
Mean Number in Queue 5.60000063 2.00000022 1.60000018
Mean Time in Queue 84.000005 30.0000018 24.0000014
Mean Number in Service 0.80000001 0.80000001 0.80000001
Mean Time in Service 12 12 12
Efficiency 0.80000001 0.80000001 0.80000001
Queuing Models 17

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.

a. How many customers are turned away in the first 2 hours?

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.

Note that one way to generate a realization of an exponential random variable


is to use the inverse transformation technique. In particular, let l be the parameter of
the exponential random variable X with cumulative distribution function F(X) = 1 –
e–lx. Also, let R be a uniform random variable defined on the interval [0, 1]. To
obtain the required expression, solve the equation F(X) = R for X in terms of R. This
leads to

–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

Random Variable TBA1 TFS1 Queue Station SimQ_17


Distribution Exponential Exponential Arrival Distribution TBA1
rate (lambda) 0.13333333 0.1 Service Distribution TFS1
Mean 7.49999952 10 Number of Servers 1
Standard Deviation 7.49999961 9.99999985 Max. Number in System 4
Type G/G/1/4
Arrival Seed 1
Service Seed 10
Number in Simulation 100
Start Data Time 60
Stop Data Time 600
Mean Number at Station 3.26435614
Mean Time at Station 60.7845626
Mean Number in Queue 2.27567316
Mean Time in Queue 42.3746036
Mean Number in Service 0.98868298
Mean Time in Service 18.409959
Arrival Rate 0.13148148
Throughput Rate 0.0537037
Efficiency 0.98868298
Probability Balk 0.5915493

We estimate the probabilities of states 0 and 4, by accumulating the simulation


times when the system was in these states.
P(0) P(4)
Probability 0.011 0.570

c. Comparing the analytical and simulated results we obtain:


Analytical Simulated
Mean Number at Station 2.55569768 3.26435614
Mean Time at Station 28.5142841 60.7845626
Mean Number in Queue 1.65941088 2.27567316
Mean Time in Queue 18.5142842 42.3746036
Prob. System Full 0.32778487 0.5915493
P(0) 0.10371318 0.01131702
P(4) 0.32778487 0.57018102
In this case the simulated results are quite different than the analytical. Averaging
multiple runs would be more accurate.
Queuing Models 23

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.

a. How many customers are turned away in the first 2 hours?

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.

Random Variable TBA2 TFS2 Queue Station SimQ_18


Distribution Uniform Uniform Arrival Distribution TBA2
lower limit (a) 0 0 Service Distribution TFS2
upper limit (b) 15 20 Number of Servers 1
Mean 7.5 10 Max. Number in System 4
Standard Deviation 4.33012702 5.77350269 Type G/G/1/4
Arrival Seed 1
Service Seed 10
Number in Simulation 100
Start Data Time 60
Stop Data Time 600
Mean Number at Station 2.87200351
Mean Time at Station 30.409449
Mean Number in Queue 1.87517547
Mean Time in Queue 19.8547991
Mean Number in Service 0.99682805
Mean Time in Service 10.5546499
Arrival Rate 0.12962963
Throughput Rate 0.09444444
Efficiency 0.99682805
Probability Balk 0.27142857
We estimate the probabilities of states 0 and 4, by accumulating the simulation
times when the system was in these states.
P(0) P(4)
Probability 0.003 0.292

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

Chapter 17. Queuing Networks and Decision Models


1. An assembly line has five stations through which every unit being produced must
pass in the same fixed order. The arrival of units to the line is random following a
Poisson process. The mean time between arrivals is 20 minutes. The stations
operate independently and queues are allowed to form in front of each. All stations
have the same mean processing time of 15 minutes. For analysis purposes assume
that the arrival process is Poisson for all stations. (This assumption is correct for
part (a) below, but not for part (b).) Determine the total average number of units in
the five queues for each case below.
a. The processing time at each station has an exponential distribution.
b. The processing time at each station is a constant, exactly 15 minutes.

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.

Random Variable P_2a_server


Distribution Gamma
r 5
rate (lambda) 20
Mean 0.25
Standard Deviation 0.1118034

Queue Station P_2a


Arrival Rate 3 per hour
Service Rate/Channel 4 per hour
Number of Servers 1
COV of interarrival times 1
COV of service times 0.4472136
COV of departures 0.74161985
Type M/G/1
Mean Number at Station 2.1
Mean Time at Station 0.7 hours
Mean Number in Queue 1.35
Mean Time in Queue 0.45 hours

b. Assume that the time to perform each operation has a constant value of 3
minutes.
Queuing Networks and Decision Models 3

Queue Station P_2b


Arrival Rate 3
Service Rate/Channel 4
Number of Servers 1
COV of interarrival times 1
COV of service times 0
COV of departures 0.66143783
Type M/G/1
Mean Number at Station 1.875
Mean Time at Station 0.625
Mean Number in Queue 1.125
Mean Time in Queue 0.375
Queuing Networks and Decision Models 4

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.

Input Central Printer


Measure processor processor station Total
Model M /M /3 M /M /1 M /M /6
L q 3.511 0.900 11.553 16.077
W q 0.234 0.075 2.407 4.169
L s 2.500 0.600 5.601 5.801
W s 0.167 0.050 1.167 1.384

b. Add a channel to the station that would most reduce the average time spent by a
job passing through all three stations.

Total Total Total


base extra printer extra
processor
L q 15.9641661 6.35772842 12.9860255
W q 2.71594285 0.71460175 2.51740014
L s 8.70093358 8.70093358 8.70093358
W s 1.38352785 1.38352785 1.38352785

Clearly, the best plan is to add an extra printer.


Queuing Networks and Decision Models 5

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)

1 30 ABDF 0.58665 0.367 17.5996


2 10 ABEF 0.29367 0.11474 2.93674
3 20 ACEF 0.34539 0.17743 6.90774
Queuing Networks and Decision Models 6

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.

Extra station added to B

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'

Demand = 80/hr Demand = 30/hr


250'

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

The minimum number of removal crews is 2 and the minimum number of


installation crews is 4. Since both operations have exponential service times and
the arrival process is Poisson this is a Jackson network.

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.

The analysis yields the following


Queuing Networks and Decision Models 9

Queue Station Remove Install


Arrival Rate 12 12 per week
Service Rate/Channel 8 4 per week
Number of Servers 2 4
Max. Number in System * * * * * *
Number in Population * * * * * *
Type M/M/2 M/M/4
Mean Number at Station 3.4285717 4.52830219
Mean Time at Station 0.2857143 0.3773585 weeks
Mean Number in Queue 1.92857158 1.52830195
Mean Time in Queue 0.1607143 0.1273585 weeks
Mean Number in Service 1.5 3
Mean Time in Service 0.125 0.25 weeks

Danger Period 0.5023585 weeks


The danger period is the sum of the removal mean service time and the
installation mean station time.
Queuing Networks and Decision Models 10

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

9. A pizza company is initiating a delivery service in a growing suburb of a city. For


simplicity assume the suburb has a square shape, as indicated in the figure below
where all distances are in miles. Two alternatives are being considered: either a
single shop is to be located at site A, or four shops are to be located at sites B, C, D
and E. In the latter case, the suburb will be divided into quadrants with each
customer served by the closest shop.

8
4

B C
4
A

D E
8

Layout for pizza delivery problem

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

a. Compute the expected travel time.


Option 1 Option 2
Travel Model Single station Each Station
a 4 2
b 4 2
c 4 2
d 4 2
E[Two way distance] 8 4
velocity 20 2 0 miles per hour
E[T] 0.4 0.2 hours

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

Queue Station Donor Rec. Seller Rec. Blood Room


Independent Arrival Rate 6 10 0
Arrival Rate 6 10 16
Service Rate/Channel 10 15 10
Number of Servers 1 1 2
Type M/M/1 M/M/1 M/M/2
Mean Number at Station 1.5 2 4.444445
Mean Time at Station 0.25 0.2 0.277778
Mean Number in Queue 0.9 1.333333 2.844445
Mean Time in Queue 0.15 0.133333 0.177778
Mean Number in Service 0.6 0.666667 1.6
Mean Time in Service 0.1 0.066667 0.1
Efficiency 0.6 0.666667 0.8
The mean time for a person donating blood is the sum of the mean times for the
donor receptionist and the blood room.
E[time for donor] = 0.250 + 0.278 = 0.528 hours.
E[time for seller] = 0.200 + 0.278 = 0.478 hours.
E[time for random person entering system] = [(6)(0.528) + (10)(0. 478)]/(6 + 10)
= 0.497.
c. Assuming the queues for both receptionists and blood donation room all
reside in the waiting room, the average number in the room is the sum of the
average numbers in the three queues, 5.078.
d. Assuming that the three queues can be modeled as independent queues we
compute the following with the Poisson queuing formulas:
P(no persons waiting for donor rec.) 0.39999998
P(no persons waiting for seller rec.) 0.33333331
P(no persons waiting for blood room) 0.1111111
The probability that all three queues are empty is the product of these three
probabilities:
P(no persons waiting) 0.01481481
Queuing Networks and Decision Models 15

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

z(s*) £ z(s* – 1) and z(s*) £ z(s* + 1).

=ls
Arrival rate to one server : 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

When the secretaries are pooled, it is still optimum to use 3 secretaries.


Secretaries form a single pool 2 3 4
Queue Station E_11b_1 E_11b_2 E_11b_3
Arrival Rate 100 100 100
Service Rate/Channel 50 50 50
Number of Servers 2 3 4
Max. Number in System * * * * * * * * *
Number in Population * * * * * * * * *
Type M/M/2 M/M/3 M/M/4
Mean Number at Station #NUM! 2.88888907 2.173913
Cost for system #NUM! $ 312 $ 374

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

L(s*) – L(s* + 1) £ Cs/Cw £ L(s* – 1) – L(s*).

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

We analyze the alternatives of 3, 4 and 5 inspection stations below using the


given parameters. The arrival rate splits evenly between stations. The hourly cost
is shown in the last row. The optimum number of servers is 4.

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

13. (Pollution Control Model) A manufacturing company continuously operates five


independent waste treatment facilities for cleaning effluents that are discharged into
a local river. The operation of each facility, however, is not completely reliable due
to equipment failures. The time between breakdowns in each facility is exponential
with a mean of 14 days. On average, it takes a repair crew one day to get a facility
back up and running. Repair times are similarly exponential, and crew costs the
company $1000 per day. The EPA does not allow the company to discharge
untreated waste so whenever a facility is "down" the plant operates at less than full
capacity. This downtime is costed at $50,000 per day per facility. Determine the
optimal number of repair crews to hire by enumerating total cost per day for 1, 2, 3,
4 and 5 crews. Is the equation given in Exercise 11, part c satisfied?

We model this system as a finite population queuing system with a population of


5. The arrival rate to the “down” state is 1/14 per day. The service rate is the
repair rate of a crew, 1 per day. The average number “down” is the average
number in the system, L. We evaluate the cost using the expression:
z(s) = 1000s + 50000L(s), where L(s) is determined using a Poisson queuing
model. The results are shown below. The least expensive policy is to use two
crews.

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.

a. Determine the minimum number of operators needed to ensure that the


probability of rejection is below 10 percent.

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

b. Assuming that one operator is to be used, determine the minimum number of


phone lines needed to ensure a probability of rejection below 10 percent.

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

Queue Station E_14b_1 E_14b_2 E_14b_3 E_14b_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 1 1 1
Max. Number in System 4 5 6 7
Number in Population * * * * * * * * * * * *
Type M/M/1/4 M/M/1/5 M/M/1/6 M/M/1/7
Mean Number at Station 1.64050746 1.97882771 2.2901628 2.57562304
Mean Time at Station 11.371088 13.2025375 14.8941393 16.4508133
Mean Number in Queue 0.91915716 1.22941576 1.52134935 1.79279768
Mean Time in Queue 6.37108797 8.20253717 9.89413893 11.450813
Mean Number in Service 0.72135025 0.74941188 0.76881343 0.78282547
Mean Time in Service 5 5 5 5
Throughput Rate 0.14427005 0.14988238 0.15376268 0.1565651
Efficiency 0.72135025 0.74941188 0.76881343 0.78282547
Prob. System Full 0.13437971 0.10070575 0.07742394 0.06060943

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.

We have a discrete decision problem in two variables. We must use a procedure


that searches the integers, s and K, over a specified range. The cost must be
evaluated at each point and the optimum is the solution that has the smallest
cost.
Queuing Networks and Decision Models 22

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%

a. What is the probability that the system is empty?

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.

b. What is the expected number if customers in the system?

L = r / (1 – r) = 0.9375 / 0.0625 = 15

c. What is the probability that a customer will pass through the server exactly twice?

Pr{Exactly two passes through server}


= Pr{Reenter after first pass} ¥ Pr{Exit after the second pass}
= 0.2 ¥ 0.8 = 0.16

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.

Wsystem @ L / g = 15/15 = 1 hour


Queuing Networks and Decision Models 27

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

a. What is the probability that node 1 is empty?

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

b. What is the probability that the entire network is empty?

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

e. What is the expected number of jobs within the network?

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.)

Method 1: To use Property 3, we must calculate the expected waiting times at


nodes 1 and 2, W1and W2, and the probabilities v1 and v2.
W1 = L1/l1 = 7/17.5 = 0.4 hour, W2 = L2/l2 = 2.61/27.5 = 0.095 Hour
g1 12 g2 10
v1 = = = 0.545 , v2 = = = 0.455
g 1 + g 2 12 + 10 g 1 + g 2 12 + 10

È 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

Method 2: Applying Little’s law to the entire system gives


Wsystem = Lsystem/(g1 + g2) = 9.61 / 22 = 0.437 hour

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.

a. Draw a block diagram to represent the emergency room network.

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%

The figure should be modified to include independent flow of 10 into node 2.

b. What is the corresponding switching probability matrix?


Queuing Networks and Decision Models 32

È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

d. What is the average number of patients in the emergency room?

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

For node 3: r3 = l3/2m3 = 7.56/(2 ¥ 5) = 0.756, and for a 2-server queuing


systems, we have L3 = 2r3/(1 – r32) = 1.512/(1 – 0.7562) = 3.529
Therefore, Lsystem = L1 + L2 + L3 = 6.528

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

f. Compute the variance of the flow time through the network.

To find the variance of the flow time, we the formula in Property 4:


m m m
Wei + S S WjWk cov[Nj, Nk]
Var[Tnet] = S Var[Ti]vW (1)
i=1 j=1 k=1
where Var[Ti] is the variance of the waiting time at node i. The formula for Var[Ti]
is not given in the text so the student has to be a bit industrious and find it in a
queuing text book. For an M/M/s system, the necessary formulas are
s
2p 0 (l / m )
E[T2q] =
m 2 s 2 s!(1 - r )3
Queuing Networks and Decision Models 34

Var[Tq] = E[T2q] – (E[Tq])2


1
Var[T] = Var[Tq] +
m2
where Tq is a random for the time in the queue and T is a random variable for the
time in the system. Note that E[Tq] ∫ Wq.
The first step is to compute the covariance matrix
È 0.16 0 -0.008 ˘
cov[Nj, Nk] = Í 0 0.1875 -0.16125˙
Í ˙
ÍÎ-0.008 -0.16125 0.2158 ˙˚
where Nj is a random variable denoting the number of visits to node j. The terms
along the diagonal are Var[Nj]. Next we must compute the variance of flow time
through each node. We will work in units of minutes in the final computations.
Node 1: M/M/1, l1 = 4.8/hr, m1 = 12/hr, r1 =l1/m1 = 4.8/12 = 0.4, and 1/m1 = 5
min.
1 2
1 2p 0 (l1 / m1 ) Ê r1 ˆ 1
Var[T1]= Var[T1q] + 2 = 2 3
– Á ˜ + 2
m1 m1 (1 - r1 ) Ë m1 (1 - r1 ¯ m1
2 r1 - r12 1 1
2 2 2 2
= m1 (1 - r1 ) + m1 = m1 (1 - r1 )
52
= 2
= 69.44 min2
0.6
Node 2: M/M/3, l2 = 18/hr, m2 = 10/hr, r2 =l2/3m2 = 18/30 = 0.6, 1/m2 = 6 min,
and from part (c), W2q = 1.77 min. Additional algebraic manipulations and
calculations give E[T2q2] = 17.739 min2.
1
2
Var[T2] = Var[T2q] + m2 = 17.739 – 1.772 + 62 = 50.606 min2
Node 3: M/M/2, l3 = 7.56/hr, m3 = 5/hr, r3 =l3/2m3 = 7.56/10 = 0.756, and 1/m3 =
12 min Additional algebraic manipulations and calculations give E[T3q2] = 787.2
min2 and W3q = 16 min.
1
2
Var[T3] = Var[T3q] + m2 = 787.2 – 162 + 122 = 675.2 min2
W = (0.2, 0.75, 0.315), W1 = 8.34 min,
Finally, application of Eq. (1) above with vW
W2 = 7.77 min, and W3 = 28 min, gives
Var (Tnet ) = 0.2 ¥ 69.44 + 0.75 ¥ 50.606 + 0.315 ¥ 675.2
Queuing Networks and Decision Models 35

+8.34(88.34 ¥ 0.16 - 28 ¥ 0.008) + 7.77(7.77 ¥ 0.1875 - 28 ¥ 0.16125)


+28( -8.34 ¥ 0.008 - 7.77 ¥ 0.16125 + 28 ¥ 0.216) = 382.4 min 2
The corresponding standard deviation is 19.56 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.)

The updated flow diagram is shown below.


Queuing Networks and Decision Models 36

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

which yields l1 = 4.8, l2 = 19.151, l3 = 7.675 . To determine the average amount of


time a patient who sees a doctor spends waiting the queue, we must calculate
Wq for an M/M/3 system with r2 = l2/3m2 = 19.151/(3¥10) = 0.638. The
remaining calculations from are as follows.

-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

Summing, we have Lsystem = L1 + L2 + L3 = 7.03.


Queuing Networks and Decision Models 38

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

a. Using the approximation formulas in Section 17.3 (should be Section 16.3),


estimate the expected length of time that a customer has to wait before receiving
service and the expected number of customers in front of the 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.

ma = 5.72 min, sa = 4.7 min  c2a = 0.675


ms = 3.5 min, ss = 5 min  c2s = 2.04

Using Eq. (2) in Section 16.3 with r = l/m = ms /ma = 0.612, we have

È c 2 + cs2 ˘ È ms r ˘ È 0.675 + 2.04 ˘ È 3.5 ¥ 0.612 ˘


Wq @ Í a ˙Í ˙ = ˙˚ ÍÎ 1 - 0.612 ˙˚ = 7.49 min
Î 2 ˚ Î (1 - r ) ˚ ÍÎ 2

Lq = Wq /ma = 7.49/5.72 = 1.31 customers (not including the one in service)

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.

For an M/M/1 system, we have

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.

Current cost of waiting: CW = ($0.25/min/customer) (1.31 customers) =


$0.3275/min = $19.65/hr
Monthly cost of waiting: MCW = CW ¥ 4 hr/day ¥ 5 days/wk ¥ 4.2 wk/mo = $1651.
È ca2 + cs2 ˘ È r 2 ˘
Cost of bar code reader: Compute new Lq (BCR) @ Í ˙Í ˙ , where now
Î 2 ˚ Î (1 - r ) ˚
ms = 3.5 min, ss = 1.7 min  c2s =0.236.
0.675 + 0.236 ˘ È 0.612 2 ˘
Lq (BCR) = ÈÍ ˙˚ ÍÎ1 - 0.612 ˙˚ = 0.44 customers
Î 2
CBCR = ($0.25/min/customer) (0.44 customers) = $0.11/min = $6.6/hr

Monthly cost of BCR:


MCBCR = CBCR ¥ 4 hr/day ¥ 5 days/wk ¥ 4.2 wk/mo + $50 = $604.
Queuing Networks and Decision Models 40

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

Monthly cost of extra cashier: MCEXTRA = CEXTRA ¥ 4 hr/day ¥ 5 days/wk ¥ 4.2


wk/mo + $500 = $608.

Conclusion  Better to buy bar code reader.


Operations Research Models and Methods
by Paul A. Jensen and Jonathan F. Bard
John Wiley and Sons, Inc.
Copyright 2003 – All rights reserved

Chapter 18. Simulation


For Ex. 4d use t = 1.
Exercise 10b and c should ask for 12 replications rather than 10.
For Exercise 15b use a Bernoulli distribution to model the process of passing
from the first station to the next. Use the 2nd and 3rd column from the random
number table to simulate the 12 observations of the Bernoulli random variant.
Exercise 21 should refer to Table 18.19. Note that Table 18.19 in Chapter 18 is in
error as well as Appendix A1 of the simulation chapter. See the errata sheet for
detailed changes.
Solutions are not available for Ex. 25 and 38.

When random numbers are called for in any of the exercises, use the three-digit numbers
in the following table unless otherwise directed.

Random number table


005 192 941 720 596 206 233 711 909 994
624 684 748 187 069 399 527 291 388 965
599 081 086 757 758 345 845 664 775 645
914 326 213 101 662 263 784 995 347 006
344 986 776 312 512 435 160 014 255 349
799 812 863 992 680 589 143 858 958 662

1. Simulate 12 service times from a normally distributed population with a mean of 4


min and a standard deviation of 1 minute. For each service time computation, use 4
random numbers in conjunction with the formula given in the text. Use the first 48
random numbers above, starting with the first row. If the simulated time is less than
zero, replace it with zero.
a. Compute the mean and standard deviation of the sample of simulated service
times. How do they compare to the population mean and standard deviation (µ
= 4 and s = 1).

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.

b. Use the Kolmogorov-Smirnov test with a = 0.05 to determine if the numbers


generated are from a normal population.

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

Max. Difference 0.1140948


Sample Size 12
Alpha 0.05
Critical Value 3

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

2. Using the same random numbers as in Exercise 1, simulate 12 observations from an


Erlang distribution with k = 4 and l = 0.25. Recall that an Erlang random variable
X has the following probability density function,

( )
Ï kl ( klx )k -1 e - klx / ( k - 1)! for x ≥ 0
f(x) = Ì
Ó0 otherwise

where k is a positive integer and l is a positive number. In particular, X is the sum


of k (independent) exponential random variables each with rate parameter kl. This
means that E[X] = 1/l and Var[X] = 1/kl2. The useful of the Erlang stems from its
relationship with the exponential. In modeling process times, the exponential
distribution is often inappropriate because the standard deviation is as large as the
mean. Engineers usually try to design systems whose process time standard
deviations are significantly smaller than their means. Notice that for the Erlang
distribution, the standard deviation decreases as the square root of the parameter k
increases so that process times with a small standard deviation can often be
approximated by an Erlang random variable.

The simulated observations are in the last column.


l= 0.25
n=4 4 Simulated Exponentials Erlang
Random Numbers Exp. 1 Exp. 2 Exp. 3 Exp. 4 Sum
1 0.005 0.192 0.941 0.72 0.005 0.2132 2.8302 1.273 4.3214
2 0.596 0.206 0.233 0.711 0.9063 0.2307 0.2653 1.2413 2.6436
3 0.909 0.994 0.624 0.684 2.3969 5.116 0.9782 1.152 9.6431
4 0.748 0.187 0.069 0.399 1.3783 0.207 0.0715 0.5092 2.166
5 0.527 0.291 0.388 0.965 0.7487 0.3439 0.491 3.3524 4.936
6 0.599 0.081 0.086 0.757 0.9138 0.0845 0.0899 1.4147 2.5029
7 0.758 0.345 0.845 0.664 1.4188 0.4231 1.8643 1.0906 4.7969
8 0.775 0.645 0.914 0.326 1.4917 1.0356 2.4534 0.3945 5.3752
9 0.213 0.101 0.662 0.263 0.2395 0.1065 1.0847 0.3052 1.7359
10 0.784 0.995 0.347 0.006 1.5325 5.2983 0.4262 0.006 7.263
11 0.344 0.986 0.776 0.312 0.4216 4.2687 1.4961 0.374 6.5604
12 0.512 0.435 0.16 0.014 0.7174 0.5709 0.1744 0.0141 1.4768
1.0142 1.4915 1.0188 0.9272 4.4518 Sample Mean
0.6643 2.0808 0.9515 0.9169 2.5053 Sample Std.Dev.

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.

Horse Mean time (min) Standard deviation (min)


1 10 1
2 9.5 0.5
3 10.5 3

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

Win Frequency Count Freq.


Horse 1 3 0.3
Horse 2 6 0.6
Horse 3 1 0.1
10

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.

e. A Weibull distribution with location parameter n = 0, scale parameter a = 1, and


shape parameter b = 2.

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.

b. A normal distribution with m = 100 and s = 20.

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

c. A lognormal distribution whose underlying distribution is a standard normal.

The lognormal is simulated as X = exp(Z), where Z is simulated from the


standard normal distribution.
1 2 3 4 5 6 7 8 9 10
X= 1.4964 1.1214 2.4271 1.1025 1.4795 0.3399 0.6469 2.125 2.4444 2.4066

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.

Here we sum 6 simulated Bernoulli random variants.


Row/Col 1 2 3 4 5 6 7 8 9 10
1 0 0 1 1 0 0 0 1 1 1
2 1 1 1 0 0 0 0 0 0 1
3 0 0 0 1 1 0 1 1 1 1
4 1 0 0 0 1 0 1 1 0 0
5 0 1 1 0 0 0 0 0 0 0
6 1 1 1 1 1 0 0 1 1 1
a . A binomial distribution with n = 6 and p = 0.4.
1 2 3 4 5 6 7 8 9 10
X= 3 3 4 3 3 0 2 4 3 4

b. A Gamma distribution with k = 6 and l = 2.

Here we sum 6 simulated exponentially distributed random variants.


Row/Col 1 2 3 4 5 6 7 8 9 10
1 0.0025 0.1066 1.4151 0.6365 0.4532 0.1153 0.1326 0.6207 1.1984 2.558
2 0.4891 0.576 0.6892 0.1035 0.0357 0.2546 0.3743 0.1719 0.2455 1.6762
3 0.4569 0.0422 0.045 0.7073 0.7094 0.2116 0.9322 0.5453 0.7458 0.5178
4 1.2267 0.1973 0.1198 0.0532 0.5424 0.1526 0.7662 2.6492 0.2131 0.003
5 0.2108 2.1343 0.7481 0.187 0.3587 0.2855 0.0872 0.007 0.1472 0.2146
6 0.8022 0.8357 0.9939 2.4142 0.5697 0.4446 0.0772 0.976 1.585 0.5424
a. A Gamma distribution with k = 6 and l = 2.
1 2 3 4 5 6 7 8 9 10
X= 3.1882 3.8921 4.0109 4.1017 2.6691 1.4641 2.3697 4.9701 4.1351 5.512

7
Simulation 8

7. (Triangular distribution) Consider a random variable X with probability density


function (pdf)

Ï x, 0 £ x £1
Ô
f(x) = Ì2 - x, 1 < x £ 2
Ô0, otherwise
Ó

This is known a triangular distribution with endpoints [0, 2] and mode at 1.


a. Derive the cumulative distribution function, F(x), for X.

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

b. Determine analytically the mean and variance of X.

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 )

c. Develop a step-by-step scheme that can be used to generate observations of X.

We first derive a procedure to draw a random variable from a triangular


distribution with range 0–1 and a mode of c.
Draw a random number (r) from a uniform distribution with range 0–1.
The c.d.f. of the Triangular Distribution (Note that this is wrong in the Probability
Supplement)

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.

We use the procedure of problem 7, but in this case a = 0 and b = 6.


1 2 3 4 5 6 7 8 9 10
r= 0.799 0.812 0.863 0.992 0.68 0.589 0.143 0.858 0.958 0.662
y= 0.683 0.693 0.738 0.937 0.6 0.547 0.267 0.734 0.855 0.589
x= 4.098 4.16 4.43 5.621 3.6 3.28 1.604 4.401 5.131 3.533

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.

We first derive the cumulative distribution.


For - • < x £ 0
x
e 2x
F ( x ) = Ú e dy =
2y

-• 2
For 0 < x < •
x
e-2 x
F ( x) = Ú e-2y dy = 1 - 2
-•

Select a random number from (0. 1). Call it r..


For 0 < r £ 0.5
e 2x
r= or x = 0.5 * ln(2 r)
2
For 0.5 < r < 1
e-2 x
r = 1- or x = -0.5 * ln(2(1 - r))
2
Using these formulas, we simulate the 10 observations below.
1 2 3 4 5 6 7 8 9 10
r= 0.624 0.684 0.748 0.187 0.069 0.399 0.527 0.291 0.388 0.965
x= 0.143 0.229 0.343 -0.49 -0.99 -0.11 0.028 -0.27 -0.13 1.33

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 .

where i is the investor's minimum acceptable rate of return (MARR). If NPW ≥ 0,


the investment provides a return at least as great as the MARR. If NPW < 0, the
investment fails to provide the MARR.
Your financial advisor tells you that a particular investment of $1000 will provide a
return of $500 per year for three years. Your MARR is 20% or 0.2.

a. Is this investment acceptable according to your NPW criterion?

The NPW is 53.24 and would be acceptable.

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.

0.5758 0.4998 0.3290 0.3854 0.6784 0.8579


0.5095 0.6824 0.3762 0.1351 0.2555 0.9773

Based on your simulation, what is the probability that the investment will yield
the MARR?

The cash flows and PW for five years is shown below.


Year Cash Flow PW
0 -1000 $ (1,000)
1 500 $ 417
2 500 $ 347
3 500 $ 289
4 500 $ 241
5 500 $ 201

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

We observe that 7 of the cases have a positive NPW, so an estimate of the


probability that the project returns the required MARR is 7/12.

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.

0.5153 0.3297 0.6807 0.0935 0.9872 0.6339


0.0858 0.3229 0.5285 0.4451 0.3177 0.1562

Combine these results with the results in part (b) to determine the probability that
the investment will yield the MARR.

We use the present worth factors in the table below.


Year PW factor
0 1.0000
1 0.8333
2 0.6944
3 0.5787
4 0.4823
5 0.4019
We use the 12 random numbers for part b to simulate the life of the project and
the 12 random numbers for part c to simulate the revenues from the project. To
compute the NPW in each case we multiply the annual revenues times the PW
factors and accumulate the values that fall below the simulated life. The values of
the NPW are shown in the last row of the table.

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

We observe that 4 of the cases have a positive NPW, so an estimate of the


probability that the project returns the required MARR is 4/12.

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.

Initial conditions Rate of change


No. of employees = 18,000 Increase per month = 2%
Average claim = $250 Increase per month = 1%
Contribution per employee = $125

Medical insurance costs for deterministic data


No. Employee Average claim Total Company
Month employees contribution per employee claims contribution
Initial 18,000 $2,250,000 $250 $4,500,000 $2,250,000
1 18,360 $2,295,000 $253 $4,635,900 $2,340,900
2 18,727 $2,340,900 $255 $4,775,904 $2,435,004
3 19,102 $2,387,718 $258 $4,920,136 $2,532,418
4 19,484 $2,435,472 $260 $5,068,725 $2,633,252
5 19,873 $2,484,182 $263 $5,221,800 $2,737,618
6 20,271 $2,533,865 $265 $5,379,498 $2,845,633
7 20,676 $2,584,543 $268 $5,541,959 $2,957,417
8 21,090 $2,636,234 $271 $5,709,326 $3,073,093
9 21,512 $2,688,958 $273 $5,881,748 $3,192,790
10 21,942 $2,742,737 $276 $6,059,377 $3,316,639
11 22,381 $2,797,592 $279 $6,242,370 $3,444,778
12 22,828 $2,853,544 $282 $6,430,890 $3,577,346
Total $33,030,746 $70,367,634 $37,336,889

15
Simulation 16

The growth rates are simulated from the prescribed distribution.

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

The results of 10 simulations are reported below. These were accomplished by


the Simulate command in the Random Variables Add-in.
Replication 1
Simulated Cell $I$43
Sample Size 10.
Mean $37,351,776
Stand. Dev. $453,086

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.

Queue Station Simulated Simulated Analytical


Type M/M/1 M/M/1/2 M/M/1/2
Mean Number at Station 2.57812505 0.97565962 0.85245895
Mean Time at Station 12.9250006 5.36624994 5.77777767
Mean Number in Queue 1.75265964 0.25658508 0.26229508
Mean Time in Queue 8.78666722 1.41125002 1.77777794
Mean Number in Service 0.82546541 0.71907454 0.59016389
Mean Time in Service 4.13833336 3.95499992 4
Throughput Rate 0.19946808 0.18181405 0.14754097
Efficiency 0.82546541 0.71907454 0.59016389
Probability Balk 0 0.33333333 0.2622951

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.

Customer Time between arrivals Service time


1 – 12
2 5 8
3 2 13
4 7 7
5 1 8
6 8 10
7 2 11
8 5 10
9 3 5
10 7 9

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.

The summarized results of 10 iterations of the Queueing Excel Simulation are


shown below together with the steady-state analytical results.
Lower Upper
Mean Std. Dev. Conf. Conf. Analytical
Mean Number at Station 3.6688 1.7748 3.1294 4.2083 4
Mean Time at Station 17.553 7.3385 15.323 19.784 20

19. Repeat the above exercise for 1000 customers.

The summarized results of 10 iterations of the Queueing Excel Simulation are


shown below together with the steady-state analytical results. Notice that the
standard deviation and the range of the confidence limits is reduced.
Lower Upper
Mean Std. Dev. Conf. Conf. Analytical
Mean Number at Station 4.0584 0.6815 3.8513 4.2656 4
Mean Time at Station 20.306 2.9109 19.421 21.191 20

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.

b. Same as part a for the random variable lead time, TL.

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).

Note that Table 18.19 is in error as well as Appendix A1 of the simulation


chapter. Equations A.6 and A.8 should use za/2 . Equation A.7 should use ta(n-1),
where the number in parentheses is the number of degrees of freedom (one less
than the sample size.)

Measures a za/2 e Demand


(D)
Estimated mean 11.65
Estimated standard deviation 2.594
Estimated size (n) for 1% error 0.01 2.5758313 0.1165 3290
Sample size (n) for 5% error 0.05 1.9599628 0.5825 77
Sample size (n) for 10% error 0.1 1.6448535 1.165 14

Measures a za/2 e Lead time


(TL)
Estimated mean 2.8
Estimated standard deviation 0.98
Estimated size (n) for 1% error 0.01 2.5758313 0.028 8127
Sample size (n) for 5% error 0.05 1.9599628 0.14 188
Sample size (n) for 10% error 0.1 1.6448535 0.28 33

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

Use a 0.05 level of significance and the following statistical tests:


a. Mann-Whitmey test
b. Matched t-test.
c. Analysis of variance test

Solution not available

30
Simulation 31

Exercises 26 - 30 are design problems. Use a simulation program to analyze the


situations and arrive at some conclusion. There are no "right" answers to these problems
since there are several measures of effectiveness in each case. Construct curves of the
performance measures computed as a function of the values of the decision variables.
Run the program at least 10 times for each parameter setting to determine the variability
of the simulation results.

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.

This is a trade-off between number of open windows and number of spaces to


allow for waiting cars. We show below the simulation of several systems with
number of windows ranging from 2 to 3 and maximum number in the system
ranging from 3 to 5. Each number in the table is an average of 3 simulation runs
each with 100 observations. Common seeds are used for the runs for each
alternative. It’s not possible to make a decision without more information about
the costs of the alternatives.

Type G/G/2/3 G/G/2/4 G/G/2/5 G/G/3/3 G/G/3/4 G/G/3/5


Mean Time at Station 2.90 3.53 4.23 2.46 2.60 2.85
Efficiency 0.80 0.89 0.93 0.60 0.68 0.73
Probability Balk 0.33 0.26 0.22 0.27 0.16 0.10

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.

We analyzed the 2-machine case with steady-state queueing analysis. We


analyzed the robotic case with four replications with 200 observations each. The
Robot column is the average of the four replications. The robot with a fixed
processing time is not as effective as the two machines, although the robot is
used more efficiently.
Summary 2 Machines 1 Robot
Type M/M/2 M/D/1
Mean Number at Station 1.01 2.27
Mean Time at Station 0.40 0.91
Mean Number in Queue 0.18 1.45
Mean Time in Queue 0.07 0.58
Mean Number in Service 0.83 0.82
Mean Time in Service 0.33 0.33
Efficiency 0.42 0.82

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.

The controllable parameter is the scheduled time between arrivals. We


investigate several alternatives in the table below. Each number is the result of
three replications of the simulation run. The replications used common seeds for
arrivals and services over the different options. The Queueing Simulator was
modified to terminate arrivals after 240 minutes. A maximum of 20 patients a day
were scheduled. Queueing data was collected for 240 minutes.
In the case of 12 minutes, patients are arriving at a greater rate than Dr. Stark
can handle them. Patients are not allowed to arrive after 240 minutes. Of course
it takes quite a while to complete the remaining patients. Although this results in
the greatest number of patients scheduled and increases the doctor’s efficiency
to almost 1, the average time in queue is quite high. On the other hand,
scheduling patients with an interval of 20 minutes, provides a more relaxed
schedule and smaller waiting times, but the doctor sees almost six patients fewer
than the 12 minute schedule. The optimum schedule depends on the trade-off
between patient convenience and the good doctor’s income.
To reduce the time required at the end of the day, it might be interesting to
investigate stopping the arrivals some time before 240 minutes.

Mean time between arrivals 12 15 18 20


Customers Served 19.67 17.67 16.33 14.00
Mean Number in Queue 3.96 2.47 1.50 1.10
Mean Time in Queue 48.54 34.40 23.63 18.94
Efficiency 0.96 0.92 0.86 0.82
Time Last Leaves 326.30 300.67 288.67 264.24

35
Simulation 36

30. A consortium of wealthy dot-com executives is planning to build a private airport


outside of Austin, Texas to better accommodate high-tech business travelers. It is
expected that there will be two busy periods in the day, 1 hour in the morning and 1
hour in the evening. During these times, the arrival rate is estimated to be 12 planes
per hour. Historical data show that arrivals occur at random and require the use of a
dedicated runway for about 10 minutes with a standard deviation of 3 minutes. How
many runways should be provided?

We simulate the airport as a multichannel queue. We stop arrivals after 60


minutes. The results for the number of runways ranging from 2 to 4 are shown
below. Although 2 runways can just handle the load, the queue time may be
excessive for planes waiting in the air for a runway to become available. With
more runways, the queue time goes to zero, but he efficiency of the runways
declines. As usual, this is a question of utilization of resources versus
convenience tot he customers.
Number of Runways 2 3 4
Mean Number in Queue 0.96 0.26 0.10
Mean Time in Queue 5.69 1.59 0.60
Efficiency 0.85 0.61 0.46
Time Last Landed 68.55 64.14 64.14

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.

a. Identify the components of this system in terms of entities, attributes of the


entities, activities and their associated events, and the calendar.

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).

Other events: arrivals of ships

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.

b. Draw a flow diagram embodying the logic of a simulation of the port.

37
Simulation 38

Container ship Unberth


source ship

Create
arrival Wait
for tug

Ship Tugs
queue idle Load

Railcars

Berths Pilot ship Arrival


Unload
empty to dock at dock

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.

One shift Two shifts


Production setup No Overtime With overtime No overtime With overtime
Maximum output 2000 2500 4000 5000
Costs ($1000s) 120 165 200 280

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

Total cost $3,159,000

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

Total cost $2,939,000

41
Simulation 42

33. (Deterministic model) Consider the operation of a single-track railway line


connecting stations A to B, B to C, C to D, and D to E. No more than one train can
be on the track between adjacent stations. A new train may enter a track segment
only when the previous train has cleared it. Trains may cross only at stations C and
D; station B does not have sufficient siding for two trains. Hence, no train may enter
the track from C to B if there is already a train traveling from A to B. However, a
second train may enter the track from A to B if there is already a train traveling from
B to C. The same rules also hold in the opposite direction. The sidings at each
station are not considered part of the track between adjacent stations. No more than
3 trains can be in each of stations C and D simultaneously. The travel and switching
times in minutes for regular and express trains are as follows.

Travel times Switching times


A-B B-C C-D D-E E-D D-C C-B B-A B C D
Regular 20 12 30 16 24 28 14 18 10 30 20
Express 15 8 15 12 16 24 10 14 0 5 5

The timetable provides the following departure times: at A in the direction


of E, regular at 8:00 AM, express at 10:00 AM, regular at 10:20 AM; at E in the
direction of A, express at 9:10 AM, regular at 9:30 AM, regular at 11:00 AM.
Simulate this operation using next event incrementation for the 4-hour period from
8 AM to 12 noon. At 8 AM, there is one regular train at station D ready to depart
toward A.

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:

for 0 £ q £ 50, $(100 - q) per unit


50 £ q £ 80, $50 per ton
80 £ q £ 100, $0.625 q per unit

Sales predictions are as follows:

Operating year Sales range Sales price/unit


1 20 to 60 unit per quarter $880
2 30 to 90 unit per quarter $890
from 3 on 40 to 100 unit per quarter $900

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?

We constructed an Excel simulation using the Simulation add-in. Here we are


using the first two rows of the random numbers appearing in thiis Exercise
section. The total net income over the 5 year period is $59,799.

46
Simulation 47

Unit Total Unit Total Net


Quarter RN. 1 Year Demand Prod. Cost Cost Rev. Rev. Rev.
0 0 0 0 0 0 0 0 0 0
1 0.005 1 8.6801 9 91 30819 880 7920 -22899
2 0.192 1 29.415 29 71 32059 880 25520 -6539
3 0.941 1 59.007 59 50 32950 880 51920 18970
4 0.72 1 47.087 47 53 32491 880 41360 8869
5 0.596 2 64.432 64 50 33200 890 56960 23760
6 0.206 2 45.037 45 55 32475 890 40050 7575
7 0.233 2 46.704 47 53 32491 890 41830 9339
8 0.711 2 70.146 70 50 33500 890 62300 28800
9 0.909 3 94.342 94 58.75 35523 900 84600 49078
10 0.994 3 115.82 100 62.5 36250 900 90000 53750
11 0.624 3 75.763 76 50 33800 900 68400 34600
12 0.684 3 78.735 79 50 33950 900 71100 37150
13 0.748 4 82.187 82 51.25 34203 900 73800 39598
14 0.187 4 53.786 54 50 32700 900 48600 15900
15 0.069 4 42.947 43 57 32451 900 38700 6249
16 0.399 4 65.332 65 50 33250 900 58500 25250
17 0.527 5 71.235 71 50 33550 900 63900 30350
18 0.291 5 59.96 60 50 33000 900 54000 21000
19 0.388 5 64.81 65 50 33250 900 58500 25250
20 0.965 5 103.05 100 62.5 36250 900 90000 53750
Total Net Rev. 5 9 7 9 9

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

Grand Average 42768


Std. Deviation 70237

c. (Computer implementation) Write a computer program to perform this


simulation. Make 100 runs, each over a 10-year period, discounting the
quarterly cash flows at a rate of 3 percent per quarter. Construct a frequency
histogram of the net discounted cash flows containing about 10 class intervals.

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.

Sample Size 100.


Mean 140.8403
Stand. Dev. 50.8193
Minimum 31.7947
Maximum 288.9116
Median 150.5611
Mid Range Frequency
31.79 0.
44.6455 0.09
70.3565 0.08
96.0675 0.09
121.7785 0.15
147.4895 0.17
173.2005 0.25
198.9115 0.14
224.6225 0.01
250.3335 0.01
276.0445 0.
288.9 0.01

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.

We must sample from an exponential distribution with rates lA = 0.2/min and lB


= 0.25/min to determine the times between arrivals at the locks in canals A and
B, respectively. Because entities 9 and 10 are already scheduled, the first
random number on the list, 56, is used to simulate the arrival of a boat to the lock
at canal A. Using the formula x = -1
l
ln(u) , where u = 56/100, we get x = 2.89.
Rounding to the nearest integer, the next arrival to canal A is 11:02 + 3 = 11:06.
The same logic was used to simulate the remaining arrivals. The results for all
operations are shown in the table.

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

Number of lock movements: 3


Number of boats moved: 8 down, 4 up
Number of arrivals at A: 10, at B: 6
Waiting time (including boats already there) at A: 189 min, at B: 236 min.

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)

Calendar ([arrival at a work center, time], [completion at a work center, time];


must be specified for each job)

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.”

REMOVE FIRST EVENT


NEXT FSE
EVENT SCHEDULED ON OR AFTER
TIME t FROM FSE

UPDATE TIME t

WHAT TYPE EVENT

WORK CENTER WORK CENTER WORK CENTER


X COMPLETED Y COMPLETED Z COMPLETED

i FILE i
YES NO
FILE i EMPTY

WORK CENTER i START WORK FILE i


IDLE ON HIGHEST
PRIORITY JOB

GENERATE JOB COMPLETION FSE


TIME AND ENTER IN FSE

YES LAST PROCESS NO


FOR JOB ?
WHAT PROCESS
CANCEL JOB, IS NEXT ?
RECORD
STATISTICS X Z
Y

i
YES NO
CENTER i IDLE?

STATUS: CENTER i BUSY. ENTER JOB IN


FILE i FILE i
GENERATE JOB
COMPLETION TIME AND FSE
ENTER IN FSE

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.

Time Completion Calendar Status† Files‡ Completions


job center center job time X Y Z X Y Z job time
(Status at 100) X 1 124 B B I 3 in 7 in
Y 2 180 4 in 8 in
5 in 9 in
6 in 10 in
124 1 X Z 1 318 B
124 X 3 171 B 3 out
171 3 X X 4 321 B 4 out 3 171
180 2 Y Y 7 375 B 7 out 2 in
318 1 Z Z 2 533 B 2 out 1 318
321 4 X X 5 457 B 5 out 4 in
375 7 Y Y 8 594 B 7 in 8 out
457 5 X X 6 645 6 out 5 in
480 end


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.

Solution not available

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)

Most imminent events (entities jointly engaged in each activity)


Arrival of pick-up request
Dispatcher finishes taking pick-up order
Dispatcher finishes assigning job to driver
Driver returns after completing pick-u[

Conditions to be checked to see if other activities can be started or completed


(entities jointly engaged in each activity)
Dispatcher starts pick-up request
Dispatcher starts assigning job to driver
Driver starts pick-up assignment

Calendar (Event, Entities associated with event, Scheduled time of event)

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 Create Job


arrives job file

Call Start
Dispatchers
waits assignment
idle

Call - Assign job


taken - Interupt call

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.

An assignment is started as soon as at least one dispatcher and one driver is


free. After the assignment ends, the pick-up is made and the paperwork is filed.
The driver then returns to the driver idle node where he or she awaits another
assignment.

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

File of scheduled Dispatch File of


Time Event Entities Calls Status Order idle
† waiting 1 2 file drivers
Event Entity Time X
Status at time zero
0 C1 in D1 100 x I B 1 in
C0 end D2 80 x 2 in
jobs V5 240 3 in
V6 1250 4 in
V7 680
V8 560
V9 1650
V10 960
V11 180 x
V12 1140
V13 1370
V14 510
V15 870
V16 1410
80 C0 end D2 Asn 0 D2/V1 140 x I B 1 out
100 C1 in D1 C1 end D1 220 x B B
C2 in D2 110 x
110 C2 in D2 C2 end D2 240 x B B
Reasn 0 D2/V1 270 x
C3 in D1 200 x
180 J end V11 11 in
200 C3 in D1 C4 in D2 390 3 in B B
220 C1 end D1 C3 end D1 350 3 out B B 1 in
240 C2 end D2 B B 2 in
270 Reasn 0 D2/V1 JO end V1 1960 B B
Asn 1 D2/V2 330 B B 1 out 2 out
etc.


X = event has been processed, I = idle, B = busy

59

You might also like