Operation Research Models and Methods.pdf ( PDFDrive.com )

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

Views 207 Downloads 22 File size 2MB

Report DMCA / Copyright

DOWNLOAD FILE

Recommend stories

Citation preview

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

6.

2

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 linear programming problem whose feasible region is shown in the accompanying diagram. The axes intercepts of the lines are:

x2

Grid size = 1

2

4

Line 1: (0, 1) and (2, 0)

3

Line 2: (0, 2.5) and (-5, 0) Line 3: (0, -5) and (4, 0) Line 4: (0, 8) and (6, 0).

1

x1

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

x1 intercept (j) 2 -5

x2 intercept (k) 1 2.5

(0, 0) feasible? No Yes

Constraint 0.5x1 + x2 ≥ 1 -0.2x1 + 0.4x2 £ 1

Linear Programming Models

C3 C4

4 6

-5 8

Yes Yes

2

0.25x1 - 0.2x2 £ 1 0.167x1 + 0.125x2 £ 1

Linear Programming Models

2.

3

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

c. The solution is unbounded.

b. Point 3 and all points above the point on line 3. There are an infinite number of alternative optima. d. The solution is unbounded.

e. The solution is unbounded.

f. Point 0

g. The solution is unbounded.

Linear Programming Models

3.

4

Consider the linear programming model shown below. a. Graph the feasible region using a 2-dimensional grid. Show an isovalue contour for the objective function and indicate the direction of decrease. Identify the optimal solution on the graph.

Minimize z = 2x1 + x2 subject to

–x1 + 2x2 £ 10

(1)

x1 – 2x2 £ 4

(2)

x1 + x2 ≥ 8

(3)

x1 + 2x2 ≥ 20

(4)

x1 ≥ 0, x2 ≥ 0

(5)

b. Graphically perform a sensitivity analysis for each of the objective function coefficients and each of the right-hand-side constants.

x2

unbounded feasible region

Grid size = 1 (1)

10

(2)

(4)

(3) 10

x1

Sensitivity Analysis Variable

Analysis

Num.

Name

1 2

X1 X2

Constraint Num.

Name

1 2 3 4

Con1 Con2 Con3 Con4

Objective Value: Objective Value Status Reduced Cost Coefficient 5 . Basic 7 . 5 Basic

0. 0.

17.5 Range Lower Range Upper Limit Limit

2. 1.

0.5 -4.

--4.

Analysis Value Status 10. 0. 12.5 20.

Upper Basic Basic Lower

Shadow Price -0.75 0. 0. 1.25

Constraint Limit 10. 4. 8. 20.

Range Lower Range Upper Limit Limit -4. -10.

20. ---

14.

---

---

12.5

Linear Programming Models

c1 = 0.5

5

c1 = •

x2 10

x2 10

(1)

(1)

(2) (3)

(2)

(4)

(3)

(4)

10 x1

10 x1

c2 = -4

c2 = 4

x2 10

x2 10

(1)

(1)

(2) (3)

(2) (3)

(4)

(4)

10 x1

10 x1

b1 = -4

b1 = 20 (1) x2 10

x2 10 (1)

(2)

(2) (3)

(4) 10 x1

(3)

(4) 10

Linear Programming Models

b2 = -10

6

b3 = 12.5

x2 10

x2 10

(1) (2)

(1)

(2) (3)

(3) (4)

(4) 10 x1

10 x1

For b2 = •, constraint 2 moves down and off the picture b4 = 14 x2 10

(1)

(2) (4)

(3)

For b3 = -•, constraint 3 moves down and off the picture. As b4 increases the optimum increases along the constraint (1) line. There is no limit to the increase, so the upper limit is •.

x2 10

(1) (4)

10 x1

For b2 = •, constraint 2 moves down and off the picture

(2) (3) 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 Goal: Max P r o f i t : 3347.3 Variables Name: Values:

Linear Obj. Coef.: aints Name M1 M2 M3 M4

Value 160 200 160 280

Rel. 0 x5> 0 x6> 0

= 0 = 15 = 10 = 2 = 2.5

Linear Programming Methods

2

b. x

2

5

3

2

4

4

3

OPTIMUM

2 1

1 0 0

1

2

3

4

5

x

1

c. Corner Nonbasic Basic Solution Feasibility Objective (Yes, No) Value Point Variables Variables (x1, ..,x6) –––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––---#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

2.

4

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

3.

6

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

4.

8

Given the following linear program, Minimize z = x1

+ 2.5x2 + x3

subject to

+ x2

x1

+ x2

≥ 10 + 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

5.

9

The tableau below is not in the simplex form. Coefficients Row Basic z 0 1 2

x1

z 1 0 0

1 1 0

x2

x3

–1 5 8

–1 –1 1

x4

x5

0 1 2

RHS 2 20 12 12 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

x1

+ 5x2 - x3

- x3

+2x5 = 20 + x4

+ 8x2 + x3 + 2x4

+12x5 = 12 +16x5 = 16

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

Basic var. Z x1 x4

Z 1 0 0

x1 0 1 0

Coefficients x2 x3 –2 0.5 1 –1.5 4 0.5

x4 0 0 1

Right Side 16 4 8

x5 -1 4 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. Z x1 x5 0 16 4 0.5 16.5 2 1 17 0 2 18 -4

x4 8 4 0 -8

Linear Programming Methods

d. Increasing x3 changes the objective value x1 and x4. x3 Z x1 0 16 4 0.5 15.75 4.75 1 15.5 5.5 2 15 7

10

x4 8 7.75 7.5 7

Linear Programming Methods

6.

a. b. c.

11

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 obtained, 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. Allow x2 to replace x4 as a basic variable. Allow x5 to replace x4 as a basic variable. Allow x5 to replace x1 as a basic variable. The tableau found in part b is

Row Number 0 1 2

Basic Basic Index Variables 0 z 1 X1 4 X4

1 X1

z 1 0 0

2 X2 0 1 0

-2 1 4

3 X3 0.5 -1.5 0.5

4 X4

5 X5 0 0 1

-1 4 8

Right Side 16 4 8

a Allow x2 to replace x4 as a basic variable. The solution is optimal. Row Number 0 1 2

Basic Basic Index Variables 0 z 1 X1 2 X2

1 X1

z 1 0 0

2 X2 0 1 0

0 0 1

3 X3 0.75 -1.625 0.125

4 X4 0.5 -0.25 0.25

5 X5 3 2 2

Right Side 20 2 2

b. Allow x5 to replace x4 as a basic variable. The solution is not optimal and it is degenerate. Row Number 0 1 2

Basic Basic Index Variables 0 z 1 X1 5 X5

1 X1

z 1 0 0

0 1 0

2 3 X2 X3 -1.5 0.5625 -1 -1.75 0.5 0.0625

4 X4 0.125 -0.5 0.125

5 X5 0 0 1

Right Side 17 0 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 Number 0 1 2

Basic Basic Index Variables 0 z 5 X5 4 X4

z 1 0 0

1 X1 0.25 0.25 -2

2 X2 -1.75 0.25 2

3 X3 0.125 -0.375 3.5

4 X4

5 X5 0 0 1

0 1 0

Right Side 17 1 0

Linear Programming Methods

7.

12

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 Number 0 1 2 3

Basic Basic Index Variables 0 z 3 X3 4 X4 1 X1

1 X1

z 1 0 0 0

2 X2 0 0 0 1

3 X3 4 4 -3 2

z

4 X4 0 1 0 0

5 X5 0 0 1 0

4 x2 4 x2 + x3

Feasible region in terms of x2 and x5

-3 -1 2 -1

Right Side 30 40 20 10

– 3 x5 = 30 – x5 = 20

3 x2

+ x4 + 2 x5 = 35

x1 +2 x2

– x5 = 5

Linear Programming Methods

13

Point #2: x1 and x5 are nonbasic Row Number 0 1 2 3

Basic Basic Index Variables 0 z 3 X3 4 X4 2 X2

1 X1

z 1 0 0 0

2 X2

-2 -2 1.5 0.5

3 X3 0 0 0 1

4 X4 0 1 0 0

5 X5 0 0 1 0

-1 1 0.5 -0.5

z -2x1

Right Side 10 20 35 5

– x5 = 10 + x3

-2x1 1.5x1

+ x5 = 20 + x4+ 0.5x5= 35

0.5x1 + x2

– 0.5x5 = 5

Point #3; x1 and x3 are nonbasic. Row Number 0 1 2 3

Basic Basic Index Variables 0 z 5 X5 4 X4 2 X2

1 X1

z 1 0 0 0

-4 -2 2.5 -0.5

2 X2

3 X3 0 0 0 1

z

1 1 -0.5 0.5

4 X4

5 X5 0 0 1 0

0 1 0 0

Right Side 30 20 25 15

-4x1

+ x3

-2x1

+ x3

+ x5

= 20

2.5x1

-0.5x3

+ x4

= 25

-0.5x1 + x2 + 0.5x3

= 30

= 15

Linear Programming Methods

14

Point #4; x3 and x4 are nonbasic. Row Number 0 1 2 3

Basic Basic Index Variables 0 z 5 X5 1 X1 2 X2

1 X1

z 1 0 0 0

2 X2 0 0 1 0

0 0 0 1

3 X3 0.2 0.6 -0.2 0.4

z

4 X4 1.6 0.8 0.4 0.2

5 X5 0 1 0 0

+ 0.2x3+ 1.6x4

Right Side 70 40 10 20

= 70

+ 0.6x3+ 0.8x4 + x5 = 40 0.2x3+ 0.4x4 = 10

x1

+ x2+ 0.4x3+ 0.2x4

= 20

Point #5; x2 and x4 are nonbasic. Row Number 0 1 2 3

Basic Basic Index Variables 0 z 5 X5 1 X1 3 X3

1 X1

z 1 0 0 0

0 0 1 0

2 3 X2 X3 -0.5 0 -1.5 -1E-08 0.5 0 2.5 1

z

4 X4 1.5 0.5 0.5 0.5

5 X5 0 1 0 0

Right Side 60 10 20 50

-0.5x2

+ 1.5x4

-1.5x2

+ 0.5x4 + x5 = 10 + 0.5x4 = 20

x1+ 0.5x2

+ 2.5x2 + x3+ 0.5x4

= 60

= 50

Linear Programming Methods

8.

15

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 Variables z X3 X4 X8 X9 X2

z 1 0 0 0 0 0

1 X1 -0 2 -2 0 0 1

2 X2 -0 0 0 0 0 1

3 X3

4 X4 0 1 0 0 0 0

0 0 1 0 0 0

5 X5 -0.2 1 -1 0 0 1

6 X6 0.2 0 1 1 2 -1

7 X7 -0.2 -1 2 1 1 -1

8 X8

9 X9 0 0 0 1 0 0

0 0 0 0 1 0

10 Right X 10 Side 0.6 11 2 5 -4 0 -3 12 -9 9 3 3

a) If x1 enters the basis, then x3 will leave the basis, the objective does not change. Basic Variables z X1 X4 X8 X9 X2

1 X1

z 1 0 0 0 0 0

2 X2 0 1 0 0 0 0

3 X3 0 0 0 0 0 1

4 X4

0 0.5 1 0 0 -0.5

0 0 1 0 0 0

5 X5 -0.2 0.5 0 0 0 0.5

6 X6 0.2 0 1 1 2 -1

7 X7 -0.2 -0.5 1 1 1 -0.5

8 X8

9 X9 0 0 0 1 0 0

0 0 0 0 1 0

10 Right X 10 Side 0.6 11 1 2.5 -2 5 -3 12 -9 9 2 0.5

b. If x5 enters the basis, then x2 will leave the basis. Objective increases. Basic Variables z X3 X4 X8 X9 X5

z 1 0 0 0 0 0

1 X1 0.2 1 -1 0 0 1

2 X2 0.2 -1 1 0 0 1

3 X3

4 X4 0 1 0 0 0 0

0 0 1 0 0 0

5 X5 3E-09 0 0 0 0 1

6 X6 -0 1 0 1 2 -1

7 X7 -0.4 0 1 1 1 -1

8 X8

9 X9 0 0 0 1 0 0

0 0 0 0 1 0

10 Right X 10 Side 1.2 11.6 -1 2 -1 3 -3 12 -9 9 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 Variables z X3 X6 X8 X9 X2

z 1 0 0 0 0 0

1 X1 0.4 2 -2 2 4 -1

2 X2

3 X3 0 0 0 0 0 1

0 1 0 0 0 0

4 5 X4 X5 -0.2 3E-09 0 1 1 -1 -1 1 -2 2 1 0

6 X6 -0 0 1 0 0 0

7 X7 -0.6 -1 2 -1 -3 1

8 X8

9 X9 0 0 0 1 0 0

0 0 0 0 1 0

10 Right X 10 Side 1.4 11 2 5 -4 0 1 12 -1 9 -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

Basic Variables z X3 X6 X8 X9 X2

Basic Variables z X3 X7 X8 X9 X2

2 X2

1 0 0 0 0 0

1 X1 0.4 2 -2 2 4 -1

2 X2

1 0 0 0 0 0

1 X1 -0.2 1 -1 1 1 0

z

z

3 X3 0 0 0 0 0 1

6 X6 -0 0 1 0 0 0

7 X7 -0.6 -1 2 -1 -3 1

8 X8

0 1 0 0 0 0

4 5 X4 X5 -0.2 3E-09 0 1 1 -1 -1 1 -2 2 1 0

6 7 X6 X7 0.3 3E-09 0.5 0 0.5 1 0.5 0 1.5 0 -0.5 0

8 X8

0 1 0 0 0 0

4 X4 0.1 0.5 0.5 -0.5 -0.5 0.5

3 X3 0 0 0 0 0 1

16

5 X5 -0.3 0.5 -0.5 0.5 0.5 0.5

9 X9 0 0 0 1 0 0

0 0 0 0 1 0

10 Right X 10 Side 1.4 11 2 5 -4 0 1 12 -1 9 -1 3

0 0 0 0 1 0

10 Right X 10 Side 0.2 11 0 5 -2 0 -1 12 -7 9 1 3

9 X9 0 0 0 1 0 0

e. If x10 enters the basis, then x2 will leave the basis. The objective will decrease. Basic Variables z X3 X4 X8 X9 X 10

z 1 0 0 0 0 0

1 2 X1 X2 -0.2 -0.2 1.333 -0.67 -0.67 1.333 1 1 3 3 0.333 0.333

3 X3

4 X4 0 1 0 0 0 0

0 0 1 0 0 0

5 6 7 X5 X6 X7 -0.4 0.4 8E-09 0.333 0.667 -0.33 0.333 -0.33 0.667 1 0 0 3 -1 -2 0.333 -0.33 -0.33

8 X8

9 X9 0 0 0 1 0 0

0 0 0 0 1 0

10 Right X 10 Side -0 10.4 0 3 0 4 0 15 0 18 1 1

Linear Programming Methods

9.

17

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 0 x1 1 x4 2

x1

z 1 0 0

0 1 0

x2

x3

–2 1 4

2 –1 1

x4 0 0 1

x5

RHS –2 –2 4 4 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

x1

z

Row Basic z 0 x3 1 x2 2 x6 3

1 0 0 0

x2

–3 4 2 1

x3

0 0 1 0

x4

0 1 0 0

x5

–3 5 –3 2

x6

–2 –3 1 –2

0 0 0 1

RHS 10 4 2 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 Variables z X1 X2 X6

1 X1

z 1 0 0 0

2 X2 0 1 0 0

0 0 1 0

3 X3 0.75 0.25 -0.5 -0.25

4 X4 0.75 1.25 -5.5 0.75

5 X5 -4.25 -0.75 2.5 -1.25

6 X6

4 X4

6 X6

0 1 0 0

5 X5 -3.8 -0.6 -0.8 -0.8

6 X6

-9 -4 -3 -4

5 X5 1E-07 2E-07 1 9E-08

0 0 0 1

Right Side 3 1 0 1

0 0 0 1

Right Side 2.4 0.8 4.4 0.4

0 0 0 1

Right Side 4 10 2 6

x1 enters the basis and x2 leaves the basis b. x4 enters the basis and x3 leaves the basis Basic Variables z X4 X2 X6

z 1 0 0 0

1 X1 -0.6 0.8 4.4 -0.6

2 X2 0 0 1 0

3 X3 0.6 0.2 0.6 -0.4

c. x5 enter the basis and x2 leaves the basis Basic Variables z X3 X5 X6

1 X1

z 1 0 0 0

1 10 2 5

2 X2 2 3 1 2

3 X3 -4E-08 1 -1E-08 -3E-08

4 X4

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 Variables z X1 X2 X6

1 X1

z 1 0 0 0

2 X2 0 1 0 0

0 0 1 0

3 X3 0.75 0.25 -0.5 -0.25

4 X4 0.75 1.25 -5.5 0.75

5 X5 -4.25 -0.75 2.5 -1.25

6 X6

4 X4 -7.5 11 -1.5 3.5

5 X5 -0.5 -5 0.5 -2.5

6 X6

0 0 0 1

Right Side 3 1 0 1

0 0 0 1

Right Side 3 0 1 1

b. x1 enters the basis and x2 leaves the basis Basic Variables z X3 X1 X6

1 X1

z 1 0 0 0

0 0 1 0

2 X2 1.5 -2 0.5 -0.5

In both cases the solution is degenerate.

3 X3 0 1 0 0

Linear Programming Methods

22

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

x1

z

Row Basic z 0 x3 1 x4 2 x6 3

1 0 0 0

x2

–3 2 –2 4

x3

2 0 1 2

x4

0 1 0 0

x5 0 0 1 0

–1 0 –7 –2

x6 0 0 0 1

RHS 4 13 7 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 Variables z X3 X4 X1

1 X1

z 1 0 0 0

0 0 0 1

2 X2 3.5 -1 2 0.5

3 X3

4 X4

2 X2

3 X3 2.5 1 8 0.5

0 1 0 0

0 0 1 0

5 X5 -2.5 1 -8 -0.5

6 X6 0.75 -0.5 0.5 0.25

Right Side 5.5 12 8 0.5

5 X5

6 X6 -0.5 -0.5 -3.5 0

Right Side 35.5 12 104 6.5

Iteration 2 Basic Variables z X5 X4 X1

1 X1

z

Unbounded

1 0 0 0

0 0 0 1

1 -1 -6 0

4 X4 0 0 1 0

0 1 0 0

Linear Programming Methods

23

13. Find all alternate optima in the following tableau. Coefficients

x1

z

Row Basic z 0 x3 1 x2 2

1 0 0

x2

0 4 2

x3

0 0 1

x4

0 1 0

x5

0 5 –3

x6

2 –3 1

4 2 3

RHS 10 4 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 Variables z X4 X2 Basic Variables z X1 X2

1 X1

z 1 0 0

0 0.8 4.4 1 X1

z 1 0 0

2 X2

0 1 -3E-08

3 X3 0 0 1

2 X2

0 0.2 0.6 3 X3

0 0 1

4 X4

0 0.25 -0.5

5 X5 0 1 0

4 X4 0 1.25 -5.5

2 -0.6 -0.8 5 X5 2 -0.75 2.5

6 X6 4 0.4 4.2 6 X6

Right Side 10 0.8 4.4

Right Side 4 10 0.5 1 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 ≥ –3

x1

x1 and x2 unrestricted

Let x1 = y1 – y1’ and x2 = y2– y2’ Minimize z =3y1 -3y1’ + 2y2 - 2y2’ subject to

–y1

+y1’

+ y2

–y2’

y1

–y1’

+ 2y2

–2y2’

–y1

+y1’

= 11 ≥ 10

£ 3

y1, y2, y1’, y2’ ≥ 0

ints Name Con1 Con2 Con3

Variables Name: Values: Lower Bounds: Upper Bounds:

1 y1

2 y1'

3 y2

4 y2'

0 0 10000

3 0 10000

8 0 10000

0 0 10000

Linear Obj. Coef.:

3

-3

2

-2

Value 11 13 3

Rel. = >= =

RHS 20 -20 20 -20 -5 -5

X-

Linear Constraint Coefficie 1 1 -2 1 1 -2 1 -1 0 1 -1 0 1 0 -1 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 x’ + y’ £ 30

subject to

x’ + y’ ≥ –10 x’ – y’ £ 20 x’ – y’ ≥ –20 x’ ≥ 0 y’ ≥ 0

ints Name Con1 Con2 Con3 Con4

Value 0 0 0 0

Name: Values: Lower Bounds: Upper Bounds:

x'

y'

0 0 10000

0 0 10000

Linear Obj. Coef.:

1

1

Rel. = =

RHS 30 -10 20 -20

Linear Constraint 1 1 1 1 1 -1 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 Variables z art1 art2 art3

Basic Variables z art1 X2 art3

Basic Variables z X1 X2 art3

1 X1

z

2 X2

1 0 0 0

-3 4 -2 1

2 X2

1 0 0 0

1 X1 -19 20 -2 -1

1 X1

2 X2

z

z 1 0 0 0

0 1 0 0

3 X3 -8 8 1 -1

4 X4 1 0 -1 0

3 X3

5 art1 1 0 0 -1

4 X4

0 0 1 0

-7 8 -1 -1

0 0 1 0

3 X3 0.6 0.4 -0.2 -0.6

6 art2 0 1 0 0

5 art1

7 art3 0 0 1 0

6 art2

1 0 0 -1

0 1 0 0

8 -8 1 1

1 0 0 -1

5 art1 0.95 0.05 0.1 0.05

6 art2 0.4 -0.4 0.2 0.6

4 X4

0 0 0 1

Right Side -33 30 3 0

0 0 0 1

Right Side -9 6 3 3

0 0 0 1

Right Side -3.3 0.3 3.6 3.3

7 art3

7 art3

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

+ x3 – 4x4

– x2 + 3x3 – 5x4 £ 20

2x1

x1 + 2x2

– x3 + 4x4 ≥ 2 x4 £ 20

xj ≥ 0, j = 1,…, 4 Initial Phase 1 tableau, art1 is the artificial variable. Basic Variables z X5 art1 X7

1 X1

z 1 0 0 0

2 X2 -1 2 1 0

3 X3 -2 -1 2 0

4 X4 1 3 -1 0

5 X5 -4 -5 4 1

6 X6 0 1 0 0

7 X7 1 0 -1 0

8 art1 0 0 0 1

0 0 1 0

Right Side -2 20 2 20

Iteration 1 : x4 enters the basis and art1 leaves. This tableau is optimum for phase 1. Basic Variables z X5 X4 X7

1 X1

z 1 0 0 0

0 3.25 0.25 -0.25

2 X2 0 1.5 0.5 -0.5

3 X3

4 X4

0 1.75 -0.25 0.25

5 X5 0 0 1 0

6 X6 0 1 0 0

7 X7

0 -1.25 -0.25 0.25

8 art1

Right Side

0 0 0 1

1 1.25 0.25 -0.25

0 22.5 0.5 19.5

0 0 0 1

8 art1 9998 1.25 0.25 -0.25

Right Side -2 22.5 0.5 19.5

Substitute original objective function to begin phase 2. Basic Variables z X5 X4 X7

1 X1

z 1 0 0 0

-3 3.25 0.25 -0.25

2 X2 1 1.5 0.5 -0.5

3 X3 0 1.75 -0.25 0.25

4 X4

5 X5 0 0 1 0

6 X6 0 1 0 0

1 -1.25 -0.25 0.25

7 X7

Linear Programming Methods

30

20. Consider the linear program. Maximize z = 2x1 + 3x2 + x3 subject to

x1

– x3

+ 4x4 + x4 £ 5 + x4 £ 6

–x1 + 2x2

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 0 x1 1 x6 2 x3 3

x1

z 1 0 0 0

0 1 0 0

x2 –1.5 0.5 2.5 0.5

x3

x4

x5

0 –1.25 0 1.25 0 2.25 1 0.25

x6 2 1 1 0

x7 0 0 1 0

1.5 0.5 0.5 0.5

RHS 22 9 15 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 Variables z X1 X6 X7

1 X1

z 1 0 0 0

2 X2 0 1 0 0

3 X3 -3 0 2 1

4 X4 -3 -1 -1 2

-2 1 2 0.5

5 X5

6 X6 2 1 1 0

7 X7 0 0 1 0

0 0 0 1

Right Side 10 5 11 8

Linear Programming Methods

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.

32

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 Variables z X3 X4 art1 X6

f

1 X1

z 1 0 0 0 0

2 X2 -1 -1 1 1 1

3 X3 -1 2 -2 1 2

4 X4 0 1 0 0 0

5 X5 0 0 1 0 0

6 X6 1 0 0 -1 0

7 art1 0 0 0 0 1

0 0 0 1 0

Right Side -8 10 40 8 20

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

x1

z

Row Basic z 0 x3 1 x1 2

1 0 0

x2

0 0 1

2 2 –1

x3

x4

0 1 0

RHS 3 –5 6 4 –2 –4

Starting tableau Row Basic Basic Number Index Variables 0 0 z 1 3 X3 2 1 X1 Dual Ratio

1 X1 1 -4E-08 0 -9E-08 0 1 ----z

2 X2 2 2 -1 2

3 X3 -1E-08 1 -6E-17 ---

4 X4 3 6 -2 1.5

Right Side -5 4 -4

Iteration 1: x1 leaves the basis and x4 enters the basis. Row Basic Basic Number Index Variables 0 0 z 1 3 X3 2 4 X4 Dual Ratio

z 1 0 0 ---

1 X1 1.5 3 -0.5 ---

2 3 X2 X3 0.5 -1E-08 -1 1 0.5 3E-17 0.5 ---

4 X4 0 0 1 ---

Right Side -11 -8 2

Iteration 2: x2 leaves the basis and x3 enters the basis. Row Basic Basic Number Index Variables 0 0 z 1 2 X2 2 4 X4 Dual Ratio

1 X1

z 1 0 0 ---

3 -3 1 ---

2 X2 3E-08 1 1E-08 ---

3 X3 0.5 -1 0.5 ---

4 X4 0 0 1 ---

Right Side -15 8 -2

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 Number 0 1 2

Basic Basic Index Variables 0 z 2 X2 3 X3

1 X1

z 1 0 0

2 X2 7 2 -2

3 X3 0 1 0

4 X4 0 0 1

2 1 2

Right Side 8 4 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 Number 0 1 2

Basic Basic Index Variables 0 z 2 X2 3 X3 Dual Ratio

1 X1

z 1 0 0 ---

2 X2

7 2 -2 3.5

3 X3 0 1 0 ---

4 X4 0 0 1 ---

2 1 2 ---

Right Side 8 2 -2

We use the dual simplex to reoptimize. x1 is selected to leave the basis and x1 enters. The tableau is now optimum. Row Number 0 1 2

Basic Basic Index Variables 0 z 2 X2 1 X1

1 X1

z 1 0 0

2 X2 0 0 1

0 1 0

3 X3 3.5 1 -0.5

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

4 X4 9 3 -1

Right Side 1 0 1

Linear Programming Methods

Basic Basic Index Variables 0 z 2 X2 3 X3

1 X1

z 1 0 0

2 X2 -8 2 -2

3 X3 0 1 0

36

4 X4 0 0 1

-3 1 2

Right Side 8 4 4

We use the primal simplex to reoptimize. x1 enters and x2 leaves to obtain the new optimum. Basic Basic Index Variables 0 z 1 X1 3 X3

1 X1

z 1 0 0

2 X2 0 1 0

3 X3

4 0.5 1

4 X4 0 0 1

1 0.5 3

Right Side 24 2 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 Index Variables 0 z 2 X2 3 X3 5 X5 Dual Ratio

1 X1

z 1 0 0 0 ---

2 X2

7 2 -2 -2 3.5

3 X3 0 1 0 0 ---

4 X4 0 0 1 0 ---

5 X5

2 1 2 -1 0.5

0 0 0 1 ---

Right Side 8 4 4 -3

We select x5 to leave the basis and x4 enters. Now x3 is negative. Basic Basic Index Variables 0 z 2 X2 3 X3 4 X4 Dual Ratio

1 X1

z 1 0 0 0 ---

2 X2

3 0 -6 2 0.5

3 X3 0 1 0 0 ---

4 X4 0 0 1 0 ---

5 X5 0 0 0 1 ---

2 1 2 -1 ---

Right Side 2 1 -2 3

We select x3 to leave the basis and x1 enters to obtain the new optimum solution. Basic Basic Index Variables 0 z 2 X2 1 X1 4 X4

1 X1

z 1 0 0 0

2 X2 0 0 1 0

0 1 0 0

3 X3 0.5 0 -0.167 0.3333

4 X4

5 X5 0 0 0 1

3 1 -0.333 -0.333

Right Side 1 1 0.3333 2.3333

Linear Programming Methods

37

24. Consider the following problem with the tableau indicating the optimal solution. Maximize z = 2x1 + 5x2 + x3 + 4x4 3x2 + 2x3

– x4 £ 5

–x1 + 2x2 + 2x3

£ 6

subject to

x1 + x2 + x3 + x4 £ 8 xj ≥ 0, j = 1,…, 4 Coefficients

x1

x2

x3

1 1.5 0 –0.5 0 1.5 0 3

0 1 0 0

4 1 0 –1

z

Row Basic z 0 x2 1 x4 2 x5 3

x4 0 0 1 0

x5

x6

0 0.5 0 0.5 0 –0.5 1 –2

x7

RHS 35 3 5 1

4 0 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 Index Variables 0 z 2 X2 4 X4 5 X5 Dual Ratio

z 1 0 0 0 ---

1 X1 1.5 -0.5 1.5 3 ---

2 X2

3 X3

0 1 0 0 ---

4 X4 4 -3E-07 1 0 1E-08 1 -1 0 4 ---

5 X5 -5E-09 0 -1E-08 1 ---

6 X6 0.5 0.5 -0.5 -2 0.25

7 X7 4 0 1 1 ---

Right Side 17 5 -2 -16

b. For the dual simplex method, we allow x5 to leave the basis and x6 enter. The resulting tableau is optimal. Only one iteration is necessary. The solution now is: (x2 = 1, x4 = 2, x6 = 8).

Linear Programming Methods

Basic Basic Index Variables 0 z 2 X2 4 X4 6 X6

z 1 0 0 0

1 X1 2.25 0.25 0.75 -1.5

2 X2 0 1 0 0

3 4 X3 X4 3.75 -3E-07 0.75 0 0.25 1 0.5 0

38

5 X5 0.25 0.25 -0.25 -0.5

6 X6 1E-08 1E-08 6E-17 1

7 X7 4.25 0.25 0.75 -0.5

Right Side 13 1 2 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 effectiveness 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

+ x4

+ x5 £ 12

2x2 + x3 + 2x4

+ x5 £ 15

2x1

+ 2x3

+ x5 £ 15

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

+ x4

+ 6x5 £ 60 + 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 2 1 2 1˙ Í0 1 0 0 A = Í1 1 0 0 1˙, I = Í0 0 1 0 Í ˙ Í Í5 7 4 5 6˙ Í0 0 0 1 ÎÍ1 1 1 1 1˚˙ ÎÍ0 0 0 0

È12˘ 0˘ ˙ Í ˙ 0˙ Í15˙ 0˙,b = Í15˙ ˙ Í ˙ 0˙ Í60˙ ÍÎ10˙˚ 1˙˚

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.5 Í B-1 = Í 0.5 Í Í 0.5 ÍÎ 1.5

0 0 1 0 0

0 0 0 1 0

0 1˘ 0 0˙ ˙ 0 -2 ˙ ˙ 0 -1˙ 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 Red. Cost

x1 0.2

x2

x3 0

0

x4 -0.1

x5 0.6

c. After one iteration, the solution is optimal. Basic Solution Z 11.4 x2 3 x3 5 x4 2 xs3 12 xs4 9

xs1 0.1

xs2

xs3 0

xs4 0

xs5 0

1

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 -1 Í B-1 = Í 1 2 Í1 1 Í ÎÍ 2 1

0 0 0 0

3˘ 2˙ ˙ 0 0 -4 ˙ 1 0 -3˙˙ 0 1 -9˚˙

The simplex tableau is as follows: Basic Basic Index Variables 0 z 2 x2 3 x3 4 x4 8 xs3 9 xs4

z 1 0 0 0 0 0

1 x1 -0 1 2 -2 0 0

2 x2

3 x3 0 1 0 0 0 0

4 x4 -0 0 1 0 0 0

0 0 0 1 0 0

5 x5 0.8 -2 1 2 3 6

6 xs1 0.2 -1 0 1 1 2

7 xs2 0.2 -1 -1 2 1 1

8 xs3

9 xs4 0 0 0 0 1 0

0 0 0 0 0 1

10 Right xs5 Side 0.6 11.4 3 3 2 5 -4 2 -3 12 -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 (Yes, No) Value Point Variables (x1, ..,x6) –––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––---#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

The figure shows the sequence of basic solutions followed by the simplex algorithm. The final solution shows no special properties besides optimality.

44

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 x1

– x3 + x4

= 10

+ 3x3

x1 + 2x2

= 5 – 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

Num.

Name

1 2 3 4 5

X1 X2 X3 X4 X5

Constraint Num.

Name

1 2 3

Con1 Con2 Con3

Value

Objective Value: Objective Status Reduced Cost Coefficient

5 . Basic 0 . Lower 0 . Basic 0 . Lower 2 . Basic

0. -13.4286 0. -4.8571 0.

12. 6. 2. 0. 0.

60. Range Lower Range Upper Limit Limit 4.1667 -------11.3333

--19.4286 25.5 4.8571 47.

Analysis Value

Status

1 0 . Equality 5 . Equality 3 . Equality

Shadow Price 4.8571 2.2857 0.

Constraint Limit 10. 5. 3.

Range Lower Range Upper Limit Limit 5.3333 5. ---

10. --5.

Sensitivity Analysis, Duality, and Interior Point Methods

3

2. Consider the linear programming problem. Maximize z = 5x1 – 3x2 + 4x3 subject to

– x4

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

Num.

Name

Value

Objective Value: Objective Status Reduced Cost Coefficient

1 2 3 4

X1 X2 X3 X4

0. 0. 9.1818 2.9091

Lower Lower Basic Basic

Constraint

Analysis

Num.

Name

1 2

Con1 Con2

Value

Status

1 3 . Upper 1 5 . Upper

-5.1818 -1.6364 0. 0.

Shadow Price 0.8182 1.5455

5. -3. 4. -1.

Constraint Limit 13. 15.

33.8182 Range Lower Range Upper Limit Limit ----2.1613 -5.75

10.1818 -1.3636 6.5714 0.3846

Range Lower Range Upper Limit Limit -37.5 4.3333

45. ---

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˘ = (9/11, 17/11) p = c BB-1 = (4, – 1) Ê ˆ Í Ë 11¯ Î-1 3˙˚ and

1 È 2 5˘ = (–2/11, –5/11). p* = c*BB-1 = (–1, 0) Ê ˆ Í Ë 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

44 Ê 3ˆ -4=0 c3 = (p 1 , p 2 ) A3 - c3 = (9 / 11, 17 / 11)Á ˜ - 4 = Ë 1¯ 11 -11 Ê 3ˆ 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 where

1 b = B–1b = Ê ˆ Ë 11¯

È 2 5˘ Ê13ˆ Ê 101 11ˆ Í-1 3˙ ÁË15˜¯ = ÁË 32 / 11˜¯ Î ˚

and 1 b* = B–1b* = Ê ˆ Ë 11¯

È 2 5˘ Ê 1 ˆ Ê -3 / 11ˆ Í-1 3˙ ÁË -1˜¯ = ÁË -4 / 11˜¯ Î ˚

Using Eq. (2), we get b1 + lb1* =

101 -3 + l Ê ˆ ≥ 0 or l £ 33.67 Ë 11 11 ¯

b2 + lb2* =

32 -4 + l Ê ˆ ≥ 0 or l £ 8. Ë 11 ¯ 11

and

Thus, l £ min{33.67, 8} = 8

(2)

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 Ë -0.5¯ Ë 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 ndimensional 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 mdimensional 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

lB

lB

Ï -b ¸ = minimum Ì *i : i, such that bi* < 0 ˝ Ó bi ˛ * = +• if bi ≥ 0 for all i Ï -b ¸ = 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 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).

(3)

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 =

subject to

pA ≥ c

which is equivalent to wRHS(l) = subject to

p(c + lc*)

p(c + lc*) Maximize w = –p 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* (1 – a)Ax2 = (1 – a)b + (1 – a)l2b* Summing (2) and (3) gives A x√ = b + (al1 + (1 – a)l2)b* Also, x√ ≥ 0 for all a Œ [0, 1]. Now,

(2) (3)

Sensitivity Analysis, Duality, and Interior Point Methods

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

11

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 – x2 + 5x3

x1

– x4

+ x5 = 20 + 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 1

–4 –1

14 5

–2 –1

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

-1 È5 -14 ˘ = (9/2, –14) p = c BB-1 = (–4, – 7) Ê ˆ Í Ë 6 ¯ Î1 -4 ˙˚ and

-1 È5 -14 ˘ = (20/3, –56/3). p* = c*BB-1 = (–8, 0) Ê ˆ Í Ë 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

13

Sensitivity Analysis, Duality, and Interior Point Methods

Ï -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 0 0 0 1.3333 0.166 0 0 1.3333 0.167 unbounded

X4

X5 0 1.3333 0 1.3333

14

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 x1 + 3x2

+ x4 £ 8

(raw material 1)

2x1 + x2

£ 6

(raw material 2)

x2 + 4x3 + x4 £ 6

(raw material 3)

subject to

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

C2

C3

p X1

1 -0.2

0.5 0.6

0.25 0

X2 X3

0.4 -0.2

-0.2 0.1

0 0.25

This is the optimal basis. Sensitivity Analysis for Worksheet P_08 Variable

Analysis

Num.

Name

1 2 3 4

X1 X2 X3 X4

Constraint

Objective Value: Objective Value Status Reduced Cost Coefficient 2. 2. 1. 0.

Basic Basic Basic Lower

0. 0. 0. -0.35

2. 4. 1. 1.

13. Range Lower Range Upper Limit Limit 1.25 3.125 0. ---

3.75 6.25 12. 1.35

Analysis

Num.

Name

Value Status

1 2 3

Con1 Con2 Con3

8 . Upper 6 . Upper 6 . Upper

Shadow Price 1.1 0.45 0.25

Constraint Limit

Range Lower Range Upper Limit Limit 8. 6. 6.

3. 2.6667 2.

18. 16. ---

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

9. Write the dual of the primal linear program below. Maximize z = 5x1 – 3x2 + 4x3 subject to

– x4

3x1 + 4x2 + 3x3 – 5x4 £ 13 5x1 – 3x2 + x3 + 2x4 £ 15 xj ≥ 0, j = 1,…, 4

Dual:

Minimize zD = subject to

3y1

13y1 + 15y2 + 4y2 ≥ 5

4y1

– 3y2 ≥ –3

3y1

+ y2 ≥ 4

–5y1 + 2 y2 ≥ –1

yj ≥ 0, j = 1, 2

17

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.

Row 0 1 2

Basic variables z xs1 x1

z 1 0 0

x1 0 0 1

Coefficients x2 x3 x4 0 –3 3 5.8 2.4 –6.2 –0.6 0.2 0.4

xs1 0 1 0

xs2 1 –0.6 0.2

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.

RHS 15 4 3

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.

Row 0 1 2

Basic variable s z x3 x4

z

x1

1 0 0

5.18 2.82 1.09

Coefficients x2 x3 x4 1.64 –0.64 –1.18

0 1 0

0 0 1

xs1

xs2

RHS

0.82 0.18 –0.09

1.55 0.46 0.27

33.82 9.18 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. zP =– 5x1 – 3x2 + x3 Maximize 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 Number 0 1 2 3

Basic Basic Index Variables 0 z 1 X1 3 X3 2 X2

1 X1

z 1 0 0 0

2 X2 0 1 0 0

3 X3 0 0 0 1

0 0 1 0

4 X4 2.6667 -0.667 0.3333 0.3333

5 X5 6 -1 1 0

6 art1 9996.3 0.6667 -0.333 -0.333

7 art2 9984.7 2.3333 -1.667 0.3333

Right Side -17 3 1 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 Number 0 1 2 3

Basic Index 0 1 4 2

Basic Variables z Y1 Y3M Y2

z 1 0 0 0

1 Y1 -2E-07 1 1E-07 0

2 Y2 0 0 0 1

3 4 5 6 7 8 Right Y3P Y3M YS1 YS2 YS3 art1 Side 9E-08 - 9 E - 0 8 3 1 1 9998 17 0 0 0.6667 - 0 . 3 3 3 - 0 . 3 3 3 0.3333 2.6667 -1 1 2.3333 0.3333 - 1 . 6 6 7 1.6667 14.333 - 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

– x3 + x4 £ 10

2x1 + 3x2

+ x3 + x4 £ 7

x1

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

Ê B–1 = Á Ë

3/7 4/7 –1/7 –3/7

0 1 0 0

1/7 –1/7 2/7 –1/7

0 0 0 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 cB Basis C 1 C 2 C 3 C 4

x4

s2 5 2 -1 1 1

x2 0 0 1 0 0

s4 1 -1 1 3 0

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

C 3 0

C 4 1

0

c. Describe the marginal effects of allowing x1 to enter the basis. We observe: Entering Variable Red. Cost Entering C 1 Column C 2 C 3 C 4

x1 6 1.5714 2.4286 0.1429 -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:

Basis Inverse

 x1 s2 x2 s4

C 1 0.3636 0.2727 -0.091 -0.182 -0.273

C 2

C 3 0 0.455 0 0.091 1 -0.36 0 0.273 0 -0.09

C 4 0 0 0 0 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 I n d e x Variables 0 z 4 x4 6 s2 2 x2 5 s1

j.

z 1 0 0 0 0

1 x1 3.333 1 1.667 0.333 1.333

2 x2 0 0 0 1 0

3 x3 7.333 1 5.667 -0.67 -1.67

4 x4 0 1 0 0 0

5 s1 2E-08 0 -0 5E-09 1

6 s2 0 0 1 0 0

7 s3 0.333 0 -0.33 0.333 0.333

8 s4 4.667 1 1.333 -0.33 -2.33

Right Side 41.33 7 6.667 6.333 0.333

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 I n d e x Variables 0 z 4 x4 6 s2 2 x2 8 s4 9 s5

z

1 x1 1 6 0 1.571 0 2.429 0 0.143 0 -0.57 0 -1

2 x2

3 x3 0 4 0 0.286 0 4.714 1 -0.43 0 0.714 0 -1

4 x4

5 s1 0 2 1 0.429 0 0.571 0 -0.14 0 -0.43 0 0

6 s2

7 s3 0 1 0 0.143 1 -0.14 0 0.286 0 -0.14 0 0

8 s4

9 s5 0 0 0 0 1 0

0 0 0 0 0 1

Right Side 26 4.857 9.143 1.714 2.143 -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

Basis Inverse

x4 s2 x2 s4 s5

C 1 0.4286 0.5714 -0.143 -0.429 0

C 2 0 1 0 0 0

C 3 0.143 -0.14 0.286 -0.14 0

C 4

26

C 5 0 0 0 1 0

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 subject to Ax ≥ b

(D) Maximize zD = pb subject to pA £ c p≥0

x≥0

Algebraic definition of primal and dual problems (P) Minimize zP = subject to

c1x1 + c2x2 + ... + cnxn

a11x1 + a12x2 + … +a1nxn ≥ b1 a21x1 + a22x2 + ... +a2nxn ≥ b2 . . .

. . . . . . . . . am1x1 +am2x2+...+amnxn ≥ bm x1 ≥ 0, x2 ≥ 0,…, xn ≥ 0

(D) Maximize zD = b1p1+b2p2+...+bmpm subject to

a11p1+a21p2+...+am1pm £ c1 a12p1+a22p2+...+am2pm £ c2 . . . . . . . . . . . . a1np1+a2np2+...+amnpm £ cn

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 ∂x1 ∂LP ∂x2 ∂LP ∂x1

= –1 +

m –p = 0 x1

(1)

= –1 +

m –p = 0 x2

(2)

=

m –p = 0 x3

x1 + x2 + x3 = 1

(3) (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 -1 +

m m m = = . 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

x1(m) =

30

3m + 1 ± 9 m 2 - 2 m + 1 . 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 x2(m) =

3m + 1 - 9 m 2 - 2 m + 1 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 = 0, x2(m) Æ 0, and x3(m) = 1 – = 1 which is 4 2 indeed the optimal solution.

As m Æ 0, x1(m) Æ

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 c C 1 C 2

X 1 3E-05 -1 1 0

X 2 3E-05 -1 1 0

X 3 3E-05 0 1 0

X 4 1 0 0 1

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

Current Solution X 1 3E-05 2 3E-05 3 0.9999 4 0.9781

31

Pi Z 1.0001 1.0001 0.0001 0.0002

1 2 0.0001 0.0002 Iter.: Gap Mu

17 0.0003 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 X 1 6E-05 2 6E-05 3 1.0333 4 1

Pi Z 1.0001 1.0001 1E-04 0.0003

1 2 1E-04 0.0003 Iter.: Gap Mu

9 0.0005 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 1 2 3 4

Z 1 1 1 1

2 1 2 1

1 1 Iter.: Gap Mu

2 1

1 6 0.375

Feasibility Vectors Primal Dual 1 0 1 0 2 0 2 0 3 0 4 0

Comp. Slack. 1 -1.625 2 -0.625 3 -1.625 4 -0.625

Direction Vectors d(Pi) d(Z) 1 0.2126 1 -1.264 2 -0.738 2 -0.313 3 -1.789 4 -0.839

d(X) -0.181 -0.312 0.0821 0.2135

1 2 3 4

1 2 3 4 Min Z Step

Ratio Vectors Ratio(Z) Ratio(X) 1.5827 1 5.5354 3.1953 2 3.2047 1.1178 3 - -1.1926 4 - -1.1178 Min 3.2047 0.8942 X Step 2.5637

Sensitivity Analysis, Duality, and Interior Point Methods

Iteration 1 X 1 0.5368 2 0.2 3 1.2105 4 1.5474

Z 0.87 0.7201 0.4 0.2502

1 2 1.1901 0.3399 Iter.: Gap Mu

2 1.4824 0.0926

Feasibility Vectors Primal Dual 1 -4E-15 1 -2E-16 2 -2E-15 2 -2E-16 3 -3E-16 4 1E-16

Comp. Slack. 1 -0.374 2 -0.051 3 -0.392 4 -0.294

Direction Vectors d(Pi) d(Z) 1 0.0426 1 -0.274 2 -0.158 2 -0.073 3 -0.389 4 -0.188

d(X) -0.261 -0.051 0.199 -0.011

1 2 3 4

1 2 3 4 Min Z Step

Ratio Vectors Ratio(Z) Ratio(X) 3.1789 1 2.0532 9.8752 2 3.9144 1.0277 3 - -1.3275 4 135.51 1.0277 Min 2.0532 0.8222 X Step 1.6426

Iteration 2 1 2 3 4

X 0.1074 0.1161 1.5373 1.5286

Z 0.645 0.6602 0.08 0.0952

1 2 1.2251 0.2099 Iter.: Gap Mu

3 0.4144 0.0259

Feasibility Vectors Primal Dual 1 1E-14 1 0 2 1E-14 2 1E-16 3 -7E-17 4 6E-17

Comp. Slack. 1 -0.043 2 -0.051 3 -0.097 4 -0.12

Direction Vectors d(Pi) d(Z) 1 -0.023 1 -0.036 2 -0.007 2 -0.052 3 -0.065 4 -0.081

d(X) -0.061 -0.068 0.0354 0.0419

1 2 3 4

1 2 3 4 Min Z Step

Ratio Vectors Ratio(Z) Ratio(X) 18.007 1 1.7531 12.764 2 1.7134 1.2309 3 - -1.1772 4 - -1.1772 Min 1.7134 0.9417 X Step 1.3707

33

Sensitivity Analysis, Duality, and Interior Point Methods

Iteration 3 1 2 3 4

X 0.0234 0.0232 1.5859 1.5861

Z 0.6112 0.6115 0.0188 0.019

1 2 1.2039 0.2037 Iter.: Gap Mu

4 0.0885 0.0055

Feasibility Vectors Primal Dual 1 0 1 1E-16 2 -2E-15 2 -2E-16 3 6E-17 4 -7E-16

Comp. Slack. 1 -0.009 2 -0.009 3 -0.024 4 -0.025

Direction Vectors d(Pi) d(Z) 1 -0.003 1 -0.009 2 -0.003 2 -0.009 3 -0.015 4 -0.016

d(X) -0.014 -0.014 0.0085 0.0082

1 2 3 4

1 2 3 4 Min Z Step

Ratio Vectors Ratio(Z) Ratio(X) 66.498 1 1.6709 64.742 2 1.6812 1.22 3 - -1.2165 4 - -1.2165 Min 1.6709 0.9732 X Step 1.3367

34

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.

S1 S2 S3 Demand

D1 10 5 11 5

[Fixed External Flow] (Cost) [-5]

[10] (10)

S1

D1

(10) (15)

[15]

(6)

[-3]

(5) (5) (10)

S2

D2

(12)

[-8]

[8] (11) (8)

S3

(7)

D3

(21)

Heavy arcs have flow Shipping cost = $327

[-17] D4

D2 10 15 8 3

D3 6 10 7 8

D4 15 12 21 17

Supply 10 15 8

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. Destination Data

Production Data

S1 S2 S3

Minimum no. units 10 15 0

Maximum no. units 15 15 8

Cost per unit $10 12 13

[Fixed External Flow] (Cost)

(Upper, Cost)

[-5]

A

(10)

A

(10) [15] (15)

D1 (2)

(6)

B

{-5}

[15]

D1

Maximum sales 5 10 8 20

[Production] {-Sales} (Shipments)

(Upper, Cost)

[5] (5, 10)

D1 D2 D3 D4

Minimum sales 5 3 0 10

[-3] D2

(7, -25)

[15] (5) B

(8)

(5)

{-10} D2

(10) [8]

(8, 13)

C

D3

D4

Optimum Profit 190.

(8, -22) C

[-10] (10, -30)

(8)

{-8} D3

{-15} D4

Unit revenue $20 25 22 30

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 outlets

Unit Capacity Period cost ($) (units) 1 $8 175 units 2 10 200 3 11 150

A $15 18 15

B $20 17 18

Maximum sales at outlets

C $14 21 17

A 50 75 20

B 100 150 80

C 75 75 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) ( Cost) (4) P1

(6)

(50,-15)

(200,10) (75,-18)

A1

(150,11)

(20,-15) A3

A2 (4)

(4) (100,-20) B1

P2

(8)

(6)

(150,-17) P3

B2

(50,-17)

(75,-21)

C1

Solution: Profit = $1455 Period Prod. 1 175 2 200 3 100

(80,-18) B3

(8)

(8) (75,-14)

(1,100)

(6)

C3

C2 (1,100)

Inventory 25 0 0

Sales A 50 75 20

Sales B 100 75 80

Sale s C 0 75 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 Cost / hr

1 15 20 25 150

2 20 22 32 130

3 40 30 50 100

4 35 50 48 80

5 45 35 60 70

Model (Upper, Cost) (20,150)

[Fixed External Flow] (Gain) C1

(1/15) (1/20 (1/25

(20,130)

C2

[-1] J1 [-1] J2 [-1]

(20,100)

C3

J3

Nodes on left represent crews. C4 and C5 are not shown. The nodes on the right represent jobs. The -1 fixed flow is the requirement that the job be done. The gain on arc (i,j) is proportion of the job completed in one hour, or the inverse of the time to complete the job.

Network Flow Programming Models

Solution (Upper, Cost) (20,150)

[Fixed External Flow] (Gain) (1/15)

C1

(1/20 (1/25 (20,130)

C2

[-1] J1 [-1] J2 [-1]

(20,100)

C3

Hours spent by crews C1 C2 C3 J1 15 0 0 J2 0 7.7333 2.3117 J3 5 12.267 0 Total 20 2 0 2.3117

Total Cost 8831.17

J3

C4 0 0 20 20

C5 0 20 0 20

5

Network Flow Programming Models

5.

Solve the 4 ¥ 4 assignment problem given in the table.

A B C D

E 3 21 14 14

Transportation model. Cost = 27. Name A B C D

E

F 1 0 0 0

G 0 0 0 1

H 0 0 1 0

0 1 0 0

Using a min-cost flow model. Name A-E B-E C-E D-E A-F B-F C-F D-F A-G B-G C-G D-G A-H B-H C-H D-H

Flow 1 0 0 0 0 0 0 1 0 0 1 0 0 1 0 0

Origin 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4

Term. 5 5 5 5 6 6 6 6 7 7 7 7 8 8 8 8

Cost 3 21 14 14 2 20 14 3 14 17 16 14 3 5 4 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).

6

F 2 20 14 3

G 14 17 16 14

H 3 5 4 4

Network Flow Programming Models

6.

7

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 A B C

Worker

1 3 4 9

2 2 3 9

3 2 7 7

4 6 5 9

5 4 3 7

6 6 3 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 and 3, B to jobs 1 and 5, and C to jobs 4 and 6. Cost 26.

[External Flow] (Cost) [+1]

[–1] (3)

A

J1 (2)

[+1] B

[–1] (2)

J2

[+1]

[–1]

C

J3

Network Flow Programming Models

b.

The solution has: Assign A to jobs 3, B to job 5, and C to job 6. Cost less 300 is 11.

[External Flow] (Cost) (upper, cost)

[+1] (3)

(1, 0)

A

J1 (2)

[+1] (1, 0)

(2)

B

J2

[+1] (1, 0) C

J3

The solution has: Assign A to jobs 1, 2 and 3, B to jobs 4, 5, and 6. Cost is 18.

c. [External Flow] (Cost) (upper, cost) (6, 0)

(3) A

[–1] J1

(2) [–1] (6, 0) B

(2)

J2

[–1]

(6, 0) C

J3

8

Network Flow Programming Models

7.

9

Find the shortest path tree rooted at node 1 for the network shown. (4)

2

4

4

(23) 8

6

(4)

8

12

(12) 1

(4) 5

(6) 13

(3) 9

(5) 16

1 (7)

(2) 3

(3) 15

(1) 11

(7) 7

2

3

(18)

(8)

5

6

10

7

(11) 14

9

Shortest path tree is shown with heavy arcs.

2

(4) 4

(12) (4) 5 1

4

(23) 8

(3) 9

6

(4) 12

(6) 13

8 (5) 16

1 (7) 2

(2) 3

3

(7) 7 (18) 6

5

(1) 11 (8) 10

7

(3) 15 (11) 14

9

Network Flow Programming Models

8.

10

You are given the following directed network.

4

(5)

(2) (9)

2

7

(3) (8) (12)

1

(1)

5 (4)

(9)

(16)

9

(6)

(13)

3

(15)

(4)

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] (flow, cost)

[-1] [-1]

[-1] (0,9)

(6,3) (3,8)

(0,1)

(2,9)

9

(2,6)

(0,13)

3

(0,15)

(16,16)

5 (0,4)

[-1]

7

[-1]

(12,12)

1

(1,5)

(2,2)

2 [8]

Shortest Path

4

8

(1,12)

6 [-1]

(0,2)

[-1]

(2,4)

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

(3,3) (23,M)

(12,12)

1

(2,9)

2

7 (1,1)

(1,8) (4,4)

9

(0,6) (2,13)

3

(23,M)

(16,16)

5

(8,9)

(3,15)

(2,12)

6

8 (2,2)

(4,4)

All arc costs are 0, except arc leaving node 9. That cost is -1.

Network Flow Programming Models

9.

12

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 of ownership 1 2 3 4 5

Operating cost during year $800 800 1000 1500 2000

Resale value at year end $2000 800 400 200 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

(c0, g1 )

1

(c1 , g2)

2

(c2, g3)

3

(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

(c0, g1 )

1

(c1 , g2)

2

3 (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. Arc Data Num. 1 2 3 4 5 6 7 8 9 10

interes 0.1 and Flows Name Flow Origin Term. Lower Upper Cost Y0-Y1 3.155 1 2 0 10000 4000 Y1-Y2 2.868 2 3 0 10000 800 Y2-Y3 2.607 3 4 0 10000 800 Y3-Y4 2.37 4 5 0 10000 1000 Y4-Y5 0 5 6 0 10000 1500 Y1-Y0 0 2 1 0 10000 -1200 Y2-Y0 0 3 1 0 10000 0 Y3-Y0 0 4 1 0 10000 600 Y4-Y0 2.155 5 1 0 10000 1300 Y5-Y0 0 6 1 0 10000 2000

Gain 0.909 0.909 0.909 0.909 0.909 1 1 1 1 1

Flow_O 2.868 2.607 2.37 2.155 0 0 0 0 2.155 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

Variable Analysis Num. Name 1 2 3 4 5 6 7 8 9 10

Y0-Y1 Y1-Y2 Y2-Y3 Y3-Y4 Y4-Y5 Y1-Y0 Y2-Y0 Y3-Y0 Y4-Y0 Y5-Y0

Value

Status

3.1547 2.8679 2.6072 2.3702 0. 0. 0. 0. 2.1547 0.

Basic Basic Basic Basic Basic Lower Lower Lower Basic Lower

14

Objective Value: 22170 Reduced Objective Range Cost Coefficient Lower Limit 0. 0. 0. 0. 0. 982.9778 1,064.2534 433.6565 0. 2.9778

4,000. 800. 800. 1,000. 1,500. -1,200. 0. 600. 1,300. 2,000.

2747 -863 -1030 --1497 -2183 -1064 166 --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.

Upper Limit 4009 810 811 1013 --------1302 ---

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

Operating cost during year

Salvage value at year end

1

$500

––

2

500

3

1000

––

4

2000

6000

5

3000

––

6

5000

2000

$10000

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,

0

(500, g)

1

0

1

(1000, g)

(500, g)

2

2

3

3

(3000, g)

(2000, g)

4

4

5

5

6

(-9500, 1) 6 (-4000, 1) 7 (3000, 1) 8

10

(100000, g )

7

8

9

10

g = 0.10737 (0, 1) 10

Flow solution [external flow] (flow)

[1] (1.3553)

0

(1.0842)

1

0

1

(0.8674)

2

2

(0.6939)

3

3

(0.4441)

(0.5551)

4

4

5

5

(0) 6 (0) 7 (0.3553) (0 )

7

8

10

9

8

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

6

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

6

5

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)

2

(2.286,1,2)

(0,1,2)

5

(4,1,2)

3

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

(0,1,2)

4

(1.143,1,2)

2 (0,1,2)

(0,1,2)

4

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

(0,1,2)

6

(0,1,2)

(0,1,2)

3

(1.143,1,2)

5

(0.286,1,2)

(0.571,1,2)

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 = 3]

[b = -1]

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

Demand

0

0

3

4

5

6

7

8

9

10

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 Reserve

(100, 200, 1) Mine

(upper, cost, gain)

(100, 300, 1) All arcs (50,0,1)

Mining

M1

M2

M3

M4

M5

M6

I4

I5

I6

Storage arcs (M,50,1)

Processing (40,200,100)

All arcs (M,.6,.9) Ingot Storage

(5000,-6,1)

[0]

(4000,-5.5,1)

[0]

I3

(3000,-5.0,1)

I2

(2000,-4.5,1)

I1

Sales

Network Flow Programming Models

Solution: Net Profit = 64000 Year 1 2 3 4 Mine Ore 0 0 20 30 Store Ore 0 0 0 0 Make Ingots 0 0 20 30 Store Ingots 0 0 0 0 Sell Ingots 0 0 2000 3000

5 40 0 40 0 4000

6 40 0 40 0 4000

21

7 40 0 40 0 4000

8 40 0 40 0 4000

9 40 0 40 0 4000

10 40 0 40 0 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 1 2 3

Demand A 100 200 176

Revenue A $50 55 49

Demand B 75 135 82

Revenue B $100 102 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 )

A1 (M,0,12 )

(20,5,0.9 ) A2

(M,0,12 )

(100,-50,1)

(200,-55,1)

(250, 0, 1) (15, 150,1) P1

S1

(M,0,12 )

(176,-49,1)

(250, 0, 1) P2

(15, 150,1)

(75,-100,1)

(M,0,8 )

A3

(M,0,8 )

B1

S2

(15, 150,1)

(135,-102,1) B2

(10,5,0.9 )

(250, 0, 1) P3

(M,0,8 )

S3

(82,-110,1) B3

(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

Prod A 4.375

0

4.75

Prod B 10.625

15

10.25

52.5 75

0 129

57 82

Total 127.5

129

139

0 0

0 0

Sales A Sales B Inv A Inv B

15

0 10

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. Number of Building faculty A 15 B 21 C 13 D 7 Capacity of lots

Distance to parking lots (blocks) I 0 1 2 6 5

II 1 4 1 5 12

III 3 3 1 5 15

IV 2 2 0 4 10

V 1 5 2 5 3

VI 4 3 3 7 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

[fixed flow]

(cost)

(0) I

(upper) (5)

[15]

[21]

[13]

[7]

A

B

C

D

(1) II (12)

(3)

(2) III (15)

(4)

(1) IV (10)

V (3)

VI (15)

Network Flow Programming Models

25

Part a. Numbers on arcs are assignments. The solution has total distance at 106. [15]

[fixed flow]

[13]

[7]

B

C

D

(3)

A

(5)

(12)

(flow)

[21]

(5)

(7)

(5) (8)

I

II

(5)

(flow)

(11)

III

IV

VI (11)

(3)

(10)

(15)

(12)

V

The solution with as a transportation model is shown below. Name

I

A B C D Min.: Max:

II

III

IV

V

VI

Min.

0 5 0 0

12 0 0 0

0 0 8 7

0 5 5 0

3 0 0 0

0 11 0 0

0 5

0 12

0 15

0 10

0 3

0 15

Max.

15 21 13 7

10000 10000 10000 10000

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

A B C D

Assoc A Assoc B Assoc C Assoc D Assis A Assis B Assis C Assis D Min.: Max:

I

II

III

IV

V

VI

Min.

Max.

0 5 0 0

2 0 0 0

0 0 0 0

0 0 5 5

3 0 0 0

0 0 0 0

5 5 5 5

5 5 5 5

0 0 0 0 0 0 0 0 0 5

2 0 0 0 8 0 0 0 0 12

0 0 2 2 0 5 6 0 0 15

0 0 0 0 0 0 0 0 0 10

0 0 0 0 0 0 0 0 0 3

0 2 0 0 0 9 0 0 0 15

2 2 2 2 8 14 6 0

2 2 2 2 8 14 6 0

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

Suppliers

1 2 3 4 Terminal Demand

5 5 1 5 6 3 17

6 4 2 5 1 1 15

7 3 3 4 4 2 20

Terminal 2 2 3 3

Supply 15 15 15 15

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

M

S1

(10)

[-17] D5

[Fixed flow] (Capacity)

[-15] D6

(15) S2

[-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. D5 D6 D7 T Tot. Shipped

S1 3 0 7 5 15

S2 7 3 5 0 15

S3 7 0 7 0 14

S4 0 7 1 0 8

T 0 5 0 5

Tot. Rec. 17 15 20 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 1 8

P1 P2

C2 5 4

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

P1 P2

Efficiency (MWH/ton) 1 0.9

Maximum input (tons) 4000 3000

Processing cost per ton ($/ton) $10 $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) M1 M2

P1 6 3

P2 12 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) (M,6,1) S1 (1200,9,1)

P1

[-1000]

(4000,10,1)

(M,0,0.99) Q1

(M,0,0.95)

(M,12,1)

[-500]

(M,0,0.98)

(1500,12,1)

C1

C2 (1500,13,1)

(M,0,0.92)

(M,3,1) (2000,15,1)

S2

(M,8,1)

P2

(3000,9,0.9)

Q2

(M,0,0.96) (M,0,0.91)

Solution: Fuel1_1 Fuel2_1 Fuel1_2 Fuel2_2 S1_P1 S1_P2 S2_P1 S2_P2

Objective value =126,647.5 1200 Plant1 1500 Plant2 1500 Tran1_1 463.98 Tran1_2 2700 Tran1_3 0 Tran2_1 1300 Tran2_2 663.98 Tran2_3

4000 663.98 938.78 0 3061.2 76.752 520.83 0

[-3000] C3

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 unit of product

Raw material cost ($) per unit of product

Plant

A

B

C

A

B

C

P1 P2

0.5 0.75

2.0 1.2

1.5 2.0

10 15

20 20

30 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.’ The easiest way to few the arc construction is a series of two arcs, one changing hours to products and one charging for [0,hours available,0] [-Demand] the raw material cost. ($20/hour, 2 products/hour) P1 A Any series arrangement of arcs Flow in hours can be changed into a single equivalent arc. The structure for the given problem is shown below [0,hours available,0] (0, 2 products/hour) P1 P1' Flow in hours

[-Demand] ($10/product, 1) A Flow in products

[Fixed Flow] (Upper, Cost) (1500, 0)

(Cost, Gain) P1

[-1000]

(20,2)

A

(10,0.5) (20,0.67)

(20,1.33) [-500]

(1500, 0)

P2 (16.67,0.83

B

(17.5,0.5)

[-700] C

Network Flow Programming Models

Plants

P1 P2 Units Produced

Products A B C Hrs. Used 500/1000 0 1000/667 1500 0 600/500 66/33 666 1000 500 1000

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

31

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.

Warehouse

1.

A B

1 10 3

Customer 2 15 5

3 8 7

4 13 10

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 Cost: 435 Status: Optimum Enter: Leave:

Press the button to restart the Simplex process.

1 2

Suppliers 3 Demand Dual(v)

1 10 0 3 15 0 0 15

Demanders 2 0 15 3 B 0 N 0 5 0 B 15 B 3 0 1 N 0 N 15 0 2

3 8 15 7 0 0 0 15

0 B 6 N 5 N -2

4 13 15 10 0 0 0 15

Supply Dual(u) 10 B 30 4 3 N 30 0 -3 B 0 0

3

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

Network Flow Programming Methods

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 Cost: 405 Status: Optimum Enter: Leave:

Press the button to restart the Simplex process.

1 2

Suppliers 3 Key Cost Flow

3.

2

Red. Costemand N/B Dual(v)

Demanders 2 4 15 7 N 0 N 0 5 0 B 15 B 7 0 5 N 0 N 15 -7 -5

1 10 0 3 15 0 0 15

3 8 15 7 0 0 0 15

0 B 2 N 5 N

4 13 5 10 10 0 0 15

5 0 20 0 0 0 0 20

0 B 0 B 0 B

-5

0

Supply Dual(u 13 B 40 3 10 N 40 13 0 N 0 0

-13

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 Cost: 390 Status: Optimum Enter: Leave:

Press the button to restart the Simplex process.

1 2

Suppliers 3 Key Cost Flow

Red. Costemand N/B Dual(v)

1 10 10 3 10 0 0 20

Demanders 2 0 15 3 B 0 N 0 5 0 B 20 B 3 0 1 N 0 N 20 0 2

3 8 20 7 0 0 0 20

0 B 6 N 5 N -2

4 13 0 10 0 0 20 20

Supply Dual(u 10 B 30 4 3 N 30 0 -3 B 20 0

3

Network Flow Programming Methods

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 Cost: 395 Status: Optimum Enter: Leave:

Press the button for iterations of the Simplex.

1 2

Suppliers 3 Key Cost Flow

5.

3

Red. Costemand N/B Dual(v)

1 10 0 3 15 0 0 15

Demanders 2 0 10 0 B 5 B 0 3 0 B 0 N 2 1000 1002 N 0 N 5 3 3

3 15 0 5 10 0 5 15

4 15 3 N 0 N 0 5 0 B 5 B 0 1000 1000 B 0 N 5 5 5 3

5 8 15 7 0 0 0 15

6 8 0 B 5 B 6 7 6 N 0 N 4 1000 1004 N 0 N 5 1 1 0

7 13 0 10 0 0 15 15

8 13 N 5 5 10 N 0 0 1000 B 0 5 5 1

Suppl Dual( 7 B 30 4 0 N 30 999 -5 N 20 0

6

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: Option: Delay:

5 Run 1

Iter: 6 Cost: -135 Status: Optimum Enter: Leave:

Key Cost Flow

Trans. Cost 1 Name D1 1 SA 4 2 SB - 1 3 SD 0 D e m an 1 5

1 1 4 0 2 -1 Suppliers 15 3 0 0 Red. Costemand 1 5 N/B Dual(v)

2 D2 6 -2 0 15

3 D3 -4 -3 0 15

4 D4 -2 -3 0 15

5 DDSupply 0 3 0 SA 0 3 0 SB 0 60 60

D1 D2 D3 D4 10 15 8 13 3 5 7 10 -14 -17 -20 -23

Press the button to restart the Simplex process. Demanders 2 4 6 7 N 0 N 0 -2 0 B 15 B 0 0 1 B 0 N 15 0 -1

3 -4 15 -3 0 0 0 15

0 B 2 N 4 N -4

4 -2 15 -3 0 0 0 15

0 B 0 N 2 N -2

5 0 0 0 0 0 60 60

0 B 1 N 0 B 0

SuppDual 0 30 -1 30 0 60

Network Flow Programming Methods

6.

4

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 Type: TeachTrans Supplies: 4 No_Sup: 9 Option: Run Trans. Cost 1 2 3 4 5 6 Delay: 1 Name D11 D21 D31 D41 D12 D22 1 SA1 1 7 2 2 1 5 2 0 1 8 23 2 SB1 1 2 1 4 1 6 1 9 1 3 15 3 SA2 ### ### ### ### 2 0 25 4 SB2 ### ### ### ### 1 3 15 D e m an 1 5 1 5 1 5 1 5 2 0 20

Iter: 8 Cost: 2205 Status: Optimum Enter: Leave:

Key Cost Flow

press the button.

7 8 D32 D42 16 21 17 20 18 23 17 20 20 20

9 DD Supply 0 30 0 50 0 30 0 50 20

SA SB

D1 10 3 10 3

D2 15 5 15 5

D3 8 7 8 7

D4 13 10 13 10

8 10 10 10

Press the button for iterations of the Simplex.

Demanders 1 2 3 4 1 17 4 22 7 15 0 20 0 0 N 0 N 15 B 5 B 2 12 0 14 0 16 2 19 0 Suppliers 15 B 15 B 0 N 10 B 3 ### 985 ### 983 ### 983 ### 978 0 N 0 N 0 N 0 N Red. Cost 4 ### 988 ### 986 ### 986 ### 981 N/B 0 N 0 N 0 N 0 N Demand 1 5 15 15 15 Dual(v) -7 -5 -5 0

5 18 0 13 0 20 0 13 20 20

4 N 0 N 4 N 0 B -6

6 23 0 15 10 25 0 15 10 20

7 N 0 B 7 N 0 B -4

7 16 10 17 0 18 10 17 0 20

0 B 2 N 0 B 2 N -4

8 21 0 20 0 23 0 20 20 20

0 N 0 N 0 N 0 B 1

9 0 0 0 0 0 20 0 0 20

SuppDual( 20 N 30 3 19 N 50 0 22 B 30 3 19 N 50 2

-22

Network Flow Programming Methods

7.

5

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 1 SA1 1 7 2 2 1 5 2 0 1 8 2 3 1 6 2 1 0 30 2 SB1 1 2 1 4 1 6 1 9 1 3 1 5 1 7 2 0 0 50 3 SA2 2 2 2 7 2 0 2 5 2 0 2 5 1 8 2 3 0 30 4 SB2 1 5 1 7 1 9 2 2 1 3 1 5 1 7 2 0 0 50 D e m an 1 5 1 5 1 5 1 5 2 0 2 0 2 0 2 0 2 0

Iter: 10 Cost: 2205 Status: Optimum Enter: Leave:

Key Cost Flow

1 1 17 0 2 12 Suppliers 15 3 22 0 Red. Cost 4 15 N/B 0 Demand 1 5 Dual(v)

SA SB

D1 10 3 10 3

D2 15 5 15 5

D3 8 7 8 7

D4 13 10 13 10

8 10 10 10

Press the button to restart the Simplex process. Demanders 2 4 22 7 N 0 N 0 14 0 B 15 B 7 27 10 N 0 N 3 17 3 N 0 N 15 -7 -5

3 15 15 16 0 20 0 19 0 15

0 B 2 N 3 N 5 N -5

4 20 5 19 10 25 0 22 0 15

0 B 0 B 3 N 3 N 0

5 18 0 13 0 20 0 13 20 20

4 N 0 N 4 N 0 B -6

6 23 0 15 10 25 0 15 10 20

7 N 0 B 7 N 0 B -4

7 16 10 17 0 18 10 17 0 20

0 B 2 N 0 B 2 N -4

8 21 0 20 0 23 0 20 20 20

0 N 0 N 0 N 0 B 1

9 0 0 0 0 0 20 0 0 20

2 N 3 N 0 B 3 N -22

SuppDual 20 30 19 50 22 30 19 50

Network Flow Programming Methods

8.

6

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

Source S1 S2 S3 Demands

a.

D1 10 5 11 5

Destination D2 D3 10 6 15 10 8 7 3 8

D4 15 12 21 17

Supplies 10 15 8

Find the optimal distribution from sources to destinations.

Iterations starting from the NW Corner solution Iter: 1 Cost: 428 Status: Not Optimum Enter: Leave: 1 2 Suppliers 3 Demand Dual(v) Iter: 2 Cost: 383 Status: Feasible Enter: (3, 2) Leave: (1, 2)

1 2

Suppliers 3 Demand Dual(v) Iter: 3 Cost: 347 Status: Feasible Enter: (3, 1) Leave: (2, 3)

1 2

Suppliers 3 Demand Dual(v)

Press the button for iterations of the Simplex.

1 10 5 5 0 11 0 5

1 10 5 5 0 11 0 5

1 10 2 5 0 11 3 5

Demanders 2 0 10 B 3 -9 15 N 0 -12 8 N 0 3 4

0 B 1 N -15 N

3 6 2 10 6 7 0 8

0 B 0 B -12 N

4

4 15 0 12 9 21 8 17

0

Demanders 2 0 10 15 B 0 N -9 15 16 N 0 N -12 8 0 N 3 B 3 14 -1

3 6 5 10 3 7 0 8

Demanders 2 0 10 3 B 0 N 3 15 16 N 0 N 0 8 0 B 3 B 3 0 -3

3 6 8 10 0 7 0 8

0 B 0 B -12 N

2

4 15 0 12 12 21 5 17

10

0 B 12 N 0 N -4

Supply Dual(u 6 N 10 0 10 B 15 0 19 B 8 7

Supply Dual(u -4 N 10 0 0 B 15 0 9 B 8 7

12

4 15 0 12 15 21 2 17

Supply Dual(u 10 N 10 0 2 B 15 0 11 B 8 -5

10

Network Flow Programming Methods

Iter: 4 Cost: 337 Status: Feasible Enter: (1, 4) Leave: (3, 4)

1 2

Suppliers 3 Demand Dual(v) Iter: 5 Cost: 337 Status: Feasible Enter: (2, 1) Leave: (1, 1)

1 2

Suppliers 3 Demand Dual(v) Iter: 6 Cost: 327 Status: Optimum Enter: Leave:

1 10 0 5 0 11 5 5

1 10 0 5 0 11 5 5

Demanders 2 0 10 3 B 0 N -2 15 11 N 0 N 0 8 0 B 3 B 3 0 -3

3 6 8 10 0 7 0 8

Demanders 2 2 10 5 N 0 N 0 15 13 B 0 N 0 8 0 B 3 B 3 5 2

3 6 8 10 0 7 0 8

7

0 B 7 N 0 N

4 15 2 12 15 21 0 17

-4

0 B 7 N -2 N

Supply Dual(u 10 B 10 0 7 B 15 5 11 N 8 0

5

4 15 2 12 15 21 0 17

3

Supply Dual(u 3 B 10 0 0 B 15 3 6 N 8 0

12

Press the button to restart the Simplex process.

1 2

Suppliers 3 Demand Dual(v)

1 10 0 5 5 11 0 5

Demanders 2 2 10 3 N 0 N 0 15 11 B 0 N 2 8 0 N 3 B 3 8 7

3 6 3 10 0 7 5 8

0 B 7 N 0 B 6

4 15 7 12 10 21 0 17

Supply Dual(u 0 B 10 0 -3 B 15 5 1 N 8 0

15

Network Flow Programming Methods

b.

8

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 Cost: 327 Status: Not Optimum Enter: Leave: 1 2 Suppliers 3 4 Demand Dual(v) Iter: 2 Cost: 302 Status: Optimum Enter: Leave:

Press the button for iterations of the Simplex.

1 10 0 5 5 11 0 4 0 5

Demanders 2 2 10 3 N 0 N 0 15 11 B 0 N 2 8 0 N 3 B -5 9 1 N 0 N 3 8 7

3 6 3 10 0 7 5 7 0 8

0 B 7 N 0 B 0 N

4 15 7 12 10 21 0 13 0 17

6

0 B 0 B 5 N -3 N

5 0 0 0 0 0 0 0 5 5

15

Supply Dual(u) 0 N 10 4 -3 N 15 0 1 B 8 0 1 B 5 1

-1

Press the button to restart the Simplex process.

1 2

Suppliers 3 4 Demand Dual(v)

1 10 0 5 0 11 0 4 5 5

Demanders 2 2 10 3 N 0 N 0 15 11 B 0 N 2 8 0 N 3 B 0 9 6 B 0 N 3 8 7

3 6 8 10 0 7 0 7 0 8

0 B 7 N 0 B 5 N 6

4 15 2 12 15 21 0 13 0 17

0 B 0 B 5 N 2 N 15

5 0 0 0 0 0 5 0 0 5

Supply Dual(u) 0 N 10 4 -3 N 15 0 1 B 8 5 -4 N 5 1

-1

Network Flow Programming Methods

9.

Data for an assignment problem are displayed in the accompanying matrix. The columns represent jobs, and the rows represent workers. The numbers are the costs of making an assignment. When M appears in a cell, that assignment is not possible. Solve the problem using the transportation algorithm.

9

J1

J2

J3

J4

J5

W1

M

8

6

12

1

W2

15

12

7

M

10

W3

10

M

5

14

M

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 Cost: 1046 Status: Not Optimum Enter: Leave: 1

Key Cost Flow

1 1000 1 2 15 Suppliers 0 3 10 0 Red. Cost 4 12 N/B 0 5 18 0 Demand 1 Dual(v)

Press the button for iterations of the Simplex. Demanders 2 0 8 0 B 0 B -989 1 2 0 N 1 B -992 1000 990 N 0 N -992 1000 988 N 0 N -984 1 7 7 N 0 N 1 997 5

3 6 0 7 0 5 1 12 0 14 0 1

3 N 0 B 0 B 5 N 9 N 0

4 12 0 1000 0 14 0 16 1 1000 0 1

0 N 984 N 0 B 0 B 986 N 9

5 1 0 10 0 1000 0 15 0 13 1 1

-10 N -5 N 987 N 0 B 0 B 8

Suppl Dual( 3 1 7 1 5 1 7 1 5 1

Network Flow Programming Methods

Iter: 2 Cost: 54 Status: Feasible Enter: (3, 1) Leave: (1, 1)

Key Cost Flow

Key Cost Flow

3 6 0 7 1 5 0 12 0 14 0 1

3 N 0 B 0 B 5 N 9 N

4 12 0 1000 0 14 0 16 1 1000 0 1

5

0 N 984 N 0 B 0 B 986 N

5 1 0 10 0 1000 0 15 0 13 1 1

-10 N -5 N 987 N 0 B 0 B

14

Suppl Dual( -2 1 2 1 0 1 2 1 0 1

13

Press the button for iterations of the Simplex.

Demanders 1 2 1 1000 992 8 0 0 N 1 B 2 15 3 12 0 Suppliers 0 N 0 B 3 10 0 1000 990 1 B 0 N Red. Cost 4 12 0 1000 988 N/B 0 N 0 N 5 18 -2 17 -3 0 N 0 N Demand 1 1 Dual(v) 12 12

Iter: 4 Cost: 51 Status: Optimum Enter: Leave:

Key Cost Flow

Press the button for iterations of the Simplex.

Demanders 1 2 1 1000 992 8 0 0 N 1 B 2 15 3 12 0 Suppliers 0 N 0 B 3 10 0 1000 990 1 B 0 N Red. Cost 4 12 0 1000 988 N/B 0 N 0 N 5 18 8 17 7 0 N 0 N Demand 1 1 Dual(v) 10 10

Iter: 3 Cost: 54 Status: Feasible Enter: (1, 5) Leave: (4, 5)

10

3 6 0 7 1 5 0 12 0 14 0 1

3 N 0 B 0 B 5 N -1 N

4 12 0 1000 0 14 0 16 1 1000 0 1

7

0 N 984 N 0 B 0 B 976 N

5 1 0 10 0 1000 0 15 0 13 1 1

0 B 5 N 997 N 10 N 0 B

16

Suppl Dual( -4 1 0 1 -2 1 0 1 8 1

5

Press the button to restart the Simplex process.

Demanders 1 2 1 1000 992 8 0 0 N 0 B 2 15 3 12 0 Suppliers 0 N 0 B 3 10 0 1000 990 1 B 0 N Red. Cost 4 12 0 1000 988 N/B 0 N 0 N 5 18 1 17 0 0 N 1 B Demand 1 1 Dual(v) 12 12

3 6 0 7 1 5 0 12 0 14 0 1

3 N 0 B 0 B 5 N 2 N

4 12 0 1000 0 14 0 16 1 1000 0 1

7

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

0 N 984 N 0 B 0 B 979 N 16

5 1 1 10 0 1000 0 15 0 13 0 1

0 B 5 N 997 N 10 N 3 N 5

Suppl Dual( -4 1 0 1 -2 1 0 1 5 1

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 1 1 1 1 1 D e m an 1

Iter: 3 Cost: 26 Status: Optimum Enter: Leave:

Press the button to restart the Simplex process.

1 2

Suppliers 3 Demand Dual(v)

1 3 0 4 1 9 0 1

Demanders 2 0 2 0 N 1 B 0 3 0 B 0 B 1 9 2 N 0 N 1 4 3

3 2 1 7 0 7 0 1

0 B 4 N 0 N 3

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

4 6 0 5 1 9 0 1

2 N 0 B 0 N 5

5 4 0 3 0 7 1 1

2 N 0 B 0 B 3

6 6 0 3 0 6 1 1

5 N 1 N 0 B 2

SuppDual -1 2 0 2 4 2

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 1 1 1 1 1 D e m an 1

Iter: 6 Cost: 11 Status: Optimum Enter: Leave:

Press the button to restart the Simplex process.

1 2

Suppliers 3 Key Cost Flow

Red. Cost 4 N/B Demand Dual(v)

1 3 0 4 0 9 0 0 1 1

Demanders 2 1 2 0 N 0 N 1 3 0 N 1 B 3 9 3 N 0 N 0 0 0 B 0 N 1 0 0

3 2 1 7 0 7 0 0 0 1

4 6 0 5 0 9 0 0 1 1

0 B 4 N 1 N 0 B 0

5 4 0 3 0 7 0 0 1 1

4 N 2 N 3 N 0 B 0

2 N 0 B 1 N 0 B

6 6 0 3 0 6 1 0 0 1

0

4 N 0 N 0 B 0 B

SuppDual 2 1 3 1 6 1 0 3

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 A

1 3

2 2

3 2

4 6

5 4

6 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, J6B

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

(4)

2

4

(12) 1

1

(4) 5

(7)

3

2 [0]

(4) 4

(23) 6

8

(3) 9

(2) 3

2

[11]

4

(6) 13

(7) 7 (18) 6

5

[15]

[36]

4

6

(4) 5

(4) 12

8 (5) 16 (3) 15

(1) 11 (8) 10

7

(11) 14

[40] (4) 12

8

(6) 13

1 (7) 2

(7) 7

3

5

[7]

[22]

(8) 10

7 [30]

(11) 14

9 [41]

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

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.

From

1 2 3 4 5

1 X X X 0 1

2 10 X X X 6

To 3 3 0 X X X

6

2

3

4

4 1 1 0 X X

5 X 2 2 2 X

6 X X 4 9 6

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 1-4 1-3

Label 1 3

4-5 3-6 5-2

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

From

A B C D E F

A –– 2 14 7 17 13

B 13 –– 8 4 8 8

To C 12 9 –– 22 14 10

D 15 8 12 –– 10 15

E 22 26 7 30 –– 15

F 10 13 9 12 3 ––

We use the label setting algorithm, we start with node D and sequentially add the following arcs. The associated labels are shown. Link D-B B-A D-F

Label 4 6 12

B-C C-E

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

I

(16)

(30)

(45)

B

G

(23)

C

L (28)

(17)

(50)

(38)

(30)

K (11)

F

(42)

(9)

A

(87)

(27)

(20)

E

J

H (20)

(76)

D

Shortest Path Tree [148]

I

[132] (16)

J

[45] (87)

[0] (45)

K

L

(28)

[157]

[120]

F

E

[45] (75)

(50)

(9)

A [148]

G

(30)

B [118]

(23)

[28] (17)

H (20)

C

D

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

(10)

(7)

(7)

A

(13)

D

(8) (10)

(10) (2)

F

E

[2]

Origin Node A

[5] (3)

B

C

(2)

[0]

(7)

[7] (7)

A

D

(10)

F

E

[9]

[10]

[3]

Origin Node C

[0] (3)

B

C

(2)

[5]

[12] (7)

A (8)

F [8]

(2)

E [10]

D

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

Âc

Maximize Z =

ij

x ij

(1)

{( i, j )ΠA }

Subject to:.

Âx

ij

Âx

ij



{ j ;( i , j )ŒA}

{ j ;( i , j )ŒA}

Âx

ji

Âx

ji

= -1 i ΠN - s

(2)

= N -1 for i = s

(3)

{ j :( j , i )Œ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 the maximum flow from A to G.

(capacity) (21) 4

B

E

(4)

(20) 3

1

Source

(24)

(2) 9

7

A

Sink

D

G (10)

(4)

(15) 2

(10)

8

5

10

(9)

C

F 6

We start with the initial solution at the right.

(flow, capacity) (16,21)

B (20,20)

(4,4) 1

Source

E

4

(2,2)

3

(18,24)

7

A

9

D

G

(4,4)

(7,15)

(6,10) 5

2

(9,10)

8 10

(3,9) C

Sink

F 6

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

Network Flow Programming Methods

New Solution

(flow, capacity) [label]

(20,21)

B

(0,4) 1

E

4

(20,20) Source

21

(2,2)

3

(22,24)

7

A

9

Sink

D

[0]

(4,4)

(11,15)

(2,10)

[-8] 5

2

G [10]

(9,10)

8 10

(7,9) C

F

[2]

6

[6]

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

(flow, capacity) [label]

(20,21)

B

(20,20)

(0,4) 1

Source

E

4

(2,2)

3

(22,24)

7

A

9

D

[0]

(4,4)

(12,15) 2

G (2,10)

[-8] 5

(10,10)

8 10

(8,9) C [2]

F 6

Sink

[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

19. We are seeking the maximum flow from node 1 to node 14.

22

2

8 7 8

1

3

9

17

9 2

18 10

4 3

10

11

1

19

14

12

5

4

11

13

20

14

5

6

21

12

15

6

22 16

7 All arcs have capacity 1

13 All arcs have capacity 9999

All arcs have capacity 1

Initial Flows Arc 1 Flow 1

2 0

3 1

4 0

5 1

6 0

We start with the initial solution at the right.

7 1

8 0

9 0

10 11 12 13 14 15 16 17 18 19 20 21 22 1 0 0 0 1 0 0 1 1 1 0 0 0 [-7]

2

8

[16]

7 8

1

3 [2]

2

4

10

1

17

[9] 18

10

11

3 [0]

9 9

4

5

13

14 11

20

[4] 14

5

6

15

[8]

21

12

6

22 16 [6]

7

[21]

19

12

13

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

Network Flow Programming Methods

New Solution

2

23

[16]

8 7 8

1

3

9

[-9]

2

[13] 18

10

4

17

9

10

11

3

1

19

12

[0] 4

5

13

6

15

[20]

14

[15] 20

11

[4] 14

5

6

21

12

[-14]

22 16

[6]

7

13

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

2

8 7 8

1

3 [-9]

2

4

9

10

[13] 18

10

11

3

1

17

9

19

14

12

[0] 4

5

13

6

15

11

20

[4] 14

5

21

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

20. The source is node 1 and the sink is node 6. Find the maximum flow.

24

(Capacity) (4) 2

4

3

(5)

(7)

(2) 1

7

4

1

6 (2) (5) 2

8

(3)

3

Initial Solution

(3)

5 5

6

(Flow, Capacity) (3, 4) 2 (5,5)

3

4 (3, 7)

(2, 2)

1

7

4

1

6

(0, 2) (1, 5)

(3, 3)

5

2

8

(1, 3)

3

6

5

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

[-4]

(3, 4) 2

(5,5)

4

7

4

1

[3]

(5, 7)

(2, 2) 1

[0]

3

6

(2, 2) (3, 5)

[7]

(3, 3)

5

2

8 [2]

3

(1, 3) 6

5

[6]

Labels from labeling algorithm are shown on the figure. Breakthrough: Path: {7, 3, -4, 6, 2} D = 1

Network Flow Programming Methods

New Solution

[-4]

(4, 4) 2

(5,5)

4 (6, 7)

(1, 2)

1

7

4

1 [0]

3

6

(2, 2) (4, 5)

(3, 3)

5

2

8 [2]

3

(2, 3) 6

5

[6]

Nonbreakthrough: Max Flow = 9. Labeled nodes: S = {1, 2, 3, 5} Cut is ( S, S ) = {3, 5, 8}. Capacity of Min Cut =9

25

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 Subject to:.

Âx

ij

Âx

ij

Âx

ij



{ j ;( i , j )ŒA}

Âx

ji

Âx

ji

Âx

ji

= 0 i ΠN - {s and t}

(2)

- v = 0 for i = s

(3)

+ v = 0 for i = t

(4)

{ j :( j , i )ŒA}



{ j ;( i , j )ŒA}

{ j ;( i , j )ŒA}

(1)

{ j :( j , i )Œ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] (upper bound, cost)

[1]

2 (2,-1) [2]

7 (3, 1)

5

(2,-1)

(3,5)

1

8

(3, 3)

4

1

4

(1,2) 3 (6, 4)

5

2

6

[–5]

(5,3)

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] (Flow, Upper Bound, Cost)

[1,-1]

2 (1,2,-1) 7

[–,0]

5

(1,3,1) 8

(0,3,5) [2,1]

1

(0,3,3) 6

(2,2,-1)

1

4

4

(0,1,2) 3 (3,6,4)

[-5,8]

5 (3,5,3)

2

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] (Flow, Upper Bound, Cost)

[1,6]

2 (0,3,5)

(0,2,-1) [–,0]

5

7 (2,3,1) 8

[2,1]

(0,2,-1)

1

4

1

(0,3,3) 6

[-5,5]

4

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

5 (5,5,3)

2

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] (Flow, Upper Bound, Cost)

[1,-2]

2 (0,2,-1) [–,0]

5

7 (0,3,1) 8

[2,-7]

(4,3,5) 1

1

(-2,3,3) 6

(5,2,-1) 4

4

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

[-5,-3]

5 (0,5,3)

2

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] (flow, upper bound, cost)

[0]

(1, 3, 3) 1 (1, 1, 2)

[0]

4

5

2

1

9

(0, 1, 2)

(0, 3, 1)

(2, 2, 1) 3

(2, 2, 6)

(4, 5, 0)

5

(1, 2, 0)

2

4

[–3]

8 6 (2, 3, 3) 7

3 [–1]

[0, 3] [fixed external flow, p] (flow, upper bound, cost)

2

5

(4, 5, 0)

1 (1, 1, 2)

1

(0, 1, 2) 4

2

9 (2, 2, 1) 3

(2, 2, 6)

[0]

(1, 2, 0)

(1, 3, 3) 5

(0, 3, 1) 8 6 (2, 3, 3) 7

[–3, 6]

4

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] (flow, upper bound, cost)

[–8]

)

3

2 (10,18 )

3

6

7

13

(11, 8 )

5

16

11 (11, 11 )

7 10

8

12

(7, 3 )

,7

6

8

9

(12, 4 )

(6, 1 )

(9

5

(5, 7 )

1

(4, 3 )

(4, 4 )

1

(20, 0)

(4, 2 )

,1

(9

4

4

2)

(4, 6 )

2

(11, 23 )

(4, 5 )

(10, 4 )

14

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

15

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

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.

2

Integer Programming Models

2.

3

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 Cost 5 3 5 is selected is given in the accompanying 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

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.

4

Integer Programming Models

3.

5

A computer service company needs to City 1 2 3 4 5 establish communications between five 1 –– 15 13 19 21 cities. An analysis of various media has 2 15 –– 10 24 14 determined that the monthly cost of 3 13 10 –– 14 17 connecting a pair of cities i and j with a 4 19 24 14 –– 12 link is cij as shown in the accompanying 5 21 14 17 12 –– matrix. The connection allows communications 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 i = 1,º, 4; j = i + 1,º, 5 Let xij = Ì Ó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 j = 1,º, 5 Let y j 2 = Ì Ó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.

yj2 ≥ yj3

PREC:

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

4.

7

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

(8)

3

2

(8) A

(9)

6

1

(7) 9 (2)

(7) 16 (10)

(3) 7

(7) (1) 15 (6) 8 14

17

(3) (1)

11

10

B (4)

13

18

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

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

9

Integer Programming Models

5.

10

(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

(1)

Â

(2)

e e

e ŒE

subject to

xe = 2 , for all i ΠN

e Œd ( i )

| N | -1 ˘ xe £ | S | -1 , for all 2 £ |S| £ ÈÍ Í 2 ˙˙ e ŒE ( S )

(3)

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

6.

11

(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 + e ŒE

subject to

Âfy j

j

(1)

j ŒN

Â

xe = 2 yj,, for all i ΠN

Â

xe £

Â

xe £ Â yi - 1, for all S Õ N\{1} )

(2)

e Œd ( i )

e ŒE ( S )

( or

e ŒE ( S )

Â

yi , for all kŒS, S Õ N\{1}

(3)

i ŒS \ {k}

(3')

i ŒS

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

7.

12

It is possible to replace the subtour elimination constraints (C3) in the text with the following constraints:

ÂÂ

xij ≥ 1,

S Ã N, S π ∆

(SEC)

s ŒS j ŒN \ S

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

Âx

Exactly one successor:

= 1, i = 1,…,n

ij

(1)

j =1

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

 Âx i ŒS

ij

= |S|

(2)

j =1

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 ij

i ŒS

j =1

i ŒS

ij

≥ | S | - | S | +1 = 1

j ŒS

Further manipulation of (3) gives Ê n ˆ Â Á Â xij - Â xij ˜ ≥ 1 ¯ i ŒS Ë j =1 j ŒS

or

Ê

 ÁË Â x i ŒS

so

j ŒS

ÂÂ

i ŒS j ŒN \ S

which is the desired result.

ij

+

ˆ xij - Â xij ˜ ≥ 1 ¯ j ŒN \ S j ŒS

Â

xij ≥ 1, for all S Ã N, S π ∆

(3)

Integer Programming Models

8.

13

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

j =1

n

subject to

Âa x ij

j

≥ di , i = 1,…,m

j =1

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

Integer Programming Models

9.

14

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 Number

1 21

2 0

3 8

4 17

5 12

6 6

7 0

8 0

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

9 0

10 0

11 0

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

8

20

16

17

13

7

14 11

6

12

10

5

8

4 6

3 2 1

1 0

19

18

9

0

1

2

4

5

2

3 3

9

7

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

I II III IV V VI VII VIII IX

1, 2, 3 4, 5, 6 7, 8, 9 6, 8, 9 7, 8, 9, 10, 11 10, 11 16, 17 12, 13 14, 15

X XI XII XIII XIV XV XVI XVII XVIII

Set 14, 15, 18 12, 13, 14, 15 18, 19, 20 16, 17, 18, 19, 20 10, 11, 16, 17 1, 2, 3, 4, 5, 6, 7, 8, 9 1, 2, 3, 4, 5 19, 20 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 st

cx Ax = e xj = 0 or 1, j = 1,...,18

The A matrix is below. W1 W2 W3 W4 W5 W6 W7 W8 W9 W10 W11 W12 W13 W14 W15 W16 W17 W18 W19 W20

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

Optimal solution Platform I II V XI XIII Cost = 249.4

Wells (1, 2, 3) (4, 5, 6) (7, 8, 9, 10, 11) (12, 13, 14, 15) (16, 17, 18, 19, 20)

18

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:

xij

Ï1 =Ì Ó0

if the product is produced in month i and covers the demand through j months, otherwise;

i = 1,…,12 j = i,…,12

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. if amount produced in month i Ï1 satisfies 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 -1 i -1 Èi + j -1 Ê i + j -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

cij xij

j =1

12 13 - i

ÂÂa x

subject to

ij ij

=b

i =1 j =1

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 0

I0

1

I1 x1

7

10

....

3

2

I2 x2

For the mathematical programming model:

x3

12

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

Objective: Min

12

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

1 0.9

2 0.8

3 0.95

4 0.75

Cost Weight (lbs.)

$100 8

50 12

40 7

200 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

i =1

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

Letting xi =

 jxij and j =1

5

Âx

ij

= 1, for i = 1,…,4, the objective function to be

j =0

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 x12

x11

3

2 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

ij

£ 5, i = 1,…,4

j =1

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

Optimal solution:

x1 = 2

z* = 0.6583

x2 = 3

Reliability = 0.991021736

x3 = 1

Cost = $990

x4 = 3

Weight = 74 pounds

25

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.

(3)

(10)

(17)

(5)

(10)

(15)

(20)

(8)

(8)

(10)

(18)

(12)

(10)

(12)

(12)

(5)

Power will be supplied by 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 scaled terms, consists of a fixed charge of $100 plus a variable cost of $2 per MW supplied. In the model all costs are expressed as lifetime figures so no adjustment need be made to account for time value of money or the differences 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. 3

13

14

15

16

9

10

11

12

5

6

7

8

1

2

y

2

1

0

1

4

3 2

3

x

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

Demand:

zj +

Âx

j = 1º16 -

kj

kj ŒA

Distance:

8y j +

Âx

jk

= dj

j = 1º16

jk ŒA

Ây

k

£8

j = 1º16

k ŒDk

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.

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

19

7

[15]

8

20

9 10

1

A

Let

[45]

21

11

2

B

C

xj = flow in arc j. j = 1, .., 18. Ï1 if plant built in arc j+6 yj = Ì Ó0 otherwise

[20]

12 22 13

3

[50]

[30]

23

14

15 16

4

D

24

17 18

5

E

F

6

j = 1, .., 2

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 = x20 + x9 + x10 = x21 + x11 + x12 = x22 + x13 + x14 = x23 + x15 + x16 = x24 + x17 + x18 =

30 15 45 20 30 50

Conservation of pollution flow at river. x19 + .1x7 + .05x8 x20 + .1x9 + .05x10 x21 + .1x11 + .05x12 x22 + .1x13 + .05x14 x23 + .1x15 + .05x16 x24 + .1x17 + .05x18

– + + + + +

–x2 –x3 –x4 –x5 –x6

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 x9 £ 15 y3 x11 £ 45 y5 x13 £ 20 y7 x15 £ 30 y9 x17 £ 50 y11

x8 £ 30 y2 x10 £ 15 y4 x12 £ 45 y6 x14 £ 20 y8 x16 £ 30 y10 x18 £ 50 y12

Solving with Excel we optain the following solution: Waste treatment plants:

x1 x1 x2 x3 x4 x5

= = = = = =

0 0 0 0 0 0

Integer Programming Models

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.

31

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

Warehouse

1

Customer 2 3 4

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

5

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

[-d1]

2

2

[-d2 ]

3

3

[-d3 ]

m

n

[-dn ]

1

c12

x1 x2 x

3

xm

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

 fi yi +

Min

i =1

m

 ci zi + i =1

m

n

ÂÂc x

ij ij

i =1 j =1

Subject to m

Âx

ij

= d j,

j = 1,...,n

Âx

ij

– xi = dj,

i = 1,...,m

i =1 n

j =1

n

zi £ ( Â d j ) yi,

i = 1,...,m

zi ≥ 0,

i = 1,...,m

xij ≥ 0,

i = 1,...,m

yi = 0 or 1,

i = 1,...,m, j = 1,...,n

j =1

For the data given, when solved as an LP we obtain: Cost = 3885.7 WH y z flow 1 2 3 1 0.7143 50 1 20 30 0 2 0.5714 40 2 0 0 40 3 0.7143 50 3 0 0 0 4 0.2857 20 4 0 0 0 20 30 40

4 0 0 50 0 50

With integrality required for the yj , we find: Cost = 4660 WH y z flow 1 2 1 1 50 1 20 30 2 1 40 2 0 0 3 1 70 3 0 0 4 0 2E-11 4 0 0 20 30

4 0 0 50 0 50

3 0 40 0 0 40

5 0 0 0 20 20

Sum 50 40 50 20

5 Sum 0 50 7E-10 40 20 70 -4E-15 -4E-15 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

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.

34

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

Utility Vitamins Fat Sugar

9 10 8 7

12 8 9 7

6 13 10 2

8 12 6 14

10 4 18 13

F

G 3 6 9 9

H

6 9 10 8

7 6 5 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: Values: Lower Bounds: Upper Bounds: Linear Obj. Coef.: aints Name Vita. Fat Sugar

Value 40 35 29

Rel. >= = I) Sum(kP(k)|0≤k≤I-1) E(Sales) E(lost sales)

0 0.000 0.000 0.000 1.500

1 0.777 0.000 0.777 0.723

2 0.884 0.335 1.219 0.281

3 0.573 0.837 1.410 0.090

4 0.263 1.213 1.476 0.024

5 0.093 1.402 1.494 0.006

We compute the steady-state results for this system. 0 Inv 0

1 Inv 1

2 Inv 2

3 Inv 3

4 Inv 4

5 Inv 5

Steady State Dist. 0.089747 0.124368 0.180438 0.417838 0.135785 0.051825

Average lost sales per period 0.3163423

4

Discrete-Time Markov Chains

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)

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

(0, 0) (0, 3) 0 1 0 0 0 0.777 0 0 0 0.442 0 0 0.191 0 0.066 0 0.019 0

(1, 0) (1, 3) 0 0 0 0 0 0.223 0 0 0 0.335 0 0 0.251 0 0.126 0 0.047 0

(2, 0) (2, 3) 0 0 0 0 0 0 0 0 0 0.223 0 0 0.335 0 0.251 0 0.126 0

(3,0) 0 1 0 0.777 0 0.442 0.223 0.335 0.251

(4,0) (5,0) 0 0 0 0 0 0 0.223 0 0 0 0.335 0.223 0 0 0.223 0 0.335 0.223

E(lost sales) 1.5 1.5 0.72313 0.72313 0.280956 0.280956 0.089802 0.02416 0.005584

The steady-state analysis reveals the state probabilities and expected lost sales per week. 0 1 2 3 4 5 6 (0, 0) (0, 3) (1, 0) (1, 3) (2, 0) (2, 3) (3,0)

7 (4,0)

Average 8 lost sales (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

5

Discrete-Time Markov Chains

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 statetransition 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) (B, 3)

1

4 (B, 2)

(1, 0)

(1,3) (1,0)

(1,2)

(B, 1)

3

(1,2)

2

(1, 0) (1,1)

(1,1)

(1,1)

6

Discrete-Time Markov Chains

DTMC Matrix

0 tanks 1 tank 2 tanks 3 tanks 4 tanks

0 tanks 1 tank 2 tanks 3 tanks 4 tanks S t a t u s 0 1 0 0 0 Transient 0 0.8 0.2 0 0 Class-1 0 0.4 0.4 0.2 0 Class-1 0 0.1 0.3 0.4 0 . 2 Class-1 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

(B, 0)

(1,2) (1,1)

(1, 0) (B, 3)

1

4 (B, 2)

(1, 0)

(1,3)

(B, 1)

3

(1,0)

(1,2) (1,2)

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

0 1 2 3 4

Z tanks tank tanks tanks tanks

0 tanks 1 tank 2 tanks 3 tanks 4 tanks 0.8 0.2 0 0 0 0.4 0.4 0.2 0 0 0.1 0.3 0.4 0.2 0 0 0.1 0.3 0.4 0.2 0 0.1 0.3 0.4 0.2

7

8

Discrete-Time Markov Chains

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 1 2 3 4 5

0 0.1 0.26 0.378 0.4564 0.50732

0 0.3 0.32 0.306 0.2928 0.28364

1 0.4 0.3 0.232 0.1876 0.15888

0 0.2 0.12 0.084 0.0632 0.05016

b. A delay occurs whenever the system begins the day in state 3 (4 tanks).

Steady State Dist.

Average 0 1 2 3 Delay 1 tank 2 tanks 3 tanks 4 tanks per period 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.

10

Discrete-Time Markov Chains

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

1

2

3

4

Total

90

5

3

2

100

2

5

200

40

5

250

3

25

15

80

10

130

4

5

10

5

0

20

125

230

128

17

500

Total

(j)

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

P=

È 0.90 0.02 Í 0.19 Î 0.25

0.05 0.80 0.11 0.50

0.03 0.16 0.62 0.25

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

7.

11

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

2

Brand mix (0, 0, 0) (1, 0, 0) (0, 1, 0) (0, 0, 1) (1, 1, 0) (1, 0, 1) (0, 1, 1) (2, 0, 0) (0, 2, 0) (0, 0, 2)

For example, (0, 1, 1) means that a customer did not purchase Brand 1 but did purchase one unit each of Brand 2 and Brand 3 for that week.

Discrete-Time Markov Chains

8.

12

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

P=

1 2 3

1 0.90 0.02 0.20

2 0.07 0.82 0.12

3 0.03 0.16 0.68

For the calculations, we start with q(0) = (0.25, 0.46, 0.29). (3)

(3)

(4)

(4)

(5)

(5)

q(3) = q(0)P = ( 0.25, 0.46, 0.29 )P = ( 0.356, 0.388, 0.256 ) q(4) = q(0)P = ( 0.25, 0.46, 0.29 )P = ( 0.435, 0.342, 0.223 ) 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

9.

13

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

14

Discrete-Time Markov Chains

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.

The new transition matrix is: P =

È 0.9333 Í 0.037 Î 0.200

0.053 0.780 0.120

The changes conform to predictions in part (a).

0.014 0.183 0.680

˘ ˙ ˚

15

Discrete-Time Markov Chains

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

P=

È 3/4 Í 1/3 Î 1/1

0/4 2/3 0/1

1/4 0/3 0/1

˘ ˙ ˚

=

È 0.75 Í 0.33 Î 1

0 0.67 0

0.25 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

11.

16

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 ˆ ˜ , the calculations are as follows. matrix P = Á Ë 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 Initial 1 2 3

Audit

0.9

0.1

0.59 0.559 0.5559

0.41 0.441 0.4441

17

Discrete-Time Markov Chains

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.

d1

a 0

d2

1

2

d3 3

d4 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

Idle

Stage1

1 – pA

pA

Stage1

1 – pC1

Stage2

Stage3

pC3 1 – pC4

pC5

Stage5

pC2 1 – pC3

Stage4

Stage4

pC1 1 – pC2

Stage3 Stage5

Stage2

pC4 1 – pC5

All three states are recurrent. The efficiency of the worker is the percentage time working. Using the steadystate solution the efficiency is 1 – p0, where state 0 is the idle state.

18

Discrete-Time Markov Chains

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 1

Idle 2

Stage 1

Stage 3

Stage 4

Stage 5

1

Idle 2

1

Stage 1

1 – pC1

Stage 2

pC1 1 – pC2

Stage 3

pC2 1 – pC3

Stage 4 Stage 5

Stage 2

pC3 1 – pC4

pC5

pC4 1 – pC5

The efficiency of the worker is the percentage time working. Using the steadystate 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.

19

Discrete-Time Markov Chains

Idle

Idle

(1,0)

1-pA

pA (1-pA)* (1-pC1)

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

(5,1)

(2,0)

(2,1)



pA* (1-pC1) 1-pC1

(1- pA)* pC1 pC1

pA* pC1



(1- pA)* (1-pC2)

pA* (1-pC2) 1-pC2

(5,0)

(5,1)

(1-pA)* (1-pC5)

pA* (1-pC5) 1 – pC5

… … … …

… (5,0)

(1,1)

(1-pA)* pC5 pC5

pA* pC5

… …

20

Discrete-Time Markov Chains

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 1 – B(1, 0) 0 0 0

1 0 B(1, 0) 1 – B(2, 0) 0 0

2 0 0 B(2, 0) 1 – B(3, 0) 0

3 0 0 0 B(3, 0) 1 – B(4, 0)

4 0 0 0 0 B(4, 0)

21

Discrete-Time Markov Chains

With p = 0.6, the transition matrix is:

0 1 2 3 4

0 1 0.6 0 0 0

1 0 0.4 0.84 0 0

2 0 0 0.16 0.936 0

3 0 0 0 0.064 0.9744

4 0 0 0 0 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 B(1, 1) B(2, 2) B(3, 3) B(4, 4)

1 0 B(0, 1) B(2, 1) B(3, 2) B(4, 3)

2 0 0 B(2, 0) B(3, 1) B(4, 2)

3 0 0 0 B(3, 0) B(4, 1)

4 0 0 0 0 B(4, 0)

With p = 0.6, the transition matrix is:

0 1 2 3 4

0 1 0.6 0.36 0.216 0.1296

1 0 0.4 0.48 0.432 0.3456

2 0 0 0.16 0.288 0.3456

3 0 0 0 0.064 0.1536

4 0 0 0 0 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.

22

Discrete-Time Markov Chains

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

D(4, 0)

D(4, 1)

D(4, 2)

D(4, 3)

D(4, 4)

D(3, 0) ¥ B(1, 1)

D(3,0) ¥ B(1,0) + D(3,1) ¥ B(1,1)

D(3,1) ¥ B(1,0) + D(3,2) ¥ B(1,1)

D(3, 2) ¥ B(1,0) + D(3,3) ¥ B(1,1)

D(3,3) ¥ B(1,0)

2

D(2,0) ¥ B(2,2)

D(2,0) ¥ B(2,1) + D(2,1) ¥ B(2,2)

D(2,0) ¥ B(2,0) + D(2,1) ¥ B(2,1) + D(2,2) ¥ B(2,2)

D(2,1) ¥ B(2,0) + D(2,2) ¥ B(2,1)

D(2,2) ¥ B(2,0)

3

D(1,0) ¥ B(3,3)

D(1,0) ¥ B(3,2) + D(1,1) ¥ B(3,3)

D(1,0) ¥ B(3,1) + D(1,1) ¥ B(3,2)

D(1,0) ¥ B(3,0) + D(1,1) ¥ B(3,1)

D(1,1) ¥ B(3,0)

4

B(4, 4)

B(4, 3)

B(4, 2)

B(4, 1)

B(4, 0)

0 1

The numerical values for the matrix are:

0 1 2 3 4

0 0.6561 0.4374 0.2916 0.1944 0.1296

1 0.2916 0.4374 0.4536 0.4104 0.3456

2 0.0486 0.1134 0.2196 0.3024 0.3456

3 0.0036 0.0114 0.0336 0.0864 0.1536

4 0.0001 0.0004 0.0016 0.0064 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

23

Discrete-Time Markov Chains

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.

S0 S1 S2 S3 S4

State Combined Cost Cost 0 0 0 600 0 1113.6 0 1800 0 2400

0 S0 0 1000 2000 3000 4000

Transition Cost Matrix 1 2 3 S1 S2 S3 0 0 0 333.33 142.86 52.632 952.38 426.23 142.86 2052.6 1142.9 333.33 3000 2000 1000

4 S4 0 0 0 0 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. 0 State 0

1 State 1

2 State 2

Steady State Dist. 0.53978 0.35985 0.08996

3 State 3

4 State 4

Average Cost per period

0.01 0.00042 335.084378

24

Discrete-Time Markov Chains

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 enter

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

25

Discrete-Time Markov Chains

E, E

E, W

W, E

W, W

B, W

E, E

0.1

0

0.9

0

E, W

0.8¥0.1 = 0.08

0.2¥0.1 = 0.02

0.9¥0.8 = 0.72

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

E,E E,W W,E W,W B,W

State Combined TP TP 0 0 0 0.8 0 0 0 0.8 0 0.8

0 E,E 0 1 0 0 0

Transition TP Matrix 1 2 3 E,W W,E W,W 0 0 0 0 1 0 0 0 0 1 1 0 1 0 0

4 B,W 0 0 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.

Steady State Dist.

0 E,E 0.0323

1 E,W 0.3634

2 W,E 0.5225

3 W,W 0.0711

Average 4 TP B,W per period 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.

26

Discrete-Time Markov Chains

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

P=

a. Find the steady-state probabilities for the corresponding Markov chain. b. If you receive $3 every time you reach state 2 and pay $1 when you 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 long-run expected return? How does this result change if there is a discount rate of 1% per play due to fatigue?

0

0

1

0

0

1

0

0

1

0

2

1/3

1/3

0

1/3

3

1

0

0

0

p = (2/9, 1/3, 1/3, 1/9) Note that all the states are all recurrent. The expected profit is 32 – 1(1 – 2) = $0.3333

The long run expected return is 0.3333 per period. One can compute the expected NPW for an interest rate of 0.01 per play. This is shown in the first line below. We convert that to a value per play in the 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 matrix above is

È0 1 Í 0 0 P =Í Í1 / 3 1 / 3 Í 0 Î0

0˘ ˙ 0˙ 0 1 / 3˙ ˙ 0 1˚ 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?

States 0, 1 and 2 are transient. State 3 is absorbing. The transient probabilities (states 0, 1, 2) will all go to zero. The probability of state 3 goes to 1.

27

Discrete-Time Markov Chains

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

0 1 2 3

Fail 0 0.729 0.81 0 0

Fail 1 0.243 0.18 0.9 0

Fail 2 0.027 0.01 0.1 1

Fail 3 0.001 0 0 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 Fail Fail Fail

0 1 2 3

Fail 0 0.729 0.405 0.225 0.125

Fail 1 0.243 0.495 0.475 0.375

Fail 2 0.027 0.095 0.275 0.375

Fail 3 0.001 0.005 0.025 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.

28

Discrete-Time Markov Chains

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

Fail 1-s 0.243 0 0 0 0.18 0.9 0

Fail 2-s 0.027 0 0 0 0.01 0.1 1

Fail 3-s 0.001 0 0 0 0 0 0

Fail 1-f 0 0.81 0 0 0 0 0

Fail 2-f 0 0.18 0.9 0 0 0 0

Fail 3-f 0 0.01 0.1 1 0 0 0

Discrete-Time Markov Chains

17.

29

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

30

Discrete-Time Markov Chains

idle 0 wait 1 waits 2 wait 3 wait 4 wait

idle 0.367879 0.331091 0.036788 0 0 0

0 wait 0.367879 0.367879 0.331091 0.036788 0 0

1 waits 0.18394 0.202334 0.349485 0.331091 0.036788 0

2 wait 0.061313 0.073576 0.19197 0.357516 0.357516 0.1

3 wait 4 wait 0.015328 0.00366 0.023221 0.001899 0.082635 0.00803 0.248181 0.026424 0.542484 0.063212 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.

31

Discrete-Time Markov Chains

State Names idle Omar busy Both Busy 1 waits 2 wait 3 wait

6

0 idle idle 0.367879 Omar busy 0.367879 Both Busy 0.367879 1 waits 0 2 wait 0 3 wait 0 Sum 1.103638

1 Omar busy 0.367879 0.367879 0.367879 0.513417 0 0 1.617055

2 Both Busy 0.18394 0.18394 0.18394 0.342278 0.716531 0 1.610628

3 4 1 waits 2 wait 0.061313 0.015328 0.061313 0.018988 0.080301 0 0.144305 0 0.283469 0 1 0 1.630701 0.034316

5 3 wait 0.00366 0 0 0 0 0 0.00366

Arrival distribution with none waiting Random Variable Distribution mean (theta)

Arr0 Poisson 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 idle Steady State Dist. 0.335236

1 2 Omar busy Both Busy 0.37388

3 1 waits

4 2 wait

5 3 wait

Revenue per period

Revenue per day

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

18.

32

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.

33

Discrete-Time Markov Chains

B_4500 B_5000 B_5500 B_6000 G_4500 G_5000 G_5500 G_6000

B_4500 B_5000 B_5500 B_6000 G_4500 G_5000 G_5500 G_6000 0.48 0.12 0 0 0.32 0.08 0 0 0.24 0.24 0.12 0 0.16 0.16 0.08 0 0 0.24 0.24 0.12 0 0.16 0.16 0.08 0 0 0.6 0 0 0 0.4 0 0.15 0.15 0 0 0.35 0.35 0 0 0.09 0.06 0.15 0 0.21 0.14 0.35 0 0 0.09 0.06 0.15 0 0.21 0.14 0.35 0 0 0.3 0 0 0 0.7 0

The steady-state distribution is: 0 1 2 3 4 5 6 7 B_4500 B_5000 B_5500 B_6000 G_4500 G_5000 G_5500 G_6000 Steady State Dist.

0.1291

0.1256

0.1306

0.0433

The expected enrollment is 5137 students.

0.1477

0.1647

0.1841

Average enrollment per period

0.0749 5137.17909

34

Discrete-Time Markov Chains

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.

0 0 ˘0 È0.99 0.01 Í0.02 0.97 0.01 0 ˙1 ˙ P=Í 0.02 0.97 0.01˙ 2 Í 0 Í 0 0 0.02 0.99˙˚ 3 Î

Construct the transition matrix that describes a 1-minute interval. The states are the number of people in the salon (not counting Archy).

b. C o m p u t e steady-state probabilities and use them to answer the following questions. c. If Archy earns $5 each time a served customer leaves the salon, what is his expected daily earnings? Assume an 8-hour day.

p

=

S0

S1

S2

S3

0.5333

0.2667

0.1333

0.0667

Average Revenue per minute

Minutes per day

Average Revenue per day

0.04666667

480

$ 22.40

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?

35

Discrete-Time Markov Chains

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 Probability

0

1

2

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.

36

Discrete-Time Markov Chains

0.1

0.1

0.1

0.6 0.3

1,N

0,N

0.6

3

0.3

3

4

2,N

0.6 0.3

4

5

0.1 0.3 0.6

0.4 0.6 1

0.1 0.3

0.4

0,Y Names 0_N 1_N 2_N 3 4 5 0_Y 1_Y 2_Y

1,Y

1

2,Y

0.6

0_N 0_N 1_N 2_N 3 4 5 0_Y 1_Y 2_Y

1_N 0 0 0 0 0 0 0 0 0

0.6

2_N

0 0 0 0.1 0 0 0 0 0

0 0 0 0.3 0.1 0 0 0 0

0 0 0 0.6 0.3 0.1 1 0.4 0.1

5

0 0 0 0 0.6 0.3 0 0.6 0.3

0_Y

0 0 0 0 0 0.6 0 0 0.6

1_Y

1 0.4 0.1 0 0 0 0 0 0

2_Y

0 0.6 0.3 0 0 0 0 0 0

0 0 0.6 0 0 0 0 0 0

b. The following shows the transient probabilities for the first five days. Day 5 is Saturday morning. 0

0_N

Initial 1 2 3 4 5

1_N

0

2_N

0

3

0

4 1

5 0

0_Y 0

0

1_Y

2_Y 0

0

0 0.1 0.3 0.6 0 0 0 0 0 0 0.06 0.18 0.36 0 0 0.07 0.15 0.18 0 0.036 0.108 0.364 0.144 0.108 0.042 0.09 0.108 0 0.036 0.124 0.361 0.205 0.13 0.025 0.054 0.065 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 Analysis

Expected 0 0_N

Steady

State

1

2

3

4

5

6

7

1_N

2_N

3

4

5

0_Y

1_Y

8

Value

2_Y per period

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 0.1 0_N 1_N 2_N 3 4 5 0_Y 1_Y 2_Y

State Value 0 10 20 30 40 50 0 10 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.

38

Discrete-Time Markov Chains

Names 0_N 1_N 2 3 4 5 0_Y 1_Y 2_Y

0_N 0_N 1_N 2 3 4 5 0_Y 1_Y 2_Y

1_N

0 0 0.1 0 0 0 0 0 0

2

0 0 0.3 0.1 0 0 0 0 0

3

0 0 0.6 0.3 0.1 0 0 0 0

4

0 0 0 0.6 0.3 0.1 1 0.4 0.1

5

0 0 0 0 0.6 0.3 0 0.6 0.3

0_Y

0 0 0 0 0 0.6 0 0 0.6

1_Y

1 0.4 0 0 0 0 0 0 0

2_Y

0 0.6 0 0 0 0 0 0 0

0 0 0 0 0 0 0 0 0

Steady State Analysis yields 0_N Steady

1_N

2

3

4

5

State 0.028 0.116 0.276 0.333 0.104 150

80

20

30

0_Y 0 0.074

40

50

1_Y

2_Y

0.07

100

per period 0 42.57227

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 Analysis

Expected 0 0_N

Steady

State

1

2

3

4

5

1_N

2_N

3

4

5

0 0.035 0.201 0.348 0.181 150

80

70

30

6

7

8

Value

0_Y

1_Y

2_Y

per period

0 0.034 0.081 0.121 42.75889

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

Expected 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

State 0.046 0.153 0.464 0.138 150

80

20

30

0 40

Another increase in cost. I haven't found a better policy than the original.

0 0.108 0.092 50

100

30

0 46.10092 20

11986.24

39

Discrete-Time Markov Chains

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 0 s0 = (0)

1

no typing service

Events Neither computer fails.

Probability 0.6

Next state s = (0)

s1 = (1)

One computer fails. Both computers fail. No computer fails.

0.3 0.1 0.6

s = (1) s = (2) s = (0)

One computer fails. Two computers fail. No computers fail

0.3 0.1 0.8

s = (1) s = (2) s = (0)

One computer fails

0.2

s = (1)

spare in operation, no typing service

2

s2 = (2) one computer in operation, typing service for $75

We compare the Transition Matrix

Economic Matrices

Original computer problem S0 S1 S2

S0 0.6 0.8 1

S1 0.3 0.2 0

S2 0.1 0 0

S0 S1 S2

State Cost 0 75 125

Transition Cost 0 1 2 S0 S1 S2 0 0 0 80 80 0 160 0 0

Steady-state probabilities and cost

0 S0

1 S1

2 S2

Cost per da

0.678 0.254 0.068 58.73

40

Discrete-Time Markov Chains

Computer problem with spares S0 S1 S2

S0 0.6 0.6 0.8

S1 0.3 0.3 0.2

S2 0.1 0.1 0

S0 S1 S2

State Cost 0 0 75

Transition Cost 0 1 2 S0 S1 S2 0 0 0 80 80 80 160 160 0

0 S0

1 S1

2 S2

Cost per da

0.618 0.291 0.091 44.64

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

22.

41

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

–1 S

[I – aP] C

È17, 569 ˘ = Í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.

42

Discrete-Time Markov Chains

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 Initial 1 2 3 4 5 6 7 8

Failed 1

Failed 2

1

0

0

0.36 0.4176 0.465216 0.448259 0.447757 0.449505 0.449134 0.449055

0.48 0.5248 0.467968 0.477307 0.480521 0.478853 0.478945 0.479083

0.16 0.0576 0.066816 0.074435 0.071721 0.071641 0.071921 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 Failed 0

1 Failed 1

2 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

24.

44

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 P=Í 0 Í0 Í1 0 Î

0 1 0 0

0˘ H 0 ˙ D1 ˙ 1 ˙ D2 0 ˙˚ D3

b. The transition matrix is below.

0˘H È0.9 0.1 0 Í0.5 0 0.5 0 ˙ D1 ˙ P=Í 0 0.5˙ D2 Í0.5 0 Í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 H

1 D1

2 D2

3 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

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.

45

46

Discrete-Time Markov Chains

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

0-30 days 0

30-60 days 0.7

60-90 days 0

Paid 0.3

Uncollectable 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

Paid 0.3 0.2 0.5 1 0

Uncoll.

The transition matrix for this situation is: D 0-30 D 0-30 D 30-60 D 60-90 Paid Uncoll.

0 0 0 0 0

D 30-60 0.7 0 0 0 0

D 60-90 0 0.8 0 0 0

0 0 0.5 0 1

The Paid state and the Uncollectable state are trapping states and the others are transient. An absorbing state analysis yields Paid Transient Transient Transient

D 0-30 D 30-60 D 60-90

0.72 0.6 0.5

Uncoll. 0.28 0.4 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%.

47

Discrete-Time Markov Chains

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 1day transition probabilities are as shown, what are the steady-state probabilities for an individual patient? One-day transition probabilities — heart patients CCU

Hospital rehabilitation

Discharged 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.05 0.015

Hospital 0.2 0.8 0.005

Gone 0.1 0.15 0.98

The steady-state probabilities for this matrix are below. 0 CCU

1 Hospital

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

48

Discrete-Time Markov Chains

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.

P=

up

down

up

0.9

0.1

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.

P=

up

down

up

0.95

0.05

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 Initial 1 2 3

down 1

0

0.9 0.87 0.861

0.1 0.13 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. 0 up

1 down

Average Cost per hour

Steady State Dist. 0.857 0.143 85.7142857

49

Discrete-Time Markov Chains

c. With the different transition matrix the steady state results are: 0 up

1 down

Average Cost 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 Savings per month

$52 $37,714

The breakeven cost is $37,714 per month. This looks like a good deal.

Discrete-Time Markov Chains

28.

50

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 P= Í Î 0.99

0.10 ˘ ˙ 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.

51

Discrete-Time Markov Chains

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

P=

0 0.05 0.08 0.12 0.20 1

1 0.95 0 0 0 0

2 0 0.92 0 0 0

3 0 0 0.88 0 0

4 0 0 0 0.80 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 Surviving

0 1000

1 950

2 874

3 769

4 615

5 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

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.

52

53

Discrete-Time Markov Chains

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 )

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

t

0

k =1



Expected cost for 3 months = $2 ¥ (expected number replaced

54

Discrete-Time Markov Chains

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

1 17

2 11.64

3 10.76

4 11.49

Individual replacement 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 0 0 0 ¥ ¥

1 0 ¥ ¥ 0 0

2 0 ¥ ¥ 0 0

3 ¥ 0 0 0 0

0 ¥ 0 0 0

1 ¥ ¥ 0 ¥

2 ¥ 0 ¥ 0

3 0 ¥ 0 0

0 0 0 ¥ ¥

1 0 ¥ ¥ 0

2 ¥ ¥ 0 0

3 ¥ 0 0 0

4 ¥ 0 0 0 0

0 ¥ 0 0 ¥

1 0 ¥ ¥ 0

2 0 ¥ ¥ 0

0 0 0 0 ¥

1 0 0 ¥ ¥

2 ¥ ¥ 0 0

3 ¥ 0 0 0

0 1 2 3

0 0 0 0 ¥

1 ¥ 0 0 0

2 0 ¥ 0 0

3 0 0 ¥ 0

0 1 2 3

0 1 2 3 4

c.

3 0 0 0 ¥

0 1 2 3

d. 0 1 2 3

e.

f. 0 1 2 3

Processes e and f are irreducible. Process e is ergodic.

Mathematics of Discrete-Time Markov Chains

Problem 13.1 analyses a S1 S2 S1 0 0 S2 0 0.5 S3 0 0.5 S4 1 0 S5 1 0 S2

S3 0 0.5 0.5 0 0

Class-1 Class-2 Class-2 Class-1 Class-1

S1 1 0 0 0.5

0 0.5 0.5 0

0 0.5 0.5 0

c S1 S2 S3 S4

S1 0.3 0 0 0

S2 0.3 0.5 0 1

S3 0.4 0 0.5 0

S4

d S1 S2 S3 S4

S1

S2

S3 0.5 1 0 0

S4 0.5 0 0 0

Status Transient Class-1 cyclic Class-1 cyclic Transient

e S1 S2 S3 S4

S1

S3 0.5 0.5 0 0

S4 0.5 0 0 0

Status Class-1 Class-1 Class-1 Class-1

acyclic acyclic acyclic acyclic

f S1 S2 S3 S4

S1

S3

S4

Status Class-1 Class-1 Class-1 Class-1

cyclic cyclic cyclic cyclic

0 0 1 0.5 S2

0 0 0.5 1

0 0.5 0.5 0 S2

0 0 0 1

1 0 0 0

S4

S5 0.5 0 0 0 0

b S1 S2 S3 S4

0 0 0 0.5

S3

S4 0.5 0 0 0 0

0 1 0 0

0 0 0 0.5

0 0.5 0.5 0

0 0 1 0

cyclic acyclic acyclic cyclic cyclic

Status Class-1 absorbing Class-2 acyclic Class-2 acyclic Transient Status Transient Class-1 acyclic Transient Class-1 acyclic

2

Mathematics of Discrete-Time Markov Chains

2.

3

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.1 Í 0.8 Î0

0 0 0.5 0.5 0 0 0 0 0 1 0 0 0.1 0.9 0 0.01 0.89 0 0 0 0 0.2 0 0 0 1 0 0 0 0

c.

È 00 Í0 Í 0.1 Í 0.8 Î 0.1

˘ ˙ ˙ ˙ ˚

0 0 0.5 0.5 0 0 0 0 0 1 0 0 0.1 0.9 0 0.01 0.89 0 0 0 0 0.2 0 0 0 0.9 0 0 0 0

˘ ˙ ˙ ˙ ˚

d.

È 00 Í 0.3 Î0

1 0 0 1

0 0 1 0 0 0.7 0 0

˘ ˙ ˚

È 0.2 Í 00 Î 0

e.

0.8 0 0 0.9 0.1 0 0 1 0 0 0.1 0.9

˘ ˙ ˚

0 0.9 0 0

˘ ˙ ˚

f.

È 0.20 Í 0.3 Î0

0.8 0 0 0.9 0.1 0 0 0.2 0.5 0 0.1 0.9

˘ ˙ ˚

È 0.20 Í 0.3 Î0

0.8 0 0.1 0 0.7 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

3.

4

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

Working

1 – pA

pA

pD

1 – pD

Both states are recurrent.

Mathematics of Discrete-Time Markov Chains

5

b. Idle

Working 1

Working 2

1 – pA

pA

0

Working 1

pD1

0

1 – pD1

Working 2

pD2

0

1 – pD2

Idle

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

Idle

Working, 0 waiting

Working, 1 waiting

1 – pA

pA

0

pD(1 – pA1)

(1 – pD)(1 – pA1)

(1 – pD)pA1

pD

1 – pD

Working, 1 waiting All three states are recurrent.

Mathematics of Discrete-Time Markov Chains

4.

6

Consider the DTMC with the states numbered 0, 1 and 2. The state-transition matrix is below.

È0 P=Í 1 Î1

0.3 0.7 0 0 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. Qt(0) 0 1 0 1 0 1 0

Period 1 2 3 4 5 6 7

Qt(1) 0.3 0 0.3 0 0.3 0 0.3

Qt(2) 0.7 0 0.7 0 0.7 0 0.7

b. 1 State 0 State 1 State 2

1 0 0 1

State 0 State 1 State 2

2 step Transition Matrix 0 1 2 State 0 State 1 State 2 0 0.3 0.3

0 0.7 0.7

3 step Transition Matrix 0 1 2 State 0 State 1 State 2 0 1 1

0.3 0 0

0.7 0 0

Mathematics of Discrete-Time Markov Chains

1

7

4 step Transition Matrix 0 1 2 State 0 State 1 State 2

State 0 State 1 State 2

1 0 0

0 0.3 0.3

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

5.

8

Find the steady-state probabilities for the Markov chain associated with the following state-transition matrix. Do the calculations by hand.

È 1 P = Í 0.1 Î 0

0 0 0.7 0.2 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 p0 + 0.1p1 = p0 (1) (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 ˘ Í 1 0 ˙˙ with Q = [0.7] and R = [0.1, 0.2] P=Í 0 0 1 ˚ Î 0 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

6.

10

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

0.6

0.4

1

2

3

0.4

4

0.6

0.6

The Transition matrix is below. 0 1 0 1 0 1 1- pW 0 2 0 1- pW 3 0 0 4 0 0

2 0 pW 0 1- pW 0

3 0 0 pW 0 0

4 0 0 0 pW 1

There is no steady state for this case. The absorbing probabilities depend on the initial state and are shown below. Class-1 S_$0 S_$10 S_$20 S_$30

Class-2 S_$40

0.876923 0.123077 0.692308 0.307692 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

0.6

0.4

1

2

0.4

3

4

0.6

0.6 1

0 0 1- pW 0 0 0

0 1 2 3 4

1 0 0 1- pW 0 0

2 1 pW 0 1- pW 0

3 0 0 pW 0 0

4 0 0 0 pW 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 Borrow $0

0.4

1

2

3 0.6

0.6 0.6 0.4 Borrow $2

0.4 2

1 0.6

0.6

0.6 0.4

0.6

Borrow $4 0

0.4 3

0.4 1

0.4 2

3

1 0.4

4

0.6

0.6

There is no steady state. Absorbing state probabilities are below. 1,0 1,2 1,4 2,0 2,2 2,4 3,0 3,2 3,4

Class-1 S $0

Class-2 S $4

0.4203 0.607101 0.876923 0.331816 0.47929 0.692308 0.19909 0.287574 0.415385

0.5797 0.392899 0.123077 0.668184 0.52071 0.307692 0.80091 0.712426 0.584615

Mathematics of Discrete-Time Markov Chains

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 3 4 5 6

0.34 0.048 0.0096 0.00192 0.000384

12

Mathematics of Discrete-Time Markov Chains

8.

13

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

0.18 0.138 0.1008

b. Probabiliti es from state 1 to state 0 n

PF(1,0,n)

1

0.8

2 3 4

0.16 0.032 0.0064

c. Probabiliti es from state 1 to state 1 n

PF(1,1,n)

1

0.2

2 3 4

0.24 0.144 0.1104

Mathematics of Discrete-Time Markov Chains

9.

14

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 P = Í 0.9 Î 0.2

0.3 0.7 0.1 0 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 Initial 1 2 3 4 5

S2

S3

0

0

1

0.2 0.16 0.21 0.1958 0.20872

0 0.06 0.054 0.0684 0.06558

0.8 0.78 0.736 0.7358 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 3 4

0.16 0.128 0.1024

Mathematics of Discrete-Time Markov Chains

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: 0 S1

1 S2

Average Cost per period

2 S3

Steady State Dist. 0.206897 0.068966 0.724138 99.2413793 Expected NPW 1101.312 1042.881 1093.542 q0 =

0.2

0.5

Exp. NPW 0 . 3 1069.76546

15

Mathematics of Discrete-Time Markov Chains

10.

16

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 P = Í 0.3 Î0

0.8 0 0 0.9 0.1 0 0 0.2 0.5 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 State 0 Steady State Dist.

1 State 1

0.04

2 State 2

3 State 3

0.32 0.106667 0.533333

d. Find the expected recurrence times for all states. 0 Expected Recurrence Time

25

1

2

3

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

0 State 0 Steady State Dist.

0.04

1 State 1

2 State 2

17

3 State 3

0.32 0.106667 0.533333

Average Cost per period 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-betweenfailure 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(3) P(3) P(3)

1 P(1) P(2) P(2) P(2)

2 P(0) P(1) P(1) P(1)

3 0 P(0) P(0) P(0)

Mathematics of Discrete-Time Markov Chains

18

For the given data the transition matrix is: 0-comp 0.593994 0.323324 0.323324 0.323324

0-comp 1-comp 2-comp 3-comp

1-comp 0.270671 0.270671 0.270671 0.270671

2-comp 3-comp 0.135335 0 0.270671 0.135335 0.270671 0.135335 0.270671 0.135335

Steady-state probabilities: 0 0-comp

1 1-comp

2 2-comp

3 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 3 4 5

0.218785 0.148047 0.10018 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

12.

19

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. 0 0 0 ˘ 37 È1 Í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 0.0788 -2 0.6003 0.8823

q(4)= Gain = Expected Gain Probability Sold

S $38 0.0456 -1

S $39 0.0721 0

S $40 0.8035 1

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.2 0

S $39 0.5 0.3 0

Sold 0.2 0.5 1

A first passage analysis into the state Sold yields the expected first passage times in to the sold state: From

State

0 S $38

1 S $39

2 Sold

3.076923 2.307692

Starting with $39, we expect to sell the stock in 2.308 days.

1

Mathematics of Discrete-Time Markov Chains

13.

20

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

From brand

1

1 60

2 8

3 20

4 12

Market share 40%

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.4, 0.2, 0.3, 0.1) Í 0.25 Î 0.28

0.08

0.20

0.40

0.25

0.16

0.50

0.12

0.20

0.12

˘ ˙. 0.09 ˚ 0.40 0.20

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

0.2p1 – 0.25p2

p1

+ p2

– 0.5p3

+ 0.2p4 = 0

+ 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 steadystate 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.

21

Mathematics of Discrete-Time Markov Chains

14.

22

Let {X t} be a DTMC with state space {a, b, c, d} and transition probabilities given by

P=

0.1

0.3 0.6

0.0

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

4j

= $5(1) = $5.

j ŒJ

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)]=

Â

E[f(X1) | X0 = j] Pr{X0 = j}

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

15.

24

Consider the following transition matrix representing a DTMC with state space {a, b, c, d, e}.

P=

0.3

0.0

0.0

0.7

0.0

0.0

1.0

0.0

0.0

0.0

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

c

b

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

a

F =

a b c d e

b

c

d

25

e

1 0 1 1 0 1 0 0 1 0 1 1 1 0 1 1 0.667 0.333 0.667 0.667

0 0 0 0 0.4

e. Let Ri,j denote the expected number of visits to state j given that X0 = i. Calculate the R matrix.

R =

a 9999 0 9999 9999 9999

a b c d e

b 0 9999 0 0 9999

c 9999 0 9999 9999 9999

d e 9999 0 0 0 9999 0 9999 0 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 10 a b c d e

step Transition 0 1 a b

0.322581 0 0 1 0.322581 0 0.322581 0 0.215054 0.333333

Matrix 2 c

3 d

0.225806 0 0.225806 0.225806 0.150538

0.451613 0 0.451613 0.451613 0.301075

4 e 0 0 0 0 0

Mathematics of Discrete-Time Markov Chains

16.

26

Let {Xt}be a DTMC with state space {a,b,c,d,e,f} and transition probabilities given by

P=

a.

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

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

.

Draw the state diagram.

b a

f

c

d

e

b.

List the recurrent states.

There are two classes of recurrent states: {b, d, f} and {c}.

c.

List the irreducible set(s)

There are two irreducible sets: {b, d, f} and {c}.

d.

List the transient states.

Transient states: {a, e}

e.

Calculate the F matrix.

a b c d e f

a 0.3 0 0 0 0.5 0

b

c

d

e

f

1 1 0 1 0.5 1

0 0 1 0 0.5 0

1 1 0 1 0.5 1

0 0 0 0 0.8 0

1 1 0 1 0.5 1

Mathematics of Discrete-Time Markov Chains

f.

Calculate the R matrix Note that 9999 implies infinity here.

a 1.429 0 0 0 0.714 0

a b c d e f

b 9999 9999 0 9999 9999 9999

27

c

d 9999 9999 0 9999 9999 9999

0 0 9999 0 9999 0

e 0 0 0 0 5 0

f 9999 9999 0 9999 9999 9999

g. Calculate the limnƕ p(n) matrix. 102 10 a b c d e f

step Transition 0 1 a b 0 0 0 0 0 0

0.540541 0.540541 0 0.540541 0.27027 0.540541

Matrix 2 c

3 d

0 0.27027 0 0.27027 1 0 0 0.27027 0 . 5 0.135135 0 0.27027

4 e

5 f 0 0 0 0 0 0

0.189189 0.189189 0 0.189189 0.094595 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 idle cut wait 1 wait 2 wait 3

cut 0 5 0 0 0

wait 1 4 0 5 0 0

wait 2

0 4 0 5 0

wait 3

0 0 4 0 5

0 0 0 4 0

Economics Matrix Transition Revenue Matrix 1 2 3 cut wait 1 wait 2 0 0 0 0 0 0 10 0 0 0 10 0 0 0 10

0 idle idle cut wait 1 wait 2 wait 3

0 10 0 0 0

4 wait 3 0 0 0 0 0

Steady State 0 idle

1 cut

Steady State (Time) 0.297 0.238 Transition Time

Expected 2 3 4 ransition wait 1 wait 2 wait 3 Time

Average Revenue rate

0.19 0.152 0.122 0.142

35.13

0.25 0.111 0.111 0.111

0.2 Rev. for 8 hours

Omar earns$281 per day. a. Add a fourth waiting chair. Rate Matrix idle idle cut wait 1 wait 2 wait 3 wait 4

0 5 0 0 0 0

cut

wait 1 wait 2 wait 3 wait 4 4 0 5 0 0 0

0 4 0 5 0 0

0 0 4 0 5 0

0 0 0 4 0 5

0 0 0 0 4 0

281

Continuous-Time Markov Chains

3

Steady State 0 idle

1 cut

Expected 2 3 4 5 ransition wait 1 wait 2 wait 3 wait 4 Time

Average revenue rate

Steady State (Time) 0.271 0.217 0.173 0.139 0.111 0.089 0.137 Transition Time

0.25 0.111 0.111 0.111 0.111

36.45

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 Omar cuts Other cuts Both cut wait 1 wait 2

0 5 5 0 0 0

4 0 0 5 0 0

0 0 0 5 0 0

0 4 4 0 10 0

0 0 0 4 0 10

0 0 0 0 4 0

Economics Matrix

idle Omar cuts Other cuts Both cut wait 1 wait 2

Transition Revenue Matrix 0 1 2 3 4 5 idle mar cuther cuBoth cut wait 1 wait 2 0 0 0 0 0 0 10 0 0 0 0 0 5 0 0 0 0 0 0 5 10 0 0 0 0 0 0 7.5 0 0 0 0 0 0 7.5 0

Steady State Expected 0 1 2 3 4 5 ransition idle mar cuther cuBoth cut wait 1 wait 2 Time

Average Revenue rate

Steady State (Time) 0.435 0.271 0.077 0.139 0.056 0.022 0.128 Transition Time

0.25 0.111 0.111 0.071 0.071

0.1

Rev. for 8 hours

More customers are served, but the extra barber reduces Omar’s revenue.

31.75 254

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 idle cut wait 1 wait 2 wait 3

cut

0 5 0 0 0

wait 1 wait 2 wait 3 4 0 5 0 0

0 4 0 6 0

0 0 4 0 6

0 0 0 4 0

Same Economics matrix as original Steady State 0 idle

1 cut

Expected 2 3 4 ransition wait 1 wait 2 wait 3 Time

Steady State (Time) 0.317 0.254 0.203 0.135 Transition Time

0.25 0.111 0.111

0.09 0.137

0.1 0.167

Average Cost rate 36.39

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 idle cut wait 1 wait 2 wait 3

0 5 0 0 0

Same Economics matrix as original

cut

wait 1 wait 2 wait 3 4 0 5 0 0

0 0 0 4 0 0 0 2.667 0 5 0 1.333 0 5 0

Continuous-Time Markov Chains

5

Steady State Expected 0 1 2 3 4 ransition idle cut wait 1 wait 2 wait 3 Time Steady State (Time) 0.348 0.279 0.223 0.119 0.032 0.153 Transition Time

0.25 0.111

0.13 0.158

Balking causes a considerable reduction in revenue.

0.2

Average Revenue rate 32.59

Rev. for 8 hours 260.7

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_0 Failed_1 Failed_2 Failed_3

0 0.002 0 0

Failed_1 0.003 0 0.005 0

Failed_2 0 0.002 0 0.005

Failed_3 0 0 0.001 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} P{all are down} P{repair shop is idle} E[number in shop] State Flow rate into shop E[flow rate into shop] E[time in shop]

0.776398 0.037267 0.310559 0.950311 0 1 2 0.003 0.002 0.001 0.00205 463.6364 hours -From Little's Law

3 0

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 Steady State (Time) Average number in system Proportion lost

0 1 2 3 4 5 pump 0 pump 1 pump 2 pump 3 wait 1 wait 2 0.05882 0.176471 0.264706 0.264706 0.176471 0.058824 2.5 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

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

0 0 0 0 0 6 0 0 0 0 0 0 0

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

4 0 0 0 0 0 6 0 0 0 0 0 0

0 6 0 0 0 0 0 6 0 0 0 0 0

0 0 4 0 0 0 0 0 6 0 0 0 0

0 0 0 6 0 0 0 0 0 6 0 0 0

0 0 6 0 0 0 0 0 0 0 6 0 0

0 0 0 6 0 4 0 0 0 0 0 0 6

0 0 0 0 6 0 6 0 0 0 0 6 0

0 0 0 0 0 0 0 4 0 0 0 0 0

0 0 0 0 0 0 0 0 6 0 0 0 0

0 0 0 0 0 0 0 6 0 0 0 0 0

0 0 0 0 0 0 0 0 0 6 0 0 6

0 0 0 0 0 0 0 0 6 0 4 0 0

A product is delivered whenever whenever station 3 completes its service. This is modeled with the economics matrix below. 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

Transition Throughput Matrix 0 1 2 3 4 5 6 7 8 9 10 11 12 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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 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 (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.

d2

d1 0

d3

1

2

3

a1

a2

4 a3

The rate matrix is S0 S0 S1 S2 S3 S4

1 0.1 0 0 0

S1

S2

0 0 0.5 0 0

S3

0 0.75 0 1 0

0 0 0.5 0 0

S4 0 0 0 0.2 1

The embedded Markov Chain transition matrix is S0 S0 S1 S2 S3 S4

1 0.118 0 0 0

S1

S2

0 0 0.5 0 0

S3

0 0.882 0 0.833 0

0 0 0.5 0 0

S4 0 0 0 0.167 1

Absorbing State Probabilities. The requested answer is in the second row. S0 S1 S2 S3

S4

0.482759 0.517241 0.413793 0.586207 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)

2

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

0

6 (0.5)

(1)

(0.5)

(1)

1

2

(1)

4

5

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

1 S1

Steady State (Time)

0

0

Transition Time

1

1

Steady State (Steps)

0

0

Expected 2 3 4 5 6 Transition S2 S3 S4 S5 S6 Time 1E-16 0.3333 0.1667 0.3333 0.1667 1 1

1

1

1

1

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_0 S_1 S_2 S_3

S_1

S_2

0 0.03 0.0333 0 0 0.0667 0 0

0 0.02 0 0.1

S_3 0 0 0.01 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

S_0 S_0 S_1 S_2 S_3

0 0.1 0 0

15

S_1

S_2

S_3

0.03 0 0.1 0

0 0.02 0 0.1

0 0 0.01 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 E[Number in Population] E[Arrival Rate(per Hour)] E[Time in System (Hours)]

Results 0.3206 0.0268 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_0 f_1 f_2 f_3

0 0.5 0 0

f_1 0.8 0 1 0

f_2

f_3

0 0.8 0 1.5

0 0 0.8 0

SS analysis f_0

f_1

f_2

Steady State (Time) 0.219 0.351 0.281

The truck is in working condition about 85% if the time.

f_3 0.15

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_0 f_1 f_2 f_3

f_1

0 0.8 0 0 0.333 0 0 0.333

f_2 0 0.8 0 0

f_3 0 0 0.8 0

SS analysis f_0 Steady State (Time)

f_1

f_2

f_3

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 steadystate 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 wii wwi wiw hwi www whw hhw hww

wwi 0 0 1 0 0 0 0 0

wiw 1 0 0 0 1 0 0 0

hwi 0 1 0 0 0 1 0 0

www 0 1 0 0 0 0 0 1

whw 0 0 1 1 0 0 1 0

0 0 0 0 1 0 0 0

hhw

hww

0 0 0 0 0 1 0 1

0 0 0 0 1 0 0 0

The economics matrix evaluates a completion whenever there is a transition caused by a completion of station 3. 0 wii

n wii wwi wiw hwi www whw hhw hww

0 0 1 0 0 0 0 0

Transition Completion Matrix 1 2 3 4 5 wwi wiw hwi www whw 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 1 0 0

6 hhw 0 0 0 0 0 0 0 0

7 hww 0 0 0 0 0 0 0 0

Steady-state 0 wii

1 wwi

2 wiw

3 hwi

4 www

5 whw

6 hhw

7 hww

Expected Transition Time

Steady State (Time) 0.1026 0.1282 0.1026 0.2051 0.1538 0.0769 0.1538 0.0769 0.5909

Average Completio rate 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_0 P_1 P_2 P_3 P_4 P_5 P_6

0.5 0 0 0 0 0 0

P_1

P_2

0.5 0.5 0 0 0 0 0

P_3

0 0.5 0.5 0 0 0 0

0 0 0.5 0.5 0 0 0

P_4 0 0 0 0.5 0.5 0 0

P_5 0 0 0 0 0.5 0.5 0

P_6 0 0 0 0 0 0.5 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)

l(1-p)

2l(1-p)

µ 0

µ

µ 1

3lp

2

3

lp

2lp

b. Construct the rate matrix for l = 1/min, µ = 2/min and p = 0.2. p_0 p_0 p_1 p_2 p_3 Sum

Lambda Mu p_fault

0 0.2 0 0 0.2

p_1 2 0.8 0.4 0 3.2

1 per min 2 per min 0.2

p_2 0 2 1.6 0.6 4.2

p_3 0 0 2 2.4 4.4

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_0 p_1 p_2 p_3

p_1 0 0 0 0

p_2 0 1 0 0

p_3 0 0 1 0

0 0 0 1

The steady-state analysis gives the state probabilities and the completion or production rate. Expected Transition 0 1 2 3 p_0 p_1 p_2 p_3 Time Steady State (Time) 0.00439 0.04392 0.21962 0.73206 0.31102

With no faults the completion rate would be 3.

Average comp. rate 2.14348

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

s_1

0 0.1

0.5 0

0 1 s_0 s_1 Steady State (Time) 0.1667 0.8333

Average prod rate 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_0 s_1 s_2 s_3 s_4 s_5

s_1

0 0 0 0 0 0.2 0 s_0

s_2

0.5 0 0 0 0 0 1 s_1

s_3 0 1 0 0 0 0

2 s_2

3 s_3

s_4

0 0 0 0 0.5 0 0 0.3333 0 0 0 0 4 s_4

5 s_5

Steady State (Time) 0.1176 0.0588 0.1176 0.1765 0.2353 0.2941

s_5 0 0 0 0 0.25 0 Average comp rate 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

Activity

d1

d2

d3

Mean time

2

3

4

23

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 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.1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.33 0 0.1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.33 0 0.1 0 0 0 0 0 0 0 0 0 0 0.25 0 0 0 0 0 0.1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.33 0 0.1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.33 0 0.1 0 0 0 0 0 0 0 0 0.25 0 0 0 0 0 0 0 0.1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.33 0 0.1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.33 0 0.1 0 0 0 0 0 0 0 0 0.25 0 0 0 0 0 0 0 0.1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.33 0 0.1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.33 0 0.1 0 0 0 0 0 0 0 0 0.25 0 0 0 0 0 0 0 0.1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.33 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.33 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 1_0_0 0.25 0 0_1_0 0.125 0 1_1_0 0 0.125 1_1_1 0 0 1_1_2 0 0 1_1_3 0 0

0 0 0 0 0 0 0.333 0 0 0 0 0.333 0 0 0 0.25 0 0.333 0 0 0 0.375 0 0.333 0 0 0 0.375 0 0.333 0 0 0 0.375 0

Continuous-Time Markov Chains

0 0_0_0

1 1_0_0

Steady State (Time) 0.1242 0.1126

2 0_1_0

24

3 1_1_0

4 1_1_1

5 1_1_2

6 1_1_3

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

a2 10

a1 10

d 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 1_0 2_0 0 0.1 0 0 0 0.1 0 0 0 0 0 0 0 0 0 0.125 0 0 0 0.125 0 0 0 0.125 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

3_0 0_1 1_1 2_1 0 0.1 0 0 0 0 0.1 0 0.1 0 0 0.1 0 0.1 0 0 0 0 0.1 0 0 0 0 0.1 0 0 0 0 0 0 0 0 0 0 0 0 0 0.125 0 0 0 0 0.125 0 0 0 0 0.125 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

3_1 0_2 1_2 2_2 0 0 0 0 0 0 0 0 0 0 0 0 0.1 0 0 0 0 0.1 0 0 0 0 0.1 0 0.1 0 0 0.1 0 0.1 0 0 0 0 0.1 0 0 0 0 0.1 0 0 0 0 0 0 0 0 0 0 0 0 0 0.125 0 0 0 0 0.125 0 0 0 0 0.125

3_2 0 0 0 0 0 0 0 0.1 0 0 0.1 0 0 0 0 0

0_3 0 0 0 0 0 0 0 0 0.1 0 0 0.1 0 0 0 0

1_3 0 0 0 0 0 0 0 0 0 0.1 0 0 0.1 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.

2_3 0 0 0 0 0 0 0 0 0 0 0.1 0 0 0.1 0 0

3_3 0 0 0 0 0 0 0 0 0 0 0 0.1 0 0 0.1 0

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 0_i 1_d 1_c 2_d 2_c 3_d 3_c 4_d 4_c 5_d 5_c

1_d

1_c

2_d

2_c

3_d

3_c

4_d

4_c

5_d

5_c

0 0.17 0 0 0 0 0 0 0 0 0 0.08 0 0.03 0.17 0 0 0 0 0 0 0 0.1 0 0 0 0.17 0 0 0 0 0 0 0 0.08 0 0 0.03 0.17 0 0 0 0 0 0 0.1 0 0 0 0 0.17 0 0 0 0 0 0 0 0.08 0 0 0.03 0.17 0 0 0 0 0 0 0.1 0 0 0 0 0.17 0 0 0 0 0 0 0 0.08 0 0 0.03 0.17 0 0 0 0 0 0 0.1 0 0 0 0 0.17 0 0 0 0 0 0 0 0.08 0 0 0.03 0 0 0 0 0 0 0 0.1 0 0 0

0 1 2 0_i 1_d 1_c Steady State (Time) 0.012 0.024 0.002

3 4 5 6 7 2_d 2_c 3_d 3_c 4_d 0.05 0.006 0.107 0.014 0.228

8 9 10 4_c 5_d 5_c 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 s0 s1 s2

s1

0 0.025 0.1

s2 0.5 0 0

0 0.075 0

Average production rate 0.05128205

0 1 2 s0 s1 s2 Steady State (Time) 0.102564 0.512821 0.384615

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 0_i 1_d 1_r 2_d 2_r 3_d 3_r 4_d 4_r 5_d 5_r

0 0 0 0 0 0 0 0 0 0.18 0

1_d 0.5 0 2 0 0 0 0 0 0 0 0

1_r 0 0.1 0 0 0 0 0 0 0 0 0

steady-state probabilities

2_d

2_r

3_d

3_r

0 0 0 0 0.9 0 0 0 0 0 0 0 0 0.05 0.45 0 2 0 0 0 0 0 0 0.03 0 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

4_d

4_r

5_d

5_r

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.3 0 0 0 0 0 0 0 0 0.03 0.23 0 2 0 0 0 0 0 0 0.02 0 0 2 0

Continuous-Time Markov Chains

0 0_i

1 1_d

2 1_r

3 2_d

4 2_r

5 3_d

6 3_r

27

7 4_d

8 4_r

9 5_d

10 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 Í4 G= Í Í7 Í4 Î

3 ? ? 0 ? -10 5 1

1˘ 5˙ ˙ 1˙ ? ˙˚

4 1 ˘ È-8 3 Í 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 continuoustime Markov chain Y with state space S = {h, m, l, d} and generator matrix

0 ˘ h È-0.03 0.02 0.01 -0.04 0.03 0.01 ˙ m Í 0 ˙ Í G= -0.05 0.05 ˙ 0 l Í 0 0 0 -0.15˙˚ d ÍÎ 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 = (0.455, 0.227, 0.227, 0.091)T p cur

S P Then, ccur = CScur p cur = 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

G new

0.01 0 ˘ È-0.03 0.02 Í 0 -0.04 0.03 0.01˙ ˙ Í = 0 -0.05 0.05˙ Í 0 Í 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 = CSnew p Pnew = 564.3 (> 538.6) cnew

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: 0 ˘ -0.01 È0.03385 -0.02 Í 0 0.04385 -0.03 -0.01 ˙ -1 ˙ Í ( bI - G cur ) = 0 0.05385 -0.05 ˙ Í 0 ˙ Í 0 0 0.1539˚ Î -0.15

-1

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 ˘ -0.01 È0.03385 -0.02 Í 0 0.04385 -0.03 -0.01 ˙ -1 ˙ = Í ( bI - G new ) = 0 0.05385 -0.05 ˙ Í 0 ˙ Í 0 0 0.3039˚ Î -0.3

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.95 0.05˙ Í 0 Í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

(I – aPcur)–1 CScur

Ê È1 Á Í0 = ÁÍ Á Í0 Á Í0 ËÎ

0 1 0 0

0 0 1 0

0˘ 0˙ ˙ - 0.9962 0˙ 1 ˙˚

5

0 ˘ˆ È0.97 0.02 0.01 Í 0 0.96 0.03 0.01˙˜ ˙˜ Í 0 0.95 0.05˙˜ Í 0 Í0.15 0 0 0.85˙˚˜¯ Î

0 ˘ È 0.03372 -0.01992 -0.00996 Í 0 0.04368 -0.02988 -0.00996˙ ˙ = Í 0 0.0538 -0.0498 ˙ Í 0 Í-0.1494 0 0 0.1533 ˙˚ Î

-1

-1

È 900 ˘ Í 550 ˙ ˙ Í Í 300 ˙ Í-700 ˙ ˚ Î

È 900 ˘ Í 550 ˙ ˙ Í Í 300 ˙ Í-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.95 0.05˙ Í 0 Í 0.3 0 0 0.7 ˙˚ Î which is the same as Pcur. From Eq. (9) in Chapter 12 we get

(I – aPnew)–1 CSnew

Ê È1 Á Í0 = ÁÍ Á Í0 Á Í0 ËÎ

0 1 0 0

0 0 1 0

0˘ 0˙ ˙ - 0.996 0˙ 1 ˙˚

0 ˘ˆ È0.97 0.02 0.01 Í 0 0.96 0.03 0.01˙˜ ˙˜ Í 0 0.95 0.05˙˜ Í 0 Í 0.3 0 0 0.7 ˙˚˜¯ Î

0 ˘ È 0.03388 -0.01992 -0.00996 Í 0 0.04384 -0.02988 -0.00996˙ ˙ = Í 0 0.0538 -0.0498 ˙ Í 0 Í-0.2988 0 0 0.3028 ˙˚ Î

-1

È 900 ˘ Í 550 ˙ ˙ Í Í 300 ˙ Í-1400 ˙ ˚ Î

-1

È 900 ˘ Í 550 ˙ ˙ Í Í 300 ˙ Í-1400 ˙ ˚ Î

Mathematics of Continuous-Time Markov Chains

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

6

Mathematics of Continuous-Time Markov Chains

3.

7

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

0j

= 1 + 7 + 2 + 10, we now have the first row, g1, of the generator matrix;

j =0

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

1j

=

j =0

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

1 7 2 0 0˘ È-10 Í 6 -16 1 7 2 0˙ ˙ Í 12 -22 1 7 2˙ Í 0 G=Í 0 18 -26 1 7˙˙ Í 0 Í 0 0 0 24 -25 1˙ ˙ Í 0 0 0 30 -30 ˚ Î 0

8

Mathematics of Continuous-Time Markov Chains

4.

9

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 continuoustime 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.25˙˚ 0

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 ˘ R Í ˙ C = 100 and C = Í0 0 0 ˙ Í ˙ Í ˙ ÍÎ100 ˙˚ ÍÎ0 0 0 ˙˚ S

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

5.

11

Let Y be a continuous-time Markov chain with state space S = {0, 1, 2, 3} and rate matrix

È0 Í6 R=Í Í0 Í2 Î

4 0 1˘ 0 4 0˙ ˙ 0 0 1˙ 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 Í 450 ˙ Í 0 S R ˙ Í C = and C = Í Í 800 ˙ Í 0 ˙ Í Í2000 Î Î1500 ˚

0 0 0 0

0 0 0 0

0˘ 0˙ ˙ 0˙ 0 ˙˚

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

6.

12

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

0 0 ˘ È-90 90 Í 0 -90 90 0 ˙ ˙ Í G= 0 -90 90 ˙ Í 0 Í 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

7.

13

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

0.1 1

0.1

2 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

8.

14

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 ˆ ˜ / (t – t ) p j @ ÁÛ I(Y = j)du ı u 0 ˜ Á ¯ Ë t0 P

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 Cumulative Time Time Frequency

0.369 350.7 0.147

0.244 1301.9 0.546

0.387 731.1 0.307

These compare to the steady-state results computed with the same add-in. 0 State 0

1 State 1

2 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

9.

15

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

p(n,m),(n–1,m+1) =

an 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

p(n,m),(n+2,m–1) =

bm 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

2

1

0

1

2

3

4

5

n

Mathematics of Continuous-Time Markov Chains

10.

17

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 birthdeath 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 birthdeath process. It is, however, a CTMC. To see this, let us define the following states. 0: 1: 2: 3: 4:

both machines working machine 1 working, machine 2 down machine 2 working, machine 1 down both down, machine 1 being repaired both down, machine 2 being repaired

The rate matrix and generator matrix are, respectively,

È 0 l1 l2 Ím 0 0 Í R = Ím 0 0 Í Í0 m 0 ÍÎ 0 0 m

0 0 l2 0 0

0˘ l1 ˙ ˙ 0 ˙ and G = ˙ 0˙ 0 ˙˚

È-(l1 + l2 ) l1 l2 0 0 ˘ ˙ Í m -( m + l1 ) 0 0 l1 ˙ Í Í m 0 -( m + l 2 ) l 2 0 ˙ ˙ Í 0 m 0 -m 0 ˙ Í ÍÎ 0 0 m 0 - m ˙˚

From these matrices, we can determine the state-transition probabilities.

p01 =

l2 l1 , p02 = 1 – p01 = l1 + l2 l1 + l2

p10 =

m l1 , p14 = 1 – p10 = m + l1 m + l1

Mathematics of Continuous-Time Markov Chains

p20 =

m l2 , p23 = 1 – p20 = m + l2 m + l2

p31 = 1, p42 = 1, all other pij = 0

18

Mathematics of Continuous-Time Markov Chains

11.

19

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 = , iŒS N ( N - 1) / 2

()

l1 1

2

...

li i

i+ 1

...

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

E[time to all infected] =

 1 / li = i =1

N ( N - 1) N 1 Â 2 pl i =1 i( N - i )

Mathematics of Continuous-Time Markov Chains

12.

20

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.

E[T0] =

1 l

E[T1] =

1 m l+m + E[T0 ] = 2l 2l 2l2

E[T2] =

l2 + m (l + m ) 1 2m + E[T1 ] = 3l 3l 3l3

E[T3] =

l3 m + m 2 (l + m ) 1 3m + E[T2 ] = 4l 4l 4l4

3

The solution can be found from

 E[T ] i

i=0

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

c. Determine the variances in parts (a) and (b). We must use the recursive formula in Section 15.5,

Var[Ti] =

mi mi 1 + 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

k =i

which can be used to find the requested variances.

21

Mathematics of Continuous-Time Markov Chains

13.

22

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 E[Ti ] =

1 mi + E[Ti -1 ] li li

which can be used to successively compute E[Ti] for i = 0, 1. Thus,

E[time to go from 0 to 2] = E[T0] + E[T1] =

1 1 m Ê 1ˆ 2 m + + = + 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ˆ + 3+ + 2 = 2+ l l (l + m ) l m + l Ë l l ¯

Mathematics of Continuous-Time Markov Chains

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

p 0P =

1 2 1 + l / m + (l / m )

and from the general relationship for p kP , we have

p 1P =

Thus, p 0P + p 1P =

l P l/m p0 = 2 m 1 + l / m + (l / m )

1+ l / m , which is the desired result. 1 + l / m + (l / m )2

23

Mathematics of Continuous-Time Markov Chains

14.

24

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

p 0P =

p 1P =

1 1 + l / m + l2 / 2 m 2

l P l/m p0 = m 1 + l / m + l2 / 2 m 2

1+ l / m , 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.

Therefore, p 0P + p 1P =

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

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.

3

Queuing Models

2.

4

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 Percent of the time

0 10

1 15

2 20

3 55

Number of waiting cars Percent of the time

0 60

1 20

2 15

3 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. 0

1

2

3

4

5

6

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

State State Probability pk

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

3.

5

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 b. Expected time in the queue

Lq = 0 .2*1+ 0.15*2 = 0.5 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: c. Expected number of customers in the system d. Expected time in the system e. Expected number of customers in service f. Expected time in service g. Proportion of customers who balk h. Percent utilization of the servers i. Probability that there will be fewer than two in the system j. Probability that there will be four or more in the system k. Probability that an arriving customer will obtain immediate service (rather than having to wait in a queue)

Wq = Lq / le = 0.5 / 42.5 = 0.01176 L = 2.88 Wq = Lq / le = 0.5 / 42.5 =0.01176 Ls = 2.38 Ws = Ls / le = 2.38 / 42.5 =0.056 p5 = 0.15 Ls/s = 2.38 / 3 = 0.7933 p0 + p1 = 0.17 p4 + p5 = 0.35 p0 + p1 + p2 = 0.4

Queuing Models

4.

6

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 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 servers and three spaces in the queue. Customers finding the queue full will balk. The arrival rate to the system is 20 per hour. What is the average time spent in the queue?

M/M/3 system

p0 + p1 + p2

M/M/2/5 system Lq = p3 + 2*p4 + 3*p5 le = 20*(1- p5) 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 5*p + 4*p + 3*p + 2*p + p the company and there is a single 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

5.

7

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 one customer will arrive in a 15-minute period?

P(1 or more) = 1-[P( none arrive) + P(only one arrives)] = 0.173, where the number of arrivals follows a Poisson distribution with mean lt = 3/4

b. What is the probability that the next service operation will require less than 1 hour?

P( t < 1 hour) = 0.632 where the time for service follows an Exponential distribution with mean 1.

c. What is the probability that each of the next two service operations will require more than 30 minutes?

The service times are i.i.d random variables. 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 Due to the memoryless property of the exponential distribution, you would expect to wait an hour…the mean of the service time.

d. Say you are a customer in this system. You have waited for 1 hour in the queue and you have been in service for 25 minutes. How long should you expect to remain in the system before completing service? e. An individual customer arrives to the system and finds one other person in the queue. If the queue discipline is first-come-first-served, how long should the customer expect to spend in the system?

f. Assuming that all servers remain busy, what is the probability that exactly four customers will complete service in the next hour? g. Assuming that all servers remain busy, what is the expected number of customers served in a 4-hour period?

Before the new customer can enter service, two customers must leave. When all servers are busy the rate of departures is 4m, so the average time between 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. The departure process is a Poisson process where the departure rate is 4m P(X = 4) = exp(-4mt) *[(4mt)^4]/4! = 0.195 Expected number served = 4mt = 4*4 = 16

Queuing Models

6.

8

For the system described in Exercise 5, find the following values.

a. Expected number of customers in the queue b. Expected time in the queue c. Expected number of customers in the system d. Expected time in the system e. Expected number of customers in service f. Expected time in service g. Proportion of customers that balk h. Percent utilization of the servers i. Probability that there will be fewer than two in the system j. Probability that there will be four or more in the system k. Probability that an arriving customer will obtain immediate service (rather than having to wait in a queue)

1.53 0.51 hrs. 4.53 1.51 hrs. 3 1 hour 0 0.75 P(0) + P(1) = 0.151 1-[P(0) + P(1) + P(2) + P(3)] = 0.51 1-P( four or more) = 1-.51 = 0.49

Queuing Models

7.

9

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 pump busy? b. How many spaces for waiting cars should be made available on the station property to assure that there is sufficient room to wait 85% of the time? c. What is the average time required for a customer to get gas? d. If the arrival rate changes to 50 per hour, what is the minimum number of pumps required to handle the load? Answer parts a, b and c using this number of pumps.

1-P(0) = E = 0.6 We want the sum of the steady state probabilities to be less than 85% P(0) +P(1) +P(2)+P(3) = 0.87 fi 2 spots. W = 7.5 min. We need: 5/6 < n/3 fi n ≥ 3 Efficiency = .8333 is the probability that any one pump will be busy. P(all pumps busy) = 0.702 i =11

 P(i) = .863

fi 11-3 = 8 spots

i=0

e. Repeat part d with one more than the minimum number of pumps.

W = 7.21 min. Efficiency = 0.625 i =5

 P(i) = .87



5-4 =1 spot

i=0

W = 3.64 min. f. Analyze this system if the arrival rate is 45 per hour and 4 pumps are used. Assume that only 4 cars can wait in the queue. How many customers will be lost because of this limit? g. Analyze the system described in part f when the service time is normally distributed. This will make it more uniform. Specifically, assume that the average service time is still 3 minutes, but that the standard deviation is 1 minute.

We analyze the M/M/4/8 system. The throughput rate is 44.52 per hour, so 0.48 customers are lost per hour. We do not have analysis procedures for this case. It is possible to find the results through simulation. With a simulation of 200 customers, no balks were observed. This is not surprising with these parameters.

Queuing Models

8.

10

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.

b. Install an additional phone with an operator.

c. Have three phones with operators and one holding line.

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 M/M/3/3 W = 1.5 minutes Efficiency = 0.653 Proportion of customers lost = P(sys. is full) = P(3) = 0.346 M/M/3/4 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

9.

11

A microcomputer laboratory in a Mechanical Engineering Department has six SuperX 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 situation.

M/M/6/6

b. What is the average number of students waiting?

None since there is no queue.

c. What proportion of the arriving students will be served by this computer lab?

Proportion servered = 1-P(busy) = 1 - 0.265 = 0.735

d. What is the utilization for the computers in the lab; i.e., what proportion of time are the computers in use?

Efficiecny = 0.735

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 situation, determine the steady-state probabilities associated with the number in the system.

b. When there is no queue the house is relatively calm. Using the results from part a how many minutes in the 1-hour period should the parents expect to have peace and quiet??

M/M/1/4/4 P(0) = 0.206 P(1) = 0.275 P(2) = 0. 275 P(3) = 0.183 P(3) = 0.061 P(no queue) = P(0) + P(1) = 0.498 E(quiet minutes/hour) = 60*0.498 = 28.9 min.

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: r = 0.75 L = 3.428 days

System 2: r= 0.677 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 Mean Number at Station Mean Time at Station Mean Number in Queue Mean Time in Queue Mean Number in Service Mean Time in Service Efficiency P(0) P(1) P(2) P(3) P(4) P(5) P(6)

M/M/1/5/5 0.49218215 54.5920639 0.13155672 14.5920622 0.36062543 40 0.36062543 0.63937455 0.25574983 0.08183995 0.01964159 0.00314265 0.00025141 0

Operational Reduced Effectiveness Failed

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

0.97696433 0.01964159 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 Arrival Rate Service Rate/Channel Number of Servers Max. Number in System Number in Population Type Mean Time in Queue Efficiency Prob. System Full

E_13_3 6 0.33333333 18 115 * * * M/M/18/115 7.76580514 0.99029189 0.00970808

E_13_4 6 0.33333333 19 48 * * * M/M/19/48 1.26193656 0.9382199 0.00965672

E_13_5 6 0.33333333 20 38 * * * M/M/20/38 0.52211137 0.89196181 0.00893123

E_13_6 6 0.33333333 21 33 * * * M/M/21/33 0.24194979 0.84908974 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 Arrival Rate Service Rate/Channel Number of Servers COV of interarrival times COV of service times COV of departures Type Mean Number at Station Mean Time at Station Mean Number in Queue Mean Time in Queue Mean Number in Service Mean Time in Service Efficiency

a 0.06666667 0.08333333 1 1 1.58113883 1.40000002 M/G/1 6.40000064 96.000005 5.60000063 84.000005 0.80000001 12 0.80000001

b 0.06666667 0.08333333 1 1 0.5 0.72111025 M/G/1 2.80000024 42.0000018 2.00000022 30.0000018 0.80000001 12 0.80000001

c 0.06666667 0.08333333 1 1 0 0.59999998 M/G/1 2.40000019 36.0000014 1.60000018 24.0000014 0.80000001 12 0.80000001

Queuing Models

Results Waiting time ( Wq)

a

b

17

c

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

19.20

8.40

7.20

Number in system (3L)

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 "warmstandby," 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. 0 S_0

1 S_1

2 S_2

3 S_3

4 S_4

Steady State (Time) 0.6765 0.2631 0.0512 0.0085 0.0007

Average MW rate 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. Mean Number at Station Mean Time at Station Mean Number in Queue Mean Time in Queue Mean Number in Service Mean Time in Service Efficiency

Analytical Simulation 3.67 3.10 1.83 1.53 2.83 2.27 1.42 1.12 0.83 0.42 0.83

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

Number waiting Time in 480 minutes Probability

0 1 2 3 163.914 81.2808 54.7739 180.032 0.34149 0.16934 0.11411 0.37507

Quite often patients are standing. In fact the simulation had as many as 12 patients waiting.

20

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

–1 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 arrivals balks

13 18 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 Distribution rate (lambda) Mean Standard Deviation

TBA1 TFS1 Exponential Exponential 0.13333333 0.1 7.49999952 10 7.49999961 9.99999985

Queue Station Arrival Distribution Service Distribution Number of Servers Max. Number in System

SimQ_17 TBA1 TFS1 1 4

Type Arrival Seed Service Seed Number in Simulation Start Data Time Stop Data Time Mean Number at Station Mean Time at Station Mean Number in Queue Mean Time in Queue Mean Number in Service Mean Time in Service Arrival Rate Throughput Rate Efficiency Probability Balk

G/G/1/4 1 10 100 60 600 3.26435614 60.7845626 2.27567316 42.3746036 0.98868298 18.409959 0.13148148 0.0537037 0.98868298 0.5915493

We estimate the probabilities of states 0 and 4, by accumulating the simulation times when the system was in these states. Probability

P(0) 0.011

P(4) 0.570

c. Comparing the analytical and simulated results we obtain: Mean Number at Station Mean Time at Station Mean Number in Queue Mean Time in Queue Prob. System Full P(0) P(4)

Analytical

Simulated

2.55569768 28.5142841 1.65941088 18.5142842 0.32778487 0.10371318 0.32778487

3.26435614 60.7845626 2.27567316 42.3746036 0.5915493 0.01131702 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 Distribution Uniform Uniform lower limit (a) 0 0 upper limit (b) 15 20 Mean 7.5 10 Standard Deviation 4.33012702 5.77350269

Queue Station Arrival Distribution Service Distribution Number of Servers Max. Number in System Type

SimQ_18 TBA2 TFS2 1 4 G/G/1/4

Arrival Seed Service Seed Number in Simulation Start Data Time Stop Data Time Mean Number at Station Mean Time at Station Mean Number in Queue Mean Time in Queue Mean Number in Service Mean Time in Service Arrival Rate Throughput Rate Efficiency Probability Balk

1 10 100 60 600 2.87200351 30.409449 1.87517547 19.8547991 0.99682805 10.5546499 0.12962963 0.09444444 0.99682805 0.27142857

We estimate the probabilities of states 0 and 4, by accumulating the simulation times when the system was in these states. Probability

P(0) 0.003

P(4) 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 Arrival Distribution Service Distribution Number of Servers Max. Number in System Type Arrival Seed Service Seed Number in Simulation Start Data Time Stop Data Time

SimQ_17 TBA1 TFS1 1 4 G/G/1/4 1 10 100 60 600

SimQ_18 TBA2 TFS2 1 4 G/G/1/4 1 10 100 60 600

Difference

Mean Number at Station Mean Time at Station Mean Number in Queue Mean Time in Queue Mean Number in Service Mean Time in Service Arrival Rate Throughput Rate Efficiency Probability Balk

3.26435614 60.7845626 2.27567316 42.3746036 0.98868298 18.409959 0.13148148 0.0537037 0.98868298 0.5915493

2.87200351 30.409449 1.87517547 19.8547991 0.99682805 10.5546499 0.12962963 0.09444444 0.99682805 0.27142857

0.39235263 30.3751136 0.40049769 22.5198045 -0.0081451 7.85530909 0.00185185 -0.0407407 -0.0081451 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. The mean number in system queues is 11.25. Queueing Network

P_1a

Arrival Rate

3

Type Mean Number in System Mean Time in System Mean Number in System Queues Mean Time in System Queues

Serial 15 5 11.25 3.75

b. The mean number in system queues is reduced to 5.625. Queueing Network

P_1b

Arrival Rate

3

COV of Interarrival times

1

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 Distribution r rate (lambda) Mean Standard Deviation

P_2a_server Gamma 5 20 0.25 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

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

3

Queuing Networks and Decision Models

3.

4

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.

Measure Model L q W q L s W s

Input processor M /M /3 3.511 0.234 2.500 0.167

Central processor M /M /1 0.900 0.075 0.600 0.050

Printer station M /M /6 11.553 2.407 5.601 1.167

Total 16.077 4.169 5.801 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.

L q W q L s W s

Total base

Total extra printer

15.9641661 2.71594285 8.70093358 1.38352785

6.35772842 0.71460175 8.70093358 1.38352785

Total extra processor 12.9860255 2.51740014 8.70093358 1.38352785

Clearly, the best plan is to add an extra printer.

Queuing Networks and Decision Models

4.

5

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 Arrival Rate Service Rate/Channel

60 60 25

0 40 22

0 20 29

0 30 11

0 30 23

0 60 20

Number of Servers

3

3

1

3

2

4

Type Mean Number at Station Mean Time at Station Mean Number in Queue Mean Time in Queue

M/M/3 4.98876 0.08315 2.58876 0.04315

M/M/3 2.37595 0.0594 0.55777 0.01394

M/M/1 2.22222 0.11111 1.53257 0.07663

M/M/3 11.0591 0.36864 8.33179 0.27773

M/M/2 2.26974 0.07566 0.96539 0.03218

M/M/4 4.5283 0.07547 1.5283 0.02547

Efficiency

0.8

0.60606

0.68966

0.90909

0.65217

0.75

Table 5

Order rate Product (per mo.) 1 2 3

30 10 20

Route ABDF ABEF ACEF

Lead Queue time (mo.) time (mo.) 0.58665 0.29367 0.34539

0.367 0.11474 0.17743

WIP (units) 17.5996 2.93674 6.90774

Queuing Networks and Decision Models

5.

6

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 steadystate 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 Arrival Rate Service Rate/Channel Number of Servers

70 70 25 3

0 50 22 3

0 20 29 1

0 30 11 3

0 40 23 2

0 70 20 4

Type Mean Number at Station Mean Time at Station Mean Number in Queue Mean Time in Queue

M/M/3 15.0735 0.21534 12.2735 0.17534

M/M/3 4.08379 0.08168 1.81106 0.03622

M/M/1 2.22222 0.11111 1.53257 0.07663

M/M/3 11.0591 0.36864 8.33179 0.27773

M/M/2 7.13178 0.17829 5.39265 0.13482

M/M/4 8.66503 0.12379 5.16503 0.07379

Efficiency

0.93333

0.75758

0.68966

0.90909

0.86957

0.875

Table 5

Order rate Product (per mo.) 1 30 2 20 3 20

Route ABDF ABEF ACEF

Lead Queue time (mo.) time (mo.) 0.78943 0.6241 0.59909 0.42016 0.62853 0.46057

WIP (units) 23.683 11.9818 12.5705

Evidently station A is the bottleneck. It has the greatest utilization (efficiency).

Queuing Networks and Decision Models

6.

7

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 Arrival Rate 110 110 Service Rate/Channel 40 40 Number of Servers 4 5 Max. Number in System * * * * * * Number in Population * * * * * * Type M/M/4 M/M/5 Mean Number at Station 3.65083337 2.9684851

A_6 110 40 6 * * * * * * M/M/6 2.8093915

The economic analysis using the parameters in the chapter gives following table. Servers Facilty Cost E[SC] Waiting Cost E[WC] Travel Cost E[TV] Total Cost

4

5

6

40 73.02 165 278.02

47.5 59.37 165 271.87

55 56.19 165 276.19

per per per per

hour hour hour hour

The best design uses 5 stations. The cost is smaller than both the alternatives given in the chapter.

Queuing Networks and Decision Models

7.

8

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

m =8

l = 12

Install

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

Queue Station

Remove

Install

Arrival Rate

12

12

9

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

8.

10

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 Number servers Expected number in system Expected number in queue System flow rate(/yr) System flow rate(/hr) Expected Time in System System balk rate(/yr) System balk rate(/hr) Costs per hour Fixed Cost Variable Cost Balking cost Waiting Cost Total Cost per hour Assuming waiting time is Waiting Cost Total Cost per hour

A

B 1 2 1.86 1.1 0.98 0.16 1350 1425 0.675 0.7125 2.75555556 1.54385965 150 75 0.075 0.0375 $ 25.00 $ 15.00 $ 7.50 $ 37.20 $ 84.70 queue time $ 19.60 $ 67.10

$ $ $ $ $

25.00 30.00 3.75 22.00 80.75

$ $

3.20 61.95

Queuing Networks and Decision Models

9.

11

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

Arrival Rate Service Rate/driver Number of drivers Max. Number in System Number in Population Type Mean Number at Station

Option 1 20 2.5 11 *** *** M/M/11 8.65322113

Option 2 5 5 2 *** *** M/M/2 1.333333373

The cost analysis shows that option 2 is the least costly. Cost Analysis Cw (cost of waiting) Ct(cost of travel) Cf (fixed cost of service) Cv (variable cost of service) Hours per year Servers Facilty Cost E[SC] Waiting Cost E[WC] Travel Cost E[TV] Total Cost/shop Number of shops Total Cost all shops

$ 20.00 $ $ 15,000.00 $ 15,000.00 2000 11 $ 90.00 $ 173.06 $ $ 263.06 1 $ 263.06

$ 20.00 $ $ 15,000.00 $ 15,000.00 2000 2 $ 22.50 $ 26.67 $ $ 49.17 4 $ 196.67

$ per hour $ per hour per year per year

per per per per

hour hour hour hour

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 l =6

l = 10

Donation Receptionist m = 10

Selling Receptionist m = 15

Blood Donation Room m =6

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

Queue Station

14

Donor Rec. Seller Rec. Blood Room

Independent Arrival Rate Arrival Rate Service Rate/Channel Number of Servers

6 6 10 1

10 10 15 1

0 16 10 2

Type Mean Number at Station Mean Time at Station Mean Number in Queue Mean Time in Queue Mean Number in Service Mean Time in Service

M/M/1 1.5 0.25 0.9 0.15 0.6 0.1

M/M/1 2 0.2 1.333333 0.133333 0.666667 0.066667

M/M/2 4.444445 0.277778 2.844445 0.177778 1.6 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.) P(no persons waiting for seller rec.) P(no persons waiting for blood room)

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

Arrival rate to one server : l© =ls

l© r l m 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

Queue Station Arrival Rate Service Rate/Channel Number of Servers Max. Number in System Number in Population Type Mean Number at Station

E_11a_1 50 50 1 * * * * * * M/M/1 #NUM!

Cost per secretary Cost for system

#NUM! #NUM!

3

4

E_11a_2 33.3333333 50 1 * * * * * * M/M/1 1.99999964 $ $

130 390

E_11a_3 25 50 1 * * * * * * M/M/1 1 $ $

105 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

Queue Station Arrival Rate Service Rate/Channel Number of Servers Max. Number in System Number in Population Type Mean Number at Station

E_11b_1 100 50 2 * * * * * * M/M/2 #NUM!

Cost for system

#NUM!

3 E_11b_2 100 50 3 * * * * * * M/M/3 2.88888907 $

312

4 E_11b_3 100 50 4 * * * * * * M/M/4 2.173913 $

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 = Cw = System Arrival rate Service rate Inspection stations Queue Station Arrival Rate Service Rate/Channel Number of Servers COV of interarrival times COV of service times COV of departures Type Mean Number at Station Cost

10 2 12 5 3 E_12_1 4 5 1 1 1.58113883 1.40000002 M/G/1 6.40000064 68.4000038

/hour /hour /hour /hour 4 E_12_2 3 5 1 1 1.58113883 1.24096739 M/G/1 2.17500024 57.4000019

5 E_12_3 2.4 5 1 1 1.58113883 1.16000002 M/G/1 1.25538475 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 Entity Arrival Rate Service Rate/Channel Number of Servers Max. Number in System Number in Population Type Mean Number at Station Cost

E_13_1 E_13_2 E_13_3 E_13_4 E_13_5 0.07142857 0.07142857 0.07142857 0.071428571 0.07142857 1 1 1 1 1 1 2 3 4 5 * * * * * * * * * * * * * * * 5 5 5 5 5 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 0.431 0.337 0.333 0.333 0.333 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 MTFS

6 5

Queue Station Arrival Rate Service Rate/Channel Number of Servers Max. Number in System Number in Population Type Mean Number at Station Mean Time at Station Mean Number in Queue Mean Time in Queue Mean Number in Service Mean Time in Service Throughput Rate Probability full Efficiency

E_14a_1 0.16666667 0.2 1 4 * * * M/M/1/4 1.64050746 11.371088 0.91915716 6.37108797 0.72135025 5 0.14427005 0.13437971 0.72135025

E_14a_2 0.16666667 0.2 2 4 * * * M/M/2/4 0.92346263 5.68442011 0.11118749 0.68442014 0.81227511 5 0.16245502 0.02526988 0.40613756

E_14a_3 0.16666667 0.2 3 4 * * * M/M/3/4 0.83527154 5.07059765 0.01162942 0.07059753 0.82364213 5 0.16472843 0.01162942 0.27454737

E_14a_4 0.16666667 0.2 4 4 * * * M/M/4/4 0.82604378 5 0 0 0.82604378 5 0.16520876 0.0087475 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

Queue Station Arrival Rate Service Rate/Channel Number of Servers Max. Number in System Number in Population Type Mean Number at Station Mean Time at Station Mean Number in Queue Mean Time in Queue Mean Number in Service Mean Time in Service Throughput Rate Efficiency Prob. System Full

E_14b_1 0.16666667 0.2 1 4 * * * M/M/1/4 1.64050746 11.371088 0.91915716 6.37108797 0.72135025 5 0.14427005 0.72135025 0.13437971

E_14b_2 0.16666667 0.2 1 5 * * * M/M/1/5 1.97882771 13.2025375 1.22941576 8.20253717 0.74941188 5 0.14988238 0.74941188 0.10070575

E_14b_3 0.16666667 0.2 1 6 * * * M/M/1/6 2.2901628 14.8941393 1.52134935 9.89413893 0.76881343 5 0.15376268 0.76881343 0.07742394

21

E_14b_4 0.16666667 0.2 1 7 * * * M/M/1/7 2.57562304 16.4508133 1.79279768 11.450813 0.78282547 5 0.1565651 0.78282547 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

m = 60/hr

m = 20/hr

l = 50/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

Arrival Rate

50

50

Service Rate/Channel Number of Servers

60 1

20 3

Type Mean Number at Station Mean Time at Station Mean Number in Queue Mean Time in Queue Mean Number in Service Mean Time in Service

M/M/1 5 0.1 4.1667 0.0833 0.8333 0.0167

Efficiency

Queueing Network

E_15

Arrival Rate

50

M/M/3 Type 6.0112 Mean Number in System 0.1202 Mean Time in System 3.5112 Mean Number in System Queues 0.0702 Mean Time in System Queues 2.5 Mean Number in System Service 0.05 Mean Time in System Service

0.8333 0.8333

Serial 11.011 0.2202 7.6779 0.1536 3.3333 0.0667

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 Arrival Rate Service Rate/Channel Number of Servers Max. Number in System Number in Population Type Mean Number at Station Mean Time at Station Mean Number in Queue Mean Time in Queue Mean Number in Service Mean Time in Service Efficiency

Option 1 4.8 1.33333 4 * * * * * * M/M/4 10.6898 2.22704 7.08978 1.47704 3.6 0.75 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

Arrival Rate 4.8 Service Rate/Channel 12 Number of Servers 4 Max. Number in System * * * Number in Population * * * Type M/M/4 Mean Number at Station 0.40009 Mean Time at Station Mean Number in Queue Mean Time in Queue Mean Number in Service Mean Time in Service Efficiency

0.08335 8.8E-05 1.8E-05 0.4 0.08333 0.1

System Time in first step Time in second step Total Time

1.0833 0.0834 1.1667

Number in first step Number in second step Total Number in system

5.2 0.4001 5.6001

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



E[number of passes] = 0.8

 n(0.2)

n -1

26

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

g1 = 12/hr

Node 1

Node 2

m1= 20/hr

m2 = 20/hr

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

È È1 + r 2 ˘ (2 r2 )2 ˘ 1 - r2 0.3125 = 0.185 p 0 = Í1 + 2 r2 + =Í = = ˙ ˙ 2!(1 - r2 ) ˚ 1 + r2 1.6875 Î Î1 - r 2 ˚

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?

Lsystem

r1 r1 r2 2 2 r23p 0 + 2 r2 + = + = L1 + L 2 = 2 1 - r1 2!(1 - r2 ) 1 - r1 1 - r22 0.875 2(0.6875) 1.375 = + = 7+ = 7 + 2.61 = 9.61 2 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 v1 =

g1 12 g2 10 = = 0.545 , v2 = = = 0.455 g 1 + g 2 12 + 10 g 1 + g 2 12 + 10

È 0 1˘ Now, the switching probability matrix F = Í ˙ and W = Î0.2 0 ˚

È1.25 1.25˘ Í0.25 1.25˙ . Î ˚

Queuing Networks and Decision Models

29

Using this information, we can calculate the mean flow time through the system with Eq. (3). We1 + W2vW We2 E[Tnet] = W1vW

È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) We1 + W2vW We2 E[Tnet] = W1vW

È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% Node 1

g1 = 4.8/hr

75%

M/M/1 m1 = 12/hr

M/M/3 m2 = 10/hr

10%

Node 3 M/M/2 m3 = 5/hr

20%

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

p0

È È (1.8)2 (1.8)3 ˘ ( sr2 )2 ( sr2 )3 ˘ 1 1 = Í1 + ( sr2 ) + + = Í1 + (1.8) + + 2! s!(1 - r2 ) ˙˚ 2! 6(1 - 0.6) ˙˚ Î Î

-1

= [1 + 1.8 + 1.62 + 2.43]-1 = 1/6.85 = 0.146 s s r2s +1p 0 27(0.6)4 (0.146) = = 0.532 Lq = 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 1 0.1 ˙ -0.1 = Í0 Í ˙ Í ˙ ÍÎ0 ÍÎ0 0 1 ˙˚ 0 1 ˙˚ W = (0.2, 0.75, 0.315). Now we need to find the From these data, we compute vW 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 i=1

(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

E[T2q] =

2p 0 (l / m ) m 2 s 2 s!(1 - r )3

Queuing Networks and Decision Models

34

Var[Tq] = E[T2q] – (E[Tq])2 Var[T] = Var[Tq] +

1 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 -0.008 ˘ È 0.16 Í 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

2p 0 (l1 / m1 ) Ê 1 1 r1 ˆ – Á Var[T1]= Var[T1q] + 2 = ˜ + 2 2 3 m1 (1 - r1 ) m1 m1 Ë m1 (1 - r1 ¯

2 r1 - r12 1 1 2 2 2 2 = m1 (1 - r1 ) + m1 = m1 (1 - r1 ) 52 = = 69.44 min2 2 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.512)2 ˘ ( sr3 )2 ˘ 1 p0 = Í1 + ( sr3 )1 + 1 ( 1 . 512 ) = + + Í s!(1 - r3 ) ˙˚ 2(1 - 0.756) ˙˚ Î Î

-1

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

Node 1

g1 = 4.8/hr

M/M/3 m2 = 10/hr

75%

M/M/1 m1 = 12/hr

90% 10%

Node 3

15%

M/M/2 m3 = 5/hr

20%

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

p0

È È (1.914)2 (1.914)3 ˘ ( sr2 )2 ( sr2 )3 ˘ 1 = Í1 + ( sr2 )1 + + = 1 + ( 1 . 914 ) + + Í 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 (more accurately 0.716) 6(0.632)2

Wq =

0.712 = 0.0374 hr  2.24 min 19.151 / hr

The final task is to calculate the average number of patients in the system.

-1

Queuing Networks and Decision Models

4.8 = 0.4, thus L1 = 0.667 12 For Node 2 (from above): L2 = 0.712 + 1.915 = 2.627 For Node 1 (same as before: r1 =

For Node 3:

l3 7.675 1.535 = = 1.535, thus L3 = = 3.736 m3 5 1 - 0.76752

Summing, we have Lsystem = L1 + L2 + L3 = 7.03.

37

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 Î 2 ˚ Î (1 - r ) ˚ ÍÎ

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 = = 5.52 min giving an error of 26.3% below the m (1 - r ) 0.388 approximate value, and Wq =

r2 0.612 2 = = 0.965 customers giving an error of 26.3% below the 1 - r 0.388 approximate value.

Lq =

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 = 0.0631 2˙ 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 624 599 914 344 799 1.

192 684 081 326 986 812

941 748 086 213 776 863

720 187 757 101 312 992

596 069 758 662 512 680

206 399 345 263 435 589

233 527 845 784 160 143

711 291 664 995 014 858

909 388 775 347 255 958

994 965 645 006 349 662

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

1 2 3 4 5 6 7 8 9 10 11 12

n=

4

0.005 0.596 0.909 0.748 0.527 0.599 0.758 0.775 0.213 0.784 0.344 0.512

0.192 0.206 0.994 0.187 0.291 0.081 0.345 0.645 0.101 0.995 0.986 0.435

0.941 0.233 0.624 0.069 0.388 0.086 0.845 0.914 0.662 0.347 0.776 0.16

2

Mean Std. Z 0.72 -0.246 0.711 -0.44 0.684 2.0975 0.399 -1.034 0.965 0.2962 0.757 -0.826 0.664 1.06 0.326 1.1432 0.263 -1.318 0.006 0.2286 0.312 0.724 0.014 -1.522 0.0136 1.11

4 1 Y 3.754 3.5601 6.0975 2.966 4.2962 3.1738 5.06 5.1432 2.6819 4.2286 4.724 2.4775 4.0136 Sample Mean 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 probability 2.5 2 3 0.136 3.5 3 4 0.341 4.5 4 5 0.341 5.5 5 6 0.136 6.5 6 7 0.021

Class Count 3 3 3 2 1

Relative Theoretical Observed Absolute frequency CDF CDF difference, 0.25 0.136 0.25 0.1140948 0.25 0.477 0.5 0.0227501 0.25 0.819 0.75 0.0685946 0.1666667 0.954 0.9166667 0.0378332 0.0833333 0.976 1 0.0241001 Max. Difference Sample Size Alpha Critical Value

0.1140948 12 0.05 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

2.

3

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) = Ì otherwise Ó0

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.

1 2 3 4 5 6 7 8 9 10 11 12

n=4 4 Random Numbers 0.005 0.192 0.941 0.596 0.206 0.233 0.909 0.994 0.624 0.748 0.187 0.069 0.527 0.291 0.388 0.599 0.081 0.086 0.758 0.345 0.845 0.775 0.645 0.914 0.213 0.101 0.662 0.784 0.995 0.347 0.344 0.986 0.776 0.512 0.435 0.16

0.72 0.711 0.684 0.399 0.965 0.757 0.664 0.326 0.263 0.006 0.312 0.014

l= 0.25 Simulated Exponentials Exp. 1 Exp. 2 Exp. 3 0.005 0.2132 2.8302 0.9063 0.2307 0.2653 2.3969 5.116 0.9782 1.3783 0.207 0.0715 0.7487 0.3439 0.491 0.9138 0.0845 0.0899 1.4188 0.4231 1.8643 1.4917 1.0356 2.4534 0.2395 0.1065 1.0847 1.5325 5.2983 0.4262 0.4216 4.2687 1.4961 0.7174 0.5709 0.1744 1.0142 1.4915 1.0188 0.6643 2.0808 0.9515

Exp. 4 1.273 1.2413 1.152 0.5092 3.3524 1.4147 1.0906 0.3945 0.3052 0.006 0.374 0.0141 0.9272 0.9169

Erlang Sum 4.3214 2.6436 9.6431 2.166 4.936 2.5029 4.7969 5.3752 1.7359 7.263 6.5604 1.4768 4.4518 Sample Mean 2.5053 Sample Std.Dev.

3

Simulation

3.

4

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

10 9.5 10.5

1 0.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 Simulate Horse 1 Simulate Horse 2 Simulate Horse 3 Winning Time Winning Horse Win Frequency Horse 1 Horse 2 Horse 3

1 2 3 4 5 6 7 9.3448 10.53 9.8755 8.3503 9.8401 9.7422 9.0945 8.2866 8.5925 8.9304 8.9808 9.566 10.094 10.145 14.408 8.8422 13.156 9.3407 12.638 11.974 9.168 8.2866 8.5925 8.9304 8.3503 9.566 9.7422 9.0945 2 2 2 1 2 1 1 Count 3 6 1 10

8 9 10 10.626 9.9635 9.667 8.9668 9.3342 9.0314 16.436 7.582 15.302 8.9668 7.582 9.0314 2 3 2

Freq. 0.3 0.6 0.1

4

Simulation

4.

5

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 0.192 0.684 0.081 0.326 0.986 0.812

4a

4b 0 1 0 0 1 1

4c 1 3 1 1 4 3

4d 0 2 0 0 8 3

0 1 0 0 3 1

4e 0.4617 1.0733 0.2906 0.6281 2.0661 1.2928

5

Simulation

5.

6

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.

Y=

m= 100 s= 20 1 2 3 4 5 6 7 8 9 10 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. X=

1 2 3 4 5 6 7 1.4964 1.1214 2.4271 1.1025 1.4795 0.3399 0.6469

8 9 10 2.125 2.4444 2.4066

6

Simulation

6.

7

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 1 0 0 1 1 0 2 1 1 1 0 0 3 0 0 0 1 1 4 1 0 0 0 1 5 0 1 1 0 0 6 1 1 1 1 1 a . A binomial distribution with n = 6 and p = 0.4. 1 2 3 4 5 X= 3 3 4 3 3

6 0 0 0 0 0 0

7 0 0 1 1 0 0

8 1 0 1 1 0 1

9 1 0 1 0 0 1

10 1 1 1 0 0 1

6 0

7 2

8 4

9 3

10 4

9 1.1984 0.2455 0.7458 0.2131 0.1472 1.585

10 2.558 1.6762 0.5178 0.003 0.2146 0.5424

1 2 3 4 5 6 7 8 9 3.1882 3.8921 4.0109 4.1017 2.6691 1.4641 2.3697 4.9701 4.1351

10 5.512

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 a. X=

1 2 3 4 5 0.0025 0.1066 1.4151 0.6365 0.4532 0.4891 0.576 0.6892 0.1035 0.0357 0.4569 0.0422 0.045 0.7073 0.7094 1.2267 0.1973 0.1198 0.0532 0.5424 0.2108 2.1343 0.7481 0.187 0.3587 0.8022 0.8357 0.9939 2.4142 0.5697 A Gamma distribution with k = 6 and l = 2.

6 0.1153 0.2546 0.2116 0.1526 0.2855 0.4446

7 0.1326 0.3743 0.9322 0.7662 0.0872 0.0772

8 0.6207 0.1719 0.5453 2.6492 0.007 0.976

7

Simulation

7.

8

(Triangular distribution) Consider a random variable X with probability density function (pdf)

0 £ x £1 Ï x, Ô 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 ¯

1 - 2c + 2c 2 - c 3 s = (4) = 0.1667 18(1 - c ) 2

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.

r= y= x=

1 2 3 4 5 6 7 8 9 10 0.005 0.192 0.941 0.72 0.596 0.206 0.233 0.711 0.909 0.994 0.05 0.31 0.828 0.626 0.551 0.321 0.341 0.62 0.787 0.945 0.1 0.62 1.656 1.252 1.101 0.642 0.683 1.24 1.573 1.89

9

Simulation

8.

10

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 3 Ô0, 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. r= y= x=

1 2 0.799 0.812 0.683 0.693 4.098 4.16

3 4 0.863 0.992 0.738 0.937 4.43 5.621

5 0.68 0.6 3.6

6 7 8 9 10 0.589 0.143 0.858 0.958 0.662 0.547 0.267 0.734 0.855 0.589 3.28 1.604 4.401 5.131 3.533

10

Simulation

9.

11

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 = 2 -• 2y

For 0 < x < • x

F ( x) =

Ú e-2y dy = 1 -•

e-2 x 2

Select a random number from (0. 1). Call it r.. For 0 < r £ 0.5 e 2x or x = 0.5 * ln(2 r) 2 For 0.5 < r < 1 r=

e-2 x or x = -0.5 * ln(2(1 - r)) 2 Using these formulas, we simulate the 10 observations below. r = 1-

r= x=

1 2 3 0.624 0.684 0.748 0.143 0.229 0.343

4 0.187 -0.49

5 6 7 0.069 0.399 0.527 -0.99 -0.11 0.028

8 0.291 -0.27

9 0.388 -0.13

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

NPW = –P +

Rk

 (1 + i)

k

.

k =1

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 0 1 2 3 4 5

Cash Flow -1000 500 500 500 500 500

PW $ (1,000) $ 417 $ 347 $ 289 $ 241 $ 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 0.5 0.329 0.385 0.678 0.858 0.51 0.682 0.376 0.135 0.256 0.977 RN 0 . 5 7 6 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 0 1 2 3 4 5

PW factor 1.0000 0.8333 0.6944 0.5787 0.4823 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

1 2 3 RN 0 . 5 7 6 0.5 0.329 Life 3 3 2 RN 0 . 5 1 5 0.33 0.681 Rev. 507.7 411.9 593.9 -1000 -1000 -1000 423 343 495 353 286 412 294 238 0 0 0 0 0 0 0 NPW = 6 9 -132 -93

4 0.385 2 0.094 236.1 -1000 197 164 0 0 0 -639

5 0.678 4 0.987 946.4 -1000 789 657 548 456 0 1450

6 7 0.858 0.51 5 3 0.634 0.086 568.4 226.6 -1000 -1000 474 189 395 157 329 131 274 0 228 0 700 -523

14

8 0.682 4 0.323 408.1 -1000 340 283 236 197 0 56

9 0.376 2 0.529 514.3 -1000 429 357 0 0 0 -214

10 0.135 1 0.445 472.4 -1000 394 0 0 0 0 -606

11 12 0.256 0.977 2 5 0.318 0.156 405.2 298 -1000 -1000 338 248 281 207 0 172 0 144 0 120 -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 Average claim = $250 Contribution per employee = $125

Increase per month = 2% Increase per month = 1%

Medical insurance costs for deterministic data Month Initial 1 2 3 4 5 6 7 8 9 10 11 12 Total

No. employees 18,000 18,360 18,727 19,102 19,484 19,873 20,271 20,676 21,090 21,512 21,942 22,381 22,828

Employee contribution $2,250,000 $2,295,000 $2,340,900 $2,387,718 $2,435,472 $2,484,182 $2,533,865 $2,584,543 $2,636,234 $2,688,958 $2,742,737 $2,797,592 $2,853,544 $33,030,746

Average claim per employee $250 $253 $255 $258 $260 $263 $265 $268 $271 $273 $276 $279 $282

Total claims $4,500,000 $4,635,900 $4,775,904 $4,920,136 $5,068,725 $5,221,800 $5,379,498 $5,541,959 $5,709,326 $5,881,748 $6,059,377 $6,242,370 $6,430,890 $70,367,634

Company contribution $2,250,000 $2,340,900 $2,435,004 $2,532,418 $2,633,252 $2,737,618 $2,845,633 $2,957,417 $3,073,093 $3,192,790 $3,316,639 $3,444,778 $3,577,346 $37,336,889

15

Simulation

16

The growth rates are simulated from the prescribed distribution. Month Initial 1 2 3 4 5 6 7 8 9 10 11 12 Total

No. Growth Employees Rate 18,000 1.73% 18,311 1.64% 18,612 1.71% 18,930 1.47% 19,209 2.19% 19,629 2.40% 20,100 1.54% 20,409 2.15% 20,848 2.15% 21,297 2.98% 21,932 2.86% 22,560 1.50% 22,898

Employee contribution $2,250,000 $2,288,916 $2,326,533 $2,366,269 $2,401,083 $2,453,563 $2,512,561 $2,551,163 $2,606,031 $2,662,157 $2,741,528 $2,820,013 $2,862,311 $32,842,129

Average claim per Employee $250 252 255 257 260 262 265 268 270 272 275 277 282

Growth Total Claims Rate 0.87% $4,500,000 0.95% $4,617,886 0.80% $4,738,427 1.47% $4,857,816 0.51% $5,001,667 1.15% $5,137,200 1.11% $5,321,228 1.03% $5,463,170 0.53% $5,638,328 1.22% $5,790,253 0.81% $6,035,450 1.48% $6,258,770 0.79% $6,446,748 $69,806,941

Company Contribution $2,250,000 $2,328,970 $2,411,894 $2,491,547 $2,600,583 $2,683,637 $2,808,666 $2,912,007 $3,032,297 $3,128,096 $3,293,921 $3,438,757 $3,584,436 $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 Simulated Cell Sample Size Mean Stand. Dev.

1 $I$43 10.

$37,351,776 $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 Service Times

Exponential Service Times

Queue Station Arrival Distribution

SimQ1 TBA_1

SimQ1 TBA_1

Service Distribution Number of Servers Max. Number in System Type Arrival Seed Service Seed Number in Simulation Start Data Time Stop Data Time Mean Number at Station Mean Time at Station Mean Number in Queue Mean Time in Queue Mean Number in Service Mean Time in Service Arrival Rate Throughput Rate Efficiency Probability Balk

Exer_1 1 *** G/G/1 1 10 12 0 55.0152262 1.9286056 8.84188943 1.05316045 4.8283217 0.87544515 4.01356773 0.21812143 0.21812143 0.87544515 0

TFS_1 1 * * * G/G/1 1 10 12 0 60.16000151 2.578125051 12.92500058 1.752659641 8.786667222 0.82546541 4.138333359 0.19946808 0.19946808 0.82546541 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 addin is shown in the table below. Event

Event Time

Event Name

System

Queue

0

0

0

0

0

10000

10000

0

1

0

A

1

0

2.58

10000

0

2 3 4

0 2.44 2.58

A S S

2 1 0

0 0 0

2.58 2.44 2.58 100000 100000 100000

13.44 13.44 13.44

5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

13.44 19.59 19.68 21.06 23.23 25.44 25.61 26.13 30.62 30.74 32.52 32.68 34.69 36.12 39.71 43.16

A A S S A A A S A Balk Balk S S A S S

1 2 1 0 1 2 3 2 3 3 3 2 1 2 1 0

0 0 0 0 0 0 1 0 1 1 1 0 0 0 0 0

21.06 21.06 21.06 100000 32.68 32.68 32.68 32.68 32.68 32.68 32.68 34.69 100000 43.16 43.16 100000

19.59 23.23 23.23 23.23 25.44 25.61 30.62 30.62 30.74 32.52 36.12 36.12 36.12 43.59 43.59 43.59

21 22

43.59 44

A S

1 0

0 0

44 1 0 0 0 0 0 1E+06 1 0 0 0 0 0 1 0 0 0 0 0 1E+06

S1 Cal. S2 Cal.

100000 19.68 100000 100000 100000 26.13 26.13 39.71 39.71 39.71 39.71 39.71 39.71 39.71 100000 100000

Arrive Cal.

The analytical and simulated results are compared below. This is quite a small sample size for a simulation. Type

Analytical

Mean Number at Station Mean Time at Station Mean Number in Queue Mean Time in Queue Mean Number in Service Mean Time in Service Throughput Rate Efficiency Probability Balk

0.811 4.302 0.057 0.302 0.754 4.000 0.189 0.377 0.057

Simulated 1.103 5.342 0.059 0.287 1.044 5.056 0.206 0.522 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 Type Mean Number at Station Mean Time at Station Mean Number in Queue Mean Time in Queue Mean Number in Service Mean Time in Service Throughput Rate Efficiency Probability Balk

Simulated M/M/1 2.57812505 12.9250006 1.75265964 8.78666722 0.82546541 4.13833336 0.19946808 0.82546541 0

Simulated M/M/1/2 0.97565962 5.36624994 0.25658508 1.41125002 0.71907454 3.95499992 0.18181405 0.71907454 0.33333333

Analytical M/M/1/2 0.85245895 5.77777767 0.26229508 1.77777794 0.59016389 4 0.14754097 0.59016389 0.2622951

19

Simulation

20

15. Consider a network consisting of two queues in series. The first is the singlechannel Markov system (M/M/1) described in the text and the second is a singlechannel 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 Mean Time at Station Mean Number in Queue Mean Time in Queue Mean Number in Service Mean Time in Service

2.58 12.93 1.75 8.79 0.83 4.14

1.25 6.81 0.61 3.36 0.63 3.46

3.82 19.74 2.37 12.14 1.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 Mean Time at Station Mean Number in Queue Mean Time in Queue Mean Number in Service Mean Time in Service

2.58 12.93 1.75 8.79 0.83 4.14

1.31 6.29 0.64 3.08 0.67 3.21

3.89 19.21 2.39 11.86 1.50 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 2 3 4 5 6 7 8 9 10

– 5 2 7 1 8 2 5 3 7

12 8 13 7 8 10 11 10 5 9

The simulation statistics are shown below. No balking occurs with the given data. Queue Station Arrival Distribution Service Distribution Number of Servers Max. Number in System Type Arrival Seed Service Seed Number in Simulation Start Data Time Stop Data Time Mean Number at Station Mean Time at Station Mean Number in Queue Mean Time in Queue Mean Number in Service Mean Time in Service Arrival Rate Throughput Rate Efficiency Probability Balk

Sim_16 From E16 From E17 2 4 G/G/2/4 1 10 10 0 39.999 2.57498937 11.4441111 0.72499312 3.22211111 1.84999625 8.222 0.22500563 0.22500563 0.92499812 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 Time

Event Name

Queue

Next TBA

Next TFS

S1 Cal.

Arrive Cal.

0

0

0

0

0

0

0

0

10000

0

1 2 3

0 1.3232 2.817

A S A

1 0 1

1 0 1

0 0 0

1.8673 1.3232 1.3232 1.8673 1.4938 1.3232 100000 2.817 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 6 7

3.7385 5.6053 10.12

A S A

1 0 1

1 0 1

0 0 0

5.6431 1.8668 5.6053 9.3817 4.5145 1.8668 100000 10.12 2.0977 3.4955 13.615 12.218

8 9 10 11 12 13 14 15 16 17 18 19 20

12.218 12.43 13.615 14.201 15.485 15.975 17.39 18.185 20.812 23.902 28.445 32.148 32.404

A A S S A A A S S S S A A

1 1 1 1 1 1 1 1 1 1 0 1 1

2 3 2 1 2 3 4 3 2 1 0 1 2

1 2 1 0 1 2 3 2 1 0 0 0 1

0.2122 2.568 1.712 1.284 0.4901 1.4148 18.517 9.2584 6.1723 4.6292 3.7034 0.2553 5.5942

21 22 23

37.998 47.316 54.724

A A S

1 1 1

3 4 3

2 3 2

9.318 22.576 54.724 47.316 12.063 22.576 54.724 59.379 6.0315 1.373 56.097 60.755

Service System

3.4955 3.4955 0.5853 3.9843 3.9843 3.9843 3.9843 2.6266 3.0907 4.5427 4.5427 22.576 22.576

13.615 13.615 14.201 18.185 18.185 18.185 18.185 20.812 23.902 28.445 100000 54.724 54.724

12.43 14.998 15.327 15.485 15.975 17.39 35.906 27.443 26.984 28.531 32.148 32.404 37.998

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

Mean Number at Station Mean Time at Station Mean Number in Queue Mean Time in Queue Mean Number in Service Mean Time in Service Efficiency

Analytic

Simulated

2.33 8.73 1.44 5.39 0.89 3.33 0.89

1.44 5.54 0.44 1.69 1.00 3.85 1.00

23

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 Conf. Conf. Analytical Mean Std. Dev. 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 Conf. Conf. Analytical Mean Std. Dev. 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 Std. Dev

11.65 2.59

The data mean and standard deviation with 95% confidence limits: Data

(d )

Mean Std. Dev. 10.70 2.49

Lower Conf. 10.16

Upper Conf. 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 Std. Dev.

2.80 0.98

The data (only three values) mean and standard deviation with 95% confidence limits: Data

(d )

Mean Std. Dev. 3.00 1.00

Lower Conf. 2.44

Upper Conf. 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

Estimated mean Estimated standard deviation Estimated size (n) for 1% error Sample size (n) for 5% error Sample size (n) for 10% error Measures Estimated mean Estimated standard deviation Estimated size (n) for 1% error Sample size (n) for 5% error Sample size (n) for 10% error

za/2

0.01 2.5758313 0.05 1.9599628 0.1 1.6448535

a

za/2

0.01 2.5758313 0.05 1.9599628 0.1 1.6448535

Demand (D) 11.65 2.594 0.1165 3290 0.5825 77 1.165 14

e

Lead time (TL) 2.8 0.98 0.028 8127 0.14 188 0.28 33

e

26

Simulation

27

22. Confirm the results for C and s√c in Table 18.20 for n = 1,000. Observations 1 8.334

2 8.692

3 8.488

4 8.404

5 8.247

Mean Std. Dev. 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 2000 5000 10000

n

a

5 5 5

95% 95% 95%

t (a, n - 1 ) 0.9625195 0.9625195 0.9625195

Mean 8.378 8.438 8.458

Lower Conf. Upper Conf. Std. Dev. 0.068 8.349 8.408 0.061 8.412 8.465 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.

Daily Cost

Mean Std. Dev. 7.17 7.06 n alpha t

Lower Conf. 5.65

Upper Conf. 8.69

20 0.05 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 Actual Simulated

1

2

3

4

5

6

7

8

9

10

10 8

12 14

15 12

20 17

18 20

17 19

24 23

28 30

30 32

25 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 Arrival Seed Service Seed Number in Simulation Start Data Time Stop Data Time Mean Number at Station Mean Time at Station Mean Number in Queue Mean Time in Queue Mean Number in Service Mean Time in Service Arrival Rate Throughput Rate Efficiency Probability Balk Last Leave Customers Served

G/G/3 1 10 20 0 120 2.24 24.39 0.06 0.68 2.17 23.71 0.09 0.09 0.72 0.00 173.13 11

G/G/4 1 10 20 0 120 2.19 23.94 0.02 0.19 2.18 23.75 0.09 0.09 0.54 0.00 173.13 11

G/G/5 1 10 20 0 120 2.18 23.75 0.00 0.00 2.18 23.75 0.09 0.09 0.44 0.00 173.13 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 Arrival Rate Service Rate/Channel Number of Servers Max. Number in System Number in Population Type Mean Number at Station Mean Time at Station Mean Number in Queue Mean Time in Queue Mean Number in Service Mean Time in Service Efficiency Probability All Servers Idle Prob. All Servers Busy Critical Wait Time P(Wait >= Critical Wait)

1 waiters 0.1 0.166667 1 *** *** M/M/1 1.5 15 0.9 8.999998 0.6 6 0.6 0.4 0.6 1 0.561304

2 waiters 0.1 0.166667 2 *** *** M/M/2 0.659341 6.593407 0.059341 0.593407 0.6 6 0.3 0.538462 0.138462 1 0.109646

3 waiters 0.1 0.166667 3 *** *** M/M/3 0.606164 6.061644 0.006164 0.061644 0.6 6 0.2 0.547945 0.024658 1 0.016528

4 waiters 0.1 0.166667 4 *** *** M/M/4 0.600615 6.006152 0.000615 0.006152 0.6 6 0.15 0.548741 0.003486 1 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 Mean Time at Station Efficiency Probability Balk

G/G/2/3 2.90 0.80 0.33

G/G/2/4 3.53 0.89 0.26

G/G/2/5 4.23 0.93 0.22

G/G/3/3 2.46 0.60 0.27

G/G/3/4 2.60 0.68 0.16

G/G/3/5 2.85 0.73 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 Mean Number at Station Mean Time at Station Mean Number in Queue Mean Time in Queue Mean Number in Service Mean Time in Service Efficiency

M/M/2 1.01 0.40 0.18 0.07 0.83 0.33 0.42

M/D/1 2.27 0.91 1.45 0.58 0.82 0.33 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 Mean Number in Queue Mean Time in Queue Efficiency Time Last Leaves

19.67 3.96 48.54 0.96 326.30

17.67 2.47 34.40 0.92 300.67

16.33 1.50 23.63 0.86 288.67

14.00 1.10 18.94 0.82 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 Mean Time in Queue Efficiency Time Last Landed

0.96 5.69 0.85 68.55

0.26 1.59 0.61 64.14

0.10 0.60 0.46 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

Unberth ship

Container ship source

Create arrival

Ship queue

38

Wait for tug

Tugs idle

Load Railcars

Berths empty

Pilot ship to dock

Arrival at dock

Unload

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 Demand

1

2

3

4

5

6

7

8

9

10

11

12

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.

Production setup Maximum output Costs ($1000s)

One shift Two shifts No Overtime With overtime No overtime With overtime 2000 120

2500 165

4000 200

5000 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 Demand Shifts Capacity Beginning inventory Regular production Overtime production Ending inventory Prod. cost ($1000) Shift change-over Inventory cost Total cost / mo ($1000)

1

2

3

4

5

6

2500 1 2000 0 2000 500 0 165 0 0

1800 1 2000 0 2000 0 200 120 0 20

2000 1 2000 200 2000 100 300 129 0 30

2800 1 2000 300 2000 500 0 165 0 0

3500 2 4000 0 4000 900 1400 272 18 140

4800 2 4000 1400 4000 1000 1600 280 0 160

165

140

159

165

330

440

40

Simulation

Month Demand Shifts Capacity Beginning inventory Regular production Overtime production Ending inventory Prod. cost ($1000) Shift change-over Inventory cost

41

7

8

9

10

11

12

5600 2 4000 1600 4000 1000 1000 280 0 100

6000 2 4000 1000 4000 1000 0 280 0 0

4500 2 4000 0 4000 500 0 240 0 0

3200 2 4000 0 4000 0 800 200 20 80

1200 1 2000 800 2000 0 1600 200 0 160

3600 1 2000 1600 2000 0 0 200 0 0

380

280

240

300

360

200

Total cost / mo ($1000)

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 Shifts Production Ending inventory Cost Month Shifts Production Ending inventory Cost

1

2

3

4

5

6

1 2500 0 165

1 1800 0 120

1 2300 300 177

1 2500 0 165

2 4900 1400 330

2 5000 1600 440

7

8

9

10

11

12

2 5000 1000 380

2 5000 0 280

2 4500 0 240

2 3200 0 220

1 2300 1100 257

1 2500 0 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 Regular Express

20 15

12 8

30 15

16 12

24 16

28 24

14 10

B-A

B

C

D

18 14

10 0

30 5

20 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

Time

Station A 8 10 20 30 40 50

B

C

D

E R0 8:00

R1 8:00

8

8:20 8:28 8:30 8:42 E1 9:10

8:58

9 10 20 30 40 50

10 10 20 30 40 50

9:12 R0

12

9:26 9:31 9:42

9:40 E2 10:00 10:15

10:06 10:11

10:18 R1

10:57 11:02

R4 11:00

11:44

11:36 E2

10:42 11:02 11:12

11:12 E1 11:26

11:24 11:36

11:32

R2 11:54 R4 12:12

10 20

A

10:14

10:28

10:42

10:40 10:50

10

10:02

10:23

11:26

R2 9:30

9 10 20 30 40 50

9:54

10:20 R3

11 10 20 30 40 50

9:12 9:22

10 20 30 40 50

B

D

11 10 20 30 40 50

12

12:02 R3

C

10 20 30 40 50

10 20

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 0.005 0.192 0.941 0.72 0.596 0.206 0.233 0.711 0.909 0.994

Simulated x 0 1 6 3 2 1 1 3 5 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 1 2 from 3 on

Sales range

Sales price/unit

20 to 60 unit per quarter 30 to 90 unit per quarter 40 to 100 unit per quarter

$880 $890 $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

Quarter 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

RN. 1

Year

0 0.005 0.192 0.941 0.72 0.596 0.206 0.233 0.711 0.909 0.994 0.624 0.684 0.748 0.187 0.069 0.399 0.527 0.291 0.388 0.965

Demand 0 1 1 1 1 2 2 2 2 3 3 3 3 4 4 4 4 5 5 5 5

0 8.6801 29.415 59.007 47.087 64.432 45.037 46.704 70.146 94.342 115.82 75.763 78.735 82.187 53.786 42.947 65.332 71.235 59.96 64.81 103.05

Prod. 0 9 29 59 47 64 45 47 70 94 100 76 79 82 54 43 65 71 60 65 100

47

Unit Cost

Total Cost

0 91 71 50 53 50 55 53 50 58.75 62.5 50 50 51.25 50 57 50 50 50 50 62.5

0 30819 32059 32950 32491 33200 32475 32491 33500 35523 36250 33800 33950 34203 32700 32451 33250 33550 33000 33250 36250

Unit Rev.

Total Rev.

Net Rev.

0 0 0 880 7920 -22899 880 25520 -6539 880 51920 18970 880 41360 8869 890 56960 23760 890 40050 7575 890 41830 9339 890 62300 28800 900 84600 49078 900 90000 53750 900 68400 34600 900 71100 37150 900 73800 39598 900 48600 15900 900 38700 6249 900 58500 25250 900 63900 30350 900 54000 21000 900 58500 25250 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 Seed 0.2536 0.3659 0.1165 0.0061 Total Net Income 1 0 3 5 3 1 - 7 7 1 5 3 4 3 6 8 3 9 8 1 6 0 Grand Average Std. Deviation

5 6 7 8 9 10 0.396 0.2371 0.4333 0.6991 0.6529 0.4355 58707 -65160 10693 65231 48275 141714

42768 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 Mean Stand. Dev. Minimum Maximum Median Mid Range 31.79 44.6455 70.3565 96.0675 121.7785 147.4895 173.2005 198.9115 224.6225 250.3335 276.0445 288.9

100. 140.8403 50.8193 31.7947 288.9116 150.5611 Frequency 0. 0.09 0.08 0.09 0.15 0.17 0.25 0.14 0.01 0.01 0. 0.01

48

Simulation

36.

49

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 ln(u) , where u = 56/100, we get x = 2.89. at canal A. Using the formula x = -1 l 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

Time

Entity no. Event

11.00 11.02 11.03 11.04 11.04 11.04 11.06 11.07

Simulation starts 9 arrival at A 9 lock lowered 10 arrival at B 12 arrival at B 13 arrival at B 11 arrival at A – lock down

11.08 11.09 11.10 11.10 11.11 11.11 11.12 11.13 11.15 11.17 11.18 11.19 11.19 11.21 11.25 11.26 11.29 11.30

15 arrival at A – lock empty 14 arrival at B 17 arrival at B 16 arrival at A 19 arrival at A 20 arrival at A 21 arrival at A – lock raised 22 arrival at A 23 arrival at A 24 arrival at A – lock up – lock empty – lock lowered 18 arrival at B – lock down simulation ends

Waiting at A B 5

50

In lock 3 4

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

5 7

Next scheduled

Event

arrival at A arrival at B arrival at A lock lowered lock down arrival at B arrival at B arrival at B

11.02 11.04 11.06 11.03 11.07 11.04 11.04 11.10

arrival at A lock empty arrival at A lock raised arrival at B arrival at B arrival at A arrival at A arrival at A arrival at A lock up arrival at A arrival at A arrival at A lock empty lock lowered lock down arrival at B lock empty

11.08 11.09 11.11 11.15 11.10 11.26 11.11 11.12 11.13 11.17 11.19 11.18 11.19 11.39 11.21 11.25 11.29 11.33 11.31

Entity no. 9 10 11 9 12 13 14 15 16 17 18 19 20 21 22 – 23 24 25 – – –

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 Sequence of centers left to be entered

1

2

3

Z

Z

X

4

5

XY XYZ

6

7

8

9

10

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:

Statistical measure Mean (min) Standard deviation (min)

Work center X Y Z 120 40

200 40

180 60

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 SCHEDULED ON OR AFTER TIME t FROM FSE

NEXT EVENT

FSE

UPDATE TIME t WHAT TYPE EVENT WORK CENTER Y COMPLETED

WORK CENTER X COMPLETED

WORK CENTER Z COMPLETED

i YES

FILE i NO

FILE i EMPTY

WORK CENTER i IDLE

START WORK ON HIGHEST PRIORITY JOB

FILE i

GENERATE JOB COMPLETION TIME AND ENTER IN FSE YES

FSE

NO

LAST PROCESS FOR JOB ?

WHAT PROCESS IS NEXT ?

CANCEL JOB, RECORD STATISTICS

X

Y

Z

i YES CENTER i IDLE? STATUS: CENTER i BUSY. GENERATE JOB COMPLETION TIME AND ENTER IN FSE

NO ENTER JOB IN FILE i

FILE i

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 job

center center

(Status at 100)

124

1

X

124

Status†

Calendar

Files‡

job

time

X Y Z

X

Y

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

Z

1

318

X

3

171

B

3 out

B

4 out

171

3

X

X

4

321

180

2

Y

Y

7

375

318

1

Z

Z

2

533

321

4

X

X

5

457

375

7

Y

Y

8

594

457

5

X

X

6

645

480

end

Completions Z

job

time

3

171

1

318

B

B

7 out B

B B

2 in 2 out

5 out

4 in

7 in

8 out

6 out

5 in



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 arrives

Create job

Call waits

Dispatchers idle

Drivers idle

Job file

Start assignment

Call taken

- Assign job - Interupt call

Pick up job & file report

End assignment

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 Time

Event

Entities Event

Entity

Time

X



Calls waiting

Dispatch Status 1 2

Order file

File of idle drivers

Status at time zero 0

C1 C0

80 100

C0 end C1 in

D2 D1

110

C2 in

D2

180 200 220 240 270

J end C3 in C1 end C2 end Reasn 0

V11 D1 D1 D2 D2/V1

in end jobs

Asn C1 C2 C2 Reasn C3

0 end in end 0 in

D1 D2 V5 V6 V7 V8 V9 V10 V11 V12 V13 V14 V15 V16 D2/V1 D1 D2 D2 D2/V1 D1

100 80 240 1250 680 560 1650 960 180 1140 1370 510 870 1410 140 220 110 240 270 200

C4 C3

in end

D2 D1

390 350

JO Asn

end 1

V1 D2/V2

1960 330

x x

I

B

1 in 2 in 3 in 4 in

I B

B B

1 out

B

B

B B B B B

B B B B B

x

x x x x x x

11 in 3 in 3 out

1 in 2 in 1 out

2 out

etc.



X = event has been processed, I = idle, B = busy

59