SERVICE SCIENCE
SERVICE SCIENCE
Mark S: Daskin
Department of Industrial and Operations Engineering University of Michigan Ann Arbor, MI
WILEY A JOHN WILEY & SONS, INC., PUBLICATION
All referenced files may be found at http://umich.edu/~msdaskin/servicescience/ Copyright © 2010 by John Wiley & Sons, Inc. All rights reserved Published by John Wiley & Sons, Inc., Hoboken, New Jersey Published simultaneously in Canada No part of this publication may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, scanning, or otherwise, except as permitted under Section 107 or 108 of the 1976 United States Copyright Act, without either the prior written permission of the Publisher, or authorization through payment of the appropriate per-copy fee to the Copyright Clearance Center, Inc., 222 Rosewood Drive, Danvers, MA 01923, (978) 750-8400, fax (978) 750-4470, or on the web at www.copyright.com. Requests to the Publisher for permission should be addressed to the Permissions Department, John Wiley & Sons, Inc., I l l River Street, Hoboken, NJ 07030, (201) 748-6011, fax (201) 748-6008, or online at http://www.wiley.com/go/permission. Limit of Liability/Disclaimer of Warranty: While the publisher and author have used their best efforts in preparing this book, they make no representations or warranties with respect to the accuracy or completeness of the contents of this book and specifically disclaim any implied warranties of merchantability or fitness for a particular purpose. No warranty may be created or extended by sales representatives or written sales materials. The advice and strategies contained herein may not be suitable for your situation. You should consult with a professional where appropriate. Neither the publisher nor author shall be liable for any loss of profit or any other commercial damages, including but not limited to special, incidental, consequential, or other damages. For general information on our other products and services or for technical support, please contact our Customer Care Department within the United States at (800) 762-2974, outside the United States at (317) 572-3993 or fax (317) 572-4002. Wiley also publishes its books in a variety of electronic formats. Some content that appears in print may not be available in electronic formats. For more information about Wiley products, visit our web site at www.wiley.com. Library of Congress Catologing-in-Publication
Data
Daskin, Mark S., 1952Service science / Mark S. Daskin. p. cm. Includes bibliographical references and index. ISBN 978-0-470-52588-3 (cloth) 1. Operations research. 2. Service industries-Management. I. Title. T57.6.D3733 2010 658.4'034-dc22
3. Service industries-Planning.
2010010792 Printed in Singapore 10 9 8 7 6 5 4 3 2 1
To My parents, Walter V'T and Betty, My daughters, Tamar and Keren, And my wife, Babette
CONTENTS
List of Figures
xi
List of Tables
xxi
Preface
xxv
Acknowledgments
xxix
1
WHY 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8
STUDY SERVICES? What Are Services? Services as a Percent of the Economy Public versus Private Service Delivery Why Model Services? Key Service Decisions Philosophy about Models Outline of the Book Problems References
PART I Methodological Foundations 2
OPTIMIZATION 2.1 Introduction 2.2 Five Key Elements of Optimization 2.3 Taxonomy of Optimization Models 2.4 You Probably Have Seen One Already 2.5 Linear Programming 2.6 Special Network Form 2.7 Integer Problems 2.8 Multiple Objective Problems 2.9 Mark's Ten Rules of Formulating Problems
1 1 6 10 11 13 16 22 25 26 27 29 30 31 34 37 41 60 65 80 101 vii
viii
CONTENTS
2.10
Problems References
QUEUEING THEORY 3.1 Introduction 3.2 What Is Queueing Theory? 3.3 Key Performance Metrics for Queues and Little's Law 3.4 A Framework for Markovian Queues 3.5 Key Results for Non-Markovian Queues 3.6 Solving Queueing Models Numerically 3.7 When Conditions Change Over Time 3.8 Conclusions 3.9 Problems References Part II Application Areas 4
5
106 108 111 111 119 122 124 153 155 170 175 176 182 183
LOCATION AND DISTRICTING PROBLEMS IN SERVICES 4.1 Example Applications 4.2 Taxonomy of Location Problems 4.3 Covering Problems 4.4 Median Problems—Minimizing the Demand-Weighted Average Distance 4.5 Multi-Objective Models 4.6 Districting Problems 4.7 Franchise Location Problems 4.8 Summary and Software 4.9 Problems References
185 186 189 203
INVENTORY DECISIONS IN SERVICES 5.1 Why Is Inventory in a Service Modeling Book? 5.2 EOQ—A Basic Inventory Model 5.3 Extensions of the EOQ Model 5.4 Time-Varying Demand 5.5 Uncertain Demand and Lead Times 5.6 Newsvendor Problem and Applications 5.7 Summary
285 285 287 292 304 310 316 324
226 236 244 262 270 271 281
5.8 6
Problems References
RESOURCE ALLOCATION PROBLEMS AND DECISIONS IN SERVICES 6.1 Example Resource Allocation Problems 6.2 How to Formulate an Assignment or Resource Allocation Problem 6.3 Infeasible Solutions 6.4 Assigning Students to Freshman Seminars 6.5 Assigning Students to Intersession Courses 6.6 Improving the Assignment of Zip Codes to Congressional Districts 6.7 Summary 6.8 Problems References
325 339 341 342 346 350 358 363 369 372 373 375
7
SHORT-TERM WORKFORCE SCHEDULING 7.1 Overview of Scheduling 7.2 Simple Model 7.3 Extensions of the Simple Model 7.4 More Difficult Extensions 7.5 Linking Scheduling to Service 7.6 Time-Dependent Queueing Analyzer 7.7 Assigning Specific Employees to Shifts 7.8 Summary 7.9 Problems References
377 377 380 385 390 394 404 406 408 409 413
8
LONG-TERM WORKFORCE PLANNING 8.1 Why Is Long-Term Workforce Planning an Issue? 8.2 Basic Model 8.3 Grouping of Skills 8.4 Planning over Time 8.5 Linking to Project Scheduling 8.6 Linking to Personnel Training and Planning in General 8.7 Simple Model of Training 8.8 Summary 8.9 Problems References
415 416 418 421 427 432 446 449 452 454 458
X
CONTENTS
PRIORITY SERVICES, CALL CENTER DESIGN, AND CUSTOMER SCHEDULING 9.1 Examples 9.2 Priority Queueing for Emergency and Other Services 9.3 Call Center Design 9.4 Scheduling in Services 9.5 Summary 9.6 Problems References
459 459 464 475 492 502 504 512
10
VEHICLE ROUTING AND SERVICES 10.1 Example Routing Problems 10.2 Classification of Routing Problems 10.3 Arc Routing 10.4 The Traveling Salesman Problem 10.5 Vehicle Routing Problems 10.6 Summary 10.7 Problems References
515 516 517 518 527 548 557 560 564
11
WHERE TO FROM HERE? 11.1 Introduction 11.2 Other Methodologies 11.3 Other Applications in Services 11.4 Summary References
567 568 568 572 575 575
y
Index
577
Appendixes and a full list of References are posted online. All referenced files may be found at http://umich.edu/~msdaskin/servicescience/
LIST OF FIGURES
Figure Figure Figure Figure Figure Figure Figure
1.1 1.2 1.3 1.4 1.5 2.1 2.2
Figure 2.3 Figure Figure Figure Figure Figure Figure Figure Figure Figure Figure Figure Figure
2.4 2.5 2.6 2.7 2.8 2.9 2.10 2.11 2.12 2.13 2.14 2.15
Figure Figure Figure Figure Figure Figure Figure Figure Figure Figure
2.16 2.17 2.18 2.19 2.20 2.21 2.22 2.23 2.24 2.25
Figure 2.26 Figure 2.27
Gross domestic product over 60 years Percentage breakdown of the gross domestic product U.S. non-farm employment by major sector, June 2009 U.S. private service employment, June 2009 Schematic of the modeling/decision-making process Taxonomy of optimization models Sample data points, one possible line through the data and the associated errors Sample data points, one possible line through the data and the associated squared errors Best line through the data Feasible region for a simple linear programming problem Feasible region and objective function contours Adding a constraint that degrades the solution Adding a constraint that does not change the solution Example budget allocation problem in Excel Solver Parameters dialog box Add Constraint dialog box in Excel Solver Solver Options dialog box Solver Results dialog box Dual menu in What's Best Simple network for shortest path from Chicago to New Orleans Solution to shortest path problem of Figure 2.15 Network for student-seminar assignment problem Figure for maximum flow problem Feasible region with integer solutions highlighted Specifying integer variables in the Excel Solver Specifying integer variables in What's Best Integer optimal solution to the police/fire problem Integer optimal solution with enhanced budget First branching in the branch and bound tree The branch and bound tree for the police/fire allocation problem Nearest neighbor solution starting at Illinois Tour before 2-opt algorithm
7 8 9 10 17 35 38 39 40 42 43 45 45 55 57 57 58 59 59 61 62 63 65 66 67 67 68 68 73 74 76 77 xi
XII
Figure Figure Figure Figure
LIST OF FIGURES
2.28 2.29 2.30 2.31
Figure 2.32 Figure 2.33 Figure 2.34 Figure 2.35 Figure 2.36 Figure Figure Figure Figure Figure Figure
2.37 2.38 2.39 2.40 2.41 2.42
Figure 2.43 Figure 2.44 Figure 2.45 Figure 2.46 Figure 2.47 Figure 2.48 Figure 2.49 Figure 2.50 Figure 2.51 Figure 2.52 Figure 2.53 Figure 2.54 Figure 3.1 Figure 3.2 Figure 3.3
Tour after 2-opt algorithm Tour starting in Illinois after 2-opt algorithm Example encoding for a genetic algorithm Regions of interest for a non-dominated solution with two minimization objectives Sample average and maximum distance tradeoff curve Distances and displeasure values from Chicago to New Orleans Distance vs. displeasure solutions All 455 solutions to average vs. maximum distance tradeoff for 3 sites selected from 15 candidate locations First two solutions in non-dominated path solutions for the example in Figure 2.33 First three solutions in the weighting method Example multi-objective shortest path problem in Excel Minimizing the displeasure Weight computation Third solution computation Weight computation between (979,220) and (1,061,205) solutions Weight computation between (1,061,205) and (1,347,193) solutions Finding the first solution using the constraint method First solution found using the constraint method Constraining the displeasure to be less than or equal to 219 First two solutions found using the constraint method Constraining the displeasure to be less than or equal to 204 First three solutions found using the constraint method Constraining the displeasure to be less than or equal to 202 First four solutions found using the constraint method Linear programming solution to constrained shortest path problem Multi-objective shortest path problem using a matrix of decision variables Variable linkage Sample service time distributions Effect of average service time and service time variability on patient waiting time with patients arriving exactly as scheduled Effect of average service time and service time variability on patient waiting time for those who wait with patients arriving exactly as scheduled
77 78 79 81 82 83 84 85 86 87 89 90 90 90 91 91 93 94 95 95 96 96 97 97 98 100 103 113 114 115
LIST OF FIGURES
Figure 3.4 Figure 3.5 Figure 3.6
Figure 3.7
Figure 3.8 Figure 3.9 Figure 3.10 Figure 3.11 Figure 3.12 Figure 3.13 Figure 3.14 Figure 3.15 Figure 3.16 Figure 3.17 Figure 3.18 Figure 3.19 Figure 3.20 Figure 3.21 Figure Figure Figure Figure Figure
3.22 3.23 3.24 3.25 3.26
Effect of average service time and service time variability on the percentage of patients who have to wait for service with patients arriving exactly as scheduled Effect of average service time and service time variability on patient waiting time with patients arriving uniformly about the scheduled appointment time Effect of average service time and service time variability on patient waiting time with patients arriving uniformly about the scheduled appointment time, using a triangular service time distribution Effect of average service time and service time variability on patient waiting time for those who wait with patients arriving exactly as scheduled, using a triangular service time distribution Relationship between arrivals and departures State transition diagram Isolating state / to consider the probability flow in and out of the state Cutting between two states to consider the probability flow to the right and left of the cut State transition diagram for the M/M/Í queue Performance versus utilization for an M/M/l queue State transition diagram for the Μ/ΜΔ queue with a restricted queue length Average time in the system goes up with the number of lines but more people can be served Schematic of an M/M/s queue with 3 occupied servers and 4 customers waiting for service State transition diagram for the M/M/s queue Example time in the system and in waiting for an M/M/6 queue with a mean service time of 2 minutes Comparison of the time in the system for an M/M/6 queue and an M/M/l queue with j the arrival rate State transition diagram for an M/M/°° queue State transition diagram for an M/M/s queue with no waiting room State transition diagram for a problem with reneging Simulated and theoretical values for an M/M/3 queue Results of four simulation runs with λ = 3.75 Results of four simulation runs with λ = 5.75 Theoretical waiting time, average of 10 simulated runs and the upper and lower 95 percent confidence intervals for the mean based on the simulated values for an M/M/3 queue
XIII
116 116
117
118 123 129 129 130 131 132 137 140 141 141 144 148 149 150 158 165 166 167
168
XIV
LIST OF FIGURES
Figure 3.27
Figure 3.28 Figure 3.29 Figure 3.30 Figure Figure Figure Figure
4.1 4.2 4.3 4.4
Figure Figure Figure Figure Figure
4.5 4.6 4.7 4.8 4.9
Figure 4.10 Figure 4.11 Figure 4.12 Figure 4.13 Figure 4.14 Figure 4.15 Figure 4.16 Figure 4.17 Figure 4.18 Figure 4.19 Figure 4.20 Figure 4.21 Figure 4.22
Approximate (theoretical) waiting time, average of 10 simulated runs and the upper and lower 95 percent confidence intervals for the mean based on the simulated values for an M/E9/3 queue Sample time dependent queueing analyzer output Sample probability of waiting results Steady state (red) and time-dependent (green) probability mass functions Taxonomy of location models Example service region and directions of travel Simple analytic model of facility and transport costs Ratio of total cost to optimal cost as a function of the ratio of the number of sites to the optimal number« of sites Weber problem solution using Pennsylvania county data Sample tree network for the 10 largest U.S. cities Taxonomy of discrete location models Simple network for covering problems Excel implementation of the set covering model for the seven-node network shown in Figure 4.8 with a coverage distance of 8 Percent covered vs. number of sites for three coverage distances Solution covering 90 percent of the demand at 200 miles with only 13 sites Excel solution for small maximal covering model for the network in Figure 4.8 Simple two-node network Maximum expected covering model for the network in Figure 4.8 Expected coverage vs. number located for the network of Figure 4.8 Solution of the three-median problem on the network of Figure 4.8 Average distance vs. the number of facilities for the network of Figure 4.8 Fixed charge location model for the network of Figure 4.8 Excel solution to the vertex four-center problem for the network of Figure 4.8 Median/coverage tradeoff model for the network of Figure 4.8 Tradeoff between coverage and average distance using three and four facilities for the network of Figure 4.8 Center/median tradeoff model for the network of Figure 4.8
169 173 174 175 189 190 191 192 195 197 200 204 206 212 214 216 218 223 226 229 230 232 235 239 240 242
LIST OF FIGURES
Figure 4.23 Figure 4.24 Figure 4.25 Figure 4.26 Figure 4.27 Figure 4.28 Figure 4.29 Figure 4.30 Figure 4.31 Figure 4.32 Figure 4.33 Figure 4.34 Figure 4.35 Figure 4.36 Figure 4.37 Figure 5.1 Figure 5.2 Figure 5.3 Figure 5.4 Figure 5.5 Figure 5.6 Figure 5.7 Figure 5.8 Figure 5.9 Figure 5.10 Figure 5.11
Tradeoff between average and maximum distance for three, four, and five facilities using the network of Figure 4.8 Center/median tradeoff for 250 largest counties with 10 facilities Compromise solution with average distance of 132.9 miles and a maximum of 418 miles Simple districting example Figure illustrating closest assignment constraints (4.48) Inputs, decision variables, and objective function for simple districting model for the network of Figure 4.8 Constraints for the simple districting model for the network of Figure 4.8 U.S. Congressional districts in Illinois Sample results of districting at the zip code level in Illinois Another heuristic solution to the districting problem in Illinois A third heuristic solution to the districting problem in Illinois Example demand functions Results of varying the cost per item per mile in the profit maximization model using the network of Figure 4.8 Results of varying the demand factor in the profit maximization model using the network of Figure 4.8 Results of the maximum capture model for three competitor location sets using the network of Figure 4.8 Basic economic order quantity relationships EOQ cost components Percent error in total cost as a function of deviations in the order quantity EOQ model with backorders Percent savings in total cost as a function of the backorder/holding cost ratio EOQ model with production at the beginning of each phase Inputs and decision variables for multiple-SKU problem with SKU-specific order frequencies and an overall order frequency Objective function and constraints for problem with SKU-specific order frequencies within an overall order frequency Solving a space constrained EOQ problem Using Goal Seek to find alpha Results of using Goal Seek to find alpha
XV
243 244 245 247 249 251 252 254 255 255 256 264 267 268 270 288 290 291 292 294 294 297 298 300 301 301
xvi
LIST OF FIGURES
Figure 5.12 Figure 5.13 Figure 5.14 Figure 5.15 Figure 5.16 Figure 5.17 Figure 5.18 Figure 5.19 Figure 5.20 Figure 5.21 Figure 5.22 Figure 5.23 Figure 5.24 Figure 6.1 Figure 6.2 Figure Figure Figure Figure Figure
6.3 6.4 6.5 6.6 6.7
Figure 6.8 Figure 6.9 Figure 6.10 Figure 6.11 Figure 6.12 Figure 6.13 Figure 6.14 Figure 7.1 Figure 7.2 Figure 7.3
Using the Solver to find alpha Solving a value-constrained E O Q problem Using a spinner to solve a value or space constrained EOQ problem Percent of annual dollar sales by month for paint and wallpaper stores Inventory on hand for inventory computation Inventory planning as a shortest path problem Optimal solution to the inventory problem of Table 5.4 with a fixed order cost of $10,000 and a per unit monthly carrying cost of $2 Stochastic inventory simulation (no stockouts) Stochastic inventory simulation (with stockouts) Stochastic inventory simulation with exponentially distributed lead times Computing the reorder point for a given fill rate Using the Solver to solve equation (5.26) for the reorder point Example post-tax post-health care funds Sample inputs for a simple assignment problem Sample decision variables, objective and constraints for a small assignment problem Example ranking of shifts by volunteers (feasible case) Example assignment of volunteers to shifts Revised availability of volunteers (infeasible case) Penalties for using dummy shifts and volunteers An optimal solution using a dummy shift and a dummy volunteer Network flow diagram corresponding to preferences of Figure 6.3 Network flow diagram with non-selected assignments included to ensure feasibility Adding a dummy volunteer and dummy time period to the network flow diagram Pare to chart of sample seminar first choices Network diagram approximating the IMS A class assignment problem Number of IMS A students assigned to first through fourth choices Class assignments relative to capacity Workforce management and services Workforce management and scheduling decisions and their impact on service quality Short-term scheduling and customer service
302 303 303 305 305 306 308 311 311 312 315 316 321 348 349 351 351 351 352 352 354 356 357 360 366 368 368 378 379 379
LIST OF FIGURES
XVII
Figure 7.4 Figure 7.5
382
Figure 7.6 Figure Figure Figure Figure
7.7 7.8 7.9 7.10
Figure Figure Figure Figure
7.11 7.12 7.13 7.14
Figure 7.15 Figure 7.16 Figure 7.17 Figure 7.18 Figure 7.19 Figure 7.20 Figure 7.21 Figure 7.22 Figure 7.23 Figure 8.1 Figure 8.2 Figure 8.3 Figure 8.4 Figure 8.5 Figure 8.6
Inputs for the basic employee scheduling problem Costs and sample matrix of akj terms showing whether an employee starting work at time j (a column) will be on duty at time k (a row) Decision variables, objective, and constraints for simple scheduling problem Network representation of simple scheduling problem Network flow diagram with overtime links Network flow diagram with part-time and overtime links Sample coefficients akg indicating if an employee who starts work at time j is on duty at time k Network diagram for 24-hour scheduling Inputs for a 24-hour scheduling problem Sample 24-hour matrix of akj terms for 12-hour shifts Sample inputs for a problem with endogenous service level determination Continuous and step-wise demand profiles akj coefficients for the nurse scheduling example with service determination Decision variables for the nurse scheduling problem with service determination Objective function for nurse scheduling problem with service determination Constraints for the nurse scheduling problem with service determination Staff, Waiting, and Total Cost as a function of the number of nurses Comparison of total person hours in the system when nurses start every hour versus when the can start every fourth hour Time dependent queueing analyzer results for 25 employees with starting times as found using the optimization model of section 7.5 Time dependent queueing analyzer results for 25 employees with improved starting times Sample inputs for a problem with skill sets Decision variables for a problem with skill sets Objective function and sample constraints for a problem with skill sets Network flow structure for example problem with skill sets Requirements, availability, and contractor needs by skill and month Analysis of statistician requirements
383 384 385 386 387 391 392 393 394 397 398 399 399 400 400 402 403 405 405 423 424 425 426 429 431
LIST OF FIGURES
XVIII
Figure Figure Figure Figure
8.7 8.8 8.9 8.10
Figure 8.11 Figure 8.12 Figure 8.13 Figure 8.14 Figure 8.15 Figure 8.16 Figure Figure Figure Figure Figure Figure
8.17 8.18 8.19 8.20 9.1 9.2
Figure 9.3 Figure 9.4 Figure 9.5 Figure 9.6 Figure 9.7 Figure 9.8 Figure 9.9 Figure 9.10 Figure 9.11 Figure 9.12 Figure 9.13 Figure 9.14
Analysis of HTML programmer requirements Analysis of manager requirements Flow conservation of projects—constraint (8.27) Sample inputs for joint project scheduling/workforce management problem Decision variables for a joint project scheduling/workforce management problem Part of the constraints for a joint project-scheduling/ workforce management problem Number of projects active in each month of the project by month of the year Constraints (8.27) for the example project scheduling/ workforce management problem Objective function for the example project scheduling/ workforce management problem Sample tradeoff results for a joint project scheduling/ workforce management problem Breakdown of labor cost vs. rescheduling cost Probability mass function for the number of projects Expected cost vs. number of planned projects Example determination of number to train Schematic of different queueing systems Time in a 24-server queue as a function of the utilization ratio and the number of lines Relative time in a 24-server queue as a function of the utilization ratio and the number of lines Priority queueing service disciplines Base case waiting times by class Impact of increased arrival rates for class 3 and class 4 customers on class 4 waiting time Impact of service time variance on waiting times Performance metrics as the number of servers increases holding the utilization ratio equal to 0.95 Number of extra servers needed to provide a given level of service versus the offered load Approximating the number of extra servers required by the normal approximation Extra servers needed vs. offered load for three levels of service Actual state probabilities and normal approximation for a small queue State transition diagram for an M/M/s queue with reneging or abandonment Numerically computing the state probabilities for an M/M/s queue with abandonment
431 432 437 438 438 440 441 441 441 442 443 445 447 451 461 461 462 465 468 469 472 478 479 480 480 481 484 485
LIST OF FIGURES
Figure Figure Figure Figure Figure Figure
9.15 9.16 9.17 9.18 9.19 9.20
Figure 9.21 Figure 9.22 Figure 10.1 Figure 10.2 Figure 10.3 Figure 10.4 Figure 10.5 Figure 10.6 Figure 10.7 Figure 10.8 Figure 10.9 Figure 10.10 Figure 10.11 Figure 10.12 Figure 10.13 Figure 10.14 Figure 10.15 Figure Figure Figure Figure Figure
10.16 10.17 10.18 10.19 10.20
Figure 10.21 Figure 10.22
Computation of approximate waiting probabilities Example simulation results: Total time and waiting time Example simulation results: P(abandon), P(busy), P(wait) Two sample base case realizations Two sample realizations using the Bailey-Welch rule Sample simulation realizations from scheduling with 2 minutes of expected slack between patient arrivals Overtime and delay vs. the policy when procedures are scheduled in order of decreasing standard deviation Overtime and delay vs. the policy when procedures are scheduled in order of increasing standard deviation Schematic of the city of Königsberg Abstraction of the city of Königsberg as a set of nodes and arcs Example undirected network Simple network of Figure 10.3 with odd-degree nodes highlighted Optimal matching of the odd-degree nodes of Figure 10.4 Example directed network for the Chinese Postman Problem Augmented network for the directed CPP of Figure 10.6 Example network for the traveling salesman problem Inputs for the traveling salesman problem for the network of Figure 10.8 Decision variables and objective function for the TSP on the network of Figure 10.8 Constraints for the TSP on the network of Figure 10.8 Solution to the assignment model for the TSP of Figure 10.8 Solution to the TSP of Figure 10.8 after adding subtour elimination constraints Subtour elimination constraints for the solution shown in Figure 10.12 TSP route using the myopic algorithm beginning at node A TSP route using the myopic algorithm beginning at node I Optimal TSP route for the data in Table 10.4 Creating spacefilling curves in a square Spacefilling curve approach for the data of Table 10.4 Illustration of Kruskal's MST algorithm for the network of Figure 10.8 Illustration of Prim's MST algorithm for the network of Figure 10.8 MST with optimal matching of odd degree (shaded) nodes
XIX
488 491 491 495 497 498 501 502 519 519 520 520 521 525 526 529 530 531 531 532 532 532 536 536 537 537 538 540 542 542
XX
LIST OF FIGURES
Figure 10.23 Christofides' heuristic result after removing multiple visits to nodes E, H, and I Figure 10.24 Illustration of the 2-opt algorithm Figure 10.25 Tour of Figure 10.15 after removing links AF and BD Figure 10.26 Tour of Figure 10.25 after removing links GC and FB Figure 10.27 Illustration of Or-opt algorithm Figure 10.28 2-opt heuristic applied to the route of Figure 10.16 Figure 10.29 Or opt heuristic applied to the route of Figure 10.16 Figure 10.30 Sweep algorithm results rotating counterclockwise from node 0 Figure 10.31 Best sweep routes found by rotating counterclockwise from node 9 Figure 10.32 Improved routes beginning with best sweep routes of Figure 10.31 Figure 10.33 Savings algorithm Figure 10.34 An interior node in a route Figure 10.35 Savings algorithm routes for the example of Table 10.6 Figure 10.36 Results of randomized savings algorithm
543 544 545 546 546 547 548 551 551 552 553 554 554 556
LIST OF TABLES
Table 1.1 Table 1.2 Table 2.1
Some of the services we commonly use Breakdown of U.S. employment in June 2009 Sample independent variable (X) and dependent variable (Y) values , Table 2.2 Node-arc incidence matrix for the network of Figure 2.15 Table 2.3 First two non-dominated path solutions for the example in Figure 2.33 Table 2.4 First three solutions to problem shown in Figure 2.33 Table 3.1 Example performance for a simple toll booth Table 3.2 Increases in the variance and standard deviation of the number in the system as the utilization ratio increases Table 3.3 Probability that the time in the system and the waiting time exceed a given value for λ = 300 and μ = 360 vehicles per hour Table 3.4 Average number in the system as a function of the utilization ratio, p , and the maximum number in the system, M Table 3.5 Example performance of an M/M/6 queue with a mean service time of 2 minutes Table 3.6 Performance measures as a function of the number of agents Table 3.7 Probability of waiting more than a given time for an M/M/6 queue with 2.92 arrivals per minute (or 175 per hour), and a mean service time of 2 minutes Table 3.8 Comparison of an M/M/6 queue with an M/M/1 queue with j the arrival rate Table 3.9 Example results for an M/M/10 queue with no waiting capacity Table 3.10 Summary of analytic queueing results Table 3.11 One realization of a simulation of the first 10 customers at an M/M/3 queue with λ = 3 and μ = 2 Table 4.1 Aggregate vs. disaggregate use of simple analytic model for lower 48 states Table 4.2 Shortest path distances on the tree shown in Figure 4.6 Table 4.3 Demand-weighted distances for each candidate city in Figure 4.6
3 9 39 61 85 87 133 134 136 138 143 145 146 147 152 156 165 193 197 199 xxi
XXII
LIST OF TABLES
Table 4.4 Table 4.5 Table 4.6 Table 4.7 Table 4.8 Table 4.9 Table 4.10 Table 4.11 Table 4.12 Table 4.13 Table 4.14 Table 4.15 Table 4.16 Table 4.17 Table 4.18 Table Table Table Table Table
5.1 5.2 5.3 5.4 5.5
Table 5.6 Table 5.7 Table 5.8 Table Table Table Table Table
5.9 6.1 6.2 6.3 6.4
Table of shortest path distances for the network of Figure 4.8 Table of coverage coefficients for the shortest path distances in Table 4.4 and a coverage distance of 8 Population and percent covered vs. number of sites for three coverage distances Maximal covering model results for the network shown in Figure 4.8 using a coverage distance of 5 Results of using the maximal covering model to solve the four-center problem for the network of Figure 4.8 Expected coverage vs. number located for three values of the P(busy) using the network of Table 4.8 Varying the number of facilities located for the network of Figure 4.8 Fixed charge location model solutions as a function of the cost per item per mile Effect of changing the number of facilities on the maximum distance Tradeoff between coverage and average distance using three and four facilities for the network of Figure 4.8 Results of using the districting model on the network of Figure 4.8 Results of using the enhanced districting model on the network of Figure 4.8 Base case inputs for sample profit maximization model Results of varying the cost per item per mile in the profit maximization model using the network of Figure 4.8 Results of varying the demand factor in the profit maximization model using the network of Figure 4.8 Example inputs for multiple SKU examples Naive model results Optimal total cost with a single joint order Example monthly demand data Comparison of infinite horizon and finite horizon annual costs for the data of Table 5.4 with a per unit per month holding cost of $10 Example probabilities of dress sales Net profit as a function of number of dresses purchased Sample probability mass function for the number of snowfalls Expected cost for each number of contracted plowings Example resource allocation problems Summary of ways of handling infeasibility Sample student rankings of seminars Results for student/seminar assignment model with linear costs
205 205 213 217 219 225 230 233 234 240 253 259 265 266 267 295 296 296 307 309 317 317 323 324 343 357 358 361
LIST OF TABLES
Table 6.5 Table Table Table Table
6.6 6.7 7.1 7.2
Table 7.3 Table 7.4 Table 7.5 Table Table Table Table Table
8.1 8.2 8.3 8.4 8.5
Table 8.6 Table 9.1 Table 9.2 Table 9.3 Table 9.4 Table 9.5 Table 9.6 Table 9.7 Table 9.8 Table 9.9 Table 9.10 Table Table Table Table Table Table Table
9.11 9.12 9.13 9.14 9.15 9.16 9.17
Results for student/seminar assignment model with concave costs Link parameters for network flow diagram in Figure 6.12 Results for the districting seeds shown in Figure 4.31 Example workforce requirements by time of day Summary of costs and employee counts for the example of Table 7.1 Example cook and CSR requirements Sample results for nurse scheduling problem with service determination Total person hours in the system as a function of the number of nurses employed and how frequently they can start a shift Example inputs for simple workforce planning model One optimal solution to the simple problem of Table 8.1 Sample data for a problem over time Requirements, availability and contractor needs Optimal number of our own employees to hire when we plan for 9 projects Results of uncertainty analysis in the joint project scheduling/workforce management problem Maximum number of servers that allow equation (9.1) to be computed in Excel Comparison of equations (9.1) and (9.2) Sample priority queueing results: Single server, Poisson arrivals, exponential service Example data for setting the priority classes Evaluation of all possible class orderings for the inputs of Table 9.4 Example data for setting the priority classes with values of customer waiting time Evaluation of all possible class orderings for the inputs of Table 9.6 Impact of increasing the number of servers while holding the utilization ratio fixed Comparison of queueing with and without preemption Example of approximating the probability of waiting with the normal distribution Number of servers needed to attain a given level of service The Halfin-Whitt approximation Best approximation as a function of beta and theta/mu Base case parameters for patient scheduling example Sample results for base case inputs Sample results for Bailey-Welch rule Sample results from scheduling patients with 2 minutes of expected slack between patient arrivals
xxiii
362 366 372 381 387 388 401 403 420 421 428 430 446 446 463 464 467 470 470 471 471 474 475 482 483 483 490 494 495 496 497
xxiv
LIST OF TABLES
Table 9.18 Impact of the policy input on scheduled surgical times for a 2-hour procedure Table 10.1 Pairs of odd-degree nodes than can be paired from the network of Figure 10.4 Table 10.2 Number of possible pairings as a function of the number of odd-degree nodes in a network Table 10.3 In-degree and out-degree of each node in Figure 10.6 Table 10.4 Sample coordinates for a TSP problem Table 10.5 Inter-nodal distances for the problem with coordinates shown in Table 10.4 Table 10.6 Sample routing data
500 521 523 526 534 535 550
PREFACE
We depend on services and service providers for many of our day-to-day activities, from thé news we wake up to on our clock radio to the e-mail we check before breakfast, from the dry cleaner we stop at on our way to work to the express mail delivery service that dropped off our latest holiday gifts, from the cute corner bistro we patronize daily for lunch to the movie theater at which we unwind on the weekends. Many services are implicit in our lives including banking, investments, insurance, police and fire services, and (hopefully) our heath care providers. Without service providers, our lives would simply not be what they are today. The service sector in the United States is rapidly growing as a percentage of the economy. Sixty years ago, the service sector represented only 20 percent of the gross domestic product; today, services account for over 40 percent of the gross domestic product. The percentage of the GDP accounted for by the production of non-durable goods (e.g., food, clothing, and energy) has seen a commensurate decline. In 1960, slightly less than one out of every two people employed in the United States was employed in the service sector; today, more than two out of every three employees work in some form of service industry. Given our daily dependence on services and the enormous role that the service sector plays in the economy—not only of the United States, but also of every developed country around the world—it is important that we understand the operation of this sector and that services be provided in an efficient and effective manner. Much of the current debate in the United States over health care reform—and health care is part of the service sector—focuses on ways of increasing access, reducing inequities, and containing costs. This book will provide students with the tools and background needed to analyze and improve the provision of services in our economy. Following a brief introduction to the service sector, Part I of the text deals with the methodological background needed to analyze service systems. Two core methodologies are introduced: optimization and queueing modeling. For students who have not had a course on one or both of these topics, these chapters provide the background necessary to master the material in the remainder of the text. In addition, the online Appendix B summarizes probability theory at a level that will allow students who have limited backgrounds to understand the chapter on queueing models. While many students may have a background in optimization and queueing, topics covered near the end of each chapter are typically not included in XXV
XXVI
PREFACE
introductory courses. Section 2.8 deals with multi-objective optimization. This is critical in the analysis of many services because service providers must often balance conflicting objectives. A local government operating an emergency medical service department (ambulances) must carefully balance the need for rapid response against the demands for fiscal responsibility. Similarly, a cell phone company must balance the demands for expanded and enhanced service area coverage against the need to show a profit at the end of the year. Section 2.9 addresses a number of common mistakes that students (and professionals) make in formulating optimization problems. Section 3.5 summarizes key queueing results that extend beyond those included in many introductory stochastic processes books. Section 3.6 outlines how to solve queueing models numerically using Excel and section 3.7 discusses queueing problems in which the input or operating conditions change over time. Such problems are critical in the analysis of services. For example, there is typically a three or four to one ratio between the peak and off-peak call rates for emergency medical service. Planning for the average daily arrival rate of calls would lead to serious delays during the peak and excess capacity during the off-peak periods. Many other services experience daily, monthly, or annual spikes in demand. Even students with good backgrounds in optimization and queueing might find these sections useful. The remainder of the text is devoted to the application of optimization and queueing to the analysis and design of service systems. Chapter 4 deals with strategic decisions regarding the number and location of service facilities. Cell phone service providers must, for example, determine the number and location of their cell phone towers to provide cost-effective coverage to a service region. Fast food restaurants must also determine how many stores to have and where they should be to balance easy access against the possibility of self-cannibalizing the market. Many service providers partition the service region into districts that are then served by individual customer service agents. The chapter concludes with a discussion of districting problems. Many authors argue that the inability to store services in inventory is a key differentiator between the service sector and the manufacturing sector. A car that is not sold today can be stored in inventory for sale tomorrow or next week. On the other hand, a surgeon who takes an afternoon off from work to watch his son star in a school play cannot place the missed operating room hours in inventory for use later in the week. While the service itself cannot be stored in inventory for future use, many service providers depend critically on the ready availability of inventory to assist in the provision of the services they deliver. The same surgeon relies on the availability of sterile instruments in the operating theater at the beginning of each procedure. The local shoe store must stock shoes in numerous styles and sizes for its customers. Thus, an understanding of inventory problems and decisions is critical for students of the service industries. Furthermore, in contracting for services, individuals and firms must often make commitments before the demand for the services is realized. For example, many of us can place pre-tax funds in special accounts to pay for qualified medical expenses. We must decide in the Fall of one year how much money to set aside
PREFACE
XXVII
during the following year before knowing what our medical expenses will be during the coming year. Any unused funds at the end of a year are lost. Such problems are known as newsvendor problems and are discussed at the end of Chapter 5 on inventory modeling. At its core, many decisions in the provision of services boil down to resource allocation decisions. A college or university must allocate classroom space to courses. Colleges and universities must also allocate limited dormitory space to students and must also assign students to courses based on the students' preferences and requirements and the availability of space in the courses. Airlines must allocate gates, to aircraft. Chapter 6 deals with resource allocation decisions. Chapters 7 and 8 address short-term and long-term workforce management decisions and problems. In the short-term, service providers must determine how many staff to employ during each period of the day. For example,-a hospital must decide how many full-time nurses to hire during each shift. It must also determine how it will staff each unit in the event that the number of patients on the unit exceeds the expected number. Typically, nurses are asked to perform overtime duty or more expensive temporary nurses are hired to fill in for the permanent staff. In the long-term, providers must determine how many employees to hire, to promote, to release, and to retrain. A consulting firm, for example, needs to determine how many college seniors to hire each year in each of the specialty areas of the firm. Some of the more senior analysts at the firm may be targeted for management training. When the firm's business base changes, the firm may need to either retrain some of its employees or release the less productive members of its staff to make room for newer, better-trained employees in the growth areas. Chapter 8 addresses these problems. Chapter 9 extends the discussion of queueing models to three particular topics that arise in many service providers. Not all customers are equal. An elderly woman presenting in an emergency room in active cardiac arrest is likely to be served long before a six-year-old boy who fell of his bicycle and who may have a broken leg or twisted ankle. Frequent customers may be flagged for improved service in many industries. Thus, priority service systems comprise the first part of this chapter. Nearly every major company and government service provider operates a call center to provide service to its customers. When it comes to call centers, bigger really is better. The second section of this chapter addresses the design and operation of call centers. Finally, in many services, customers can be scheduled for service. A dermatologist can schedule most of her patients. Issues in customer scheduling are outlined in the final portion of the chapter. Finally, many services entail the delivery or pickup of customers or goods. A local public school must provide bussing to its students to pick them up from their homes in the morning and to return them home at the end of the school day. Large white goods (refrigerators, freezers, dish washers, washing machines, and dryers) must be delivered to customer homes in a timely manner following the purchase of the items. The mail must be delivered daily and streets must be
XXVIII
PREFACE
cleaned during the summer and plowed during the winter. Chapter 10 introduces vehicle routing problems and models as they arise in the delivery of services.
All referenced files may be found at http://umich.edu/~msdaskin/servicescience/
The course that I taught at Northwestern University, which operates on a 10-week quarter system, had prerequisites of (a) deterministic optimization, (b) probability, (c) statistics, and (d) stochastic modeling, including an introduction to queueing theory. Thus, students were largely well-prepared in terms of methodological backgrounds. Because of their background in optimization, after a quick summary of the first chapter, I was able to cover only sections 2.8 and 2.9 of Chapter 2.1 usually did a one- or two-day review of queueing theory including a quick introduction to time-dependent problems covered in section 3.7.1 typically would spend two weeks on location models (Chapter 4). My coverage of inventory theory focused on the newsvendor problem (section 5.6). Resource allocation problems (Chapter 6) were typically introduced during the review of optimization. I would often spend a week each on Chapters 7 and 8 on short-term and long-term workforce management. Topics from Chapter 9 on priority queueing systems, call centers, and customer scheduling typically rounded out the course. Routing and inventory were, with the exception of the newsvendor problem, not covered in the course as there was a separate supply chain management course as well as a production scheduling course that covered routing and inventory. Although students had to take only one of the three courses—supply chain management, production scheduling, or service operations management— many students took two or even all three of the courses. Excessive duplication of material was deemed inappropriate by those of us teaching these three courses. In short, I encourage faculty and students using the text to pick and choose those topics that are of most interest to them. For students with a strong methodological background in optimization and stochastic modeling, Chapters 4 through 10 should generally stand on their own and can, to a large extent, be covered in any order and in a level of detail that suits the instructor and the class. I hope you enjoy using the text as much as I enjoyed writing it and teaching the course, which was the genesis of the book. Mark S. Daskin
ACKNOWLEDGMENTS
The genesis of this book was a course that I created for the undergraduates of the Department of Industrial Engineering and Management Sciences of Northwestern University. In the six quarters that I taught this course, dating back to the Fall of 2003, over 200 students took the course. I am indebted to them for their insightful questions and comments and for their enthusiasm for the course. I also owe a deep debt of gratitude to the six teaching assistants who helped me with this course over these years: Taylan Ilhan, Bilal Gokpinar, Michael Lim, Zigeng Yin, Yao Cheng and Yue Geng. Your help greatly improved both the course and this text. Many thanks. I also want to thank the many other friends that I made in the IEMS department—students, faculty, and staff—for their friendship and encouragement during my years in the department. I particularly want to thank Barry Nelson, the chair of the department, who afforded me the time to finish writing this text during my last quarter at Northwestern. Without that time, this book would not have been finished on time, and maybe not at all. From my initial meeting with her, Susanne Steitz-Filler, my editor at John Wiley, expressed strong enthusiasm for this project. She and Stephen Quigley, who filled in for her during her maternity leave, have been with me at every step. Many thanks to both of them. This book is dedicated to my parents, Walter and Betty; to my two daughters, Tamar and Keren; and to my wife, Babette. My parents always said that if subsequent generations had not surpassed the generation before them, then we would all still be living in caves. I hope that this text enables and motivates the next generation of students of the service industries to surpass me and my generation of researchers. My children, Tamar and Keren, have always been a source of joy and light in my life. Finally, without Babette's support, encouragement, and friendship over the 35 years that we have known each other, I would not be where I am today and this book would never have been written. I love them all and I truly thank them for everything.
XXIX
1 WHY STUDY SERVICES?
1.1
WHAT ARE SERVICES?
We use services every day of our lives. When we wake up to the voice of our favorite radio broadcaster on our bedside alarm clock, we are using the services of the radio station as well as those of the electric company providing our home with power. A quick shower entails the use of the water supplied by the water company. The bowl of cereal that we eat at breakfast was purchased from a retail grocery store, or perhaps delivered to our house by a food delivery service, either of which received the box of cereal using trucking services. The pants that we put on before leaving the house were cleaned at the local dry cleaners, yet another service we use implicitly before leaving the house. After alighting from our bus (a public transportation service), we stop at the local coffee shop for a latte before walking to the office. Chances are we work for a service provider, such as a lawyer, doctor, accountant, or consultant. During the day at the office, we use numerous communication services, including e-mail, phones, faxes, the Internet, and instant messaging. To learn more about the new software our employer installed last week, we may employ the services of an online training program or a consultant at the software vendor's call center. Service Science, by Mark S. Daskin Copyright © 2010 by John Wiley & Sons, Inc 1
2
WHY STUDY SERVICES?
Lunch with friends at the nearby burger house demands the services of this establishment, including the waiters, chefs, busboys, and cashier. As we pay with our credit card, we utilize the financial services of our bank. The afternoon call to our dentist to schedule our next checkup brings us in touch with the vast array of medical services at our disposal. After a quiet dinner at home, we drive to a nearby theater to catch the latest movie, taking advantage of the myriad of entertainment services that surrounds us. We take many services for granted. For example, in driving to the movie theater, we may have forgotten about the public road maintenance services that patched the potholes left by last winter's snows. We surely forgot about the snow plowing services that removed the snow. Unless we recently had our car repaired, we didn't consider the auto maintenance and repair services that keep our cars going. We took for granted the police services that kept our streets'and neighborhoods safe. Most of us are probably unaware of the traffic monitoring services provided by many large municipalities and counties to ensure the smooth flow of traffic on our highways and arterials. If the theater was one we frequent often, we probably did not need the GPS service in our car or on our cell phone. And throughout the day, we implicitly relied on our life, auto, health, homeowner's, and property insurance services. In short, we rely on and utilize services for many of our daily needs. So what are services and how can we characterize them? Table 1.1 lists some of the services that we frequently encounter. This should give the reader a sense of the broad spectrum of economic activity that is encompassed by the service sector. In further defining the service sector, it may be easier to define what it is not. Agriculture is not part of the service sector, though agriculture relies on transportation carriers (part of the service sector) to move seed, feed, and fertilizer to farms and to ship produce and animals to producers and markets. The construction industry, which builds roads, airports, manufacturing plants, office buildings, and much more, is not part of the service sector, though it too depends on many services. Manufacturers of durable goods such as automobiles, washers, driers, and refrigerators are not part of the service sector, though they too rely heavily on services for the goods they produce. Manufacturers depend on the financial industry for loans for inventory, raw materials and machinery; on accountants to help manage their finances; on the legal profession to ensure that they comply with government regulations; and consultants for a wide range of professional services. Some durable goods manufacturers are also in the service business. For example, General Motors seems to spend as much time advertising its OnStar emergency and vehicle diagnostic service as it does marketing the vehicles it produces. Often, government activities and employees are separated from the service sector, though many governmental activities are rightly considered services. For example, police, fire, and emergency medical personnel clearly provide important services to the communities in which they are located, as do teachers, many of whom are employed by their local public school districts. Several attributes characterize most services. First, it is difficult to inventory services. Empty seats at a Sunday matinee of a musical cannot be sold for the
WHAT ARE SERVICES?
TABLE 1.1. Some of the services we commonly use Financial
Insurance
Retail
Health
Communication Services
Dining
Savings Checking ATMs Credit card Mortgage services CDs Stocks Bonds Mutual funds Life Health Dental Disability Automobile Homeowner/property Long-term care Grocery store Book store Gasoline station Jewelry store Department store Specialty clothing Electronics warehouse Social worker Psychiatrist Personal physician Specialist Dentist Clinic Hospital Emergency room Post offlce/U.S. mail Express mail Land line telephone Cell phone E-mail Text message Internet
Education
Primary school Secondary school Community college Four-year college University Online training Private school Parochial school
Entertainment
Movies Live theater Concerts Sports Television Radio
Transportation
Parking Taxi Bus Train Airplane Truck Rail freight
Personal Services
Fast food Family dining School cafeteria Ethnic restaurant Fine dining
Other
Hair stylist Spa Massage Dry cleaning Shoe repair Accountant Financial consultant Lawyer Library Police Fire Emergency services Garbage collection Roads Water Electricity Call center Lawn care Snow removal Pet care
Public Services
4
WHY STUDY SERVICES?
following Saturday night when demand may be high. Students who miss a class on optimization cannot sit in on a class on French literature and make up for the material on optimization that they missed. A dry cleaner who goes on vacation for two weeks cannot make up for the lost business during that time by working overtime because her customers are likely to have taken their clothing to another cleaner during that time. Airline seats that are flown empty on one flight cannot later be used for a flight that is overbooked. Nevertheless, services often depend critically on the careful management of inventories. Without an adequate inventory of sterile equipment and materials, surgeries cannot be performed. A retail establishment must maintain an adequate inventory of goods to be able to serve its customers. Airlines think of their seats as a perishable inventory that they manage using sophisticated revenue management techniques. Videotaping and recording of lectures, coupled with online material, may allow students to "inventory" a lecture for future reference. Second, there is an intangible quality associated with services. You cannot touch the interaction between a psychiatrist and his or her patient, just as you cannot hold the education that a student receives in high school. Third, services typically produce some value for customers, or the service provides a solution to a customer need. The value may be in the form of improved health care, entertainment, or education. The value may also provide peace of mind (as in the case of insurance, police, fire, and emergency medical services) or convenience (as provided, for example, by dry cleaners). Fourth, services typically involve an interaction between a service provider and a consumer of the service. For example, doctors interact with patients in providing health care services. Teachers and professors interact with students in the educational process. Lawyers provide advice and counsel to their clients. Finally, the need for services varies significantly with time. This is one of the key distinguishing features of services as opposed to manufacturing operations where the number of products produced each day is likely to remain roughly constant. An automobile assembly plant can produce approximately one vehicle a minute or about 1,000 cars per day during two eight-hour shifts. The production rate remains the same throughout the day. Emergency room arrivals, on the other hand, vary significantly over the course of the day. For example, in Austin, Texas, we found that the ratio of the peak hourly demand for ambulance services to the demand during the least busy hour exceeded four to one (Eaton et al., 1979). Traffic on most urban highways also exhibits clear daily patterns with low volumes in the late evening and early morning hours and heavy traffic during the morning and evening rush hours. The demand for air travel also exhibits weekly and annual peaks. The Sunday of Thanksgiving weekend is typically one of the busiest times of the year for most airlines. Retail establishments must often sell a large fraction of their goods during the Christmas holiday season if they are to have a successful year. Accountants experience a rush of business in the first three and a half months of the year, as clients try to meet the April 15 tax filing deadline. Some services, such as summer-stock theaters or winter ski resorts,
WHAT ARE SERVICES?
5
operate only during certain times of the year. Other services, such as insurance sales and library usage, exhibit significantly lower degrees of temporal variation. Planning for these peaks and valleys in demand is a critical task for a service manager. If possible, one would like to smooth the demand. In some cases, pricing can be used to shift demand from peak to off-peak periods. For some services, this is not possible. The demand for emergency medical services, for example, is not likely to be influenced significantly by any pricing scheme that a hospital or municipality might consider putting in place. Similarly, Thanksgiving holiday travel may decrease overall with significant price increases, but people are not likely to shift that travel to other times of the year since Thanksgiving is when most employees and most students have two (or more) days off from work or classes. Supply can also be adjusted in many cases. Additional flights can be scheduled for busy periods. Larger aircraft can be assigned to those routes that are known to experience the most significant percentage increases in demand during a busy period. Additional temporary accounting staff are hired during the tax filing period. More doctors and nurses can be scheduled to work in an emergency room during the busier hours of the day and week. Reversible traffic lanes are used in many urban areas to accommodate the daily rush hour traffic. Many services have evolved significantly since the turn of the century. The Internet has spurred much of this evolution. For example, in booking an airline reservation, one used to have to contact the airline or a travel agent directly. Today, many people book reservations online with little to no human interaction. This function of travel agents has been largely replaced by the Internet. Toward the end of the twentieth century, it was nearly impossible to research the housing stock in a community without the aid of a realtor. Today, most sophisticated home buyers conduct a significant amount of research regarding communities and home prices before visiting their first house. Smart and sophisticated realtors encourage and facilitate this sort of research. To illustrate the evolution of services, consider what has happened to photography during the twenty-first century. In the pre-Internet, pre-digital camera era, photographs were taken on film. The film was developed at a local photo shop and converted into pictures and negatives or slides. Alternatively, some film manufacturers provided customers with mailers to return the film for processing by the company. Today, relatively few people rely on film; most have converted to digital photography. With this conversion has come an explosion in the number of options people have for processing photographs. It is worth noting, that most digital photographs are probably never printed as they can be viewed on the camera or on a computer. Only the winners need be printed and processed. In addition to the local photo shop as a means of printing pictures, consumers can now print their photographs on an inexpensive color printer hooked to their home computer. Many printers now allow users to bypass the computer completely with the camera or memory card linked directly to the printer. Photographs can be uploaded to an online photo
6
W H Y STUDY SERVICES?
processor. Pictures can then be ordered for mail delivery or pickup at a local store. Many drug stores and other establishments have stand-alone kiosks to allow photo enthusiasts to print pictures, again with little or no interaction with the store owners. Finally, digital photos are finding their way into far more than pictures. Online companies allow customers to order mugs, photo books, magnets, calendars, clothing and much more. Many other services are also being transformed by the Internet. In his seminal book entitled, The World is Flat, Thomas Friedman (2005) points out that many accountants are sending simple tax returns to India and other lowlabor-cost countries for processing. Accountants are now finding more sophisticated ways of meeting their clients' needs. Medical images taken at a hospital in Boston, Massachusetts, may be read by a radiologist in Boston; they could just as easily, however, be read by a radiologist in Beer Sheva, Israel or Bangalore, India.
1.2
SERVICES AS A PERCENT OF THE ECONOMY
In measuring the economy, the U.S. Bureau of Economic Analysis divides the gross domestic product—the value of all goods and services produced in the country—into these broad categories: a. Durable goods, including such items as motor vehicles and parts, furniture and household equipment b. Non-durable goods, including food, clothing, shoes, gasoline, oil, fuel, and other energy supplies c. Exports, which is the value of all exported goods and services d. Imports, which is the value of all imported goods and services and which contributes negatively to the gross domestic product e. Gross private domestic investment, which includes the value of all inventory and machinery in the country f. Government expenditures, including federal defense and non-defense related expenditures as well as all state and local government expenditures g. Services including expenditures on housing, transportation, household operating expenses (electricity, gas and other operating costs), medical care, recreation, and so on. Figure 1.1 plots the value of these components of the gross domestic product beginning with the first quarter of 1947 and running through the first quarter of 2008 in current dollars. The explosive growth of the value of the service sector of the economy is readily apparent. In 2000 dollars, the GDP increased from $1.57 trillion to $11.7 trillion ($0,237 to $14.2 trillion in current dollars) during
SERVICES AS A PERCENT OF THE ECONOMY
7
Figure 1.1. Gross domestic product over 60 years. (See color insert) Based on the U.S. Department of Commerce, Bureau of Economic Analysis, National Income and Product Accounts Table 1.1.5 Gross Domestic Product (Seasonally adjusted at annual rates)
this interval. This is an increase of 745% in real dollars or a compounded growth rate of over 3.3 percent per year. In the 60-year period from 1940 to 2000, the U.S. population grew from 142.2 million to 291.4 million, a compound growth rate of only 1.2 percent. Figure 1.2 is perhaps more enlightening, as it plots the percentage of the gross domestic product in each of these areas in 10-year increments beginning with the first quarter of 1948 and going through the first quarter of 2008. While the value of durable goods remained roughly constant at about 8 or 9 percent of the GDP, the value of services more than doubled from 20.5 percent in 1948 to 42.5 percent of the GDP in 2008. During this interval, the value of non-durable goods has decreased from 36.5 percent of the GDP to 20.8 percent. Up until the late 1960s, the United States was generally a net exporter; the United States has been a net importer of goods and services during the subsequent four decades (http://www.u-s-history.com/pages/h980.html).
8
W H Y STUDY SERVICES?
Figure 1.2. Percentage breakdown of the gross domestic product
While services represent roughly 45 percent of the gross domestic product, the number of people employed in the service industry is an even greater percentage of the total employment. Table 1.2 shows the breakdown in non-farm employment in the United States in June 2009. (Note that less than 2 percent of the U.S. workforce is employed on farms, so looking only at non-farm employment is quite reasonable.) Of the 131.4 million employees, less than 15 percent are employed in goods-producing industries including natural resource extraction, construction, and manufacturing. About the same percentage (17.1 percent) are government employees (many of whom can be viewed as being in service-related jobs), while over two out of every three employees (nearly 69 percent) work in the service sector according to the U.S. Bureau of Labor Statistics. Figure 1.3 shows the breakdown of the U.S. employment in percentage terms for June 2009. Figure 1.4 breaks down the service sector employment into the major categories shown in Table 1.2. Two out of every seven service sector employees work in the trade, transportation, or utility industries, another 19 percent work in professional and business services, while 17 percent work in health care.
SERVICES AS A PERCENT OF THE ECONOMY
TABLE 1.2. Breakdown of U.S. employment in June 2009 Non-farm Jobs in the US—June, 2009 Raw #s Total Non-farm Employment (xlO3) Goods Producing Natural Resources Construction Manufacturing Private Service Providing Trade, Transportation, Utilities Information Financial Activities Professional and Business Services Education Health care Leisure and Hospitality Other Government Federal State Local
131,411
18,713
90,223
22,475
% of previous
715 6,162 11,836 25,174 2,834 7,737 16,624 3,072 16,190 13,177 5,415 2,826 5,149 14,500
14.2%
68.7%
17.1%
3.8% 32.9% 63.3% 27.9% 3.1% 8.6% 18.4% 3.4% 17.9% 14.6% 6.0% 12.6% 22.9% 64.5%
Based on the U.S. Bureau of Labor Statics, Table B-3. Employees on nonfarm payrolls by major industry sector and selected industry detail, seasonally adjusted (http://www.bls.gOv/ces/#tables, ftp:// ftp.bls.gov/pub/suppl/empsit.ceseeb3.txt)
Figure 1.3. U.S. non-farm employment by major sector, June 2009
10
WHY STUDY SERVICES?
Figure 1.4. U.S. private service employment, June 2009
1.3
PUBLIC VERSUS PRIVATE SERVICE DELIVERY
Services are provided by both the public and private sectors. The public sector refers to governmental agencies, while the private sector encompasses private companies. For the purposes of this discussion, we will consider non-profit agencies, like many food pantries, to be governmental agencies since, in important ways, they behave in a manner that is similar to government agencies. One of the fundamental differences between services provided by a public agency and those delivered by a private company has to do with the service provider's objective. Private companies, even though they are in the service provision business, often act just like other companies. Their primary objectives have to do with profit maximization or maximizing the return on their shareholders' equity. For example, the primary objective of a company providing cellular phone service is to maximize its profits. In those cases in which their (short-term) revenues are fixed, such firms attempt to minimize the cost of delivering the service. In modeling such firms, it is important to include a constraint that guarantees a minimum level of service. For example, while the long-term objective of a package delivery service company is to maximize profit, its short-term day-to-day objective might be to minimize its costs. Clearly, the firm can minimize its costs by doing nothing! However, it typically is constrained to deliver the packages scheduled for that day. With this constraint, it wants to do so at minimum total cost.
W H Y MODEL SERVICES?
11
Public agencies and most non-profit agencies operate with different objectives and different constraints. Such agencies typically want to maximize some measure of service, such as the number of clients served, while operating within a fixed, and often very tight, budget. For example, an ambulance service might want to locate its bases to maximize the number of people who live within a given time of the nearest ambulance base, since time is of the essence in medical emergencies. The ambulance service will typically have sufficient funds to build and operate only a limited number of bases. In other cases, an agency may want to maximize some measure of the equity of the service provided to its clients. For example, maximizing the minimum fill rate (the ratio of the delivered food to the requested food) was the objective used in allocating collected food from food donors to food pantries in the Greater Chicago Food Depository program (Lien, Iravani, and Smilowitz, 2007). A vehicle would visit donor companies—typically grocery stores or restaurants—collecting fresh food donations in the morning and would then deliver the food to roughly half a dozen food kitchens over the course of the afternoon. Without some attempt to achieve equity between the food kitchens, the first kitchen visited might receive a large allocation, leaving little if any food for the last kitchens visited on the vehicle's route. Not only is the profit maximization objective typically replaced by a servicerelated objective when considering public sector service providers, but also we typically have to capture multiple objectives (Cohon, 1978). For example, in locating ambulances, not only is it important to maximize the number of people served adequately—those for whom an ambulance is located within a specified time standard—but it is also important to ensure equity across different socioeconomic groups within the community. There may well be important tradeoffs between the number of people who can be served adequately and a measure of equity across all groups. Also, a public agency may want to minimize the disruption to the community, thereby introducing a third objective. In the case of ambulance bases, the city providing the service may want to maximize the number of bases that are located on existing city land, or equivalently to minimize the number of pieces of property that need to be seized using eminent domain laws. This will introduce additional tradeoffs and will make the analysis and modeling of the problem that much more complicated and difficult. Johnson and Smilowitz (2007) outline many important issues in community-based operations research, a growing field that is closely related to public sector service modeling. While many of the models that we outline will be appropriate for both public and private sector service providers, it is important that we bear in mind the differences between these two contexts when determining the appropriate objective(s) and constraints for any model.
1.4
WHY MODEL SERVICES?
From the discussion above, it is clear that services constitute a significant part of the U.S. economy and increasingly of the global economy. Over two out of
12
W H Y STUDY SERVICES?
every three employees work in the service industry and over 45 percent of the $13.8 trillion 2007 GDP is attributable to services. A number of good books have been written outlining the service industry (Davis and Heineke, 2003; Fitzsimmons and Fitzsimmons, 2008; Metters, King-Metters, and Pullman, 2003). While providing an excellent introduction to the service industry and its components in general, these texts do not focus on modeling some of the key decisions that managers of service-oriented firms or agencies need to make. Many service providers face similar decisions. Much of the focus of this book is on those decisions or classes of problems that are common across many service providers, be they in the public or private sectors. These decisions include: • Location decisions - how many facilities to have and where should they be located • Resource allocation decisions - how to allocate scarce resources (such as class capacity) to demands (such as students wishing to take each course) • Short-term workforce scheduling issues - how many employees to schedule for each shift and when each shift should begin • Long-term workforce management problems—how many employees to hire, release, and retrain, at which locations, and in which positions • Inventory problems (arising in retail services as well as a range of other services) - how much safety stock inventory to maintain, when to place orders, and how much inventory to order • And vehicle routing problems—how many routes are needed to serve a customer base (e.g., clients for Meals on Wheels), how to assign customers to routes, and how to sequence the stops on the route to achieve a service provider's objectives In many of these cases, the fundamental underlying issue is that of striking the right balance between the demand for services and the supply of those services. Alternatively, this can often be viewed as striking a balance between the level of customer service that is achieved and the cost of providing that level of service. Intuitively we would expect that as more service is provided, the cost of providing the service increases but the quality of service also improves. For example, if a grocery store increases the number of cashiers on duty, its labor costs will go up, but the quality of service, as measured by the time patrons must wait to pay for their groceries, will improve. Similarly, if a popular restaurant increases its seating capacity with a concomitant increase in wait staff, chefs and other personnel, its costs will increase. At the same time, however, the waiting time for a table during the peak dining hours will decrease. As more screeners are added at an airport security checkpoint, costs increase but passenger delay times decrease.
KEY SERVICE DECISIONS
1.5
13
KEY SERVICE DECISIONS
In the long-run, service providers must make decisions regarding the number and location of facilities. For example, a hospital system may need to decide how to allocate services to hospitals and whether additional sites are needed to accommodate a growing demand for medical services. Complicating the planning process is the need to have some services co-located at the same site. Also, any plan must evolve over time as the population ages and changes demographically (Santibáñez, Bekiou, and Yip, 2009). A coffee .company like Starbucks must decide how many stores to open and where they should be. In fact, Starbucks seems to have opened too many stores and, in the summer of 2008, announced that it was closing 600 stores in the United States (de la Merced, 2008). Just as the decision of where to open stores can be modeled, so too can the decision regarding the number of stores to close and the location of those stores. While this is a private sector problem for which we earlier argued that profit maximization should be the long-run objective, news reports, editorials and commentaries (Wong and Rose, 2008) suggest that even such corporate decisions must account for community-based objectives if the firm is to avoid negative publicity. In some industries, the service region needs to be partitioned or divided between sales representatives. This is a districting problem that generally has multiple objectives. Typically, one wants the districts to be contiguous so that a salesperson does not service one county in New York, for example, and another in southern California. In addition, one often wants to equalize the workload (e.g., the number of potential customers) in such districts. At the same time, one would typically prefer a compact (close to circular) district with small customerto-base travel distances to one that is highly elongated with longer travel distances. This too is a form of a location problem. Resource allocation problems are also common in the provision of services. For example, at Northwestern University, half of the freshmen are in the Weinberg College of Arts and Sciences (WCAS). Each of these 1,000 students must take a seminar in the fall quarter and another in the winter or spring quarter. During the fall quarter, there are roughly 70 seminars, each with a capacity of about 15 students. Students must be assigned to seminars so that each student is in exactly one seminar, the seminar capacities are not violated and the assignment maximizes a measure of student satisfaction. Similarly, each quarter or semester, at every college or university in the country, classes need to be assigned to rooms and times. Clearly one objective is to minimize the number of classes that do not have adequate seating capacity for those wishing to enroll in the course. At the same time, we do not want to assign a small class to a large auditorium as this makes for an uncomfortable teaching and learning experience for all involved. (I know this from personal experience.) In addition, we typically want to minimize both faculty and student walking times. Faculty walking times or distances are generally easier to estimate because we can generally assume that faculty leave for class from their offices,
14
W H Y STUDY SERVICES?
while the location of students immediately before a class is less certain. They could be in their dormitories, at a student cafeteria, in the library, or in another class. Finally, we need to ensure that no faculty member has to teach two classes at the same time. We also would like to respect faculty requests for teaching schedules as much as possible. Some faculty members prefer mornings to afternoons; some prefer longer Tuesday/Thursday classes to shorter Monday/ Wednesday/Friday classes. Airlines operating at large hubs like Chicago, Atlanta, Los Angeles, the various New York airports, Dallas, Houston, and San Francisco must assign planes to gates. Airlines today operate hub and spoke systems with aircraft converging on the hub at about the same time and then leaving at about the same time roughly an hour or so later. This allows time for passengers to change planes and to make connections. Airlines may try to assign flights to gates to minimize the total walking distance of all connecting passengers. Typically, this problem is constrained by the capacity of specific gates to accommodate different aircraft types. Almost all services, with the possible exception of Internet-based services, need to schedule employees. As noted above, the demand for services varies dramatically over time. In many cases, such as the provision of emergency services and restaurant services, the demand exhibits daily patterns with significant peaks and troughs. Key questions that can be answered with appropriate models include: • • • •
How many employees to have on duty at each time of the day? When should the employees begin and end their shifts? How many full-time and part-time employees should be utilized? How should cross-trained employees (those with multiple skills) be deployed? • What is the tradeoff between employee costs and customer service? For some industries, the temporal variability occurs over the time span of months. For example, the demand for accounting services peaks in the first three and a half months of each year in the United States as citizens prepare their personal income tax returns. Community organized or for-profit summer camps, parks, and swimming pools must add staff during the summer months. Retail stores add staff for the pre-holiday sales season. The key decision in these cases revolves around how much staff to add and when to begin the staff in any required training program. Many service providers must deal with long-term personnel management. For example, a management consulting firm must determine how many new hires to bring on board with various skills and how to assign those employees to projects. While this may seem on the surface to be a simple issue of managing an inventory of employees—a problem for which inventory management is, perhaps, well-suited—employees differ significantly from an inventory of drill bits at a
KEY SERVICE DECISIONS
15
home improvement store. First, employees (unlike drill bits) have preferences for where they are deployed and which projects they work on. A failure to account for such preferences can result in disgruntled employees and higher than necessary turnover rates. Second, employees typically come with a bundle of skills whereas a {-inch drill bit has only a limited number of attributes. Third, and perhaps most importantly, employees acquire and can· be taught new skills while untapped and unused knowledge may be forgotten or become out-of-date. A drill bit will not "forget" what it is supposed to be able to do; at the same time, it is unlikely to acquire a new skill and suddenly know how to rip a sheet of i-inch plywood. In short, while inventory theory may teach us some lessons about personnel management, we need to account for the unique features of people in managing personnel. While most writers use the presence or absence of inventory as a key distinguishing feature between manufacturing sector and service sector, inventory decisions play a key role in the provision of many services. As such, it is appropriate and important that students and managers of the service industries understand fundamental issues of inventory management. For example, retail stores must manage large quantities of inventory if they are to remain in business. When the skies open up in a sudden downpour, customers running into the local drug store for shelter want to be able to buy an umbrella. They are not willing to backorder one, only to pick it up a week later on a sunny day. Auto maintenance and repair facilities must carry an inventory of the commonly used spare parts. Few, if any, drivers would be willing to wait three days while a local service station ordered a few quarts of motor oil for a $20 oil change. But inventory issues extend far beyond the obvious ones of managing a physical stock of items. Airlines view the seats on their flights as a perishable inventory in the sense that once the flight has departed any unsold seats have "perished" or "spoiled." Yield and profit management systems are used to manage this inventory of seats. Hotels face a similar problem. A room that is not rented on a given night cannot be placed in inventory to be rented during an evening when the hotel is full. At the same time, the hotel does not want to rent a room several months in advance at a low family rate when they could hold the room in "inventory" and rent it to a businessperson willing to pay a far higher rate. Finally, the newsvendor problem in inventory theory has much to teach us about services as well. In its classical statement, the newsvendor problem is that of a small convenience store determining how many of the daily newspaper to order. If it orders too many, it loses money on unsold copies. If the store orders too few, customers arriving late in the day will be disappointed at not being able to buy a paper, resulting in a loss of goodwill on the part of the store. In the long run, the store may lose such customers as they choose to buy not only newspapers, but other items as well, at a store that does have the paper in stock. Such models are applicable not only in this context but also in the context of seasonal clothing purchases for which there is likely to be a single purchasing window months in advance of the realization of demand. These models can also inform decisions about contracting for such services as snow plowing of one's driveway.
16
WHY STUDY SERVICES?
Finally, employees who must make decisions about how many pre-tax dollars to set aside in flexible health care spending accounts are making decisions similar to those made by the newsvendor; the dollars must be committed before the need for those moneys is realized. Finally, vehicle routing is important in the delivery of many services. Express mail companies such as UPS and FedEx are in the business of delivering small packages to home and business locations. For such firms, efficient vehicle routes can mean the difference between profitability and bankruptcy. In other cases, vehicle routing is a necessary part of doing business. For example, a company selling white goods (refrigerators, freezers, washing machines, and driers) must often deliver and install the items purchased by its customers. The firm must decide when to offer delivery to customers in each region that it services and then how to sequence customers on routes on the day of delivery. In a different context, many regions share an inventory of books across multiple libraries serving the area. If a book is not available at your local library, you can often request the book on an inter-library loan system. Such books are sent from one library to another on a dedicated fleet of vehicles operated by a regional library system. A library system may encompass hundreds of primary, middle and high school, university, hospital, and public libraries. Determining the frequency of pickups and dropoffs at each library in the system as well as the route of each of the vehicles in the fleet is a complex vehicle routing problem that significantly impacts the time a library patron must wait for a book to become available at his or her local library.
1.6
PHILOSOPHY ABOUT MODELS
George Box, the noted statistician, said, "Essentially, all models are wrong, but some are useful" (Box and Draper, 1987). A model is an abstraction of reality that may ignore many details of the real world context. This is true of all models. A picture of the heart in a text on biology is a model of the heart. Clearly, the model does not beat. The picture also does not pump any blood. The picture is often cut away in a manner that would be fatal to any patient with such a "wound" in his or her heart. Nevertheless, the picture, coupled with the associated text, is useful in explaining to biology and medical students the various components of the heart, their placement relative to each other, and the functions they perform. The same is true of models of services. For example, while we know that the demand for emergency services varies by time of day, most facility location models ignore this temporal variability as it is unlikely to impact long-term decisions about where to locate fixed ambulance bases. The model may not explicitly account for the uncertain nature of ambulance demand. The model may also assume that all ambulances are always available for service. Differences between patients in the required on-scene time as well as whether or not transport to a hospital is or is not required are also typically ignored. Nevertheless, location
17
PHILOSOPHY ABOUT MODELS
models are often used to assist decision makers in locating ambulances because the models provide valuable insights into the problem and the impact of the decisions that need to be made (Eaton et al., 1985). Similarly, a model of the delays experienced by callers to a call center is likely to make a number of assumptions that may not be supported by empirical studies. For example, we are likely to assume that calls arrive at the center according to a particular stochastic process known as a Poisson process. While this is often supported by the data, we may also assume that the duration of calls follows an exponential distribution. This is rarely validated by empirical results. Despite these flaws, the models are likely to provide valuable insights into the operation of a call center and are likely to help us determine the appropriate number of customer service agents to employ to balance operating costs and customer waiting time. But the value of modeling a process extends far beyond any insights that the model may provide regarding the operation of the underlying system and the decisions needed to design the service. The process of developing a model often yields benefits in and of itself. This process is shown in Figure 1.5. Modeling generally begins with a problem. For example, the problem might be that of assigning freshmen at a university to seminars in a more efficient and more equitable manner than the current manual process. The problem might be that of determining how many parking spots to build in a municipal parking garage. The problem might be that of identifying bases for emergency medical service vehicles. It could be identifying improvements in a hospital discharge planning process.
Identify Problem
Monitor Outcomes
Collect Data
Adopt and Implement Recommendations
Identify Modeling Assumptions
Convert Model Outputs into Action Recommendations
Develop Mathematical Model
Solve, Exercise, and Analyze the Model Figure 1.5. Schematic of the modeling/decision-making process
18
W H Y STUDY SERVICES?
There are three key facets associated with identifying a problem for modeling and analysis. First, we need to identify the key stakeholders or groups impacted by the process. For example, in the case of hospital discharge planning, key constituents clearly include: (a) the patients and their families, (b) the physicians, (c) the nursing staff, (d) other patient-oriented staff including social workers and discharge planners, (e) the hospital administration, and (f) any institutions such as nursing facilities and rehabilitation institutes to which patients might be sent. Each of these groups may have different subgroups. For example, patients might be stratified by the cause of their hospitalization. The discharge process for a teenager with a broken leg is likely to differ significantly from that of an elderly patient who was hospitalized for a heart attack. Physicians include in-house hospitalists, specialists who treated the patient, and the patient's own internist. Each of these groups might have different perspectives on the issue. Second, we need to identify the key objectives to be achieved. Two objectives in the case of discharge planning are (a) expediting the process to increase the flow of patients through the hospital and (b) enhancing the communication of discharge orders between the medical personnel (physicians and nursing staff) and the patient. Third, we need to identify any constraints that may be affecting the system. In the case of discharge planning, constraints may include language barriers between patients and the medical staff. One community hospital in the Chicago area has to deal with over 40 languages for informed consent forms for surgery; a large metropolitan hospital is likely to encounter far more languages. Such language barriers are likely to be present not only at the time a patient is admitted for a surgical or medical procedure but also at the time the patient is discharged. Another significant constraint is that the medical staff has many other tasks to perform each day other than discharging patients. Once the problem—stakeholders, objectives and key constraints—is identified, the next step involves collecting data on the current process. In the case of discharge planning, this would include data on the number of patients discharged each day, the destinations to which they are discharged, the reasons for their initial hospitalization, and so on. It would also include mapping the current discharge process so that the key steps are clearly identified. The third key step in modeling a service operation is to identify any key assumptions that the model(s) might make. For example, if we are developing a simulation model of the discharge process, we need to structure the "arrival" process of patients ready to be discharged on any given day. What probabilistic laws does this process follow? Will we model the process as if the same number of patients are discharged each day? This is likely to be a very bad assumption. Which of the various steps in the discharge process will we model explicitly and which will we handle implicitly? How will we represent the delays in this process that are caused by physicians or nurses dealing with other patients who are not being discharged? If the model is an optimization model, explicitly enumerating the assumptions often entails identifying the nature of the relationships between the key decision variables as well as how those variables interact in the objective
PHILOSOPHY ABOUT MODELS
19
function(s). For queueing models, we need to be explicit about the probabilistic form of the customer arrival and service processes as well as the queue discipline that specifies the order in which customers are to be served. Developing the model is the next key step. In the case of a simulation model, this entails writing the computer code in the relevant simulation language to represent the modeled process. In the case of an optimization model, this involves writing down the objective function and constraints in terms of the input data and the decision variables. This mathematical model must then be translated into some form that a computer can understand. For example, many optimization models can be solved within spreadsheet systems like Microsoft Excel. Larger and more complex problems may require the use of specialized optimization languages such as AMPL (Fourer, Gay, and Kernighan, 2002) and IBM's ILOG CPLEX optimizer. Developing the model involves setting up the appropriate spreadsheets and/or writing the code needed to invoke specialized languages. Developing a queueing model may be simple if the model already exists in the literature. If it does not, the underlying equations for the queueing process need to be written down. Sometimes these can be solved in closed form, while in other cases they need to be solved numerically. In the latter case, developing the model entails writing the code or developing the spreadsheet model capable of solving these equations. Solving, exercising, and analyzing the model is the next step. In many cases, solving the model is actually fairly straightforward once the model has been developed. For simulation models, one simply has to run the model. Similarly, many optimization models can be solved with software built into spreadsheet systems or with off-the-shelf optimization packages. If the results of a queueing model are known, there is nothing to solve! If they are not, numerical procedures in a spreadsheet can often solve a given instance of a queueing model quite adequately. Exercising the model entails changing the key inputs to see how the model responds. This is necessary (1) to validate the model, (2) to test alternative policies, and (3) to determine the sensitivity of the results to changes in key model inputs. For example, in a simulation model we might increase the rate at which customers arrive at the system. If the performance metrics improve (i.e., if the customer waiting time decreases as the arrival rate increases) we have strong reasons to suspect that the model is not valid. Similarly, if attempts to replicate current conditions (e.g., the current discharge process at a hospital) result in times that differ significantly from those observed in practice, we again have reason to suspect that there is a problem with the model. If the model appears to be valid, we generally want to test alternative policies with the model. For example, if we simulated the discharge planning process, we might want to use the model to understand the impact of moving some steps of the process earlier. We might want to know, for example, how the average time required to discharge a patient—measured from the time a physician says a patient is ready to leave the hospital until the time the patient actually vacates the bed—changes if we begin arranging for a nursing home bed at the time critically ill patients are
20
WHY STUDY SERVICES?
admitted to the hospital, rather than waiting to do so until they are discharged. In the case of an optimization model for assigning students to seminars, we might want to see how many more students can get their first-choice seminar if we increase the number of students allowed in each seminar by one. For a queueing model, we might want to see how the average waiting time before service is impacted by changes in the average arrival rate of customers, the number of servers on duty, or the mean service time. The model results must also be analyzed, often statistically. In the case of a simulation model, this is particularly important since the output of any simulation model is typically one realization of a random process. Running the simulation model a second time with different random numbers is likely to result in different output values. Thus, it is important to analyze the results to see if the predicted results of two different policies are indeed statistically significantly different. In the case of an optimization model, there may be multiple objectives and the tradeoff between these objectives may need to be identified as part of analyzing the results. For example, in assigning students to seminars, there is likely to be a tradeoff between maximizing the satisfaction with the assignments averaged over all students and minimizing the number of students who are particularly adversely affected by the assignment (e.g., those who get their fourth choice or worse!). Once the model has been validated, exercised, and analyzed, we must convert the model results into action recommendations. In the case of discharge planning, this might involve recommending that additional hospitalists be employed to expedite the discharge process. It might mean recommending that physicians spend additional time with patients to ensure that the patients fully understand their discharge instructions. Perhaps one of the recommendations would be to begin certain processes, like planning for rehabilitation care or nursing care, as soon as it becomes apparent that the patient will need this additional level of care upon discharge, even if this means beginning the planning significantly earlier in a patient's stay. It is worth noting that this is often the stage at which the formal modeling by an analyst ends and the work of the decision maker takes over. For example, in assigning students to seminars, it is probably not appropriate for a technical analyst to recommend one assignment plan over another. Rather, the job of the analyst may be to make explicit to the decision maker—the dean in this case—the tradeoffs that must be made in choosing one assignment over another. The next step involves adopting and implementing the action recommendations. This is often complicated by the many stakeholders involved in the process. For example, a recommendation might be that a patient not be discharged until he or she can tell the nurse the top three discharge instructions. This sounds simple and is intended to ensure that the physician has adequately communicated the discharge instructions to the patient. However, adopting and implementing such a recommendation may be anything but simple. First, it requires that the physician identify the top three instructions and communicate to the nurse that these are, in fact, the key instructions that the patient needs to understand before
PHILOSOPHY ABOUT MODELS
21
being discharged from the hospital. Second, the nurse now has added work as he or she must ask the patient what these key instructions are. Third, what should happen if the patient does not understand the instructions or cannot recite them back for the nurse? Should the physician be called back in to discuss the instructions again with the patient? Should the nurse discuss the instructions with the patient? In assigning students to seminars, the seminar assignments must be uploaded to the university or college course scheduling software and conflicts that might arise between the assigned seminars and other courses individual students have enrolled in must be resolved. The last step involves monitoring the process to assess how well the recommendations have worked. Are discharge times reduced? Is there evidence that patients understand their discharge instructions better than they did before and that they are healthier following the revised discharge process than they had been under the old process? Are students happier with the new assignment process for freshman seminars? Have the number of complaints from parents been reduced as a result of the new assignment process? Finally, Figure 1.5 shows a feedback link between the step of monitoring the process and the initial step of identifying the problem. In some cases, we find that the problems that initiated the study are still not resolved and the process needs to be repeated. Perhaps we need a more careful understanding of the objectives of the constituents. Maybe the initial process failed to account for some key constraints that resulted in an incomplete or failed implementation of the recommendations. Maybe the data that were collected were biased or erroneous in important ways, which resulted in serious discrepancies between the modeled results and those obtained in the real world. Perhaps the differences between the real and modeled world resulted from unrealistic assumptions that were made in the process of modeling the problem. In any event, it may be necessary to cycle through this modeling/decision making process until the monitored results are satisfactory. It should be clear that there are likely to be many ancillary benefits associated with this modeling process aside from the direct benefits that result from the recommendations. First, the process forces us to identify the key stakeholders, their objectives, and the constraints under which they and the process operate. Identifying these people and sharing the various objectives with all stakeholders is likely to be a valuable exercise as all parties will begin to see the problem from a new perspective. Doctors will be forced to consider the discharge process from the perspective of patients, nurses, and social workers, while administrators will better understand the myriad demands placed on a doctor's limited time. Similarly, the data collection process is likely to yield important side benefits. In the course of collecting data relevant to a problem, one often finds that important information is missing, thereby making it hard to assess quantitatively how well the current system is performing. What metrics should be used to measure a patient's understanding of the discharge instructions that he or she has been given? In many hospitals, there is limited, if any, data on such issues. Proxies,
22
WHY STUDY SERVICES?
such as the number of calls back to a physician regarding medication instructions, may be the best information available. Thus the data collection process may suggest that new metrics need to be devised and new data collected. In the course of collecting and using the data, errors in the dataset are likely to be discovered. Correcting these errors for future use is another ancillary benefit of any modeling process. The process of identifying the key modeling assumptions further facilitates discussion among the stakeholders and between the stakeholders and the technical staff performing the analysis. Agreement must often be reached regarding which aspects of a problem are likely to impact the key decisions and are therefore worth modeling. Is there reason to believe that it is important to model patients being discharged to home separately from those being discharged to a nursing home or rehabilitation facility? Is the age of the patient an important determinant of the discharge time and, if so, should this be included in the model? If we are developing a model for surgical scheduling, is there agreement that uncertainty in the duration of surgical procedures may be contributing to delays in the starting times of subsequent surgeries and that modeling this uncertainty is worthwhile? Finally, by making the assumptions explicit, we are likely to be better able to discuss the results of the model and the recommendations that are derived from the modeling process. Both the technical analysts and the stakeholders will have a better appreciation for whether or not a particular result or recommendation is likely to have been caused by a modeling assumption or is the consequence of underlying properties of the process being analyzed. In summary, in addition to the insights and action recommendations provided by the modeling process, there are likely to be significant ancillary benefits in the form of more reliable and useful data for future modeling, enhanced communication among stakeholders, and an improved understanding by all of the modeling being done.
1.7
OUTLINE OF THE BOOK
Thomas Davenport and Jeanne Harris argue that "analytics" is the new tool for competitive firms (Davenport and Harris, 2007). Analytics means data-driven decision making. They cite numerous examples of companies and organizations— from professional sports teams to pharmaceutical manufacturers, from banks to book sellers, from casinos to international insurance companies—that are getting ahead faster than their competitors by using quantitative data-based decision tools. They argue that firms that use analytic techniques routinely manage to out-think and out-perform their competitors in a systematic way. Ian Ayers, in a related book, argues that our lives are increasingly being ruled by "super crunchers" (Ayers, 2007), individuals and organizations capable of managing and analyzing huge quantities of data to extract important trends. Like the Davenport and Harris's firms that compete on analytics, Ayers' super crunchers are found in a broad variety of industries, from medical diagnostics to
OUTLINE OF THE BOOK
23
airline pricing, from studies of Supreme Court decisions to online matchmaking and dating services. Ayers argues that two methodologies—randomization and regression—are the keys to super crunching. Randomization basically means that treatments are applied randomly to elements of a population to see which treatment is most effective. Medical science has used randomization for many years in testing new drugs and procedures. Other industries are taking up the banner of randomization as well. Ayers reports, for example, that it is now possible for a firm like Amazon.com to determine in a matter of hours which of several different home page web designs generates the most viewing time and the most clicks by randomly showing the different designs to different customers over the course of thé testing period. Because pages are shown randomly, preference differences that might exist based on age or gender or geographical location or ethnicity or any other individual characteristic are washed out due to the large sample that Amazon.com can amass in a short period of time. For samples that include data on individual characteristics, regression can be used to assess the impact of a treatment as a function of the individual characteristics. For example, in drug testing, individual characteristics that might impact the efficacy of a new drug include (1) how long a patient has had a disease, (2) the age of the patient, (3) the patient's gender, (4) the patient's family history, and (5) any other health conditions (e.g., obesity) that the patient may currently have or may have had in the past. Near the end of the text, Ayers introduces a third methodology, hypothesis testing, which can be used to determine whether or not the differences between two samples are statistically significant. For example, if, in a sample of 200 teenagers, we find that boys have more traffic accidents per mile driven than do their female counterparts, we can test whether the difference is statistically significant or if the difference could have been caused purely by chance. Just as Ayers focuses on two methodologies, so too this text will focus primarily on two methodologies: optimization modeling and queueing theory. Optimization involves determining the values of key decision variables—those factors associated with a problem about which we need to make decisions—to minimize or maximize some objective. For example, in locating ambulances, we may want to determine the base locations that maximize the number of people who are within 8 minutes of the nearest ambulance base using a limited number of ambulances. Queueing models are typically closed-form mathematical equations that tell us how long a customer will have to wait for service. For example, we can use queueing theory to estimate the average time a person will spend in line and being served at a vehicle emission testing station if we know how many testing bays are operating, some characteristics of the rate at which cars arrive to be tested, as well as key attributes of the time required to test each vehicle. In some important cases, optimization and queueing will merge. In scheduling nurses in an emergency room, for example, we may want to examine two competing objectives: minimizing the cost of the nursing staff that we use and minimizing the total time that patients wait. Chapter 2 reviews key concepts and issues in optimization modeling. The chapter outlines five key questions that need to be addressed in developing any
24
W H Y STUDY SERVICES?
optimization model. It then reviews linear programming, one of the fundamental tools used in optimization. Network optimization, a special form of linear programming modeling, is then summarized, as is integer programming, another extension of linear programming, in which some variables must take on only integer values. Integer programming is particularly useful when yes/no decisions need to be made. Returning to the example of locating emergency medical service bases, there is likely to be a yes/no variable associated with each candidate location at which a base can be located. As indicated above, many problems are characterized by multiple objectives. Chapter 2 discusses two methods of finding efficient points on a tradeoff curve. Chapter 2 concludes with a list of 10 rules for formulating problems, rules that many students and practitioners seem to violate with disturbing regularity. Chapter 3 introduces queueing theory. After introducing four key performance metrics of interest in almost any queueing problem and Little's law relating the average time in the system to the average number in the system, the chapter develops a general approach to analyzing a commonly studied class of queues. This general approach is then applied to a range of queueing problems. A more general model is introduced for the case of systems with a single server. Finally, since many service systems are characterized by time-varying conditions (arrivals of customers and service capabilities), the chapter concludes with a discussion of a numerical approach to solving queueing problems in the face of temporally changing conditions. After reviewing these two key methodologies, the remainder of the text focuses on problems that arise frequently in the design and operation of services. Chapter 4 examines location models, which are typically used to assist in making strategic decisions regarding the number and location of service facilities. The chapter includes a discussion of districting problems that also arise in services. Inventory theory is closely related to queueing theory and serves as the topic of Chapter 5. While services themselves can rarely be carried in inventory, most service providers require an inventory of some goods or equipment to aid in the service delivery process. As in other chapters, we begin with a simple model, the economic order quantity model, and progressively extend the model in a variety of ways. The chapter concludes with an analysis of the newsvendor problem. Chapter 6 focuses on decisions related to the allocation of resources to customers or demands. For example, if we know where schools are located, we need to determine which students should attend each of the available schools. This can be thought of as a districting problem or as a resource allocation problem in which we are allocating the scarce resource of classroom space to the students in the district. Similarly, assigning students to seminars is also a resource allocation problem in which the resources are the courses allocated to the students. Assigning gates to aircraft at an airport is also a resource allocation problem. Many such problems can be solved using what is called an assignment model, perhaps with minor modifications.
PROBLEMS
25
Short-term workforce scheduling decisions and problems are the focus of Chapter 7. Many simple scheduling problems can be modeled as network problems. This allows us to solve large instances of such problems very quickly and easily. The basic model can be extended in important ways to include part-time workers, overtime shifts, and cross-trained employees. More complex problems, including cases in which employees must be scheduled over a 24-hour period or situations in which employees are permitted scheduled breaks, require more complex modeling techniques. The chapter concludes with a discussion of a multiple-objective employee scheduling problem in which employee costs and customer delays are traded off against each other. Chapter 8 discusses long-term workforce management. This is an evolving area and models of this important topic are still in their nascent stage. The chapter begins with a very simple model and then evolves to increasingly complex problems including a model that accounts (approximately) for employee attrition, hiring and firing in response to anticipated workload requirements. The chapter concludes with a model that examines the tradeoff between employee costs and schedule delays for projects. Such a model could be of particular value in assessing the true cost of new projects in a consulting environment, for example. Chapter 9 examines a variety of applications of queueing theory in the design and operation of service systems. Priority queueing problems arise in the operation of emergency response systems. Clearly, an elderly patient in active cardiac arrest will be given priority over a young child with a sore throat in an emergency room. Call center design is an important application of queueing theory in service systems. Finally, many services, including non-emergent health care systems, can schedule their customers (or patients). Chapter 9 concludes with a discussion of this problem. Chapter 10 deals with vehicle routing decisions and problems. As in the case of long-term workforce management, vehicle routing models explicitly devoted to service problems are relatively few and far between. The chapter therefore focuses on traditional models and outlines ways in which such models might be extended to account for the unique issues that arise in the service industries. Any text on a topic as broad as modeling the service industries can only begin to scratch the surface of the problems that we are likely to encounter. This is certainly true of this book as well. Chapter 11 outlines a number of additional directions for future modeling of the service industries that are not explicitly covered in this book.
1.8
PROBLEMS
1. List the services that you employed: a) in the last 24 hours b) in the last week c) in the last month
26
WHY STUDY SERVICES?
Be sure to include services that you implicitly used, such as insurance. 2. Identify two services that you have used recently and briefly discuss ways in which each can be improved.
REFERENCES Ayers, I., 2007, Super Crunchers: Why Thinking by Numbers Is the New Way to Be Smart, Bantam Books, New York. Box, G. E. P., and N. R. Draper, 1987, Empirical Model-Building and Response Surfaces, Wiley, New York, NY. Cohon, J. L., 1978, Multiobjective Programming and Planning, Academic Press, New York, NY. Davenport, T. H., and J. G. Harris, 2007, Competing on Analytics: The New Science of Winning, Harvard Business Press, Boston. Davis, M. M., and J. Heineke, 2003, Managing Services: Using Technology to Create Value, McGraw Hill/Irwin, Boston, MA. de la Merced, M. J., 2008, "Starbucks announces it will close 600 stores," The New York Times, July 2, 2008, online at http://www.nytimes.com/2008/07/02/business/ 02sbux.html?_r=l&scp=l&sq=starbucks%20600%20stores&st=cse. Eaton, D. J. et al., 1979, Location Techniques for Emergency Medical Service Vehicles: Volume I—An Analytical Framework for Austin, Texas, Lyndon B. Johnson School of Public Affairs, The University of Texas at Austin, Austin, TX. Eaton, D., M. S. Daskin, D. Simmons, B. Bulloch, B., and G. Jansma, 1985, "Determining emergency medical service vehicle deployment in Austin, Texas," Interfaces, 15, 1, 96-108. Fitzsimmons, J. A., and M. J. Fitzsimmons, 2008, Service Management: Operations, Strategy, Information Technology, 6th ed., McGraw Hill/Irwin, Boston, MA. Fourer, R., D. M. Gay, and B. W. Kernighan, 2002, AMPL: A Modeling Language for Mathematical Programming, Duxbery Press/Brooks/Cole Publishing Company, South San Francisco, CA. Friedman, T L., 2005, The World Is Flat: A Brief History of the Twenty-first Century, Farar, Straus and Giroux, New York, NY. Johnson, M. P., and Smilowitz, K., 2007, "Community-Based Operations Research," in TutORials in Operations Research, INFORMS, Institute for Operations Research and the Management Sciences, Chapter 6,102-123. Lien, R., Iravani, S., and K. Smilowitz, 2007, Sequential allocation problems for nonprofit agencies, Technical report, Department of Industrial Engineering and Management Sciences, Northwestern University, Evanston, IL. Metters, R., K. King-Metters, and M. Pullman, 2003, Successful Service Operations Management, Thomson/South-Western, Mason, OH. Santibáñez, P., G. Bekiou, and K. Yip, 2009, "Fraser Health uses mathematical programming to plan its outpatient hospital network," Interfaces, 39,3,196-208. Wong, W, and B. Rose, 2008, "Starbucks' exit leaves some areas wondering," The Chicago Tribune, July 19, 2008, online at www.chicagotribune.com/business/chi-satstarbucksj ul 19,0,7595492.story.
PART
I
METHODOLOGICAL FOUNDATIONS
Service Science, by Mark S. Daskin Copyright © 2010 by John Wiley & Sons, Inc
2 OPTIMIZATION
Rosemary, an assistant dean in charge of the freshman class, stared at the piles of cards on the table. Most of the piles contained 14 or 15 cards, each card representing an incoming freshman. There was one pile for each of the 68 seminars being offered in the Fall term. One larger pile contained about 40 cards. These students had not yet been assigned to a seminar and were the "problem children" with whom Rosemary had been wrestling for days. The top five choice seminars of each of these students were all at capacity. Every time Rosemary tried to shuffle a few students around to get another student into a seminar, she seemed to end up back where she started, with a large pile of unassigned freshmen. The good news was that this two-week process would come to an end one way or another in two days, on Friday, when the assignments were due at the registrar's office. The bad news was that each year some students ended up with their seventh or eighth choice (or worse). She knew she would hear from many of the parents of those students. After all, at an expensive private university, parents expected their children to be welcomed and to be able to attend the classes they wanted.
Service Science, by Mark S. Daskin Copyright © 2010 by John Wiley & Sons, Inc
29
30
2.1
OPTIMIZATION
INTRODUCTION
"Whatever you do in life, do your best." I still remember that charge from my parents, and I suspect that most parents wish this, among many other things, for their children. I know that I do. Doing your best is really what optimization is all about. While Rosemary was doing her best to assign freshmen to seminars, it seemed to her that there had to be a better way to do so. There is, and optimization is the key to the problem. Optimization arises in many services. For example, in the late 1970s, Austin, Texas, had approximately a dozen ambulances to serve a population of roughly 350,000 people. At the time, the crews for these ambulances were housed in public apartment buildings scattered throughout the city. Drugs and expensive equipment could not be stored in an unsecured ambulance parked outside an apartment building. As a result, when a crew received a call for service, they had to bring the drugs and equipment from the apartment to the ambulance and then carefully stow them before beginning to drive to the scene of the emergency. When seconds and minutes may determine whether or not a patient survives, the additional delays introduced by this process were deemed unacceptable. Consequently, the city began working with a team of students and faculty at the University of Texas at Austin to identify permanent, secure ambulance sites for their crews and vehicles. To analyze the problem, the team began with a history of all calls for emergency medical services during a five-month period. Calls for service were geocoded to one of 358 zones that had been established for traffic modeling by one of the city agencies. In addition, the team had access to demographic data from a special census that was conducted in 1976. After significant discussion with city and emergency response personnel, the team focused on a model that maximizes the number of people who are no more than a pre-specified service time from the nearest ambulance base. A number of different service times, and demographic and medical emergency proxies for demand were utilized to develop a large number of locational options for the city (Eaton et al., 1985). Chapter 4 deals with location problems of this sort. At Northwestern University, the Weinberg College of Arts and Sciences routinely uses an optimization model to assign roughly 1000 freshmen to approximately 70 seminars each fall quarter. During the summer preceding their freshman year, each new student provides the dean's list with their top choice seminars ranked from number 1 (their most preferred seminar) on down. The objective of the optimization model is to minimize the sum of the rankings of all student/ seminar assignments. Thus, if a student is assigned to her third choice seminar, she contributes three units to the objective function. Clearly, an objective function value of 1000 would be perfect, as it would mean that each student was assigned to his or her first-choice seminar. Unfortunately, this cannot generally occur. The problem has two key constraints. First, each student must be assigned to exactly one seminar. Second, no seminar can be assigned more students than it can accommodate. It is this second constraint that prevents each student from
FIVE KEY ELEMENTS OF OPTIMIZATION
31
being assigned to his or her first-choice seminar. Seminars typically accommodate 15 students. One year, over 100 students requested a seminar on forensic pathology as their first choice. Clearly, 85 or more of these students would not be assigned their first-choice seminar. (Equally clearly, many Northwestern students want to be the next CSI star!) Chapter 6 focuses on resource assignment problems like this one. As indicated in Chapter 1, services are almost always provided by people. As a result, service providers are faced with the problem of determining staffing schedules. The schedule determines, in part, how many people will be on duty at each point in time. Although Chapter 3 and part of Chapter 9 deal explicitly with the relationship between staffing levels and the quality of service provided by a service system, it should be intuitively clear that more staff generally will mean better service and shorter waiting times for service. The schedule determines the staffing level at each point in time during a day (or service period) by deciding how many staff should report for duty at each hour. The detailed schedule will determine not only how many staff to report for duty at each time period, but also which individuals should be on duty at each time period. In determining the number of employees to start work at each time period, we may want to try to minimize the employee costs while ensuring that an adequate number of staff are on duty at each time period. Alternatively, we may want to examine the tradeoff between minimizing the employee costs and maximizing a measure of service to the customers. In assigning individual staff to the schedule, we often need to account for work rule regulations that limit the number of consecutive hours that an employee can work, individual preferences for certain times of the day or week, seniority issues, and a host of other requirements. Chapter 7 examines short-term scheduling problems of this sort.
2.2
FIVE KEY ELEMENTS OF OPTIMIZATION
While numerous textbooks have been devoted to optimization modeling and theory (e.g., Dantzig, 1998; Nemhauser and Wolsey, 1988; Winston and Venkataramanan, 2003), the essence of optimization modeling can be boiled down to five key questions. Once we have the answers to these five questions, we are likely to be well on the way to developing a useful model of a service operation or, for that matter, any problem amenable to optimization.
2.2.1
What Do You Know?
Perhaps the first step in studying any problem is to determine what you know. In the ambulance location problem outlined in section 2.1, the team had lots of information on the location, time, and severity of over 4000 calls for emergency services. In addition, they had information on the demographics of 358 zones within the city as well as the travel times between each pair of zones. In assigning students to seminars, the dean's office knows the preferences of each student as
32
OPTIMIZATION
well as the number of students each seminar can accommodate. In scheduling employees, we are likely to know either the minimum number of employees that the provider deems necessary to have on duty at each time period or the relationship between the number of employees on duty and a measure of the quality of service that is provided. We are also likely to have information on the preferences of each employee for different times of the day or week as well as knowledge of any work rules that a schedule must obey. Finally, we will have information on the costs of different types of employees (e.g., full-time and part-time employees, employees working the night shift and those beginning during the day, and so on). What you know before studying the problem constitutes the inputs to the problem.
2.2.2
What Do You Need to Decide?
The second aspect of optimization is figuring out what you really need to decide. In some cases, parts of this may be clear. For example, in locating ambulances in the city of Austin, Texas, we clearly want to decide where to locate the ambulances. In assigning students to seminars, we want to determine which students are allowed to take each seminar. In other cases, what needs to be decided may be less clear. In scheduling employees, for example, it is not immediately obvious what we need to decide. At the aggregate level, we typically need to decide how many employees should start working at each possible starting time. Note that having fixed, nonoverlapping employee shifts (e.g., 8 A.M. to 4 P.M., 4. P.M. to midnight, and midnight to 8 A.M., for a service provider with 8-hour shifts and 24-hour coverage) is not likely to achieve the best possible results. Instead, it is often better to have some employees start at different times of the day and to allow shifts to overlap. Problem 1 illustrates this phenomenon. In addition to making it easier to minimize the number of required employees or the total labor cost, overlapping shifts provide for smoother transitions between shifts in many cases because only a fraction of the employees will be turning over at any point in time. This may be particularly relevant in nurse scheduling, for example, where the handoff between nurses is critical to patient safety and the quality of care received by the patients. In addition, sometimes we need decision variables to help compute the objective function value. For example, in locating ambulances, in addition to location variables, we need another set of variables to indicate whether or not each zone is within the service standard of the nearest ambulance. It is critically important that we distinguish between inputs, those data items that we know before beginning the modeling process, and decision variables, those variables whose values are the output of the modeling process and whose values we are trying to determine through exercising the model. All too many students and practitioners fail to distinguish adequately between these two categories and refer to both as "variables." This inevitably leads to confusion and to errors in the model.
FIVE KEY ELEMENTS OF OPTIMIZATION
2.2.3
33
What Are You Trying to Achieve?
The third key component of any optimization problem is determining what you want to achieve. By this we mean, what do you want to optimize or what do you want to maximize or minimize? In the ambulance location problem, the team tried to maximize the number of demands, measured by one of many different surrogates for demand, that were within a specified time limit of the nearest ambulance. Such demands are said to be covered, while those demands that are further away are not covered. Another objective might have been to minimize the cost of the ambulance fleet needed to cover all demands. Yet a third objective might have been to minimize the average response time of the ambulances. Finally, a fourth possible objective might have been to minimize the maximum of worst-case response time. In assigning students to seminars, the dean's office tries to minimize the sum of all assigned preference rankings. This is equivalent to minimizing the average of all assigned preference rankings. Because low preference rankings correspond to more preferred choices, this is equivalent to maximizing the average assigned seminar preference over the freshman class. Other objectives are also possible. For example, they could also minimize the worst assignment over all students. In determining staffing schedules, we might want to minimize the number of employees needed or, more generally, the cost of satisfying all of the requirements in each period. Determining the appropriate objective function(s) for a problem is the third key component of developing an optimization model.
2.2.4
What Inhibits Your Ability to Do So?
In formulating optimization models, either mathematically or conceptually, it is important to ask what inhibits our ability to achieve the desired objective. In locating ambulances, there is likely to be a budget that limits the number of ambulances that can be deployed. In assigning students to seminars, there are two classes of constraints. The first requires each student to be assigned to exactly one seminar while the second limits the number of students assigned to any particular seminar to the capacity of that seminar. In staff scheduling, there is likely to be a constraint that specifies the minimum number of staff that have to be on duty at any time. Other constraints are less obvious. For example, in locating ambulances, there must be a constraint that links the two classes of variables: the location variables specifying where ambulance bases are to be located and the coverage variables indicating which nodes can be served adequately by the bases that are located by the model. This constraint simply says that a demand node cannot be counted as covered unless we locate one or more bases sufficiently close to the demand node. There must be at least one base located within the service standard of the demand node for the node to be counted as covered. Constraints inhibit our ability to achieve the objective function. They also link key classes of decision variables to each other.
34
2.2.5
OPTIMIZATION
What Can You Learn?
While answers to the first four questions are adequate for developing an optimization model, we must also ask what we want to learn from the model. Except for the simplest of real-time decisions, the results of an optimization model must be analyzed in a broader context that often includes non-modeled components of the problem. In addition, some inputs, such as the budget for new ambulance bases, the capacity of individual seminars, or the number of staff to have on duty at any time of the day, may not be known perfectly. Instead, we may want to perform some sort of sensitivity analysis on these unknown or uncertain parameters. Thus, we might like to know how much the percentage of the population that is covered by an ambulance within a given service standard increases if we can afford one more ambulance base. By how much would the coverage decrease if we could build fewer bases? How would the average assigned seminar preference change if a particular seminar's capacity increased by 20 percent? If the desired number of staff on duty during some period (e.g., midnight to 4 A.M.) increased by 10 percent, how many more employees would we need and when should they start work? How would the number of employees change if each staff member was on duty for 8 hours but had a 1-hour break during the fifth hour on duty? In short, the output of optimization models is rarely implemented directly and without additional analysis. The optimization models need to be exercised for a range of parameter values. In setting up an optimization model, either in Excel or in some other modeling environment, we should keep in mind the need to do this sort of analysis.
2.3
TAXONOMY OF OPTIMIZATION MODELS
While there are many ways to categorize optimization models, Figure 2.1 provides one taxonomy of such models. We can first distinguish between models that have a single objective, such as minimizing the cost of providing a service, and those that have multiple objectives. In this book, we will typically limit our attention within the class of multi-objective problems to cases with only two objectives. For example, we may want to minimize the average distance between ambulances and population centers and we may also want to minimize the maximum distance between ambulance bases and the population being served. Multi-objective problems with two objectives are easier to visualize and easier to understand than are problems with more than two objectives. Within both the single and multiple objective classes of optimization problems, some models are linear while others are non-linear. By a linear problem, we mean a problem in which the constraints and the objective function can be written as linear functions of the decision variables. This means that we are not using trigonometric functions, we are not raising constants to a power that depends on a decision variable, we are not multiplying decision variables together,
TAXONOMY OF OPTIMIZATION MODELS
35
Figure 2 . 1 . Taxonomy of optimization models
and so on. Simply put, the objective function and all constraints can be written as the sum of terms and each term is a constant multiplied by a single decision variable. In Excel, what this also means is that we are not using IF statements to represent logical conditions. For example, in locating ambulances to maximize the number of covered demands, one might be tempted to model the problem with one set of decision variables representing where we locate facilities. We might then determine whether or not a particular demand node was covered within the service standard using a set of IF statements that depend on the location variables. This would make the model non-linear and this approach should be avoided at all costs. Instead, we should use a separate set of decision variables to determine whether or not each demand node is covered. We will see how to do this in Chapter 3 when we discuss location problems explicitly. It is useful to distinguish between linear and non-linear problems for a number of reasons. First, for linear problems (with the exception of integer linear problems discussed below), when we get a solution, we can be sure that we have obtained an optimal solution. For non-linear problems, we need to be much more careful before asserting with certainty that the solution is truly the best possible solution. Either we need to make fairly restrictive assumptions about the nature of the constraints and the objective function or we need to take extreme care in designing a solution algorithm for non-linear problems to ensure that we have the true optimal solution when the algorithm terminates. Second, linear programming algorithms are pervasive while algorithms for non-linear problems are less readily available, although this is changing rapidly over time. Third, linear problems tend to be easier to understand than are their non-linear counterparts. Finally, the size of the problem (as measured, for example by the number of decision variables or the number of constraints) that we can solve for linear problems is much larger than is the size we can solve for non-linear problems.
36
OPTIMIZATION
Despite the inherent advantages associated with linear optimization problems, there are times when a non-linear formulation is essential. For example, as we will see in Chapter 5, inventory costs typically are non-linear functions of the annual demand, the holding cost per item, and the fixed cost of placing an order. Trying to approximate such inherently non-linear functions in a linear manner will introduce errors. In many such cases, it is better to simply live with the nonlinearity inherent in the problem. Nevertheless, for most of the problems in this text, we will be able to use linear modeling techniques. A good rule is to try to linearize problems as much as possible. The discussion in section 2.7 shows some ways of using integer variables to represent logical conditions while still remaining in the linear family of models. Within the linear family of models, in addition to the generic linear optimization problems, two classes of problems deserve special mention. Many problems that we will be interested in can be represented as network optimization problems. This is useful for a number of reasons. First, we can solve very large network optimization problems very quickly. To get some sense of this, consider the problem faced by Mapquest or Google Maps. When you ask for driving directions from your home in Dallas, Texas, to your university (in Ann Arbor, Michigan, for example), the computer behind the web page must solve a network optimization problem known as a shortest path problem (see section 2.6). Despite the fact that the problem may have thousands of variables, the directions seem to come back almost instantly. Furthermore, the web page is simultaneously determining not only the directions you requested, but also the directions for many other users all of whom are logged on to the site simultaneously. The fact that the underlying problem is a network problem enables this fast response. (In addition, the algorithms underlying such web pages use sophisticated heuristics or rules to eliminate potential solutions that are clearly going to be sub-optimal. For example, such algorithms may stop searching for shortest paths once they get more than a certain number of miles south of your home in Dallas if your destination is north of Dallas in Ann Arbor, Michigan.) The second reason to focus attention on network optimization problems is that they can be represented graphically as a network. This means that we can often visualize problems with thousands or even millions of variables. The U.S. map is one visualization of the inputs to a shortest path problem, for example. As we will see below, the problem of assigning students to seminars in the Weinberg College of Arts and Sciences at Northwestern University is a network problem with over 10,000 variables. Nevertheless, we can readily draw a network that allows us to visualize what the problem looks like. The third reason for focusing on network problems is that the structure of such problems is always the same, at least for our purposes. The objective will be to minimize (or sometimes to maximize) a linear function of the decision variables. The constraints will fall into two categories. First, for every node in the problem—think about a highway intersection as a node—we will require
YOU PROBABLY HAVE SEEN ONE ALREADY
37
that the flow into the node equals the flow out of the node. Flow must be conserved at every node. This means, for example, that if we go into St. Louis, Missouri, on our way from Dallas, Texas, to Ann Arbor, Michigan, we must also leave St. Louis. The second set of constraints restricts the amount of flow on each link to a range of values. In other words, for some problems the flow on a link must be greater than or equal to some quantity and less than or equal to some other quantity. In the problem of assigning students to seminars, each student will be represented by a node and each seminar will be represented by a node. There will be a link into each student node and the flow on each of those links must be greater than or equal to one, meaning that each student must be assigned to a seminar. Similarly, there will be a link out of each seminar node and the flow on those links must be less than or equal to the capacity of the associated seminar. The fourth reason for focusing on network problems is that if a problem can be structured as a network optimization problem, then we can be assured that the decision variables will take on integer values, as opposed to fractional values. This is a very useful property, as we will see. Integer programming problems represent the other specialized form of linear optimization models that we need to consider. In general linear programming problems, there is no guarantee that the optimal value of a decision variable will be integer-valued. In fact, in many cases, the optimal solution will involve many non-integer-valued decision variables. For some contexts, this is fine. In other cases, however, we need to specify that we want only integer valued solutions. For example, if a variable represents whether or not we should locate an ambulance in the 2700 block of North Halsted in Chicago, a value of j would not be useful. The value should either be 1, meaning we should locate an ambulance there, or 0 meaning we should not. Logical relationships between variables are often expressed using integer variables. For example, the condition that we cannot assign demands at node j to a facility at node k unless we have decided to locate at node k can be represented using integer variables. Unfortunately, if the problem structure is such that we are not guaranteed an all-integer solution, then solving the problem becomes more difficult and time-consuming. The good news is that asking Excel or any of the standard Excel add-ins to ensure that certain variables take on only integer values is easy to do; it just may take longer to get the solution.
2.4
YOU PROBABLY HAVE SEEN ONE ALREADY
Finally, before discussing linear programming in detail, it is worth noting that you have probably already seen and used optimization; you just may not have recognized what you were doing as solving an optimization problem. Students of statistics are familiar with least squares regression. We should recognize this as an optimization problem by its very name: least squares regression. The problem is that of fitting a straight line to a set of observations.
38
OPTIMIZATION
Figure 2.2. Sample data points, one possible line through the data, and the associated errors
The line is defined by its slope and intercept, which are the two decision variables. Figure 2.2 shows six observations of an independent variable and the corresponding six values of the dependent variable. These are also shown in Table 2.1. Figure 2.2 also shows one possible line through the data. The line is Y = 1.2 + 0.95X, corresponding to a line with an intercept of 1.2 and a slope of 0.95. Figure 2.3 shows the "squared errors" in a manner similar to that used by Erkut and Ingolfsson (2000). On the surface, this line looks fairly good. There are three points above the line and three below the line. The errors below the line look about the same as the errors above the line.
See Squared Errors.xls in t h e o n l i n e appendix.
However, we can do better using optimization or, as it is called in this case, least squares regression. The error associated with observation i, e¡, is given by e,.=^.-(a
+ Mf,.)
since a + bXt is the value on the line corresponding to observation i. If we now try to minimize the sum of the squared errors, we will be minimizing
39
YOU PROBABLY HAVE SEEN ONE ALREADY
TABLE 2.1. Sample independent variable (X) and dependent variable (Y) values
Observations X
Y
1 4 7 11 15 18
1 8 12 8 13 20
Figure 2.3. Sample data points, one possible line through the data and the associated squared errors
i=l
1=1
= Σ Y> - 2αΣ γι - 2bt i=l
i=l
i=l
x
?i+™2+2abt
x i=l
i+b2 Σ xf i=l
(2·1)
where n is the number of observations. It is worth noting that the objective function is non-linear since (2.1) includes terms such as ab, a2, and b2, each of which is the product of decision variables.
40
OPTIMIZATION
We can readily show—by taking the first derivatives of (2.1) with respect to a and b and solving the resulting two simultaneous linear equations for a and b—that the optimal intercept is given by
â=Y-bX and the optimal slope is given by
ΥΣΧ^-ηΧΫ
ο = ^ψ
^Xf-nXX
where X and Ϋ represent the average of the X and Y observations respectively. Using these values, we find that the best line through these six observations is Y = 2.4 + 0.85X, a line with a larger intercept and smaller slope than the one shown in Figures 2.2 and 2.3. Figure 2.4 shows this line. The sum of the squared errors is now only 47.2, as opposed to 49.76 for the line shown in Figures 2.2 and 2.3. Note that 47.2 is the optimal value of the objective function (2.1).
Figure 2.4. Best line through the data
LINEAR PROGRAMMING
41
In short, for those familiar with linear regression, we have already seen a non-linear optimization problem. We will see other non-linear models in Chapter 5 on inventory models. In the remainder of this chapter, however, we focus on linear models.
2.5
LINEAR PROGRAMMING
In this section, we more formally introduce linear programming. We will begin with a review of what we mean by linear in section 2.5.1. In the following section, we will illustrate linear programming with a simple two-variable problem that can readily be graphed. In section 2.5.3, we will present the canonical linear programming problem using algebraic notation. Section 2.5.4 discusses the dual of a linear program and its relationship to the main or primal problem we are trying to solve. Section 2.5.5 formulates a number of key problems as linear programming models. Finally, we show how to structure and solve some of these problems in Microsoft Excel.
2.5.1
What Is a Linear Program?
What exactly is a linear program? Linear programming does not have anything to do, necessarily, with computer programming, though almost every linear program of practical interest today is solved using a computer. Doing so sometimes requires some programming expertise in either a high-level programming language like C or C++ or in a specialized optimization language like AMPL (Fourer et al., 2002). In this text, however, we will explore smaller linear programming problems which can be solved readily in Excel using either the built-in Solver or one of a number of commercial add-in solvers for Excel such as What's Best (2009) by Lindo, Co. Linear programming means that we are trying to minimize or maximize a linear function of some decision variables subject to constraints that are themselves linear functions of those, and perhaps other, decision variables. By linear we mean that we are not multiplying decision variables by one another, we are not squaring decision variables or taking the square root of decision variables, or more generally, raising a decision variable to any power (other than 1). We are also not raising a constant to a power that depends on a decision variable and so we are not using functions such as ex, where X is a decision variable. Similarly, we are not dealing with the logarithm of decision variables and we are not dealing with trigonometric functions of decision variables. All we are doing is multiplying a decision variable by a known constant and then adding or subtracting similar such terms in both the objective function and in the constraints. Fortunately, many important problems can be structured as linear programming problems and others that cannot immediately be represented that way can be transformed into linear models or can be approximated by linear models.
42
2.5.2
OPTIMIZATION
Graphical Representation
To illustrate a simple linear programming problem, consider an abstraction of the problem faced by many small towns and cities in deciding how to allocate a budget for municipal services between police and fire protection. In this very simplified model, each police patrol costs $200,000 per year and each fire truck costs $1,000,000 per year including the cost of the fire station. The city has only $5,350,000 to allocate to the combined police and fire budgets. In addition, contracts with the unions representing the two city services stipulate that there must be at least 1.5 times as many police patrol units as there are fire trucks and that there cannot be more than 7.5 times as many police units as there are fire units. The goal of the city is to allocate funds to maximize the number of lives saved over the course of a year. An outside consultant has told them that they can expect 0.2 lives saved per year per police patrol unit and 0.65 lives saved per fire truck. Figure 2.5 shows the constraints on the problem. The heavy line defines the budget. All solutions below that are feasible in the sense that they do not require the city to spend more than its available budget of $5,350,000, though some of the solutions below this line violate one of the other two conditions. All solutions to the right of the uppermost line that slopes upward satisfy the condition that there must be at least 1.5 police units per fire truck, while all solutions above the
Figure 2.5. Feasible region for a simple linear programming problem
LINEAR PROGRAMMING
43
Figure 2.6. Feasible region and objective function contours
lower upward sloping line satisfy the condition that there are 7.5 or fewer police units per fire truck. Thus, the region enclosed by these three lines—the triangle defined by the points A, B, and C—represents the set of all combinations of fire and police units that satisfy all three constraints. This triangular region is the intersection of all of the linear constraints and is called the feasible region of the linear programming problem. Any solution to the problem must be inside or on the border of this region. Figure 2.6 shows the feasible region with four parallel lines representing different values of the objective function. The smallest value of the objective function shown is 1.4. Clearly, there are better values of the objective function—maximizing lives saved—that we can attain and still be within the feasible region. If we double this value, we get to 2.8 and arrive at the second objective function line shown in the figure. Again, we can do better. If we move out to a value of 4.2—another 50-percent increase in the number of lives saved— we still have some solutions that are within the feasible region. Finally, when we move the line representing the objective function value a bit further to the right to a value of 4.601, we find that the line representing the objective function—the solid objective function line in this case—intersects the feasible region at only one point. This is the best we can do and we have now solved the linear programming problem graphically. The optimal objective function value is 4.601 and we should fund 16.05 police units (at a cost of $3,210,000) and 2.14 fire trucks at a cost of $2,140,000, completely expending the budget for the two city services. Furthermore, at this solution, there are exactly 7.5 police units per fire truck and so the constraint representing the maximum number of police per fire truck is also limiting our ability to improve the solution. These two constraints are said
44
OPTIMIZATION
to be binding constraints. The third constraint stipulating that there be at least 1.5 police units per fire truck is not binding and does not constrain the optimal solution. See Simple LP Example.xls in the online appendix.
Mathematically, we can write the problem as follows: Max
0.2· Police
+0.65 Fire
s.t.
200· Police +1000-Fire
< 5350
(2.3)
-1.0· Police +1.5-Fire
< 0
(2.4)
1.0 Police
< 0
(2.5)
> 0
(2.6)
> 0
(2.7)
-7.5· Fire
Police Fire
(2.2)
The objective function (2.2) maximizes the number of lives saved. The first constraint (2.3) is the budget constraint expressed in thousands of dollars. We have simply divided the cost of a police unit, the cost of a fire truck, and the budget by $1000. The second constraint (2.4) says that we must have at least 1.5 police units per fire truck while the third constraint (2.5) ensures that we have no more than 7.5 police units per fire truck. Constraints (2.6) and (2.7) are nonnegativity constraints and stipulate that we cannot have a negative number of either police or fire units. For now, let us not be overly concerned about the fact that the solution tells us to hire a fractional number of police and fire units. We will return to this issue in section 2.7 below when we discuss integer linear programming problems. The graphical view of the linear programming problem allows us to consider the impact of adding an additional constraint to the problem. Suppose the city did not want to hire more than 11 police officers. We would then have to add a constraint of the form Police < 11
(2.8)
Graphically, this changes the problem as shown in Figure 2.7.The old feasible region defined by points A, B, and C is no longer the correct feasible region. The triangle represented by C, D, and E has been eliminated from the feasible region and the new feasible region is the four-sided figure given by points A, B, D, and E. The previously optimal solution at C is no longer optimal. Instead, the optimal solution is found at point D, at which we employ 11 police officers and 3.15 fire units, resulting in an objective function value of 4.2475, which is less than the value at point C, which was 4.601. Alternatively, suppose there was a restriction limiting the number of fire units to 3. The new feasible solution is shown in Figure 2.8. Again, the original
LINEAR PROGRAMMING
Figure 2.7. Adding a constraint that degrades the solution
Figure 2.8. Adding a constraint that does not change the solution
45
46
OPTIMIZATION
feasible region defined by points A, B, and C is no longer valid. In this case, the triangle defined by points B, F, and G is removed and the resulting feasible region is defined by points A, F, G, and C. Note that point C is still optimal after the addition of this constraint. The optimal solution is again to employ 16.05 police units and 2.14 fire units, resulting in an optimal value of 4.601, as before. This illustrates a key point. Adding a constraint to an optimization problem cannot improve the objective function value; often, doing so, will degrade the objective function value. For a maximization problem, this means that the objective function will stay the same (if we are lucky) or go down if we add a constraint. For a minimization problem, adding a constraint will cause the objective function value to stay the same (if we are lucky) or to increase.
2.5.3
Canonical Form of a Linear Program
As indicated above, some linear programming problems try to maximize an objective function, while others try to minimize an objective function. In some cases, we have constraints that stipulate that a linear function must be less than or equal to some value, while in other cases we have linear constraints that say that a linear function must be greater than or equal to some value, or perhaps simply equal to some value. In most problems, the decision variables must be non-negative, while in other cases they must be non-positive and in others the variables may be unconstrained in sign. It would be most unfortunate if we needed a different theory and a different set of algorithms for every possible combination of the type of objective function (minimization or maximization) the possible constraints (greater than or equal to, less than or equal to, or simply equal to) and the types of variables (non-negative, non-positive, or unconstrained). Fortunately, we do not need such different theories and algorithms as every linear programming problem can be put into canonical form. Problems 2 through 6 ask you to show that this can be done for each of the relevant cases that are not in canonical form. (Note that we will not need to rewrite our linear programs in this form as all available software handles this automatically.) The canonical form of a linear program can be written as: Max
JjcjXj
s.t.
Σ ν Ό ^ X;>0
(2 .9) V / e /
(2.10)
V/e/
(2.11)
We can think of this as follows. / is a set of products we can produce. X¡ represents the ; l h decision variable, or the amount of the ;'th product or service we choose to produce. c¡ can be thought of as the unit profit of producing one unit of product or service /. / is the set of inputs or resources to be used in the
47
LINEAR PROGRAMMING
production or service delivery process. b¡ represents the maximum amount of input i that we have available, and a¡¡ is the amount of input i that must be used in producing a single unit of output / or delivering a single unit of service /. The objective function, (2.9), maximizes the total profit of the products we produce or services we deliver. Constraint (2.10) states that we cannot use more of any resource than we have available. Constraints (2.11) state that we cannot produce a negative amount of any product or service. It is important to realize that this interpretation of the canonical form of the linear programming problem is exactly that. It is one interpretation of the canonical form. Many other interpretations are possible. The key is that we have a linear objective to be minimized, subject to less than or equal to constraints, and nonnegative decision variables. We can also write the problem in standard form. This simply introduces a slack variable into each of the constraints in (2.10) so that we have equality constraints. The linear programming problem in standard form is given by:
Max JjcjXj
(212)
i<¡j
s.t.
J^ayXj+S^bi
Vie/
(2 .13)
Xj>0
V/e/
(2.14)
5,>0
Vie/
(2.15)
The slack variable, S¿, simply represents the amount by which the righthand side of (2.10) exceeds the left-hand side at the optimal solution. It is the amount of unused resource i. It will be useful to have the linear programming problem in standard form when we talk about the complementary slackness conditions.
2.5.4 Dual of a Linear Programming Problem and the Complementary Slackness Conditions Associated with every linear programming problem that we are interested in solving is another linear programming problem. The one we are primarily interested in solving is referred to as the primal linear programming problem, or sometimes simply as the primal problem. The other linear programming problem, the one lurking in the background, is the dual linear programming problem. The dual of the canonical linear programming problem (2.9)-(2.11) is given by: Min
£&.W¡.
(2.16)
16/
s.t.
^a¡¡Wi>cj
y/e/
(2.17)
W, >0
Vie/
(2.18)
iel
48
OPTIMIZATION
Associated with each of the constraints in (2.10) is a dual variable, W¡. As in the primal problem, this variable must be non-negative as stipulated by constraint (2.18). The right-hand side constants in (2.10) become the coefficients of the dual decision variables in the objective function (2.16), which is now to be minimized. Similarly, the coefficients in the primal objective function (2.9) become the righthand side values in the dual constraints (2.17). Finally, note that while the primal linear programming problem in canonical form was written with less than or equal to constraints, the canonical dual linear programming problem has greater than or equal to constraints. Note also that the coefficient matrix of the constraints (the a¡¡ terms) has been transposed. In our summation notation, this is indicated by the fact that we are now summing over the set of products, /, in the dual problem rather than over the set of inputs, J, as in the primal problem. The dual problem also has an interpretation. The dual variable, Wh gives the value to the objective function of having one more unit of resource i. It tells us how much the objective function would increase if we had one more unit of this resource. (See Rubin and Wagner [1990] for a discussion of the limitations of interpreting the dual variables too literally.) Another way of thinking of this is that Wi gives the value of resource i, or how much we should be willing to pay for one more unit of this resource, at the margin. This is why the dual variable is also referred to as the shadow price. The dual objective minimizes the value of all resources, or what we should pay at the margin for these resources. Constraint (2.17) states that the value of all resources that go into making one unit of product / must be at least as much as the profit associated with product j . Constraint (2.18) simply states that the dual variables or shadow prices cannot be negative. Just as we could write the primal linear programming problem in standard form, so too can we write the dual linear programming problem in standard form by introducing surplus variables, T¡, into constraints (2.17). The dual problem in standard form is then: Min s.t.
J^b¡W¡
(2.19)
ie/
Y,aijWi-Tj=cj
VjeJ
(2.20)
W¡>0
Vie/
(2.21)
7} >0
V/e/
(2.22)
The primal and dual problems are intimately related. 1. If the primal problem is infeasible—meaning that the intersection of all of the regions formed by constraints (2.10) and (2.11) is non-existent— then either a. the dual problem is also infeasible or b. the dual problem is unbounded, meaning that the dual objective function, (2.16), can be made arbitrarily small.
49
LINEAR PROGRAMMING
2. If the primal is unbounded, then the dual is infeasible. Generally speaking, however, we are interested in the cases in which both the primal problem and the dual problem have feasible solutions. In these cases, there are several other properties of interest to us. 3. If both linear programming problems are feasible, then for any feasible set of primal decision variables, X¡, and any feasible set of dual decision variables, W¡, we know that ^b¡W¡ > ^c¡Xj.
This is known as the weak
jel
ie/
duality condition. It states that for any feasible solution to the primal problem and any feasible solution to the dual problem, the value of the primal objective function—the one we are maximizing—will always be less than or equal to the value of the dual objective function—the one we are minimizing. 4. For the optimal solutions to the primal and dual problems, which we will denote by X* and S* for the primal and W* and T* for the dual, V b¡W* = V c-X*. In other words, at the optimal solution to the primal and dual problems, the objective function values are exactly equal. 5. Furthermore, at the optimal solution, X*T* = 0 for all products ;', and W*S* = 0 , for all inputs or resources /. These conditions are known as the complementary slackness conditions. These conditions have an important interpretation. Consider the conditions W*S* = 0 on the resources. This can also be written as W¡
= 0 for every resource i.
This says that if we do not use up all of resource /, meaning that 5* > 0 or b, ~ y a,X* > 0, then the value of an additional unit of this resource must be 0 or W* -0. Conversely, if we are willing to pay a positive amount for an additional unit of this resource, meaning W* > 0, then we must be using all of that resource that we currently have, or S* = 0, or equivalently bl—'£aijX*=0.
The condition X*T*-0
has a similar
interpretation in terms of which products we produce. In short, if the value of the inputs required to produce product or service ; exceeds the profit from the product or service, meaning that T* > 0, then we do not produce any of that product or service X* = 0. 6. At least one optimal solution occurs at a corner point of the feasible region, meaning at a point at which some set of constraints intersect. 7. The dual of the dual is the primal. This says that if we find the dual problem to the dual problem, we get back to the primal problem.
50
OPTIMIZATION
To illustrate the dual problem, consider again the simple problem of determining the number of police and fire units to deploy that we discussed in section 2.5.2. For ease of use, we repeat that problem here: Max
0.2· Police
+0.65 Fire
s.t.
200· Police +1000 Fire < 5350 Total
(2.2) (2.3)
-1.0· Police +1.5 Fire
< 0
MinPolice
(2.4)
1.0· Police
< 0
MaxPolice
(2.5)
-7.5-Fire
Police Fire
> 0
(2.6)
> 0
(2.7)
Associated with constraints (2.3), (2.4), and (2.5) are dual variables Total, MinPolice, and MaxPolice, which are shown above next to each constraint. The dual problem associated with this linear programming problem is Min s.t.
5350 Total 200 Total
(2.23) -1.0· MinPolice +1.0 MaxPolice
1000 Total +1.5 MinPolice
>0.2
(2.24)
>0.65
(2.25)
>0
(2.26)
>0
(2.27)
>0
(2.28)
-7.5· MaxPolice
Total MinPolice AaxPolice
To solve this problem, we can use the complementary slackness conditions. We know that at the optimal primal solution, constraint (2.4) is not binding and so the associated dual variable, MinPolice, must be 0. The other two constraints are binding and so their associated dual variables can be greater than 0. Since we know that the dual of the dual is the primal, the dual variables associated with constraints (2.24) and (2.25) are the Police and Fire variables respectively. Since these variables are both positive at the optimal solution, we know that (2.24) and (2.25) must be satisfied by strict equality (with no slack). Therefore, we have to solve the following three equations to find the optimal solution. 200 Total
-1.0 MinPolice
+1.0· MaxPolice
=0.2
(2.29)
1000 Total
+1.5 MinPolice
-7.5· MaxPolice
=0.65
(2.30)
=0
(2.31)
MinPolice The solution to this problem is Total = 0.65 + 7.5.
'0.35'
/1000 = 0.00086, 12.5 0 35 MinPolice = 0, and MaxPolice = = 0.028 . The objective function value for 12.5 the dual problem is 4.601, which is exactly the value obtained in section 2.5.2 for the primal problem. The dual variable associated with the budget, Total, says that
LINEAR PROGRAMMING
51
for every extra $1000 in the budget, we will save an extra 0.00086 lives. (Recall that the budget constraint was written in terms of $1000s.)
2.5.5
Example Problems
In this section, we show how two problems can be formulated as linear programming problems. The first is the problem of assigning students to seminars. The second is the problem of finding the shortest path between two cities. 2.5.5.1 Assigning Students to Seminars. We begin by showing how to formulate the problem of assigning students to seminars. For every student, we know the ranking that student gave to each seminar that the student ranked. In particular, let STUDENTS be the set of students and let SEM be the set of seminars. Each student ranks a subset, SEM¡, of the seminars. For each seminar k e SEMh we know the ranking, rankjk that student j gave to seminar k. The smaller the ranking, the more preferred the seminar is for that student. We will assign students only to seminars that they rank. We know the capacity, capk, of each seminar k e SEM. We define ASSIGN¡k to be a decision variable that will equal 1 if student/ is assigned to seminar k, and 0 otherwise. The problem can now be formulated as follows: Min
]Γ
£
jeSTUDENTS
s.t.
Σ
rankjk ASSIGNjk
(2.32)
keSEMj
ASSIGNjk
=1
Vje
STUDENTS
keSEMj
£
ASSIGNjk
VkeSEM
¡¿STUDENTS
ASSIGN
jk
>0
VjeSTUDENTS;VkeSEMj
(2.33) (2.34) (2.35)
The objective function (2.32) minimizes the sum of all assigned ranks over all students. The first constraint, (2.33), states that each student must be assigned to exactly one of the seminars that he or she ranks. The second constraint, (2.34), states that for each seminar, the number of students assigned to the seminar cannot exceed the seminar's capacity. Finally, constraints (2.35) state that the assignment variables cannot be negative. Note that while we defined the assignment variables as binary—either 0 or 1—in our verbal description of the problem, in the mathematical description of the problem we simply defined them as real, non-negative variables. We can do that in this case because this problem is a network linear programming problem, as discussed in section 2.6. For network problems, there will always be an allinteger solution and so we do not need to worry about forcing the assignment variables to be either 0 or 1. Furthermore, because each student must be assigned
52
OPTIMIZATION
to exactly one seminar, we know that the assignment variable will not take on a value greater than 1. Finally, we note that the problem may not have a feasible solution for two reasons. First, the selections made by the students may not admit a feasible solution. To illustrate this, suppose we have five students and three seminars, each with a capacity of two. Each student ranks two of the three seminars, indicating implicitly that he or she does not want the third seminar at all. If one of the seminars is not ranked by any of the five students, then we are left with trying to assign all five students to the remaining two seminars, which have a combined capacity of four students. Clearly, we cannot assign all students to only seminars that they rank in this case. Second, if the total number of students to be assigned exceeds the sum of the seminar capacities, then there can be no feasible solution. This situation can arise if each professor teaching a seminar can set the capacity of his/her seminar. To handle both of these eventualities, we can create a new "dummy" seminar whose capacity is equal to the total number of students to be assigned. Students assigned to this seminar represent students who cannot be assigned to a "real" seminar. For each student, we add the dummy seminar to the set of ranked seminars by the student. The "cost" of assigning student j to the dummy seminar, rankj4ummy, should be set to a very large number. For example, this value might be 10 times the total number of students times the number of seminars ranked by each student. In the example above, there are five students and each student ranked two seminars. Therefore, if each student gets his/her second choice, the objective function value would be 10. If we assign a value of 100 to each of the non-ranked seminars, we will quickly be able to tell whether or not any student was assigned to the dummy seminar. If the objective function value exceeds 100, we know this happened. Similarly, if there is not enough capacity in the real seminars, some students will have to be assigned to the dummy seminar. Again, the objective function value will exceed 100 in our simple example if there is not enough capacity (e.g., if there were seven students and only three seminars each with a capacity of two students). This illustrates an important point about linear programming in particular and optimization in general. We need to ensure that the model can deal with infeasibility caused by the inputs. In addition, we may need to protect against infeasibility caused by an excess of constraints. For example, we might have additional constraints that stipulate that the ratio of men to women be between 0.5 and 2.0, meaning that there cannot be more than twice as many women as there are men or more than twice as many men as there are women in each seminar. If we add these constraints, along with other diversity-oriented constraints (perhaps regarding mixing of students by intended majors or by geographic background), we can rapidly generate problems without any feasible solution. 2.5.5.2 Shortest Path Problems. The shortest path problem is also a network linear programming problem, as we might expect. In this case, N defines a set of
53
LINEAR PROGRAMMING
nodes in the network through which we might pass on our journey. These correspond to intersections in a highway or road network. Two nodes are of special interest to us. We begin our trip at the origin and end at the destination. We will denote the origin by o and the destination by d. L defines a set of direct connections between two adjacent nodes. Not all pairs of nodes need to have a link between them. For each link (j, k) going from node / to node k, t^^ will be the travel time of traversing the link. Note that the "time" to traverse the link may actually be the distance, the time, the dollar cost, or any combination of these quantities. Xyjc) is the decision variable. X^) will equal 1 if the optimal solution entails using link (/, k) in going from the origin, o, to the destination, d, and 0 if we do not use this link. Finally, we define the set of nodes that you can get to from node j as O(j) for out-of /. Similarly, we define the set of nodes with links pointing into node ;', the set of nodes that will get you to node / with a direct connection, as /(/). With these definitions, we can formulate the problem of finding the shortest path from the origin to the destination as follows. Min
(2.36)
(j.k)tL
1 s.t. Σ X(i,n) - Σ X(n,i) = ' 0 nsO(i) ne/(» -1 Xm>0
j =o je N;jít o and j^d
(2.37)
j=d
V(j,k)eL
(2.38)
The objective function (2.36) minimizes the total time associated with the links that we use in going from the origin to the destination. Constraints (2.38) ensure that the decision variables are non-negative. Constraints (2.37) require a bit more attention. The first term on the left-hand side, ^
neO(j)
Χ(^η), represents
the total number of times we leave or go out of node /. The second term, V X,n j , represents the total number of times we go into node j . Thus, the left-hand side of the constraint is the difference between the number of times we leave or go out of node j and the number of times we go into node /. If node ;" is the origin, o, the constraint says that we need to leave the node one more time than we go into the node. In other words, we need to leave the origin. If node j is the destination, d, the constraint says that we must go into the destination one more time than we go out of the destination. In other words, we must end up at the destination. For all other nodes in the network, the constraint says that the number of times we go into the node must equal the number of times we go out of the node. For these nodes, flow in must equal flow out. If we go into such a node, we must also leave the node. If we do not go into the node at all, then we cannot leave the node.
54
OPTIMIZATION
Again, just as in the student/seminar assignment problem, because this is a network linear programming problem, we can be assured that the decision variables will take on integer values. Also, as long as all link travel times are positive (as we would expect in practical problems), the decision variables will be either Oorl. The shortest path problem, however, arises in a number of contexts in which the "times" may be negative. Suppose, for example, we need to reposition a vehicle from an origin to a destination. On some links we will have to deadhead the vehicle, meaning that we incur a cost. On other links, we can carry a load, meaning that the vehicle generates positive profit or negative cost. For these links, the "time" will be negative. We want to find the shortest path from the origin to the destination, the location to which the vehicle must be repositioned. A path with a negative total cost would indicate that the vehicle can generate positive revenue during the repositioning trip. The shortest path problem also often arises as a subproblem in an algorithm for solving a much larger problem. In some of these contexts, which are beyond the scope of this text, we also end up with negative link times or costs. If the shortest path problem has negative link times, then there is no inherent guarantee that the solution to the problem formulated above will not have "negative cost" or "negative time" cycles. Such a cycle is a loop with a negative total cost. In such a case, the primal problem is unbounded unless we add an additional constraint limiting X(¡,k) to be less than or equal to 1. We will generally assume that all times are positive in the remainder of this text.
LINEAR PROGRAMMING
55
56
OPTIMIZATION
LINEAR PROGRAMMING
57
58
OPTIMIZATION
LINEAR PROGRAMMING
59
60
2.6
OPTIMIZATION
SPECIAL NETWORK FORM
A number of the linear programming problems that are of interest to us have a network structure. By this we mean that the problem can be represented by a network of nodes and arcs. The nodes typically represent points in time, points in space, people, courses, jobs, and so on. Decision variables are associated with the arcs. The decisions in such problems typically deal with assignments (of students to seminars, or population centers to ambulances, for example), inventory to be carried from one period to the next, the number of employees to start each shift (in personnel scheduling problems), and so on. Three constants are typically associated with each arc: a minimum flow that has to be carried on the arc, a maximum allowable flow, and the unit cost associated with the flow on the arc. Determining the values of these three constants is critical in network flow problems. The objective of the network flow problem that we will consider is to minimize the total cost associated with all arcs in the network. The cost on any arc is the unit cost on the arc times the flow on the arc. The total cost is the sum of these arc costs over all arcs. In network models, we minimize this total cost subject to constraints that require that the flow on each arc must be greater than or equal to the minimum allowable flow and less than or equal to the maximum allowable flow on the arc. The difference between the flow into a node and the flow out of the node must equal some input value for that node. In many cases, we will simply require that the flow into each node equal the flow out of each node. Mathematically, we can define TV to be a set of nodes and A to be a set of arcs. We will generally use / and j to index nodes and a or (i,j) to index arcs. The relationship between nodes and arcs is specified by a node-arc incidence matrix in which the rows represent the nodes and the columns represent the arcs. There will be a 1 in the row corresponding to node / and the column corresponding to arc a or arc (i,/) if the arc goes from node i to node /; a - 1 in the row corresponding to node j and the column representing arc a or arc (¿, j) if the arc goes from node i to node j ; and a 0 everywhere else in the matrix. To illustrate this, consider the simple network shown in Figure 2.15 in which we are trying to find the shortest path from Chicago to New Orleans. The node-arc incidence matrix for this network is given by Table 2.2. Note that in the node-arc incidence matrix, in each column there is exactly one 1 and one - 1 value and all the other values (those not explicitly shown in Table 2.2 are 0. Equations (2.36)-(2.38) shows how the shortest path problem can be formulated. For the example of Figure 2.15, we would require a net flow of 1 at Chicago, a net flow of - 1 at New Orleans, and a net flow of 0 at every other city. The values of f(/A.) (which represent the great circle distances between the cities in this case) are given beside each of the arcs. Thus, the distance between Chicago and St. Louis is 293 miles.
SPECIAL NETWORK FORM
61
TABLE 2.2. Node-arc incidence matrix for the network of Figure 2.15 Arc ChicagoChicagoIndianapolis- Indianapolis- St. LouisMemphisSt. Louis Indianapolis St. Louis Montgomery Memphis Montgomery
Node Chicago Indianapolis St. Louis Memphis Montgomery New Orleans
1 -1
1 -1
MemphisNew MontgomeryOrleans New Orleans
1 -1 ■1
1 -1
1 -1
1 -1
Figure 2.15. Simple network for shortest path from Chicago t o New Orleans
To further illustrate the use of network models, consider the problem of assigning students to seminars. Figure 2.17 shows a network for this problem. At the heart of the network are two big sets of nodes: student nodes and seminar
62
OPTIMIZATION
nodes. There is one node for each student and one node for each seminar that is offered. If a student ranks a seminar then we connect the node representing that student to the node representing the seminar. In Figure 2.17 each student has ranked three seminars. A student's first-choice seminar is shown with a heavy black arc, his/her second choice seminar with a dashed arc and the student's third choice with a dotted arc. If a student does not rank a seminar, there is no arc between the student node and the seminar node. Note that of the four students shown in Figure 2.17, three ranked Seminar M as their first choice. Also, two of the four ranked Seminar 1 as their last choice and two ranked Seminar 2 as their last choice. The lower bound for each student/seminar arc would be 0 and the upper bound would be 1, meaning that a given student does not necessarily need to be assigned to any particular seminar, but a student can be assigned only once to any seminar. If we want to minimize the average ranking of the assigned seminars, where low rankings correspond to high preferences, we could assign a unit
63
SPECIAL NETWORK FORM
First Choice
y
Second Choice
►
Third Choice
>
Figure 2.17. Network for student-seminar assignment problem
cost of 1 to the arc which corresponds to each student's first choice, 2 to the arc corresponding to the student's second choice, and so on. Three other classes of arcs are shown in Figure 2.17 as well as two special nodes, the SOURCE and SINK nodes. The arcs connecting the SOURCE to each student node are where we enforce the constraint that each student is assigned to exactly one seminar. We do so by imposing a lower and upper bound of 1 on the flow on each such arc. This requires that we have a flow of 1 going into each student node. Since we will require the flow into each node to equal the flow out of each node, having a flow of 1 into each student node means that we have to have a flow of 1 out of each student node. In other words, we have to pick one of the arcs out of each student node, meaning we have to assign each student to exactly one seminar. The unit cost of each such arc is 0. The arcs between the seminars and the SINK node enable us to enforce the seminar capacity constraints. For the arc between Seminar j and the SINK, we impose a lower bound of 0 (we do not need to assign any students to the seminar), an upper bound equal to the capacity of the seminar, and a unit cost of 0. Finally, the return arc between the SINK and SOURCE nodes simply allows us to have a flow into each node equal to the flow out of each node. The lower bound on this arc can be 0, the upper bound can be equal to the number of students, and the unit cost should equal 0. If we minimize the total cost in this network—the sum over all arcs of the flow on the arc times the unit arc cost-subject to the flows being between the lower and upper bounds for each arc and the condition that the flow into every node equals the flow out of every node, we will minimize the average rank of the
64
OPTIMIZATION
student assignments. In other words, the solution will assign students to their most preferred seminars to the extent possible. From Figure 2.17, it should be clear that not every student is likely to be assigned to his or her first-choice seminar. In this simple example, if the capacity of Seminar M is 2 or less, we cannot simultaneously assign students 1, 2, and N to their first-choice seminar. Section 6.4 discusses the freshman-seminar assignment problem in greater detail. Network linear programming problems are important for four reasons. First, many important problems can be structured as network problems. Second, being able to represent the problem as a network means that we can readily create a mental image of the problem and we can draw a figure that quickly captures the essence of the problem. Third, if we can represent the problem as a network flow problem with integer values for the lower and upper bounds for each arc and integer-values for the difference between the flow into and out of each node, then the optimal flows will be integer-valued when we solve the resulting linear programming problem. This means that we cannot get a solution like the one we found above in section 2.5.2, in which the optimal solution was to employ 16.05 police units and 2.14 fire trucks; these values are clearly not integer values. In other words, we do not need to worry about the solution to the student-seminar assignment problem of Figure 2.17 telling us that we should assign \ of Student 1 to Seminar 1 and \ of Student 1 to Seminar 3. Similarly, the solution to the shortest path problem of Figure 2.15 will always tell us to either use an arc, with a flow of 1, or to not use the arc, with a flow of 0. We will never get a "maybe" solution with a flow of \ . Finally, there are exceptionally efficient and fast algorithms for solving network flow problems. MENU-OKF (available from the text's website) solves network flow problems using the out-of-kilter flow algorithm, one such specialized algorithm for solving network flow problems. As a final example of a network flow problem, consider the problem of maximizing the flow of goods between an origin and a destination. For example, suppose that we wanted to maximize the number of volunteers we could send from Chicago to New Orleans for disaster relief. Perhaps each leg of the trip is limited by the number of seats in vans that we can hire. The number of seats available to us between each of the major city pairs is given in Figure 2.18. While this figure looks similar to Figure 2.15, in this case, the numbers beside each arc represent the maximum number of volunteers who can travel between the two cities per day. Figure 2.18 includes a return arc from New Orleans to Chicago. If the unit cost on this arc is - 1 , there will be an incentive to move flow along this arc. This in turn will create an incentive to move flow through the primary arcs of the network from Chicago down to New Orleans. The lower bound on the return arc should be 0 and the upper bound should be a big number. It should be bigger than the maximum possible flow (which clearly is less than the sum of all of the arc capacities, or 2615 in this case). The lower bound on every other arc should be 0 and the upper bound should be the arc capacity shown in Figure 2.18. The unit cost on every other link should be 0. If we now minimize the total cost in this network while ensuring that the flow into every node equals the flow out of
65
INTEGER PROBLEMS
Figure 2.18. Figure for maximum flow problem
every node and that the arc flows are between their minimum and maximum values, we will be maximizing the flow from Chicago to New Orleans. Maximum flow problems are another important category of network flow problems. Note that in this case, some arc costs are negative. 2.7
INTEGER PROBLEMS
In many of the problems that are of interest to us in the design and operation of services, fractional solutions from optimization problems are not acceptable. We have already encountered one such example. The simple linear programming problem of section 2.5.2 indicated that we should employ 16.05 police units and 2.14 fire units. Clearly this is not possible. It is tempting to simply round these two values down to the next smaller integer values. In other words, why don't we hire 16 police and 2 fire units? This would clearly satisfy the budget. After all, if we can afford 16.05 police and 2.14 fire units we can afford less of each. This highlights one of the problems, however, with rounding. If one of the two values to be rounded needed to be rounded up, there would be no guarantee that the solution would still satisfy the budget constraint. In our case, rounding produces other problems. Recall that the number of police units must be less than or equal to 7.5 times the number of fire units. Hiring 16 police and only 2 fire units does not satisfy this condition, as the ratio is now 8:1 rather than 7.5:1, which is the maximum allowable ratio. Clearly, rounding a linear programming solution to get the nearest integer solution may not produce
66
OPTIMIZATION
Figure 2.19. Feasible region with integer solutions highlighted
a feasible solution and is not likely to produce the best integer solution. Thus, we need to use some other technique. The model that we should be solving in the police/fire example is the following. Wax 0.2 · Police :t.
+ 0.65 · Fire
(2.2)
200· Police +1000 Fire < 5350
(2.3)
-1.0· Police +1.5 Fire
< 0
(2.4)
1.0 Police
< 0
(2.5)
-7.5 Fire
Police Fire
> 0 and integer
(2.39)
> 0
(2.40)
and integer
Note that constraints (2.6) and (2.7) have been changed to (2.39) and (2.40), in which we explicitly state that the decision variables must be integer-valued. In terms of the solution space, the feasible region is now shown in Figure 2.19 in which the feasible integer solutions are shown as black dots.
INTEGER PROBLEMS
67
The optimal integer-valued solution is to hire 15 police units and 2 fire units. The objective function decreases from 4.601 to 4.30 lives saved. Since we have added constraints to the problem, we know that the optimal value of the solution cannot increase, and, in fact, it decreased in this case. Figure 2.22 shows this solution. Notice that we do not use the entire budget in this case. Presumably, the city would find other uses for the remaining $350,000! For example, the funds might be allocated to another city service (e.g., allowing the library to buy a few more books—maybe even this one!) or promoting public safety through various public education programs.
68
OPTIMIZATION
Figure 2.22. Integer optimal solution to the police/fire problem
Figure 2.23. Integer optimal solution with enhanced budget
Now suppose the budget increases modestly next year from $5,350,000 to $5,400,000. We can solve the problem with the new budget. Our intuition tells us that the best thing to do might be to hire additional employees. Unfortunately, this is not the case when we solve the problem with the enlarged budget. Figure 2.23 shows the solution in this case. Now it is optimal to employ 12 police and 3 fire units. The entire budget is expended. The objective function value now
INTEGER PROBLEMS
69
increases from 4.3 to 4.35. However, this solution necessitates eliminating 3 of the 15 police units that we employed when the budget was $5,350,000. Eliminating civil service positions is exceptionally difficult. This illustrates one of the problems with implementing some integer programming solutions directly: The optimal solutions can be very sensitive to small changes in the constraint values. Note that the budget would have to increase from $5,350,000 to $6,000,000, more than a 12 percent increase, for the optimal solution to be to employ the same 15 police units plus an additional fire unit. This suggests that multi-year planning is essential in such situations so that we avoid being "painted into a corner." Such problems exist in other contexts as well. The manager of one plant once told me that 100 years of rational decision making had led to a disastrous plant layout. The firm had made good or optimal decisions for 100 years about where to place new equipment conditional on where everything else was at the time. A failure to plan ahead had resulted in a layout that was terrible even though the myopic decisions had all been well-founded. Such problems clearly also arise in service industries.
2.7.1
Uses of Integer Variables
We have just seen one of the important uses of integer variables in optimization. Sometimes a non-integer solution simply does not make sense. We cannot hire \ of a person. We also showed that rounding the solution may not give a feasible solution. When doing so does result in a feasible solution, there is no guarantee that it is truly the optimal solution for the integer programming problem. Nevertheless, in many practical cases, rounding a fractional solution to get a nearby integer solution often works well, at least as a starting point for discussions. As indicated in Figure 1.5, developing a mathematical model and exercising, solving, and analyzing the model results are only two of many phases in the modeling/decision making process. The most common form of an integer variable is a binary integer variable that can take on a value of either 0 or 1 only. Such variables are typically used for two purposes: ■ To represent decisions to either do something or not to do something • To capture the relationships between key decisions. In many problems, we have to decide whether or not to take certain actions. For example, in the student/seminar assignment problem, students may have been able to express a preference for any one of 70 different seminars, but we may have rooms, faculty, and resources for only 50 seminars. Thus, we must simultaneously determine which 50 seminars to offer (an either/or decision for each seminar) and which students to assign to the seminars we do offer. Note that we clearly would not want to enumerate every possible way of offering 50 seminars out of a total of 70 since there are over 1017 ways of doing so. (This is 100,000,000,000,000,000 possible ways!) If we could evaluate 109 or 1 billion
70
OPTIMIZATION
combinations every second, it would still take us over 5 years to evaluate every possible way of offering 50 out of 70 seminars. The entire freshman class would have graduated long before we could decide which seminars to offer if we had to resort to a total enumeration approach like this. Fortunately, we can formulate and usually solve such problems quite well using integer programming models. For each seminar, we will have a binary (0 or 1) variable, which will be 0 if the seminar is not to be offered and 1 if it is. The model will automatically determine which 50 of these variables should take on a value of 1. Similarly, we may have hundreds of candidate sites at which we can locate automatic meter readers for household electricity use (Gavirneni, Clark, and Pataki, 2004). For each location, we will have a binary variable, which will take on a value of 0 if we do not use that candidate site for a meter reader and 1 if we do use the site. The problem addressed in Gavirneni, Clark, and Pataki (2004) is to select the minimum number of meter reader locations needed to serve all homes subject to distance limitations between the reader and the home meter and a capacity limitation on the number of homes that can be assigned to any meter. Binary variables are used in many other contexts. In routing vehicles, we may have a binary variable that is equal to 1 if customer k follows customer j immediately on a route and is 0 if not. In classroom scheduling, we might define room/time combinations representing a specific room and time of day. For example, the Monday, Wednesday, Friday time slot from 9 A.M. to 10 A.M. in lecture room 5 might represent one room/time combination. We could then define a variable that would be 1 if course m is assigned to room/time combination n and 0 if not; for example, the variable would be 1 if Introduction to Probability is to be taught in lecture room 5 from 9 to 10 on Monday, Wednesday, and Friday mornings. In addition to making yes/no decisions, binary variables can be used to represent logical conditions that must exist between decisions. In the seminar assignment problem, for example, we cannot pick more than 50 seminars. In the problem of assigning classes to rooms and times, we must pick exactly one room/time combination for each class and we cannot assign more than one class to any particular room/time combination. In the vehicle routing problem, we would impose a condition that states that we go from every node to exactly one other node and that we go into every node exactly once. These are all examples of relationships between variables within the same class of decision variables. In other words, they represent logical conditions that are imposed on only one type of decision variable as opposed to decisions that cut across two or more types of decision variables. Such cross-cutting conditions are also important. In the student/seminar assignment problem, in addition to a variable representing whether or not we offer each seminar, there will also be a variable for each student/seminar combination indicating whether or not a particular student is assigned to the particular seminar. One constraint will stipulate that we have to assign each student to exactly one seminar. The cross-cutting condition or linkage condition will ensure
71
INTEGER PROBLEMS
that we do not assign a student to a seminar unless we have decided to offer that seminar. To illustrate how we can use binary (0 or 1) variables in this way, let us define the following two types of decision variables. The first will be a variable that allows us to decide whether to offer a seminar or not. Specifically, let us define X¡ to be 1 if seminar; is to be offered and 0 if not, in the student/seminar problem. We also let Ύή be 1 if student i is assigned to seminar ;' and 0 if not. We will now have constraints of the following form.
Ση =1
V¿e/
(2.41)
Y¡i<Xi
Viel-jeJ
(2.42)
Έχι-Ρ
(2.43)
jeJ
In these constraints, / is the set of students and / is the set of candidate seminars that might be offered. Constraint (2.41) states that each student must be assigned to exactly one seminar. Note that this constraint applies only to the assignment or Y¡¡ variables. Constraint (2.42) states that the assignments can only be made to seminars that we offer. These are the linkage constraints that link the assignment decision variables, Y¡¡, to the X¡ decision variables indicating whether or not a seminar is to be offered. Finally, constraint (2.43) states that we can only offer p seminars because of budget or room availability constraints. Again, these constraints pertain to only one class of decision variables, the X¡ variables. It is worth noting that in many problems, we will not have to require the assignment variables, Y,>5 to be binary; in many cases, they will naturally be either 0 or 1. We will generally have to require the decision variables regarding which seminars to offer, the X¡ variables, to be binary.
In essence, constraints (2.42) represent a form of binary constraints that say that you can only do A if you also have done B, or equivalently, if you want to do A, you must also do B. In the seminar assignment case, these constraints say that you cannot assign student / to seminar j unless you decide to offer seminar j ; that is, unless X¡ = í. Another way of saying this is that if you want to assign student / to seminar j , you must elect to offer seminar j . Binary variables can also be used to represent problems in which we must do either A or B, but not both. If we let XA equal 1 if we choose to do A and 0 otherwise, and if we define XB similarly in terms of action B, then XA + XB = 1
72
OPTIMIZATION
requires that we take exactly one of the two actions but not both. This is an either/ or constraint. For example, we may decide to offer pizza at our restaurant or to offer hamburgers, but not both since we do not have the kitchen space for both types of food. We must offer one or the other, however, or we will not have a restaurant (at least one that we want to consider operating). Similarly, Xi + XB < 1 says that we can take at most one of the two decisions, A or B, but not both. We may also decide to take no action. For example, we might decide to assign a faculty member to the department's strategic planning committee (decision A) or to the faculty recruiting committee (decision B). The faculty member may, however, not be assigned to either committee. A single faculty member could not serve on both committees if this constraint is imposed. Note that constraint (2.43) is a generalization of this form of condition or constraint. This constraint states that we can select at most p seminars. Thus, instead of saying that we can select either seminar A or seminar B, it states that we can select at most p of the seminars that were listed as candidate seminars to be offered.
2.7.2
How to Solve Integer Programming Problems
2.7.2.1 Branch and Bound. For the most part, we will not need to concern ourselves with the details of how the Excel Solver or What's Best solve integer programming problems. Once we state which variable(s) must be either integer or binary as discussed above, the software takes over and ensures that the requisite variables are not fractional in the solution that is returned. However, it is important to have some understanding of what the software is doing so that we can appreciate why integer programming problems may be much more difficult to solve than their linear programming cousins and why they may take much longer to solve. Let us again consider the budget allocation problem shown in Figure 2.6. The optimal solution was to employ 16.05 police units and 2.14 fire units with an objective function value of 4.601. Clearly, this is not an integer-valued solution and it would be impossible to hire this many units of either type. Because the solution indicates that we should hire 16.05 police units, the optimal integervalued number must be either less than or equal to 16 or greater than or equal to 17. Therefore, we create two new linear programming problems. In the first problem, we add a constraint that states that the number of police units must be less than or equal to 16 and in the second we add a constraint saying that the number of police units must be 17 or more. Figure 2.24 shows the results of adding these two problems. This is the beginning of what is called a branch and bound tree. We have branched on the Police variable, creating two new problems. In the problem on the left, we require the Police variable to be less than or equal to 16. As a result of adding this constraint, the number of fire units has increased to 2.15 and the objective function value has decreased slightly to 4.5975. Recall that adding a constraint to a maximization problem cannot improve the objective function, and in this case, it degraded the objective function value. The value of
73
INTEGER PROBLEMS
Root Node Police = 16.05 Fire = 2.14 Ob¡ = 4.601
Police! 16 Police = 16 Fire = 2.15
Obj = 4.5975
Police > 16 No Feasible Solution
Figure 2.24. First branching in the branch and bound tree
4.5975 is an upper bound on the value of the objective function that we would find if we continue processing the left-hand node of the tree, which we are going to have to do since the number of fire units is still not integer-valued. On the right-hand side, adding the constraint that the number of police units be greater than or equal to 17 creates an infeasible problem. This should also be evident from Figure 2.6 which shows that there is no solution with 17 or more police units. We can fathom this node of the tree as any additional constraints added to this problem will not allow the problem to be feasible. In short, we cannot have 17 or more police units. We now return to the left-hand node. The number of fire units is 2.15 and so we now will branch on the Fire variable, adding two more new problems, one in which we use two or fewer fire units and one in which we use three or more fire units. The continuation of the branch and bound tree is shown in Figure 2.25. Note that both of the new problems inherit the constraints from the node (and all nodes) above. In particular, in solving the two new problems, we continue to impose the constraint that the number of police units must be less than or equal to 16. When we limit the number of fire units to 2 or less, the optimal solution is to employ 15 police units and 2 fire units with an objective function value of 4.3, as shown in Figure 2.25. This is an all-integer solution and so we know that 4.3 is the worst that we can do. In other words, we now have a lower bound on the integer programming objective function. When we require that the number of fire units be 3 or more, we employ 11.75 police units and 3 fire units, resulting in an objective function value of 4.3 (again) as shown in Figure 2.25. This is still not an integer-valued solution, and so we might be tempted to continue branching from this node. However, in this case, the value of 4.3 is an upper bound on the value of any solution that we might find if we continue adding constraints to problems below this node. No solution below this node can do better than an objective function value of 4.3. Since we already have an all-integer solution with a value of 4.3, we know that the solution
74
OPTIMIZATION
Root Node Police = 16.05 Fire = 2.14 Obj = 4.601
Police ¿16 Police = 16 Fire = 2.15 Obj = 4.5975
Fire <, 2 Police = 15 Fire = 2 Obj = 4.3
Police ¿16 No feasible solution
Fire £ 3 Police = 11.75 Fire = 3 00/ = 4.3
Figure 2 . 2 5 . The branch and bound tree for the police/fire allocation problem
shown in the bottom left node of Figure 2.25 is the optimal solution and there is no reason to continue branching from the bottom right node. Thus, the optimal integer-valued solution is the to employ 15 police units and 2 fire units with a resulting objective function value of 4.3 lives saved per year. For our purposes, the key is that the Excel Solver, What's Best, or any other optimization program will progressively add constraints to the original linear programming problem until it finds a solution that it can prove is the best solution satisfying all the integer constraints. Many linear programming problems may have to be solved! For example, if we have a problem with 10 binary variables, potentially we have to solve 211 - 1, or over 2000, linear programming problems. If we have 20 binary variables, potentially we might need to solve over 2 million linear programming problems. With 50 binary variables, we might need to solve over 2,000,000,000,000,000 linear programming problems. Problems with this many binary variables are quite common. Fortunately, we very rarely need to solve anywhere near this many problems to find the optimal integer programming problem solution! But, there is almost always considerably more work to be done by the computer in solving an integer programming problem than there is in solving a simple linear programming problem of comparable size. 2.7.2.2 Heuristics. The difficulties associated with solving integer programming problems optimally have resulted in a large body of literature in which the problems are solved much faster, but are solved heuristically. A heuristic is a rule-of-thumb that sounds good, but does not guarantee that the optimal solution will be found. For example, in assigning students to seminars, if we have to pick
INTEGER PROBLEMS
75
50 out of 70 seminars to offer, we might proceed as follows. For each seminar, compute the average score for the seminar over all students. In other words, if we have 10 students and 5 ranked the seminar their first choice, 3 ranked it their second choice and 2 ranked it their third choice, the seminar would get an average ,. , . , . cn r ( 5 x l ) + (3x2) + (2x3) Λ „ „, score of —= 1.7 . We would then Fpick the 50 seminars with 10 the smallest average scores. This is a rule-of-thumb that sounds good since we are picking the more popular seminars overall, but it may not lead to an optimal solution. One simple heuristic that is often used in solving integer programming problems is to fathom nodes (stop searching from those nodes) if the value of the objective function at those nodes is within some percentage of the best known value. For example, in the branch and bound problem illustrated in Figure 2.25, if the value of the objective function at the bottom right node—in which we have imposed the constraints that the number of police must be less than or equal to 16 and the number of fire units must be 3 or more—was no more than X percent above the best known value, we might stop and declare the solution that we had the heuristic solution to the problem. For example, suppose the objective function value at the node had been 4.35 instead of 4.3. This is 1.16 percent above the all-integer value shown in the node of 4.3. If we were looking for a solution that we knew was within 2 percent of the best possible solution, we would fathom the node even though there might be a better solution below that node. Heuristic algorithms often fall into two broad categories. Construction algorithms use various rules to find feasible solutions to the problem. Improvement algorithms take a feasible solution and modify it in some way in an attempt to improve the value of the objective function. To illustrate construction and improvement algorithms, consider the problem of finding the shortest path starting at some city and visiting all other cities in a region exactly once and then returning to the original city. This is known as the Traveling Salesman Problem (TSP) and is a classic problem in operations research. It has a broad range of applications from vehicle routing to machine scheduling. This problem has been the subject of thousands of papers and many excellent books including that of Lawler et al. (1985). One simple construction heuristic for the TSP is to start at the original city and visit next the closest city. From there we proceed to the closest unvisited city and so on. We proceed in this manner until all cities have been visited. Then, we return to the original city. This will build a feasible solution in the sense that the tour visits every city exactly once and it returns to the original city. It satisfies all of the constraints of the TSR This is known as the nearest neighbor algorithm. While it sounds good, it is unlikely to result in an optimal solution. The problem with this algorithm becomes apparent when one considers what is likely to happen near the end of the algorithm. In short, the algorithm is likely to "paint us into a corner" with the remaining cities to visit located far from each other and far from the starting city (to which we have to return). Figure 2.26 shows the solution when we must visit each of the capitals of the 48 contiguous
76
OPTIMIZATION
Figure 2.26. Nearest neighbor solution starting at Illinois
states plus Washington, DC. We begin and end the tour in Illinois. We begin by going from Illinois (IL) to Missouri (MO) and from there to Kansas (KS) and so on. The last location visited is in Arizona (AZ) and we have to return from there to IL to complete the tour, incurring a distance of 1311 miles, over 10 percent of the total tour length. Also note that the tour frequently crosses itself. For example, in going from Maine (ME) to Arkansas (AR), the tour crosses itself. It does so again on the final two legs of the tour. In fact, if we start the algorithm from each of the 49 locations, the tour always crosses itself. The average length of the tours resulting from these 49 applications of the nearest neighbor algorithm is 13,240 miles. The best solution results from starting in Arizona (AZ); this tour has a length of 12,434 miles. On average, the last link in each of these tours, the link connecting the last visited node to the original starting node, is 1147 miles, or 8.63 percent of the tour length. This is roughly four times as long as the average link length. (Because there are 49 links in each of these tours, each link will be about 2 percent of the total tour length.) See A n i m a t e d GIF W i t h O u t 2 0 p t . g i f in t h e online appendix.
INTEGER PROBLEMS
77
Figure 2.27. Tour before 2-opt algorithm
Figure 2.28. Tour after 2-opt algorithm
Improvement algorithms take a feasible solution and try to find local ways to improve the algorithm. In the case of the TSP, one simple improvement algorithm is the 2-opt algorithm. In this algorithm, we remove two links. This creates two disconnected portions of a tour, as illustrated in Figure 2.27. In this example, the link from i to i + 1 and the link from / to / + 1 cross each other. Between node i + 1 and node j there may be a series of other nodes that are visited by the tour. Similarly, between node j + 1 and node /, there are other nodes visited by the tour. If we remove the two solid links, we are left with two disconnected portions of the tour represented by the dashed lines. We now consider reconnecting the two disconnected portions of the tour. In the case of the 2-opt algorithm, there is only one way to do that. We connect node i to node ;' and then connect node i + 1 to node ; + 1. This also requires that we reverse the path between node i + 1 and node j so that the tour goes from / to / + 1. The new tour is shown in Figure 2.28. If this change reduces the length of the tour, we accept the change; if not, we return to the original tour as shown in Figure 2.27. (When the distances between nodes or cities is the straight-line or Euclidean distance, we can show that a tour will never cross itself after the application of the 2-opt algorithm.) Figure 2.29 shows the result of applying the 2-opt algorithm to the tour shown in Figure 2.26. The tour does not cross itself (even though the distances used are strictly not Euclidean distances, but are great circle distances instead). When the
78
OPTIMIZATION
Figure 2.29. Tour starting in Illinois after 2-opt algorithm
2-opt algorithm was applied to each of the 49 tours resulting from starting at each of the 49 cities, the average improvement was 16.4 percent of the original tour length. The best solution now has a length of 10,654 miles and results from starting with Minnesota (MN).
See A n i m a t e d GIF W i t h 2 Q p t . g i f ¡n t h e online appendix.
Most heuristic algorithms are variants of construction and improvement algorithms. Some algorithms, such as tabu search (Glover, 1989, 1990a, 1990b; Glover and Laguna, 1997) and simulated annealing (Chiang and Russell, 1996) allow solutions to degrade slightly to avoid being trapped in local optima. Nevertheless, most algorithms operate on a single solution trying to improve the solution progressively. Genetic algorithms (Goldberg, 1989) are significantly different. Genetic algorithms work simultaneously on many solutions, or on a population of solutions. Rather than trying to improve any single solution, genetic algorithms rely on a
79
INTEGER PROBLEMS
1 0 1
Mother Father I Child before Mutation I | Child after Mutation |
2 0 0 0
0
| |
3 1 1 0
0
| |
1 0
Candidate Site 5 6 0 1 0 0
4 1 0 | |
1 1
| |
0 0
| |
0 0
7 0 0 |
|
8 0 1 0
0
| |
g 0 0
10 0 0
1
|
0
|
0
|
1
[
0
|
1
|
Figure 2.30. Example encoding for a genetic algorithm
biological analogy—survival of the fittest—to improve solutions. The basic operators of genetic algorithms are selection, crossover, and mutation. Selection picks two (or occasionally more) solutions to act as the parent solutions of one (or more) new solutions. The parents are selected with a bias toward the better solutions. This is a key to any genetic algorithm. Crossover is a process in which a portion of each parent solution is combined with portions from the other parents to create new (and hopefully improved) solutions. This is similar to the biological process of combining chromosomes from a child's mother and father to create the genetic encoding of the child. Finally, mutation is a process in which the encoding of a solution is changed randomly. Mutation is often critical to ensure the continued diversity of the population in a genetic algorithm. To illustrate this process, consider the problem of determining where to locate facilities. For example, we might have 10 candidate locations for meter readers. We associate a 0/1 bit with each candidate location. Figure 2.30 shows two parents we are (creatively) calling the Mother and Father solutions. In the Mother solution, we would locate facilities at candidate sites 3, 4, and 6, those sites for which the encoding includes a 1. In the Father solution, we would locate at candidate sites 1, 3, and 8. These two solutions would be selected from many other solutions using the selection operator. In all likelihood, they would be better, on average, than the other solutions in the population. We then pick a randomly selected crossover position. In the example shown in Figure 2.30, we have selected the crossover position to be between the (encodings of the) fourth and fifth candidate sites. One child would then inherit the encoding of the Mother for the first 4 candidate sites and of the Father for the remaining 6 sites. In the Child solution, facilities would be located at sites 3,4, and 8. Mutation might then randomly select two positions in the encoded Child solution and swap the encodings in those positions. For example, if the two selected positions were 3 and 10, we would end up with the last solution shown in Figure 2.30, in which we locate at candidate sites 4, 8, and 10. For some problems and some encodings of the solution, the selection, crossover, and mutation processes may result in infeasible solutions. There are at least two ways of handling infeasible solutions. The first is to penalize such solutions. The second is to apply some heuristic to return the solution to feasibility. For example, if the location problem stipulated that there be only three sites selected, some crossover positions in the example of Figure 2.30 would result in more or
80
OPTIMIZATION
less sites in the Child solution. We could then randomly add or drop sites depending on whether we had too few or too many sites in the Child solution. Genetic algorithms have been remarkably powerful at solving difficult integer programming problems.
2.8 2.8.1
MULTIPLE OBJECTIVE PROBLEMS Why Multiple Objectives
Life is inherently multi-objective. In deciding how to invest our money, we are each faced with decisions about how much risk to assume and how much reward we want to receive. We would like to minimize risk and to maximize reward or return on our investment. Unfortunately, we generally cannot do both simultaneously and so we need to find investment strategies that balance these two objectives. The correct balance for one person may not be the best balance for someone else. Recognizing this, many retirement plans default to an age-adjusted portfolio mix that incurs greater risk for young investors and becomes increasingly more conservative for older employees who are closer to retirement age and for whom secure (but perhaps lower return) investments are essential. When we drive from one location to another, the GPS system in our car often gives us the choice between several different routes. One might minimize the travel time while another might minimize the distance of the route and a third might be a compromise between the two. Most online mapping and travel direction services also provide users with options to allow them to express their own preferences. In assigning students to seminars, we might want to minimize the average ranking of the seminars to which the students are assigned. We might also want to minimize the worst or maximum assignment of any student. After all, the parents of a student assigned to his or her first- or second-choice seminar are not likely to call the dean to complain about their daughter's assigned seminar; rather, the parents of a child assigned to her eighth choice might well complain to the dean when they are feel like they are paying a small fortune in tuition and fees! Similarly, in locating ambulances, we might want to minimize the city's investment in ambulance bases. We would also want to reduce the average response time to an emergency location. We might also want to maximize the number of people who live within 5 minutes of the nearest ambulance base and to minimize the maximum response time. At the national level, there are numerous tradeoffs that are made continuously. We must balance the national security needs of the country as reflected by funding for defense, homeland security, and intelligence on the one hand against funding for education of young children. We have to balance investments for infrastructure maintenance against research to cure deadly diseases. In short, we live in a multi-objective world.
MULTIPLE OBJECTIVE PROBLEMS
2.8.2
81
Dominated Solutions
The goal of multi-objective analysis is not to find a single "best" solution. Rather, the goal is to find a set of solutions that are non-dominated. Solution A dominates solution B if solution A does as well as solution B in terms of each of the objectives and strictly better than solution B in terms of one or more objectives. Figure 2.31 shows a generic problem with two minimization objectives. Recall that we can readily convert any maximization objective to a minimization objective by multiplying the objective function value by - 1 , so there is no loss of generality in considering only minimization objectives. The solid point represents a solution that is non-dominated. To the northeast of this point is a region of solutions that are dominated by this solution. Solutions in this region are also said to be inferior solutions. To the southwest is a region in which we know that no solution can exist. We know this because any solution there would dominate the solution shown by the solid dot. Because that solution is known (somehow) to be non-dominated, we know that there cannot be any solution to the southwest of that solution. Thus, if we have a solution that we know is non-dominated, we are interested only in solutions to the southeast and northwest of that solution. To illustrate this, consider Figure 2.32, which shows the tradeoff between the average and maximum distance for the 15 largest states in the continental United States. In this problem, we collapsed the population of each state to the state capital. The distances between cities are the great circle distances, the shortest distances on a sphere. The "average" distance is the demand-weighted average distance, meaning that larger locations contribute more to the average than do smaller locations. Three facilities are located in each solution.
Figure 2.31. Regions of interest for a non-dominated solution with two minimization objectives
82
OPTIMIZATION
Figure 2.32. Sample average and maximum distance tradeoff curve
The figure shows five solutions that are non-dominated. The best solution in terms of minimizing the average distance is to locate in California, Indiana, and New Jersey. This results in a demand-weighted average distance of roughly 270 miles, but the maximum distance is 925 miles between the facility in Indiana and the population in Texas. Locating in California, Missouri, and Virginia, on the other hand, minimizes the maximum distance. For this solution, the demand-weighted average distance is 299 miles, while the maximum distance is 653 miles between Missouri and Texas. By locating in California, Texas, and Ohio, however, we can reduce the maximum distance from 925 in the first solution to 663, a value that is very close to the best possible value of 653. The average distance is only slightly larger than the best possible average distance of 270 miles. This illustrates the value of multiobjective analysis. This solution does not optimize either objective, but it does very well with respect to both objectives. Two other non-dominated solutions are also shown in the figure. In addition to the five non-dominated solutions, two other solutions are shown as diamonds. These solutions are dominated by one or more of the nondominated solutions. Consider, for example, locating in California, Georgia, and Pennsylvania (CA, GA, and PA). This solution results in an average distance of 277 miles and a maximum distance of 816 miles. We can improve both objectives by locating instead in California, Illinois, and New Jersey (CA, IL, and NJ). For this solution, the average distance decreases from 277 to 271 miles and the maximum distance drops from 816 to 799 miles. Locating in California, Illinois, and New Jersey does better in terms of both objectives and so this set of sites dominates locating in California, Georgia, and Pennsylvania.
MULTIPLE OBJECTIVE PROBLEMS
83
Similarly, consider locating in California, Indiana, and New York (CA, IN, and NY). The average distance for this solution is 275 and the maximum distance is 925. Again, we can do better by locating in California, Indiana, and New Jersey. The average distance for this set of sites is 270 and the maximum is again 925. Since the California, Indiana, and New Jersey grouping does as well as California, Indiana, and New York in terms of the maximum distance and better in terms of the average distance, locating in California, Indiana, and New Jersey dominates locating in California, Indiana, and New York.
2.8.3
Example Shortest Path Problem
To illustrate these concepts further, consider again the problem of driving from Chicago to New Orleans. Now, in addition to the distances, we are given a measure of the displeasure or disutility associated with driving on each segment of the route. This is shown in Figure 2.33. (If you have ever driven between Chicago and St. Louis, you know that the first mile looks just like the next roughly 300 miles; hence, the relatively large displeasure associated with that segment of the route! The other displeasure values are relatively arbitrary and were selected to illustrate the points below.) You can readily enumerate all of the possible paths from Chicago to New Orleans for this simple problem. In fact, you would never want to enumerate all possible solutions to find the tradeoff curve, but for this simple problem, it is instructive to do so. These solutions are shown in Figure 2.34. There are four
Figure 2.33. Distances and displeasure values from Chicago to New Orleans
84
OPTIMIZATION
Figure 2.34. Distance vs. displeasure solutions
non-dominated solutions and one dominated solution. No matter how you value displeasure and distance relative to each other, you would never want to use the path going from Chicago to Indianapolis to St. Louis, to Memphis and then to New Orleans. This path takes 1108 miles and incurs a displeasure of 210. You can improve both measures by using the Chicago to Indianapolis to Montgomery to New Orleans route with a distance of 1061 (a savings of 47 miles) and a displeasure of 205 (a savings of 5 units).
2.8.4
Weighting Method
As indicated above, we do not want to enumerate every possible solution to a multi-objective problem. For the location problem in which we are trying to locate 3 sites from among 15 candidate locations, there are 455 possible solutions. Figure 2.35 shows these 455 solutions along with the 5 non-dominated solutions that are on the tradeoff curve. For a problem in which 10 sites are to be picked from 150 candidate sites, there are over 1.1 x 1015 possible solutions. If we could evaluate 1 billion solutions every second, it would take nearly 1 year to evaluate all such solutions. Let's hope our computer does not crash during that time! For the 150 largest cities in the contiguous 48 states, there are only 21 non-dominated solutions. Fortunately, we do not need to evaluate all 1.1 x 1015 possible solutions
85
MULTIPLE OBJECTIVE PROBLEMS
Figure 2.35. All 455 solutions to average vs. maximum distance tradeoff for 3 sites selected from 15 candidate locations
TABLE 2.3. First two non-dominated path solutions for the example in Figure 2.33
Min Distance Solution Min Displeasure Solution
Distance
Displeasure
979 1347
220 193
to find the 21 solutions in which we are really interested. In fact, we can find these 21 solutions in under 1 minute with a well-designed algorithm. So, how do we do it? There are two techniques that can be used (Cohon, 1978). The first method is the weighting method. We will discuss this method in the context of two competing objectives to be minimized. We begin by finding the best non-dominated solution with respect to each of the two objectives. For the shortest path problem shown in Figure 2.33 we simply minimize the distance and then minimize the displeasure. This will result in the two solutions shown in Table 2.3. These two solutions are also shown in Figure 2.36. We now find a weight on the two objectives such that any solution on the line connecting these two solutions will have the same value. In other words, we find the value of w such that 979w + (1 - w) 220 = 1347w + (1 - w)193. Solving for w, we find w = 27/395 = 0.068354. More
86
OPTIMIZATION
Figure 2.36. First two solutions in non-dominated path solutions for the example in Figure 2.33
generally, if Z/yt is the value of the j ' h objective and the k'h solution, we want to solve for the value of w such that wZu + (1 - w) Z 2 1 = wZX2 + (1 - w) Z22.
(2.44)
In other words, the weighted value of the first solution is equal to the weighted value of the second solution. The solution to (2.44) is _
7
^2,2
-7
^2,1
1^1,1 ~~ -^2,1 j ~ V 1,2 ~~
_ 2,2 j
7
^2,2
-7
"^2,1
, „ . _.
(.-^1,1 ~ A , 2 j + 1^2,2 ~~ ^ 2 , 1 )
Note that w must be between 0 and 1 since Z 2 2 - Ζ2λ < 0 and Z u - Z 1 2 < 0. This is so because the first solution is, by definition, the best solution with respect to objective 1 and so Z u - Z 1 2 < 0. Similarly, the second solution is, by definition, the best solution with respect to objective 2 and so Z2i2 - Z2,\ < 0. Note that in our case, any solution on this line will have a value equal to 0.068354 · 979 + 0.931646 · 220 = 271.881 and any solution below this line will have a smaller weighted value. Once we find the correct value of w, we minimize w times the first objective plus 1 - w times the second objective. In this case, we want to minimize 0.068354 times the distance plus 0.931646 times the displeasure. Geometrically, this is equivalent to trying to push the line connecting the two solutions down and to the left in a direction that is perpendicular to the line connecting the two solu-
MULTIPLE OBJECTIVE PROBLEMS
87
TABLE 2.4. First three solutions to problem shown in Figure 2.33 Distance
Displeasure
979 1061 1347
220 205 193
Min Distance Solution First Weighted Solution Min Displeasure Solution
Figure 2.37. First three solutions in the weighting method
tions. When we do this, we find a new solution with a distance of 1061 and a displeasure of 205. The weighted value of this solution is 0.068354 · 1061 + 0.93 1646 · 205 = 263.5114, which is less than the weighted value of 271.881 for each of the two original solutions. The three solutions that we have now found are shown in Table 2.4 and in Figure 2.37. We now repeat the process by examining the interval between (979,220) and (1,061,205) and the interval between (1,061,205) and (1,347,193). For the first interval we use w ■
7
(Ά,Ι
—
■^2,2
-7
-^2,1
-^1,2 ) + (-^2,2
—
^2,1 /
205-220 (979-1061)+ (205-220) = 0.154639
15 97
88
OPTIMIZATION
All solutions on the line connecting these two points have a weighted value of 337.3711. For the second interval we use W = -
7
r
-7
r
Ι,Ά,Ι ~ A,2 j + V 2,2 — "^2,1 )
193-205 6 ~ (1061-1347)+ (193-205) ~ 149 = 0.040268 All solutions on the line connecting these two solutions have a weighted value of 239.4698. In both cases, we fail to find a new solution. Minimizing the weighted distance plus displeasure using these two weights returns one of the two solutions that defined the line that determined the weight that was used. At this point, we have explored the entire solution space and we have found all of the solutions that we can find using the weighting method. The algorithm would stop at this point. Had we found another solution using either of one of these two weights, we would again have two unexplored segments to explore using two new weights.
89
90
OPTIMIZATION
MULTIPLE OBJECTIVE PROBLEMS
91
A serious word of caution is in order here. Many people—researchers, practitioners, and students—fail to compute the weights correctly. Instead, many people will use arbitrary weights. For example, they might use weights of 0, 0.1, 0.2,... ,1.0. The hope is that by using these weights, they will find a good approximation to the tradeoff curve. This presents two problems. First, this approach may simply skip, or fail to find, some of the important points on the tradeoff curve. Second, in some cases, such as this one, it requires more work. In the example above, we solved 5 shortest path problems to find the tradeoff curve shown in Figure 2.37. Using the arbitrary weights we would need to solve 11 shortest path
92
OPTIMIZATION
problems. In this case, we would have found the same tradeoff curve, but there is no guarantee of that in general. In short, it is always best to compute the true weights as outlined above and to use those values rather than any set of arbitrarily chosen weights.
2.8.5
Constraint Method
So what happened to the fourth point on the tradeoff curve shown in Figure 2.34? Why does the weighting method fail to find the solution with a distance of 1218 miles and a displeasure value of 203? How can we find that solution? First, let us consider why we cannot find that solution using the weighting method. The weight between the two surrounding solutions, (1,061,205) and (1,347,193) is 0.04026846, as shown in Figure 2.43. Any point on the line connecting these two solutions has a weighted value of 239.4698. However, the solution with a distance of 1218 and a displeasure of 203 has a weighted value of 243.9. Therefore, when we try to minimize the weighted sum of the objectives with a weight of 0.04026846, we will not find this solution; instead, the linear programming problem will return a weighted value of 239.4698 corresponding to one of the original two solutions used to find this weight. Solutions like this one that cannot be found using the weighting method are called non-supported solutions, while those that can be found using the weighting method are called supported solutions. So how can we find this solution? In general, how can we find the nonsupported solutions as well as the supported solutions? We do so using the constraint method, which proceeds as follows. In this discussion, we will assume that the second objective takes on only integer values. If it does not, we can always multiply by a large number (e.g., 100) and then use the rounded values as an approximation of the integer values to get an approximation of the objective function and of the tradeoff curve. For example, if the second objective is measured in miles and we are worried (for some reason) about missing solutions with values that differ from other solutions by a tenth of a mile, we can multiply all distances by 100 so that they are now measured in hundredths of a mile. The constraint method proceeds as follows. First, we minimize the first objective. We record the value of both objective functions. Let us call those values OBJ1 and OBJ2. We then constrain the second objective to take on a value less than or equal to OBJ2 - 1. We then minimize the first objective function subject to all the original constraints plus this new constraint on the value of the second objective. This effectively makes the previously found solution infeasible and forces the optimization model to return a new solution that differs from the previous one. We proceed in this manner until the optimization model tells us that there is no feasible solution. At that point, the most recently found solution corresponds to the best solution in terms of the second objective.
93
94
OPTIMIZATION
MULTIPLE OBJECTIVE PROBLEMS
95
96
OPTIMIZATION
MULTIPLE OBJECTIVE PROBLEMS
97
The constraint method will find supported and non-supported solutions, while the weighting method will find only the supported solutions. This being the case, why should we ever use the weighting method? The reason is that we often have some sort of algorithm or black box that solves the problem with one
98
OPTIMIZATION
objective. In the example above, there are several excellent algorithms for solving the shortest path problem. We can use any input data we want and the algorithm will do just fine. In particular, we can let the "distance" on any arc be a weighted sum of the real distance and the displeasure (and any number of other terms, such as the dollar cost of traveling on the arc, a penalty for using highways if the traveler wants to avoid highways, and so on). The shortest path problem will treat this new "distance" as a number and will do just fine. However, when we impose a constraint on one of the objectives, we change the underlying structure of the problem. Shortest path algorithms typically do not allow constraints on a second measure or metric of the path. Thus, using the constraint method frequently destroys the underlying structure of the problem. We will often need to use a different algorithm to solve the constrained problem.
Thus, the weighting method is often easier to use because we may well have a good method for solving the problem with one of the two objectives. The constraint method, however, is somewhat more powerful.
MULTIPLE OBJECTIVE PROBLEMS
99
100
MARK'S TEN RULES OF FORMULATING PROBLEMS
101
2.8.6 Multi-Objective Optimization Is a Natural for Genetic Algorithms As suggested above, genetic algorithms have been quite successful at solving difficult integer programming problems. They have been particularly useful for certain multi-objective problems, or problems in which we are trying to optimize two or more objectives simultaneously (Shen and Daskin, 2005). The goal of multi-objective optimization is to identify good tradeoff solutions between the various objectives. Any population of solutions will automatically give an approximation of the tradeoff curve between the objectives. This is well-illustrated in Figure 2.35, which shows the entire set of all 455 possible solutions to the problem of selecting 3 sites from among 15 to minimize the average and maximum distances.
2.9
MARK'S TEN RULES OF FORMULATING PROBLEMS
Formulating problems well is still more of an art than a science. There are often multiple formulations of a problem, all of which are technically correct. Of course, there are many more formulations that are wrong. This section provides 10 rules that should help you avoid some of the more common formulation mistakes that students, practitioners, and researchers often make in formulating problems. Rule 1: Clearly define all sets in words. I usually use upper-case letters to denote sets and I try to choose letters near the middle of the alphabet if possible. For example, set / may be the set of students and set / may be the set of seminars. It is important to note that any variable can be used as an index of a set. While we usually will use / to index the set / and j to index the set /, there is nothing that forces us to do so. In fact, there will be times when it is important or necessary to use some other variable to index a set. Nevertheless, sets should be clearly defined. Rule 2: Clearly separate the definitions of sets, other inputs, and decision variables. We have already seen some of this in the spreadsheets above in which we distinguished between inputs and decision variables. In defining notation for a problem, it is always a good idea to subdivide the notation section into subsections for the definitions of the input sets, the other inputs (constants and parameters), and the decision variables. All too many papers have been written in which the authors violate this rule, leaving the reader to wonder what the inputs are and what the decision variables are. Rule 3: In defining inputs or decision variables in words, if an index appears in the input or decision variable, it should appear in the verbal definition as well. For example, if an input is d¡¡, then the verbal definition should refer to / and to j , since the input is indexed by both of these indices. A proper definition of άή might be that άί; is the distance between customer site / e / and candidate location / € /. Note that the definition refers not only to the indices, but also to the relevant sets because the indices can be chosen arbitrarily. An improper
102
OPTIMIZATION
definition of d¡j would be one that simply says that d¡j is the distance. The reader is left wondering what distance is it? Between which locations are we measuring the distance when we refer to dtp. Rule 4: Do not leave dangling subscripts in the objective function. What do we mean by a dangling subscript? A dangling subscript in the objective function would be a subscript we do not sum over. For example, if we are computing the total cost of a solution and c¡¡ denotes the unit cost of serving customer i e / from candidate location j G J and X¡¡ denotes the amount of flow between candidate location j G J and customer / e /, then the objective function would be written as X X ^ y ^ / y Since the terms in the objective function depend on the indices i and j , we must sum over these indices in the objective function. An objective function written as ^c^X^ would be incorrect as it leaves the index / as a iel
dangling subscript. What should we be doing with this subscript in this objective function? Rule 5: At least some decision variable must appear in the objective function and in each constraint. Conditions on the inputs that we require for an algorithm to work correctly—for example, the condition assumed by many shortest path algorithms that all arc distances are positive—should not be stated as part of the constraints. This can be discussed in a paragraph related to the algorithm or it can be stated in the definition of the input. If there is no decision variable in the objective function or if a constraint fails to contain a decision variable, the formulation is incorrect. Rule 6: Be sure that all variables are linked in some way to each other. Otherwise, the problem is separable and you probably have an error in the formulation. To illustrate this, consider the maximal covering location problem. In this problem, we are given a set / of demand nodes and a set / of candidate locations. Associated with each demand node is / i s the demand at that node, h¡. If candidate location j e J can adequately serve demand node i e /, we say that the demand node is covered by the candidate location and we set an input a¡j = 1; otherwise, we set a¡¡ = 0 if candidate site j e J cannot adequately serve demand node i e I. (Note that this definition of service is based solely on inputs and not on decisions related to which other demands might be assigned to a facility at the candidate location. Thus, this definition of coverage does not generally deal with congestion at the facilities.) The problem is to select/) sites at which to locate to maximize the number of covered demands. We will define two classes of decision variables. Z, will be 1 if demand node i € I is covered by any of the selected sites and 0 if not. Similarly, X¡ will be 1 if we locate a facility at candidate site j e J and 0 if not. We might (incorrectly) formulate this as follows. Maximize
^_¡hiZi
(2.46)
iel
Subject to
^ X- — p jeJ
(2 47")
103
MARK'S TEN RULES OF FORMULATING PROBLEMS
Z,. e {0,1}
V/ e /
(2.48)
X¡ e {0,1}
V/ e /
(2.49)
On first glance, this seems fine. The objective function, (2.46), maximizes the number of covered demands. Constraint (2.47) states that we can locate only p facilities. Constraints (2.48) and (2.49) stipulate that the decision variables must all be binary. The objective and all of the constraints that we can readily state verbally have been translated into mathematical notation. What could be wrong? The problem is that the decision variables in the objective function, the coverage variables Z„ are not linked in any way to the location variables, X¡, which are used in the constraints. The solution to this problem, as stated, is to pick any p sites that we want for the facilities and to then assert that all demand nodes are covered by setting all Z, variables to 1. We need a constraint that links the coverage variables to the location variables. This constraint is
ζ,-Σ>,,*,<ο
v/E/
(250)
jt=J
This constraint says that we cannot count demand node / e / as being covered—we cannot set Z, = 1—unless we locate at one or more of the candidate locations that cover demand node ¿, or V a J f . > 1 . This constraint links the location variables and the coverage variables. However, each variable does not have to be linked directly to every other variable. Figure 2.54 depicts three possible ways of linking four classes of variables, W, X, Y, and Z. In part (a), each variable is linked directly to each other variable. In many problems, this suggests that the formulation is over-constrained and may well indicate a problem. In part (c), the first two classes of variables, the W and X variables, are linked to each other as are the Y and Z variables. However, there is no linkage between the W and X variables on the one hand and the Y and Z variables on the other hand. This sort of formulation is separable into two subproblems: one in W and X and a second subproblem in Y and Z. This generally indicates a problem in the formulation. In part (b), the variables are all linked to each other, but not necessarily directly. This is reminiscent of the song
Wr—;X
ιχι
Y
«—* z
(a) Over-constrained
W*
i
*X
i
z
Y
(b) Okay
W* Y
X
«—* z
(c) W,X are not Linked to Y,Z
Figure 2.54. Variable linkage
104
OPTIMIZATION
about the leg bone (W) being connected to the knee bone (X), the knee bone (X) being connected to the thigh bone (Y), and the thigh bone (Y) being connected to the hip bone (Z). Not every bone needs to be connected to every other bone in the body directly. We would be very strange looking creatures if this were so. However, every bone needs to be connected to every other bone through some sequence of bones (and other tissues including ligaments, tendons, and muscles). Similarly, every class of decision variables must be connected directly or indirectly to every other class of decision variables. Rule 7: If a variable or constant used in a constraint includes some index, then you must either (a) sum over the index or (b) specify the values of the index to which the constraint applies. You should not do both in the same constraint. This is best illustrated by some examples. In these examples, we do not really need to know the definition of the inputs or variables. Consider first, the following constraint.
Σχ.,=1
v¿e/
jeJ
The variables in the constraint are indexed by i and j . The constraint tells us to sum over the index j and that the constraint applies to all values of the index i in the set /. This constraint is fine. Next, consider the following (incorrectly stated) constraint:
This constraint is problematic. The indices i, j , and k are used in the constraint. We sum over the index j and the constraint applies to all values of the index / in the set /. What should we do with the index k, however? This is a dangling subscript and indicates an error in the formulation. Finally, consider the following constraint that is also problematic:
This constraint has two problems. The indices i and ; are used in the constraint. We are told to sum over all values of the index ; in the set J. Okay, so far. However, we are also told that the constraint applies to all values of the index j in the set /. Once we have summed over the index j in the set J, the constraint no longer depends on the index j . We cannot simultaneously sum over an index and indicate that the constraint applies to all values of the index! Also, we are not told what to do with the index i. This again is a dangling subscript. Rule 8: Try to keep the formulation linear if possible. As indicated above, we can solve very large linear programming problems. Once the problem becomes non-linear, we will encounter significant difficulties in solving the problem. Therefore, if at all possible, avoid multiplying decision variables together in the objective function or in the constraints. Also, avoid raising a decision variable to
MARK'S TEN RULES OF FORMULATING PROBLEMS
105
some power or raising a constant to a power that depends on a decision variable. Avoid taking the log of a decision variable or using decision variables in trigonometric functions. Often, we can avoid non-linearities—especially those that arise as a result of multiplying decision variables together—by transforming the problem in some way or by defining new variables that might be equal to the product of the original variables.
Rule 9: Avoid big-M type constraints if possible. A big-M constraint is one that uses a large constant (M) to enforce some condition. Typically, there will be an either/or condition that is being enforced using this constraint. Rule 10: Disaggregate constraints when possible. To illustrate rules 9 and 10, consider a location-allocation problem in which we must locate facilities at some sites within a set of candidate sites J and we must allocate demands in the set / to the facilities we locate. We will again define the decision variable X¡ to be 1 if we locate at candidate site j e J and 0 if not. Similarly, we will define Y¡¡ to be 1 if we assign demand node is I to a facility at location j e / , and 0 if not. If we locate at candidate site / e / , then we can assign any or all of the demand nodes to that site; if we do not locate there, then no demand nodes may be assigned to that site. The following simple constraint ensures that this occurs.
X^.<|/|* ; . v/E/ IE/
In this constraint the notation l/l denotes the cardinality of the set / or the number of elements in the set. This is simply the number of demand nodes. If we locate at candidate site j Ë /, the right-hand side of the constraint is simply equal to the number of demand nodes. In that case, the constraint says that we can assign as many demand nodes as we want to that site. If we do not locate at candidate site / e /, the right-hand side of the constraint is 0. In that case, we cannot assign any demand nodes to that site. While this constraint when coupled with an integrality constraint on the decision variables will ensure the condition we want to impose, this is a big-M constraint. (Actually, this is a big-l/l constraint, but we use the general terminology of big-M.) A better way to formulate constraints that impose this condition is to disaggregate the constraints as follows. Yij<Xj In this constraint, if we assign demand node i e assign demand node / e more constraints—and
Vie/Je/
do not locate at candidate site j e J, then we cannot / t o that location. If we do locate at / e /, then we can / t o that location. Although this seems to create a lot it does—the linear programming relaxation of this
106
OPTIMIZATION
problem (the problem we obtain by ignoring the integrality constraints on the decision variables) tends to give an objective function value that is much closer to the integer solution. In general, fewer of the location variables will be fractional using this approach. To see why, suppose a solution entails assigning 5 out of 20 demand nodes to some candidate site, j e / . The aggregate constraint would then allow X¡ = 0.25, thereby allowing more facilities to be located (if there is a constraint on the total number of sites used) or counting only { of the fixed cost of establishing the facility at candidate location / e J. The disaggregate approach, however, would ensure that X,■ = 1. These rules should help in formulating problems correctly and in structuring problems that can be readily solved with either the Solver in Excel, What's Best, or some other commercial optimization solver.
2.10
PROBLEMS
1. Consider the problem of scheduling employees to work during a 24-hour day. You have divided the day into six 4-hour segments beginning and ending at midnight. You have estimated the number of employees needed during each period to provide adequate customer service as shown in the table below. Employees work 8-hour shifts. Time
Number Needed
0-4 4-8 8-12 12-16 16-20 20-24
5 8 4 9 7 3
a) Assume that you have three shifts beginning at midnight (0 o'clock). In other words, the first shift works from 0-8, the second from 8-16, and the last from 16-24. How many employees do you need to meet the customer service requirements? b) Now assume again that you have three shifts, but instead of the shifts beginning at midnight, the first shift begins at 4 and ends at 12, the second begins at 12 and ends at 20 and the third begins at 20 and ends at 4 A.M. the following day. Assume further that each day looks identical so that the employees who started "last" night at time 20 are on duty for the first 4 hours of today. Now how many employees do you need? c) Finally, suppose we do not have rigid 8-hour shifts that start 8 hours apart. Rather, some employees will start at 0 and work for 8 hours, some at 4 and work for 8 hours and so on. Verify that the starting times given in the
107
PROBLEMS
table below ensure that the minimum staffing requirements are met. How many employees does this schedule utilize? Time
Number starting
0-4 4-8 8-12 12-16 16-20 20-24
8 0 5 4 3 0
d) What can you conclude about using rigid non-overlapping shift schedules if the objective is to minimize labor costs? 2. Show that a maximization objective can be written in canonical form. In other words, apply a suitable transformation to the objective to be maximized so that minimizing the resulting function is equivalent to maximizing the original function. 3. Show that a less than or equal to constraint can be transformed into canonical form through a suitable transformation. 4. Show that an equality constraint can be transformed into canonical form. Hint: Recall that an equality constraint is equivalent to two constraints, one of which constrains the function to be greater than or equal to a constant and the other constrains the function to be less than or equal to the same constant. 5. Show that a non-positive variable can be transformed into canonical form. 6. Show that an unconstrained variable can be transformed into canonical form. 7. Find a simple (one- or two-variable) linear programming problem such that: a) The primal problem is infeasible and the dual problem is also infeasible. b) The primal problem is infeasible and the dual problem is unbounded. c) The primal problem is unbounded and the dual problem is infeasible. 8. In the student-seminar assignment problem discussed in section 2.6, we minimized the average ranking of the students or the total of all student rankings. Suppose we are interested, instead, in assigning students so that the worst student-seminar assignment is minimized. In other words, it would be better to assign many students to second choices than to assign even one student to his or her third choice. Similarly, we would prefer many students being assigned to second and third choice seminars to assigning a single student to a fourth choice seminar. Such an objective makes sense because it is the parents of such students—those assigned to seminars they really did
108
OPTIMIZATION
not want—who are most likely to complain to deans and university presidents! a) How can you modify the costs in the network flow diagram shown in Figure 2.17 so that the resulting solution minimizes the worst-case assignment? b) How would you solve the hierarchical problem of first minimizing the worst-case assignment and second, from among all solutions which minimize the worst-case assignment, choose the solution that minimizes the average ranking of the students? 9. Find the maximum possible flow from Chicago to New Orleans for the network shown in Figure 2.18. 10. Explain why only the variables in C55:G59 of Figure 2.53 need to be constrained to be binary in the constraint method using the matrix approach to solving a multi-objective shortest path problem instead of all of the decision variables.
REFERENCES Chiang, W.-C, and R. A. Russell, 1996, "Simulated annealing metaheuristics for the vehicle routing problem with time windows," Annals of Operations Research, 63, 3-27. Cohon, J. L., 1978, Multiobjective Programming and Planning, Academic Press, New York, NY. Dantzig, G. B., 1998, Linear Programming and Extensions, Princeton University Press, Princeton, NJ. Eaton, D., M. S. Daskin, D. Simmons, B. Bulloch, and G. Jansma, 1995, "Determining emergency medical service vehicle deployment in Austin, Texas," Interfaces, 15, 1, 96-108. Erkut, E., and A. Ingolfsson, 2000, "Let's put the squares in least-squares," INFORMS Transactions on Education, 1,1, 47-50, http://archive.ite.journal.informs.org/VollNol/ Erkutlngolfsson/Erkutlngolfsson.pdf. Fourer, R., D. M. Gay, and B. W. Kernighan, 2002, AMPL: A Modeling Language for Mathematical Programming, Duxbery Press/Brooks/Cole Publishing Company, South San Francisco, CA. Gavirneni, S., L. Clark, and G. Pataki, 2004, "Schlumberger optimizes receiver location for automated meter reading," Interfaces, 34, 3, 208-14. Glover, F , 1989, "Tabu Search—Part I," ORSA Journal on Computing, 1, 3,190-206. Glover, F , 1990a, "Tabu Search—Part II," ORSA Journal on Computing, 2,1,4-32. Glover, F 1990b, "Tabu Search: A tutorial," Interfaces, 20,4,74-94. Glover, F , and M. Laguna, 1997, Tabu Search, Kluwer Academic Publishers, Boston, MA. Goldberg, D., (1989). Genetic Algorithms in Search Optimization and Machine Learning, Addison-Wesley, Reading, MA. Lawler, E. L., J. K. Lenstra, A. H. G. Rinnooy Kan, and D. B. Shmoys, 1985, 77;e Traveling Salesman Problem: A Guided Tour of Combinatorial Optimization, John Wiley & Sons, New York.
REFERENCES
109
Nemhauser, G. L., and L. A. Wolsey, 1988, Integer and Combinatorial Optimization, John Wiley & Sons, New York. Rubin, D. S., and H. M. Wagner, 1990, "Shadow prices: Tips and traps for managers and instructors," Interfaces, 20, 4,150-57. Shen, Z-J M , and M. S. Daskin, 2005, "Tradeoffs between customer service and cost in an integrated supply chain design framework," Manufacturing and Service Operations Management, 7, 3,188-207. Winston, W.L., and M.Venkataramanan,2003, Introduction to Mathematical Programming— Operations Research: Volume One, 4th ed., Thomson Brooks/Cole, Pacific Grove, CA. What's Best, 2010, Version 10.0, Lindo Systems, Chicago, IL, www.lindo.com.
3 QUEUEING THEORY
Ellen had been waiting in line at the bank for a good 10 minutes. Fortunately, the wait was not overly painful as she really enjoyed looking at the modern art hanging on the walls behind the bank officers in their little cubicles. Still, 10 minutes seemed to her to be a long time just to make a simple deposit and to get some cash from her account. It seemed that the line was simply not moving. Two of the three tellers were nowhere to be seen; they seemed to have disappeared in the middle of serving the two gentlemen who were now waiting and getting visibly upset themselves. Normally, she would have done her banking business at the ATM, but only one of the three had been working and it too had a long line. Today, it seemed everything was going wrong.
3.1
INTRODUCTION
In many ways, the design and operation of service systems is all about finding the appropriate balance between the resources devoted to a system and the demands placed on the system so that the quality of service to the customer is as good as possible. Queueing theory allows us to predict the quality of service, Service Science, by Mark S. Daskin Copyright © 2010 by John Wiley & Sons, Inc 111
112
QUEUEING THEORY
measured in a variety of ways, as a function of both the demands on the system and the service capacity that has been allocated to the system. Ellen's waiting time would have been significantly less than it was had all three ATMs been working or if the people ahead of her had not required such long and complicated service. A queue is a line for service. We are all familiar with queues from our everyday experiences. When we call a doctor, we may be placed in a queue until the receptionist can answer our call. If we need to see a doctor, we usually must wait in the doctor's office until we can be seen. When we go to a grocery store, we must join a queue to pay for our food. We wait for buses in cities and for lights to change when we drive our cars. When we phone in to a call center, we often have to wait for the next available customer service agent. When we have our car inspected at a vehicle emission testing center, we sometimes have to wait for service. There are clearly some service systems for which we hope never to wait. If our house is on fire, we do not want to be put on hold when we dial 911 and we certainly do not want to be told, "Thank you for calling your local fire station. All available units are busy now. Please remain on the line and your call will be answered in the order in which it was received." Similarly, we have grown accustomed to virtually instant service on the Internet and even short delays in downloading a web page are now perceived as annoying. At first glance, we might be tempted to argue that if the average service capacity, measured for example in terms of the number of customers per hour that a system can handle, exceeds the demand placed on the system, measured also in terms of customers per hour, then queues should not form. In the remainder of this section, we will explore this hypothesis using a simple example. Consider a small doctor's office with a single physician. Patients are scheduled for appointments every 20 minutes from 8:00 A.M. until 4:40 P.M. On average, the doctor spends 18 minutes with each patient. We would expect the doctor to have 2 minutes off after every patient and no one would have to wait for service. In fact, this is exactly what happens, provided all goes perfectly well. Unfortunately, all is not likely to go as well as planned. To see this, we can simulate the doctor's office in Excel. The simulation will examine the operation of the office for 365 days and compute the average time that patients wait between when they arrive and when they get to see the doctor. Each day the office opens anew and so the first patient does not have to wait at all for service. See Doctor Simulations.xls in the online appendix.
What can go wrong and why would patients have to wait? First, suppose the doctor does not spend exactly 18 minutes with each patient. Rather, she spends more time with some patients who seem to need more care and less time with others. Clearly, if you arrive just after a patient who needs considerably more than the average time of 18 minutes, you are likely to have to wait. Thus, one of
113
INTRODUCTION
the factors that we will examine is the impact of variability in the service time, the time a patient spends with the doctor, on the average time that patients wait for service. Specifically, we will look at two distributions of service time. (The reader is encouraged to consult the online Appendix B for a review of probability.) The first is the uniform distribution. We will let the distribution of service time be uniform between its average minus some spread value to the average plus the spread value. Thus, the width of the uniform distribution will be two times the spread value. The second service time distribution will be a triangular distribution that slopes down from the average minus a spread parameter value to zero at the average plus twice the spread parameter. These two distributions are shown in Figure 3.1 below for a value of 5 minutes for the spread. Note that both distributions shown have the same average of 18 minutes. If service times are uniformly distributed, there is a probability of 0.3 that a service time will exceed the 20 minute time interval between customer arrivals. If service times follow the triangular distribution, the probability of exceeding the 20 minutes allotted to each patient is slightly less (0.2844), but there is a chance of very long times, up to 28 minutes. We can also show that the variance of the triangular distribution shown in Figure 3.1 is 1.5 times the variance of the uniform distribution. Clearly, service times in excess of 20 minutes are likely to cause the subsequent patient to have to wait. In addition to variability in the time the doctor spends with each patient, some patients will arrive a bit early and some will arrive a bit late. Those who
Figure 3 . 1 . Sample service time distributions
114
QUEUEING THEORY
arrive early are likely to have to wait for the doctor and those who arrive late are likely to cause subsequent patients to have to wait. We will allow actual patient arrival times to vary about the scheduled time according to a uniform distribution. Finally, we will look at variations in the average time that the doctor spends with the patient. If the doctor spends 18 minutes with each patient, we would expect her to be busy about 90 percent of the time. If the average time drops to 15 minutes, the doctor will be busy about 75 percent of the time. At 19.5 minutes per patient, the doctor will be busy roughly 97.5 percent of the time. The third factor we will analyze is the impact of changing the average time the doctor spends with the patient, or the doctor's average utilization. We will look at three key performance metrics: the average waiting time to see the doctor for all patients, the average waiting time for those who have to wait, and the fraction of patients who have to wait. Figure 3.2 shows the impact of service time variability and changes in the average service time on the waiting time a patient experiences, assuming all patients arrive exactly at their scheduled time. The uniform service time distribution was used in this case. When there is little variability in the service times (small spread values) and when the service time is small relative to the time between patient arrivals (20 minutes), few if any patients have to wait. However, as the variability increases and as the average time with the patient goes up, the average waiting time increases quickly.
Figure 3.2. Effect of average service time and service time variability on patient waiting time with patients arriving exactly as scheduled
INTRODUCTION
115
Not all patients will have to wait. Figure 3.3 shows the average waiting time for those who do have to wait. The waiting time conditional on having to wait shows the same relationship to the average service time and the spread in service time shown by the waiting time averaged over all patients. Note that the average time given that you have to wait is larger than the average over all customers, as expected. Figure 3.4 shows the percentage of patients who have to wait for service. This too exhibits similar trends. Note that patients have to wait even if (a) the average service time is less than the time between patient arrivals and (b) the customers arrive exactly as scheduled. Variability in the patient arrival times introduces another cause of delays. As indicated above, patients who arrive early are likely to have to wait themselves and those who arrive late are likely to cause subsequent patients to have to wait. Figure 3.5 shows the average waiting time over all patients if patients arrive uniformly with a spread of 5 minutes about their scheduled appointment time. Notice that now there is some small chance of waiting and a correspondingly small (but positive) average waiting time even when the average service time is 15 minutes and there is no variability in the service time distribution! To see how this can happen, consider a patient who is scheduled for an 8:00 A.M. appointment. If he arrives 4 minutes late, he will finish service at 8:19. If the next patient, scheduled for 8:20 arrives 3 minutes early, she will have to wait 2 minutes to see the physician. Also note that the average waiting time is greater in this case than it was when patients arrived exactly as scheduled, the case shown in Figure 3.2.
Figure 3.3. Effect of average service time and service time variability on patient waiting time for those who wait with patients arriving exactly as scheduled
116
QUEUEING THEORY
Figure 3.4. Effect of average service time and service time variability on the percentage of patients who have to wait for service with patients arriving exactly as scheduled
Figure 3.5. Effect of average service time and service time variability on patient waiting time with patients arriving uniformly about the scheduled appointment time
INTRODUCTION
117
Finally, we examine the impact of increased variability in the service time distribution in Figure 3.6. This corresponds to the same case as Figure 3.5 except that the service time distribution is now triangular. As before, waiting time increases dramatically with increased variability (spread) in the distribution and with increases in the average service time, despite the fact that the average service time is always less than the average time between patient arrivals. The increase in service time variability, coupled with the small likelihood of very long service times—up to 31.5 minutes when the average time is 19 and the spread is 6—further increases the average waiting time. Figure 3.7 shows the average waiting time given that a patient has to wait. Note that there is a broad range of the input conditions in which those who do wait have to wait more than 6 minutes on average. The values reported above are averages over all customers, or over all customers who have to wait at all. In fact, many patients will have to wait considerably longer than the average. For example, when the average time is about 8 minutes (the case of an average service time of 19.5 and a spread parameter of 6 in Figure 3.6), nearly one in five patients will have to wait over 15 minutes. Clearly, these are likely to be the least satisfied of the doctor's patients, at least in terms of waiting time. This example illustrates a number of principles of queueing. First, waiting and delays can occur even when the average service capacity exceeds the average demand. In fact, such delays are common. Second, variability in either the time
Figure 3.6. Effect of average service time and service time variability on patient waiting time with patients arriving uniformly about the scheduled appointment time, using a triangular service time distribution
118
QUEUEING THEORY
Figure 3.7. Effect of average service time and service time variability on patient waiting time for those who wait with patients arriving exactly as scheduled, using a triangular service time distribution
between customer arrivals or the service time produces these delays. Finally, the likelihood and magnitude of the delays increase sharply as the load on the system—the product of the average demand per hour to the average service time measured in hours—increases. Before delving more deeply into queueing theory, let us see how simple queueing models can be used to design simple systems. Consider the problem of determining the number of parking spaces that are needed at a large shopping mall. If cars arrive at the lot according to a Poisson process at a rate of 1200 per hour (20 cars arriving every minute on average) and people stay at the mall for exactly 3 hours, how many spaces should be built to be 99 percent sure that the lot will not be full? At first glance, one might imagine that if 1200 cars arrive every hour and people stay for three hours, we would need only 3600 spaces. This, of course, would not be correct as it ignores the variability in the number of vehicles that actually arrive in one hour. With Poisson arrivals at a rate of 1200 per hour, there is about a 50:50 chance that there will be more than 1200 vehicles arriving in a given hour. This means that there is about a one in eight chance that we will have 3 successive hours with more than 1200 vehicles arriving in each of those hours. That would clearly result in our running out of spaces; and there are many other conditions under which we would run out of spaces with only 3600 spaces. In fact, the probability of running out of room in the parking lot is about 0.5 when we have only 3600 spaces.
WHAT IS QUEUEING THEORY?
119
Maybe we need a LOT more spaces. Maybe 6000? Maybe 7000 are needed to be 98 percent sure we do not run out of space. Again, this is not so. Designing a parking facility with this many spaces would be overly costly and would use far too many spaces. If cars arrive according to a Poisson process and they stay exactly 3 hours, then the number of vehicles in the lot follows a Poisson distribution with a mean of 3600 vehicles. The Poisson distribution with a mean of 3600 is nearly normal with a mean of 3600 and a standard deviation of 60. There is only about a 2 percent chance of a normal random variable taking on a value more than about 2 standard deviations above the mean. This means that if we use 3720 or 3600 + 2(60) spaces, we can be about 98 percent sure that we will not run out of spaces. (In fact, we need 3723 spaces, using the Poisson distribution.) This means that the reserve number of spaces should be about 3.4 percent of the average number needed in this case. Is this really enough spaces? Is this really the right service criterion? If there is one space available, do we really want customers to have to hunt among over 3700 spaces to find that one available space? Without a very advanced system capable of identifying empty spaces to vehicles as they enter the parking facility, this criterion is likely to result in a lot of frustrated customers. Another way to look at this is to consider partitioning the lot into K regions, perhaps 20 regions. Within each region, we might ask that there be enough spaces so that customers arriving randomly at each region will have a 98 percent chance of finding a parking space. With 20 regions, the number of vehicles in each region would follow a Poisson distribution with a mean of 180. To be 98 percent sure that there are enough spaces in each such region, we would need 208 spaces per region, or 4160 spaces overall. But, if the probability of finding a space in each region is 0.98, the probability that there will be a space in each of the 20 regions is 0.9820 = 0.667. To ensure that we have a probability of 0.98 of finding a space throughout the garage, we need the probability in each of the 20 regions to be e ln ( a98)/20 = 0.99899. This means we need 223 spots in each region of 4460 spaces overall. This is 24 percent more spaces than the average number needed. Clearly, we need to be careful about how we specify the service standard even in this simple case.
3.2
WHAT IS QUEUEING THEORY?
Having established that delays can occur even for systems whose average characteristics suggest that queueing should not happen, we now turn to a more formal approach. The results shown above were derived using simulation. While simulation is a useful technique for complex systems, it suffers from three key drawbacks. First, simulation can be expensive in terms of both a programmer's time and computer time. Developing and validating a simulation model is difficult and time consuming even in the best of circumstances. Second, the output of a simulation model—be it the average waiting time or the fraction of customers waiting
120
QUEUEING THEORY
longer than a target value or the average number of people in the system—is, itself, a random variable and is subject to uncertainty. Running the same simulation again with different random numbers will produce different results. Thus, the output of a simulation model should be analyzed statistically to be sure that the results of two simulation runs under different conditions are truly different in a statistical sense. For example, we might want to simulate the checkout lines at a large grocery store. Key questions would be (i) how many express lines to have, (ii) what the cutoff should be in terms of purchase size to qualify for the express lines, and (iii) how many full-service lines should be utilized. Recognizing that the output of any single simulation run with specified conditions is a random variable, we would need to use careful statistical analysis to determine if one set of conditions results in performance levels that are significantly different from those obtained under different conditions. Third, unless a simulation is run many times (as was the case in section 3.1), a few simulation runs may not be sufficient to see clear trends in the performance metrics as a function of the input conditions (e.g., the variability in service times). To resolve these problems, we turn to queueing theory. Queueing theory is concerned with the mathematical description of queues or waiting lines. Two basic approaches to queueing theory have developed: models based on fluid approximations (e.g., [Newell, 1971]) and probabilistic queueing analysis. This chapter, and the rest of this book, concentrate on the latter, which has received the bulk of the attention to date. In simplistic terms, the fluid approximation approach is a deterministic view of queues and is particularly useful in analyzing queues in which the average arrival rate exceeds the average service rate for extended periods of time. Probabilistic queueing theory, as its name implies, adopts a stochastic view of queues and is most useful in analyzing queues in which the arrival rate is less than the service rate for extended periods of time. Queueing theory, be it deterministic or stochastic, requires several inputs. As indicated in section 3.1, we need to characterize the arrival process as well as the service process. A more complete list of the inputs required for a queueing model includes: a) A description of the way in which customers arrive at the system. This is termed the arrival process. Of particular interest is the distribution of the time between customer arrivals. b) A description of the way in which customers are served, or the service process. Of particular concern are estimates of the mean and variance of the time needed to serve a customer as well as the actual probability distribution of the time needed to serve a customer. c) The number of servers. d) The maximum number of customers that can be in the system. e) The size of the pool of customers. f) The way in which waiting customers are chosen for service, or the service discipline.
WHAT IS QUEUEING THEORY?
121
Inputs (a), (b), and (c) are always needed. Kendall has developed a standard notation for these inputs. The notation is written as X/Y/Z where X and Y are letters used to describe the arrival and service processes respectively, and Z is an integer (which may be °o) stating the number of servers. To be more specific, X and Y are used to describe the probability distributions used in modeling the interarrivai times and service times of customers. Frequently used symbols include: M Ek
HE D G, GI
Exponential distribution. As shown in the online Appendix B, exponential interarrivai times correspond to Poisson arrivals. Erlang-k distribution. Recall that an Erlang-1 distribution is an exponential distribution and that the Erlang-k distribution is the sum of k independent identically distributed exponential distributions. Hyperexponential distribution. Deterministic. Any general distribution with a finite mean and variance. GI is usually used for arrivals and denotes general independent; G is usually used for service times. In both cases, we assume that successive interarrivai or service times are independent random variables.
Thus, for example, an MlMil queue is a single server queue with Poisson arrivals and an exponentially distributed service time distribution. An M/Ek/1 queue also has a single server, Poisson arrivals, but an Erlang-k service time distribution. An M/M/s queue is characterized by Poisson arrivals, exponentially distributed service times, and s servers. Finally, by way of example, an MIGI°° queue has Poisson arrivals, any general service time distribution (with a finite mean and finite variance), and an infinite number of servers. In much of this chapter, we will be concerned with queues that have Poisson arrivals (or exponentially distributed interarrivai times) and exponentially distributed service times. Queues with Poisson arrivals and exponentially distributed service times are known as Markovian queues. The key reason to focus on Markovian queues is that the exponential distribution has the memoryless property (as shown in the online Appendix B).The memoryless property significantly simplifies the modeling of a queue because it means that we do not need to know, for example, how long it has been since the last customer arrived at the queue if the interarrivai times are exponentially distributed. If the mean time between arrivals is 10 minutes, the conditional distribution of time until the next customer arrives given that it has been 8 minutes since the last customer arrived is still exponential with a mean of 10 minutes. Customer arrivals are often well-modeled by Poisson arrivals or exponential interarrivai times.
122
QUEUEING THEORY
Similarly, if we model a restaurant by using exponentially distributed service times (times people spend at a table), we do not need to know how long a group has been at a table. The additional time a group spends at the table, if the total time is exponentially distributed, is also exponentially distributed with the same parameter. While this simplifies the modeling, it is clearly not a very reasonable assumption in many cases. For example, if we know that a family of four was seated an hour ago at a local pizzeria and that the average time that a group of four spends dining at the restaurant is 1.25 hours, the additional time the family will spend at the restaurant is probably not 1.25 hours. Rather, it may be closer to half an hour. (In fact, if the distribution of time at the table is actually an Erlang-5 distribution with A = 4, the additional time given that the group was seated an hour ago is 33 to 34 minutes.) While many queues are not truly Markovian, the insights that we can derive using Markovian queues typically extend to non-Markovian queues. The minimal set of outputs of a queueing model include: a) The mean number in the system (in the queue or line and in service) b) The mean number in the queue (waiting for service) c) The mean time in the system or in the queue In some cases, we will be interested in additional outputs including the distribution of time that a customer spends either in the system or in the queue. We may also be interested in the distribution of time between departures from the queue.
3.3 KEY PERFORMANCE METRICS FOR QUEUES AND LITTLE'S LAW We can establish a number of key relationships between the input quantities and the key outputs. To do so, we define the following quantities: L Lq W Wq A μ 1 —
μ
average number of customers in the system average number waiting to be served average time in the system average time in the queue waiting to be served average arrival rate average service rate average service time
We also let a(t) d(t) N(t)
number of people to arrive at the system in time [0, t] number of people to depart from the system in time [0, /] number of people in the system at time t. Note that N(t) = a(t) - d(t).
KEY PERFORMANCE METRICS FOR QUEUES AND LITTLE'S LAW
123
These quantities are shown graphically in Figure 3.8. The total number of person-minutes of time in the system is given by the area between a(t) and d(t). That is, let €(i)
total accumulated person minutes during interval [0, i]
and i
ΐ(ή = ΐΝ(τ)άτ =
ι
\[α(τ)-ά(τ)]άτ.
£(t) The average waiting time in the interval [0, t] is —— = W (i) and the average a(t) Ht) number in the system is —— = L(t) ■ So,
t)jMJM»M. t
a{t)
t
Taking the limit of (3.1) as t -> <», we have WmL{t) = L
Ht) „,
ι->~α(ί) hm
/-»»
t
A.
Figure 3.8. Relationship between arrivals and departures
(3<1)
124
QUEUEING THEORY
So L = XW.
(3.2)
This is known as Little's Law and it holds under very general circumstances. We can similarly show that Lq=Wq
(3-3)
and L=XW=k-,
μ
where Ls is the average number in service and Ws is the average service time. Finally we also have, W = W„+-,
(3.4)
or the average time spent in the system is the sum of the average time spent waiting for service to begin plus the average service time. Equations (3.2) through (3.4) are critical because they imply that if we know any one of the four quantities—L, Lq, W, or Wq—we can determine the other three quantities using these four equations. Note, also, that we did not make any assumptions about the interarrivai or service time distributions in deriving these equations. Thus, while our (initial) focus in this chapter will be on Markovian queues, these equations apply well beyond the regime of exponentially distributed interarrivai times and service times.
3.4
A FRAMEWORK FOR MARKOVIAN QUEUES
A Markov process is a stochastic process in which the conditional probability of being in any state at some future time given the present and past states equals the probability of being in the state in the future given only the present state. That is, the past history of the system does not provide any information needed to predict future states. In particular, for our purposes, the state of the system will typically describe the number of customers in the queue, though in some of the more advanced systems we consider, a different description of the state of the system will be needed. A stochastic process is Markovian if the probability of being in some future state (e.g., there being five people in the system) depends only on the state of the system now (e.g., there being six people in the system). The future probabilities do not depend on how we arrived at the current state. Furthermore, for a system to be Markovian, the time that we have spent in the current state is irrelevant in terms of predicting when we will leave that state (or the state to which we will transition next). In this section, we develop a general framework for analyzing Markovian queues. We know that the exponential distribution is a memoryless distribution.
125
A FRAMEWORK FOR MARKOVIAN QUEUES
What this means, again, is that if the service time is exponentially distributed with a mean of 15 minutes, then knowing that the current customer has been in service for 12 minutes (or even for 20 minutes) tells us nothing about the conditional additional time the customer will spend in service. The mean conditional additional time is still 15 minutes and the additional time the customer will spend in service is also exponentially distributed. Thus, if the service times are exponentially distributed and the interarrivai times are exponentially distributed (meaning we have Poisson arrivals), then both the arrival and service processes exhibit the memoryless property. Such systems are Markovian. Before beginning this development, we need to review one additional feature of the exponential distribution. We do so by considering Poisson arrivals with an arrival rate A. The probability of no arrivals in a small amount of time Δί is P(N(At) = 0) = e-^' ~l-ÁAt
+ o((Atf),
where ο((Δί)2) are terms of order (Δί)2 or smaller. For small At we have P(N(At) =
0)~l-AAt
Ρ(Ν{Αή = 1) « ÁAt P(N(At) > 1) = 0. In other words, the probability of two or more Poisson events in a sufficiently small amount of time is essentially 0 and we can ignore this possibility. Similarly, if service times are exponentially distributed with a mean of ί/μ, the probability of two or more service completions in a very small amount of time is also 0, while the probability of no service completion is 1 - μΑί and the probability of exactly 1 service completion is μΑί. We will begin by developing general equations that govern the state of the system as it evolves over time. Initially, we will let both the arrival rate and the service rate depend on (i) the number of people in the system and (ii) time. Specifically, we will let A„(i) μ„(ί)
(Poisson) arrival rate with n people in the system at time t service rate with n people in the system at time t
Then we can write, letting /¡(f) be the probability of being in state i at time t, / , 0 ( ί + Δί) = [1-Α 0 (ί)Δί]Ρ 0 (0 + [μ 1 (ί)Δί]Ρ 1 (0
(3.5)
Ρ ί (ί + Δί) = [λ / . 1 (ί)Δί]/ΐ. 1 (ί) + [l-Xi(t)At][l-ßi(t)At]Pi(t) + [μΜ(ήΑί]ΡΜ(ή i = 1,2,...
(3.6)
and
Equation (3.5) states that the probability of being in state 0 with no one in the system a very short time from now is equal to (i) the probability that the system
126
QUEUEING THEORY
is in state 0 now and no customer arrives plus (ii) the probability that there is one customer in the system and that person finishes his or her service during the very short time. Equation (3.6) states that the probability that the system is in state i a very short time from now is equal to the sum of (i) the probability that the system is in state i-l now and there is one arrival during the very short time, (ii) the probability that the system is in state i right now and there are no arrivals or service completions during the short interval of time, and (iii) the probability that the system is in state i + 1 right now and there is one service completion during the short interval. If we bring P,(i) to the left-hand side of (3.5) and (3.6) and divide by At, we have
At i?(r + AQ-J>(0 At
-λΜΡΜ-μΜΡΜ +μι+ι(ήΡΜ(ή
+ λΜμΜΡΜΔί
i = 1,2,...
Taking the limits as At —> 0, we have dP0(t) = -λΰ(ήΡΰ(ή dt
dm
+
μι(ήΡί(ή
(3-7)
= λ,_ 1 (ί)^_ 1 (0
-[m+u(t)]m +μι+ι(ήΡί+1(ή
i = 1,2,...
(3 8)
'
Equations (3.7) and (3.8) are known as the Chapman-Kolmogorov equations. For any state of a Markovian queue, they give us the rate at which the probability of being in that state changes as a function of time. Note that we have not said anything about the number of servers in the system. We have only implicitly assumed that we have a potentially infinite number of states. Equation (3.8) can readily be modified in a straightforward manner if we have a finite number of states. Such systems would arise if there is finite capacity for customers to queue, as in a call center with a limited number of lines, or a finite number of servers with no queueing allowed, as in a parking garage, or in systems with a finite population, as in the case of a service facility that repairs specialized equipment such as aircraft. In this case, the number of states is limited by the size of the population being served. We will use equations (3.7) and (3.8) directly in section 3.7 when we develop a numerical procedure for computing the state of the system at any point in time. In the next section, we use these equations to derive a general formula for the
A FRAMEWORK FOR MARKOVIAN QUEUES
127
steady-state (long run average) state probabilities when we assume that the arrival and service rates do not depend on time.
3.4.1
Steady-State Balance Equations
Our primary concern in queueing theory will be with estimating the long run average performance of the system. To do this, we will need to assume that both the arrival and service rates do not depend on time. Thus, we will have A,(f) = A, and μ;(ί) = μ at all times t. What this means is two things. First, the system is assumed to operate for an infinitely long period of time. For practical purposes, this is often not a problem because we only really require that any current conditions (the arrival rate, the service rate, the number of servers) persist for a long period of time relative to the time between service completions and customer arrivals. A more technical description of this condition is beyond the scope of this text. However, in section 3.7 we relax this condition. Second, this assumption tends to preclude systems that close for business at the end of the day, as the arrival rate clearly drops to 0 when the service facility is closed. Also, shortly after the facility opens, any arriving customers are unlikely to have to wait for service, whereas later in the day customers may frequently wait. Thus, such systems may never attain steady-state operations. The key insights about queueing systems that we obtain from the steady-state analysis, however, are likely to carry over to systems that do not satisfy the restrictive assumptions needed for steady-state modeling. Furthermore, we will be interested in the system after any initial transient conditions have died out. Mathematically, this means that we are interested in the systems when P¡(t) = Pi and — ' — = 0 for every state / and for every time t. dt Therefore, we can rewrite (3.7) and (3.8) as follows: β = -λϋΡ0+μχΡλ
(3-9)
0 = Α;_1/>_1-(Α,.+μ,.)/>+μ,+1/>+1
i = 1,2,...
Solving (3.9) for Pi in terms of P0 P
=^P
Let us now write (3.10) for i = 1. λ0Ρ0+μ2Ρ2 = (A, + μχ)Ρχ = (A, + μ1)^-Ρ0 ßl
or n AnA, μ2Ρ2=^^Ρ0οτΡ2= A*i
AnA, -2-± Ρ0. thth.
/*1
=^Ρ0+λ0Ρ0
(3.10)
128
QUEUEING THEORY
Let us generally assume that
IK
Pi=Jf—P0
(3.11)
IK
We can now verify this by showing that it holds for ;' + 1 given that it holds for state;'. Rewriting (3.10) and isolating the terms related to state; + 1 and utilizing h i the fact that P, - ——P ,, we have
—
}
!
Ρ
So, dividing both sides by μ/+1, we obtain A , A,
Pi+i=-LL-LPj-i
λ λ ϊϊλ y-i
^ + ι γ[μ.
IK
ικ
= -£Ξθ ;+l
r
o
( 3 · 12 )
P M>>
1=1
which is the result we expected from (3.11). Equation (3.11) combined with the condition
¿¿W ;'=o
(3.13)
enable us to compute the state probabilities for all states. From these quantities, we can compute the key performance measures. For example, we have
7=0
129
A FRAMEWORK FOR MARKOVIAN QUEUES
and
where s is the number of servers. Before discussing some of the more common examples of the use of equation (3.11), we will show two alternate approaches to developing the steady-state balance equations (3.9) and (3.10). Consider the state transition diagram shown in Figure 3.9. In this figure, X¡ and μ, may be thought of as the rates at which we move from state j upward or downward respectively. In steady state, the rate at which probability flux or flow leaves state j must equal the rate at which probability flux or flow enters state /. In Figure 3.10, we isolate state / (y = 1, 2,...). The rate of probability flux out of the dashed circle must equal the rate into the circle, resulting in Rate out = rate in (A,. + μ, )P¡ = XhlPhl
+ μμιΡ)+ι
j = 1, 2,...,
which is identical to equation (3.10). Similarly, for state 0, we have Λ)^0
=
M\P\i
which is identical to equation (3.9).
oooooc M2
M,
M5
MA
• · · M6
Figure 3.9. State transition diagram
Äj-
Äj
Figure 3.10. Isolating state; to consider the probability flow in and out of the state
130
QUEUEING THEORY
Figure 3.11. Cutting between two states to consider the probability flow to the right and left of the cut
An alternative approach is to consider an imaginary slice between states j and / + 1 (/ = 0,1,...) as shown in Figure 3.11. In steady state, the net rate of probability flux across any such cut must be zero. This implies, Rate to the right = Rate to the left λ^
= μί+ιΡί+ι.
(3.14)
But (3.14) simply says P
A, =—— P
;' = 0 1
Mj + 1
which agrees with (3.12).
3.4.2
Applications of the Basic Model
In this section, we show how equation (3.11) can be applied to a variety of Markovian queueing problems. As indicated above, we will assume that the arrivals follow a Poisson process (meaning that the interarrivai times are exponentially distributed) with rate A per unit time and that the service times are independent, identically distributed, exponential random variables with parameter μ, or mean service time ί/μ. 3.4.2.1 The M/M/1 Model. We begin with the Ml Mil queue, which has Poisson arrivals, exponentially distributed service times, and a single server. For this system, the state transition diagram is shown in Figure 3.12. This results in the following state-dependent arrival and service completion rates. A,.=A μ,=μ
Vi vi
Note that in this case, there is actually no state-dependence at all. Then
131
A FRAMEWORK FOR MARKOVIAN QUEUES
μ
μ
μ
Figure 3.12, State transition diagram for the ΜΙΜΙλ queue
P=^-P0=p'P0 μ'
Vy,
(3.15)
where λ .,. . p = — = utilization ratio.
μ
The utilization ratio measures how intensely the server is used. For the example of the doctor's office outlined above, the utilization ratio would be computed as the arrival rate (A = 3 patients per hour) times the mean service time (in hours). For the case of the mean service time of 15 minutes, the mean service time in hours is 0.25 hours. Thus, the utilization ratio would be 0.75 = 3(0.25). With patients arriving every 20 minutes (3 per hour on average) and service times averaging 15 minutes, we would expect the physician to be busy about 75 percent of the time as indicated by the utilization ratio. Combining equation (3.15) and the condition that the probabilities must sum to 1, (3.13), we have
¿P0p> = lor Poly =1. /=0
y=0
For p < 1 we have V
l
i
;=0
ί
- I
or /,o=l-p ^=(1-P)P;
7 = 0,1,2,...
(3-16>
These are the M/M/l queue state probabilities. Note that this is a geometric distribution. We therefore have:
^iiP^PoiiP1
=(ΐ-Ρ)Σ>' ^ - ^ Τ Γ ^ Τ Γ ^
(3Λ7)
132
QUEUEING THEORY
provided p < 1. We can then derive „,
L
W =W--
1A 1
1
=— μ μ(\-ρ)
P ?-£-= p(l-p) μ(1-ρ)'
(319) ^ ^
L? = A W „ = - ^ . (3.20) 1-ρ The condition p < 1, needed to derive equations (3.16) through (3.20), is known as the steady-state condition. It says that the arrival rate must be strictly less than the service rate if steady-state conditions are to hold. If p > 1, the queue grows without bound. This is a key point that we demonstrated and discussed at length in section 3.1. Note that equations (3.17)-(3.20) all are proportional to .As the utilization ratio, p, approaches 1.0, performance gets very bad. This is illustrated below in Figure 3.13. Note that the system performs very well as long as the utilization ratio is less than about 0.8. Between 80 and 90 percent utilization of the service facility, service begins to degrade. Service degrades very rapidly as the utilization ratio goes above 0.9. For example, consider a single toll booth that can serve 360 people (cars) per hour, or one every 10 seconds, on average. We have the values shown in Table 3.1. Note that if the arrival rate is 300 cars per hour (f of the capacity) it takes a minute, or 60 seconds, to get through the toll, on average. If the arrival rate
Figure 3.13. Performance vs. utilization for an ΜΙΜΙλ queue
133
A FRAMEWORK FOR MARKOVIAN QUEUES
TABLE 3.1. Example performance for a simple toll booth Arrivals per hour λ 120 180 240 270 300 330 345
Times in seconds P
L
W
wq
Lq
0.333 0.500 0.667 0.750 0.833 0.917 0.958
0.5 1 2 3 5 11 23
15 20 30 40 60 120 240
5 10 20 30 50 110 230
0.167 0.500 1.333 2.250 4.167 10.083 22.042
increases by 10 percent, it takes 2 minutes on average. At 345 cars per hour, it takes 4 minutes to get through the toll. Can you hear the complaints to the state government yet? Now let us compute the variance of the number in the system, denoted by Var{N) ναΓ{Ν) =
Σ?ΡΓϋ
and
ΣΉ
P+P (i-p)2
;=o
using (A.9) and the state probabilities given by (3.16). So, the variance of the number in the system is given by Var{N) =
Zi2P,-L2
_ P+P2
(I-P) 2 P
LI-PJ
(I-P) 2 As expected, this agrees with the variance of the geometric distribution given in (B.26) after substituting p = 1 - p. Note that the Var(N) goes up even faster than does L as p approaches 1.0. To continue with the example, Table 3.2 shows how the variance and standard deviation of the number in the system grow as the utilization ratio (shown in the second column) increases. Note that the standard deviation of the number in the system is approximately equal to the number in the system itself. Actually, for the M/MIl queue,
134
QUEUEING THEORY
TA B L E 3.2. Increases in the variance and standard deviation of the number in the system as the utilization ratio increases λ
P
L
120 180 240 270 300 330 345
0.333 0.500 0.667 0.750 0.833 0.917 0.958
0.5 1 2 3 5 11 23
Var(N)
Std(N)
0.75
0.866 1.414 2.449 3.464 5.477 11.489 23.495
2 6 12 30 132 552
we can show that the standard deviation of the number in the system will always slightly exceed the average number in the system. Now let us compute the probability of finding m or more people in the system. This is given by P(m or more in system) = ^ ( l - p ) p ; Pm
= Pm
(i-p)
and in particular P(l or more) = P(wait) = p. We can also compute the probability density function of the time in the system. To do so, we will now have to make one additional assumption. In particular, we will assume that customers are served using a first-come-first-served (FCFS) queue discipline. In other words, customers are served in the order in which they arrive. If you arrive to find m people ahead of you, which occurs with probability (1 - p)pm, your time in the system will be the sum of m + 1 independent, identically distributed (iid) exponential random variables, or will have an Erlang m + 1 distribution. The moment generating function (MGF) of an Erlang m + 1 distribution (with parameter μ) is x «i+l
μ-θ) as shown in the online Appendix B, equation (B.91).Therefore, the unconditional MGF of the time in the system is
135
A FRAMEWORK FOR MARKOVIAN QUEUES
m+1
_(ί-ρ)μ μ-θ
1 ί__ρμ_ μ-θ μ-θ μ-θ-ρμ
(1-ρ)μ μ-θ
(1-Ρ)μ (Ι-Ρ)μ-Θ
But this is just the MGF of an exponential distribution with parameter (1 - ρ)μ. Therefore, for an MlMil queue with an FCFS queue discipline, the time in the system is exponentially distributed. We have /w(^) = (l-p)Aíe" (1 " p)í " v (μ-λ)κ = {μ-λ)β-(μ-λ),χ
">0 w>0,
...^Α
(3.21)
which has a mean of 1 W- (1-ρ)μ
1 μ-λ
in agreement with (3.18). We can use (3.21) to determine the probability that the time in the system exceeds some value, since the cumulative distribution of the time in the system for the M/M/Í queue with an FCFS queue discipline is Fw{w) = l-e-{l-p)>,w
w>0.
Returning to the example of the small toll booth, if the arrival rate is 300 cars per hour or 5 per minute, Table 3.1 shows that the average time in the system is 60 seconds. However, as shown in Table 3.3, more than one in eight cars will spend more than two minutes in the system and one out of every 20 will spend 3 or more minutes in the system. Similarly, if you arrive to find m people ahead of you, m > 1, your waiting time has an Erlang-m distribution. The probability of m people ahead of you, P P. = —- = (1-p)p' l, j= 1, 2,.... conditional on m> 1 is — P(\ or more in the system) p So the MGF of the waiting time conditional on at least one ahead of you is
X(i-p)p/->Ui- =(i_ p )¿p/UL· £ί
\μ~θ)
Ρ,
\μ-θ
y+i
(1-Ρ)μ (Í-P)μ-Θ,
as before. Therefore, the unconditional probability distribution of waiting time is
^W-L'-A).*·*
Sȕ
<3 22)
·
136
QUEUEING THEORY
with a mean of
w= "
p
μ(1-ρ)
=-P~,
μ-Α'
as in (3.19). Note that (3.22) is a mixture of a discrete distribution and a continuous density function. There is a probability mass of (1 - p) associated with no waiting at all (wq = 0) and a continuous exponential density function associated with strictly positive waiting times. This exponential density function has a parameter (μ - A) and is itself weighted by the probability of waiting, p. As before, we can use (3.22) to find the probability that a car will wait more than a given time before being served (getting into the toll booth) in our simple toll booth example. For example, as shown in Table 3.3, there is about a 1 in 25 chance of waiting more than 3 minutes before getting to the front of the line when A = 300 and μ = 360. Finally, let us consider the distribution of times between departures from the system. To do so, we need to consider two cases: a) If the system is empty, the time until the next departure is the sum of an exponential random variable with mean 1/A (the time until the next arrival) plus the service time, which is exponential with mean 11μ. In this case, the MGF of the time until the next departure is (
)(
).
b) If the system is not empty, the time until the next departure is exponential μ with mean l/μ and the MGF of this time is simply ( ).
TABLE 3.3. Probability that the time in the system and the waiting time exceed a given value for A = 300 and μ = 360 vehicles per hour Time (sec), w
Prob (time in system > w)
Prob (waiting time > w)
60 75 90 105 120 135 150 165 180 195 210 225 240
0.368 0.287 0.223 0.174 0.135 0.105 0.082 0.064 0.050 0.039 0.030 0.024 0.018
0.307 0.239 0.186 0.145 0.113 0.088 0.068 0.053 0.041 0.032 0.025 0.020 0.015
137
A FRAMEWORK FOR MARKOVIAN QUEUES
So the unconditional MGF of the time until the next departure is (1-P)
λ-θ
μ μ-θ
+ (l-p)
λ{μ-λ) (λ-θ)(β-θ) λμ-λθ ~(λ-θ)(μ-θ) λ ~ λ-θ'
μ
μ-θ)1-ρ
λ(μ-θ) (λ-θ)(μ-θ)
This means that the inter-departure times are exponential or the departure process is Poisson with a mean rate λ, just like the arrival process. Note that while it should not be surprising that the mean arrival rate and the mean departure rates are equal (since what goes into the queue in the long run must come out), what is perhaps more surprising is that the distribution of the departure process is the same as the distribution of the input process for this queue. This result is most useful in modeling a series of queues. Burke (1956) has shown that this holds for an Ml Mls queue. In both cases, there can be no limit on the number in the system for this result to be true. 3.4.2.2 M/M/1 Queue with a Restricted Queue Length. Suppose now that we limit the number in the system to M. In other words, the state transition diagram is as shown in Figure 3.14. From the state transition diagram, it is clear that the state dependent arrival and service rates are
λ = μ„
λ η = 0,1,...,Μ-1 0 η = Μ,Μ + Ι,... β
η = ί,...,Μ
0
η = M +1,
Then Ρί=Ρ*Ρ0
λ
7 = 0,1,..·, M
λ
(4>\>4/* fc μ
μ
μ
μ
μ
μ
Figure 3.14. State transition diagram for the /W//W/1 queue with a restricted queue length
138
QUEUEING THEORY
by equation (3.12) and by (3.13) we have
P
V 1-P )
so l
P-
P=(1-y
-P
, = !,...,M
and £ .(l-p)p¡ =
p[l-{M
é7i-PM+1=
+
l)pM+MPM+1]
(ΐ-ρ)(ι-ρΜ+1)
'
This is clearly messy. Table 3.4 below gives values of L for various values of M and p. The results in Table 3.4 raise several important points. First, as p goes up, the average number in the system goes up. As M goes up, L approaches that of an M/M/l queue (as shown in the final column) with no restriction on the queue length. This is true as long as the utilization ratio is less than 1. When there is a restriction on the number in the system, we do not require p < 1 for steady state conditions. If p > 1, the M/M/l results no longer apply, but the results for the queue with a restricted number in the system can still be computed. For p > 1, the average number in the system rapidly approaches M, the maximum number
TABLE 3.4. Average number in the system as a function of the utilization ratio, p, and the maximum number in the system, M
M, maximum number in system P
1
2
3
10
100
1000
M/M/l
0.1 0.3 0.5 0.7 0.9 1.1 1.3 1.5 1.7 1.9
0.09 0.23 0.33 0.41 0.47 0.52 0.57 0.60 0.63 0.66
0.11 0.35 0.57 0.77 0.93 1.06 1.17 1.26 1.34 1.40
0.11 0.40 0.73 1.07 1.37 1.62 1.82 1.98 2.12 2.22
0.11 0.43 0.99 2.11 3.97 5.94 7.32 8.13 8.60 8.90
0.11 0.43 1.00 2.33 9.00 90.01 96.67 98.00 98.57 98.89
0.11 0.43 1.00 2.33 9.00 990.00 996.67 998.00 998.57 998.89
0.11 0.43 1.00 2.33 9.00 n/a n/a n/a n/a n/a
139
A FRAMEWORK FOR MARKOVIAN QUEUES
in the system. Second, for small values of p, the limit on the number in the system has little effect; as p goes up, the effect of M increases. To compute W, we need the effective arrival rate, XefS. Note that when there are M customers in the system, any additional arrivals are turned away or lost. So, (1-P)P* -^{i-PM)-λ 1
Ka =λ =λ
l-pk 1-p
M+l
1-P* l-pM
Now, W =
L _l-{M l
eff
+ l)pM +Mp" μ(1-ρ)(ΐ-ρΜ)
and Wq=Wλ
μ
^ = Λ· The equations above assume that p Φ 1. For p = 1, we get the following revised equations: 1 M +\ 1 M +\ M
j = 1,..., M i
¿=Σ; ;=o Μ + ί Kg W
Μ_ ~2
M 1 = λ Μ + \. Μ +1 MÍM + 1 j _ 1 Μ + ί T i M 'λ λ 2
-λ{ΐ-ρΜ)-λ 1L "'ff
w=w-
1 μ
=νη
1ÍM + 1 λ M
M
Ύ~ Μ + \
_1 μ
140
QUEUEING THEORY
For a queue with a restricted number in the system (or equivalently, a restricted queue length), there is a tradeoff between (a) increasing the fraction of all arrivals that are served (or minimizing the number of customers who arrive and find that they cannot even wait in line) and (b) decreasing the average waiting time in the system. To see this, consider a simple phone system at a doctor's office that may be characterized by an M/M/l queue with a limited number in the system. The limit on the number in the system results from there being a limited number of phone lines at the doctor's office. The receptionist may have three lines, for example. Thus, she can be talking to one person while another two are on hold. If a fourth patient calls during the time that two are on hold, that person simply gets a busy signal. Such a person cannot join the queue and we assume that the person is lost to the system. Figure 3.15 illustrates this tradeoff for a case of λ = 0.45, μ = 0.5, and p = 0.9. This is a situation in which the average time the receptionist spends with a patient is 2 minutes and people phone in at a rate of 27 per hour. While this might seem high, we might find such values for a single receptionist serving a practice composed of four or five doctors. As we increase the number of lines or the maximum number of patients who can be on hold at any one time, the average time in the system actually increases! Why would a physician want to add lines if, after doing so, patients have to wait longer to talk to the receptionist? The reason is simple. As the number of lines increases, more and more people can get through to the receptionist and fewer and fewer get a busy signal.
Figure 3.15. Average time in the system goes up with the number of lines but more people can be served
A FRAMEWORK FOR MARKOVIAN QUEUES
141
3.4.2.3 M/M/s Queue. We now turn our attention to a simple multi-server queue, the M/M/s queue, with Poisson arrivals, exponentially distributed service times, and s identical servers. There are two possible ways for the waiting line to operate for such a system. First, customers could line up behind each server and (generally) remain in that line until their service is completed. This is the way most grocery stores operate, at least in the United States. This is not the way in which our M/M/s queue will operate. This form of operation is essentially a set of s independent M/M/l queues, each with an arrival rate of AJs. In this section, when we refer to an M/M/s queue, we mean a system in which there is a single waiting line and the person at the front of the line is served by the next available server. This is the way many airline check-in systems operate and is also the way most passport control centers operate at airports. This system is illustrated in Figure 3.16. The figure shows a system with 5 = 3 or three servers (shown as squares). Each server is occupied in the diagram by a customer (depicted as a circle). Four additional customers are waiting for service. The first customer in the waiting line will proceed to the first server who completes his or her service. For such a system, the state transition diagram is shown in Figure 3.17. This leads to the following values for the state-dependent arrival and service completion rates λη=λ ίημ μη -\ ysß
η = 1,2,..., s n = s,s + l,...
Figure 3.16. Schematic of an M/M/s queue with three occupied servers and four customers waiting for service
Figure 3.17. State transition diagram for the M/M/s queue
142
QUEUEING THEORY
Substituting these relations into equation (3.11), we get
μ/μ)η Ρ=·
Ρ0
η = 0,1,..., s
(λ/μ)" Ρ 0 Isis!*"-
η =s +1,...
ni
(3.23)
Combining the state probabilities with the normalizing condition (3.13), we obtain an explicit expression for the probability of the system being empty, P0 0
—
[γ(ΑΜ,(ΑΜ ,1 = _ρ0
y!
s\
Π -1
χμ -λ_
or equivalently,
^(λ/μΥ —0
)\
^λ/μΥ^λΊ s\
—^μ
si
$μ-Α
'ψ (λ[μί (λ/μΥ sR " for ■<1,
Ψ the steady state condition. We can also derive
/>(wait) = ¿ P ; = A f - ^ | / > s\
^5·μ-λ
and L =
λμ
(λ/μΥ
(s-l)!(sM-A)
P.
2 * 0n
(3.24)
Note that in this case, it is easier to derive the average number of people waiting for service, Lq, than it is to derive the average number in the system, L. The reason for this is that deriving L would entail using two different forms of the state probabilities (3.23), one form for states ;' = 0, ... , s and a second form for states j = s + 1, s + 2 , . . . . In deriving the average number waiting for service, Lq, we need only use the state probabilities for states y = s + 1, j + 2 , . . . . As before, we can use (3.2), (3.3), and (3.4) together with (3.24) to find the mean time waiting for service, Wq, the mean time in the system, W, and the average number in the system, L.
143
A FRAMEWORK FOR MARKOVIAN QUEUES
Note that if s = 1, we have
μμ-λ_\
L
μ-λ
μ-λ
+λ
J
= 11
λ
μ
= 11-ρ
and
L
9
HJM-A
(μ-λ)
2
μ
A2
μ(μ-λ)
Α ' / μ ' p2
(μ-λ)/μ
1-ρ
which agree with (3.16) and (3.20), respectively. To illustrate the use of the MlMis queue, consider an airline check-in counter with six customer service agents. The mean service time is — = 2 minutes, so μ μ = 0.5. On average, each customer service agent can serve 30 passengers per hour. Therefore, with six servers, we require λ < 6 · 30 = 180 for steady state conditions to be attained. Table 3.5 shows the key performance metrics as the arrival rate increases from a low of 18 per hour up to nearly 180 passengers per hour. Figure 3.18 shows the mean time in the system and the mean time waiting for service for this system as a function of the utilization ratio, Α/(χμ). The utilization ratio gives the expected fraction of time that each server or customer service agent is busy. TABLE 3.5. Example performance of an MIMI6 queue with a mean service time of 2 minutes λ (per λ (per minute) hour) 0.30 0.60 1.20 1.50 1.80 2.10 2.40 2.70 2.85 2.87 2.88 2.90 2.92 2.93 2.95 2.97 2.98
18 36 72 90 108 126 144 162 171 172 173 174 175 176 177 178 179
μ
λΐμ
0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5
0.60 1.20 2.40 3.00 3.60 4.20 4.80 5.40 5.70 5.73 5.77 5.80 5.83 5.87 5.90 593 5.97
A/s/i 0.1000 0.2000 0.4000 0.5000 0.6000 0.7000 0.8000 0.9000 0.9500 0.9556 0.9611 0.9667 0.9722 0.9778 0.9833 0.9889 0.9944
Po
¿,
0.5488 0.0000 0.3012 0.0004 0.0903 0.0266 0.0490 0.0991 0.2948 0.0260 0.0132 0.7839 0.0061 2.0711 6.6611 0.0021 16.4462 0.0009 18.9219 0.0008 0.0007 22.1119 0.0006 26.3732 0.0005 32.3487 0.0004 41.3242 0.0003 56.2996 0.0002 86.2749 0.0001 176.2501
w,
W (min)
L
(min) 0.0000 0.0007 0.0222 0.0661 0.1638 0.3733 0.8630 2.4671 5.7706 6.6007 7.6689 9.0942 11.0910 14.0878 19.0846 29.0814 59.0783
2.0000 2.0007 2.0222 2.0661 2.1638 2.3733 2.8630 4.4671 7.7706 8.6007 9.6689 11.0942 13.0910 16.0878 21.0846 31.0814 61.0783
0.6000 1.2004 2.4266 3.0991 3.8948 4.9839 6.8711 12.0611 22.1462 24.6553 27.8786 32.1732 38.1821 47.1908 62.1996 92.2082 182.2168
144
QUEUEING THEORY
Figure 3.18. Example time in the system and in waiting for an M/M/6 queue with a mean service time of 2 minutes
Note that the mean time in the system is always exactly 2 minutes more than the time a passenger spends waiting in the line for service by a customer service agent. More importantly, note that as long as the utilization ratio is less than about 0.8, the time spent waiting for service is very small. As the utilization ratio increases beyond 0.8, the waiting time increases dramatically. For example, for a utilization ratio of 0.8, the expected time waiting for service is less than 1 minute. When the utilization ratio increases to 0.9—an increase of only 18 passengers arriving per hour—the mean waiting time increases to roughly 2.5 minutes. When the utilization ratio increases to 0.95 (another 9 passengers per hour), the average time goes up to about 5.75 minutes. Passengers wait in the line nearly half an hour if the utilization ratio is 0.99. It is interesting to note how much better the system becomes as we add customer service agents. For example, suppose the arrival rate is 175 per hour. Table 3.6 shows the performance of the system as a function of the number of customer service agents. Adding one extra agent above the number needed for steady state conditions decreases the average waiting time in the queue from 11 minutes to under 1 minute. The expected waiting time in the queue can be reduced to almost 0 by adding four extra agents, bringing the total number of agents to 10.
145
A FRAMEWORK FOR MARKOVIAN QUEUES
TABLE 3.6. Performance measures as a function of the number of agents
Agents 6 7 8 9 10
λ (per λ (per minute) hour) 2.92 2.92 2.92 2.92 2.92
175 175 175 175 175
μ
λ/μ
λΐεμ
Wa (min)
0.5 0.5 0.5 0.5 0.5
5.83 5.83 5.83 5.83 5.83
0.9722 0.8333 0.7292 0.6481 0.5833
0.0005 32.3487 11.0910 13.0910 38.1821 0.0020 2.7931 0.9576 2.9576 8.6265 0.0026 0.8595 0.2947 2.2947 6.6929 0.0028 0.3167 0.1086 2.1086 6.1500 0.0029 0.1218 0.0418 2.0418 5.9552
W (min)
The probability of having to wait is simply the probability that a customer will arrive to find all of the servers busy. Thus, we have F (wait) = P(a\\ servers are busy) = Ύ\Ρ,
(λ/μΥ(
εμ
ςμ-λ
If you arrive to find n + s people in the system, then you have to wait for n + 1 service completions. The time between service completions, when all servers are occupied, is exponentially distributed with parameter χμ. Thus, the moment generating function of the time that you wait before being served, given that you arrive to find n + s people in the system is ( m . The moment generating function of the time that you wait for service conditional only on having to wait is given by $μ-θ P(wait)
n Σ
1
(λ/μ)"Ρ0
¿μ-θ
(λ/μΥΡ0 s·!
I
sis
n-s
*μ
ίμ-Α
φ - 1 γ ί ¿μ Ψ ^Χϊμ-θ ' ί μ - Α Υ ϊμ i, *μ Λίμ-θΐ^εμ-θ) ςμ-λλί ίμ
λ_ ςμ
χμ Α$μ-Θ)^0^μ-Θ ί μ - Α Υ 5·μ ^ 1 ςμ )\3μ-θ).. A χμ-θ χμ-Α *μ-θ ςμ ςμ ςμ-θ )\$μ-λ-θ χμ-Α 5μ - A - θ
'λΥ" {ζμ)
146
QUEUEING THEORY
But this is simply the moment generating function of an exponential distribution with parameter ςμ - λ. So, for the MlMls queue, the distribution of waiting time before being served is given by
I \_J1_p(wait)
f», K ) - |p( W ait)( Sj u- A)e-(*"-*K
w
o=0
Wq
> 0.
(3 25)
·
As in the case of the distribution of waiting time for the Ml Mil queue, given by equation (3.22), this is a combination of a probability mass function, with a mass at wq = 0, and a density function for wq > 0. We can use the distribution of waiting time for service (3.25) to find the probability that a passenger will have to wait more than a given amount of time. Table 3.7 shows the probability of having to wait more than a given number of minutes for the airline check-in problem outlined above when we have 175 passengers checking in per hour, a mean time per passenger of 2 minutes, and six servers. While the average waiting time is 11.1 minutes, the probability of having to wait more than this time is 0.367. In fact, about one in seven people will have to wait more than twice the mean time. The probability of waiting 30 or more minutes is 0.076. We can also compare the performance of an MIMIs queue with arrival rate A to that of an MIMI1 queue with arrival rate λ/s. In other words, we can ask whether a single line feeding s customer service agents is better or worse than individual lines of customers waiting for each of the s agents. Table 3.8 returns to the airline check-in example. The arrival rate increases with each row of the table. The left-hand portion of the table shows the results for an M/M/6 queue. As expected, the number in the system, the time in the system, and the
TABLE 3.7. Probability of waiting more than a given time for an MM/6 queue with 2.92 arrivals per minute (or 175 per hour), and a mean service time of 2 minutes Time, w
F(wait > w)
10 12 14 16 18 20 22 24 26 28 30
0.402 0.340 0.288 0.244 0.206 0.175 0.148 0.125 0.106 0.090 0.076
A FRAMEWORK FOR MARKOVIAN QUEUES
147
TABLE 3.8. Comparison of an MIMI6 queue with an ΜΙΜΠ queue with i the arrival rate MIM/6 queue p
λ (per hour)
0.100 0.200 0.400 0.500 0.600 0.700 0.800 0.900 0.950 0.956 0.961 0.967 0.972
18 36 72 90 108 126 144 162 171 172 173 174 175
L
0.6 1.2 2.4 3.1 3.9 5.0 6.9 12.1 22.1 24.7 27.9 32.2 38.2
MIM/1 queue
W (min) Wq (min) λ (per hour)
2.0 2.0 2.0 2.1 2.2 2.4 2.9 4.5 7.8 8.6 9.7 11.1 13.1
0.0 0.0 0.0 0.1 0.2 0.4 0.9 2.5 5.8 6.6 7.7 9.1 11.1
3.0 6.0 12.0 15.0 18.0 21.0 24.0 27.0 28.5 28.7 28.8 29.0 29.2
L
0.1 0.3 0.7 1.0 1.5 2.3 4.0 9.0 19.0 21.5 24.7 29.0 35.0
W (min) Wq (min)
2.2 2.5 3.3 4.0 5.0 6.7 10.0 20.0 40.0 45.0 51.4 60.0 72.0
0.2 0.5 1.3 2.0 3.0 4.7 8.0 18.0 38.0 43.0 49.4 58.0 70.0
number in the queue all increase as the arrival rate increases. The righthand portion of the table shows the results for a single M/M/Í queue with onesixth the arrival rate of the M/M/6 queue. This represents the case in which passengers join a queue and remain in that queue until they are served, even if another queue is moving faster or is even empty with an idle server. As in the case of the M/M/6 queue, the performance metrics all degrade as the arrival rate increases. More importantly, however, we notice that for any arrival rate (any row of the table) the time in the system for the M/M/Í queue as well as the waiting time for service for the M/M/Í queue exceed the corresponding expected time for the M/M/6 queue. Figure 3.19 compares the total time in the system for the two queues. Clearly, having a single line, as in the case of the M/M/6 queue, reduces both the waiting time and the time in the system. In addition, a single line eliminates the perception that some other line is moving faster. It also eliminates the possibility of someone arriving after you arrive, beginning his or her service before you begin your service as long as people are served in the order in which they arrived. Maintaining an FCFS queue discipline across multiple lines is virtually impossible. It is not surprising then, that the single line approach is used extensively in airline check-in operations, airport security processing, immigration processing at airports, waiting lines at amusement parks, and so on. Finally, note that the equations for the M/M/s queue are rather messy and involve a rather difficult formula for computing P0, the probability that the system is empty. We can approximate the performance of this system using the following equation:
148
QUEUEING THEORY
Figure 3.19. Comparison of the time in the system for an M/M/6 queue and an ΜΙΜΙΛ queue with \xh the arrival rate
n
ϊ
'
(3
·26)
where p = —. To see how well this approximation works, consider an M/M/5 queue with 1 1 30 1 λ = 500 arrivals per hour and — = 30 seconds (or — = = hours). The F v μ μ 3600 120 ' exact formulas yield 22.4 seconds for the waiting time in the queue, while the approximation yields 23.0 seconds. If we consider an M/M/9 queue with twice the arrival rate, the exact formula yields 34.2 seconds while the approximation yields 34.4 seconds. 3.4.2.4 M/M/oo Model. We now turn to a queue with Poisson arrivals, exponentially distributed service times, and an infinite number of servers. An infinite number of servers! Why would we ever care about having an infinite number of servers? In fact, just about everyone reading this book has experienced a service system with an infinite number of servers, and most have done so within days (if not hours) of the time they are reading this book. How can we possibly have an infinite number of servers? The key is to begin thinking about the other name for this queue, the "self-service queue." As we will see below, and
149
A FRAMEWORK FOR MARKOVIAN QUEUES
as should be relatively clear from the fact that we have an infinite number of servers, the waiting time for service in this queue should be zero. For all practical purposes, the Internet operates as an infinite server queue. Waiting times for downloads, particularly on high speed lines, are virtually zero. Internet users serve themselves. They decide which sites to explore and which products to order online. Other queueing systems should also operate as infinite server systems with little or no waiting time. How often have you been asked to wait for the next available fire company when you call the fire department? How would you feel if the local ambulance service told you that all available paramedics were busy serving other patients and asked you to hold for the next available medical team? It was exactly this insight that enabled Fitzsimmons (1973) to develop a Computerized Ambulance Location Logic (CALL) model. Having established that many systems operate as if they had an infinite number of servers, we now turn to modeling such a system. The state transition diagram for an M/M/<=° queue is shown below in Figure 3.20. The state-dependent arrival and service rates are given by: λη=λ Substituting these relations into (3.11), we obtain
fPo P, = wn<
„ =(U , 2 ,....
If we combine this with the normalizing condition (3.13), we find
Using (A.14), we find that
À
À
A
À
À,
M
2μ
3μ
Αμ
5μ
Figure 3.20. State transition diagram for an M/M/°o queue
150
QUEUEING THEORY
SO
P.-WrtV» „ = 0 , u , . . .
(3.27)
L =-
(3.28)
n\ But, (3.27) is nothing more than the Poisson probability mass function (B.48) with parameter λ/μ for which we know that
λ
μ
Thus, the average time in the system for an M/M/oo queue is simply the mean 1 service time. Therefore, since W =W—, the mean time waiting for service is μ 0, as expected. Similarly, we have Lq = 0. In fact, we can show that the steady-state distribution of customers in an M/G/oo queue, in which the service time distribution has a mean of l/μ and a finite variance, is also given by (3.27) and so the mean number in such a system is given by (3.28). 3.4.2.5 M/M/s Queue with No Waiting. We now turn to an important variant of the M/M/s queue, one in which there is no capacity for waiting. Such a queueing model is appropriate for services such as parking garages in which there are a limited number of parking places, and vehicles are not admitted to the garage once the facility is full. An M/M/s queue with no waiting would also apply to a small call center in which the number of customer service agents equaled the number of incoming lines. Again, in such a system customers who call when all agents are busy answering other calls would get a busy signal and would not be admitted to the system. Figure 3.21 shows the state transition diagram for this queue. The statedependent arrival and service rates are given by λη=Χ μη=ημ
n = 0,l,2,...s-l n = l,2,...s.
(3.29)
A
A
A
A
A
μ
2μ
3μ
(s-1)//
sß
Figure 3.21. State transition diagram for an M/M/s queue with no waiting room
151
A FRAMEWORK FOR MARKOVIAN QUEUES
Substituting (3.29) into (3.11), we obtain
P, = ^ P
J=
0
o,i,...,s.
(3.30)
If we combine this with the normalizing condition (3.13), we find 1
p0 =
(3.31)
Substituting (3.31) into (3.30), we find
p
i =
(W
j = 0,1,..., s.
(3.32)
We can use (3.32) to derive p
■
^
(3.33)
A/! where p = λΐμ. As in the case of the MIMIl queue with finite capacity, we need to compute the effective arrival rate:
λΣ Xeff -
'-
7!
(3.34)
à/!
As expected, since there is no capacity to wait, we find W
L
1
\ff
μ
wq = o
(3.35)
Lq=0.
For example, consider a small parking lot with 10 spaces and an average stay 1 of — = 2 hours or a - 0.5. In this case, we obtain the results shown in Table 3.9. μ As in the case of the MIMIl queue with finite waiting capacity, we do not require A < sß - 5, since we have a finite queue. Also note that Xeff = λ{ί - P(full)}.
152
QUEUEING THEORY
TABLE 3.9. Example results for an /W/M/10 queue with no waiting capacity λ (per hour)
L
P(full)
p = λΐμ
1 2 3 5 7 10 20
2.00 3.98 5.74 7.85 8.72 9.24 9.69
3.82E-05 0.005 0.043 0.215 0.377 0.538 0.758
2 4 6 10 14 20 40
Again, as in the case of the MIMI°° queue, it turns out that equations (3.33), (3.34) and (3.35) hold for an MIGIs queue with no waiting area, where — = £ (service time). Note that as s —» °° we get the results for the M/G/oo queue, as expected. Equation (3.32) is known as Erlang's Loss Formula.
153
KEY RESULTS FOR NON-MARKOVIAN QUEUES
3.5
KEY RESULTS FOR NON-MARKOVIAN QUEUES
The results above apply if the service times and inter-arrival times are exponentially distributed. Assuming Poisson arrivals, or exponentially distributed interarrival times, is often not a bad assumption. However, service times are often not exponentially distributed. The exponential distribution has two key features that make it disturbing as a service time distribution. First, as noted above, it is memoryless. This means that the distribution of time until the current customer completes service is independent of how long that customer has been in service. For example, it means that knowing that on average a barber takes 20 minutes to cut a man's hair and that the current patron has spent 15 minutes having his hair cut, tells you nothing about how much longer the current customer will take to finish his haircut. The conditional additional time is still 20 minutes. In fact, this is unlikely in this case and in many other cases. The fact that a particular surgery normally takes 90 minutes and that the current patient has been in the operating room for 1.75 hours (or 105 minutes) should suggest that the surgery is likely to end soon. The second problem with the exponential distribution is that the coefficient of variation of the exponential distribution, the ratio of the standard deviation to the mean or expected value, is 1.0. This represents what is often viewed as a highly variable or spread out distribution. Most service time distributions do not exhibit such a large degree of variability. With these two problems in mind, this section presents results for non-Markovian queues. We begin with the simplest such queue, the M/G/l queue in which the service times can follow any general distribution with a finite mean and variance. For this queue, we can show (Clarke and Disney, 1970; Gross and Harris, 1985) that the mean number in the system is given by L = p +
P+A*
2(1-P)
(3. 3 7 ) l
'
where p = XE{S), E(S) = l/μ is the expected service time, and σ 2 is the variance of the service time distribution. We can use this in conjunction with (3.2), (3.3), and (3.4) to find the mean waiting time in the system, the mean waiting time for service, and the mean number waiting for service.
154
QUEUEING THEORY
As in the case of the MlMil queue, equation (3.37) assumes that the utilization ratio, p, is less than 1. Also, note that, as in the case of the MlMil queue, the performance metrics degrade significantly as the utilization ratio approaches 1. Finally, note that the performance degrades as the variance of the service time distribution increases. Equation (3.38) gives the waiting time in the queue (before service) for the M/G/l queue. "
2 2 P +,WjW)^ 2A(l-p)
2(l-p)
For the MlMil queue, we have σ2 = \ and so W M/M/1 = — - ^ = -B—.-. 4 μ2 2Α(1-ρ) 1 - p μ For the MIDI! queue, we have σ2 = 0 and so 2
WMIMH
l
ψΜ/D/i _ — K __F _ —i i n other words, the waiting time in the « 2 A ( l - p ) 1 - p 2/x 2 queue for a single server system with deterministic service times is exactly half the waiting time in the queue for a similar system with exponentially distributed service times. Similarly, the average number waiting for service in a single server queue with deterministic service, L%IDIX, will be exactly half the number waiting for service, ¿ζ/Μ/\ in a system with exponentially distributed service times. Queues with coefficients of variation of the service time distribution between 0 (the M/DIl case) and 1 (the M/M/l case) will exhibit average performance levels between the levels exhibited by these two systems. In short, service time variability hurts, as shown before. To further emphasize this point, consider applying (3.38) to the M/Ek/1 -. queue for which σ 2 = —r-. 2 kß k
M¡E ¡\ _ ^
W.
ρ2+λ2(
1 Ί( 1 ϊ ·kß2)_p2[i+k)
2Α(1-ρ)
(3.39)
2Α(1-ρ)
Clearly, the waiting time in the queue before service decreases as k increases, or as the service time becomes less and less variable. As k approaches infinity, the service time distribution approaches a deterministic distribution and (3.39) reduces to the expected waiting time for the MIDI! queue given above. When the arrival process is not Poisson and the service times for a single server again follow a general distribution, we can approximate the waiting time in the queue before service by: W' =
'c2+c^
1 1-ρ)μ
(3.40)
155
SOLVING QUEUEING MODELS NUMERICALLY
where
μ
p c2
c2
is the mean service time as before, is the utilization ratio or XIμ where λ is the arrival rate, is the squared coefficient of variation of the inter-arrival time distribution (the variance divided by the square of the mean), and is the squared coefficient of variation of the service time distribution.
Once we have the value of the waiting time in the queue, we can get the other three key measures of queueing performance (L, W, and Lq) quite readily. Note that for the MlMil queue, we have c2 = c2 = 1 and so this equation boils down
w
» <-iñ
—, which is the exact result for the M/M/l queue. Also note that μ
for the MIDI! queue, we have c2 = 1 and c2 = 0, so W„ =\ —^-— — as shown
'
{ΐ-ρ)2μ
using (3.38). Finally, we can also approximate the GIlGIs queue performance as follows: W "
J£«1£L\.P
{
2
)
S(l-p)
± μ'
(3.41)
where all of the terms are as defined above. Note that for 5 = 1, (3.41) agrees with (3.40), which gives the expected waiting time for service for a single server queue. Also note that this agrees with the approximation given in (3.26) for the MIMIs queue, for which we have c^ =c2 - 1, making the first term of (3.41) equal to 1. Table 3.10 summarizes the analytical results for the queues that we have analyzed so far. Many of these results can also be found in Queueing Results Extended w Abandonment and Diagrams.xls in the online appendix.
3.6
SOLVING QUEUEING MODELS NUMERICALLY
Although we can solve for the steady-state properties of many Markovian queues using (3.11) and the normalizing relation (3.13), many of the resulting equations are messy. Simply put, they are not easy to deal with. Furthermore, in many cases, the interarrivai times are not exponentially distributed and the service times are not exponentially distributed. For these reasons, it is valuable to have two other tools at our disposal. In this section we outline two Excel-based approaches for analyzing queueing problems. We begin with an approach that works for more complex Markovian systems and then outline an approach that works for (just about) any interarrivai time distribution and any service time distribution.
£
M/Mls
MlMIX with finite capacity λ = μ
MlMIX with finite capacity λ Φ μ
M/MIl
Queue
J =
P
I
;
P0
"i-l
r-
j\
(W P
1 M+l
1_ρΑΜ
P=(1-P)P
P¡=(X-P)PÍ
0
s\
sß-λ
j = 0,l,...,s
State probabilities
TABLE 3.10. Summary of analytic queueing results
7=0
i-p
Ι-Ρ Λ
-1
1 M+l
L
M 2
(ί-1)!(ί/χ-λ)
M A„ff — A ..M + l. 1 M+l w A 2
ί=Σί ^
w =~Ç~
2-Ό
l)pM+MPM+1]
(I-P)(I-P M+1 )
+
μ(1-ρ){ΐ-ρΜ)
(l-p)p>: _p[l-(M
L _ l - ( M + l)pM+MpM+1
Aeff — A
L=
L
Key performance metric
XI
in
β/μϊ
i (λ/μ)'ε
c^+ci If 2 d+c2)
μ
1
with p = Α/μ
pV^ 1 )-' 1 i(l-p) μ
p Ί1 )\\-ρ)μ
and W = - , W„ = 0, La = 0
;=0 1 ·
ΡΣ-
ρ2 + λ2σ2 2(1-p)
^-^-
*Σ
¡Zl pi
¿JPi=-
L=p+
"'ir
y
s(l-p)
_V2(s+l)-l £-
;=o
μ
=
L=
w.
}'■
7 = 0,1,..., s
GI/G/s
. ~
(AM
„-(m
Q
W~
P,■ =
i =
P
W
G/G/l
M/G/Í
MIMIs or M/G/s with no waiting room
MIMloo and M/Gh
MIMIs approximate
158
QUEUEING THEORY
A
A
λ
A
A/2
A/3
A/4
M
2μ
3μ
εμ
sß
Sß
Sß
Figure 3.22. State transition diagram for a problem with reneging
To motivate this further, consider a restaurant at which some customer groups renege on the queue, or choose not to join the queue, when they have to wait. In particular, suppose the arrival process is Poisson with parameter λ per hour. When a group arrives to find all tables busy, in other words, their group would be the next to be seated, they choose to stay and wait at the restaurant with probability 0.5. If they would be the second group seated, the probability of their staying drops to i. When they would be the k'h group to be seated, the probability of their staying drops to
. Assuming for the moment that there k+l are s tables, and that the time a group spends at the restaurant is exponentially distributed with parameter μ, this is a Markovian queue with the following statedependent arrival and service rates: λ
n = 0,1,...
,s-l
— n = s,s + X... (n-s + 2) ίημ n = l,...,s ß "~\sß n = s+l,... The state transition diagram for this queue is shown in Figure 3.22.
SOLVING QUEUEING MODELS NUMERICALLY
159
160
QUEUEING THEORY
SOLVING QUEUEING MODELS NUMERICALLY
161
162
QUEUEING THEORY
SOLVING QUEUEING MODELS NUMERICALLY
163
164
QUEUEING THEORY
SOLVING QUEUEING MODELS NUMERICALLY
165
166
QUEUEING THEORY
SOLVING QUEUEING MODELS NUMERICALLY
167
168
QUEUEING THEORY
SOLVING QUEUEING MODELS NUMERICALLY
169
170
3.7
QUEUEING THEORY
WHEN CONDITIONS CHANGE OVER TIME
All of the results that we have derived so far, from section 3.4.1 on, have been for the time-independent case. In other words, we have assumed that the input conditions do not change over time. This has required the arrival rate, the service rate, and the number of servers to be independent of time. In many cases, however, we know that the arrival rate depends critically on the time of the day. For example, the ratio of the peak arrival rate at a hospital emergency room to the lowest arrival rate each day is around 4:1. Arrivals at a fast-food restaurant also depend critically on the time of day, peaking around meal times. Indeed, arrivals at any restaurant—fast-food or haute cuisine—peak around meal times. Longer term seasonality can be seen in retail sales (which peak around the Christmas holiday season), airline travel (which exhibits weekly, monthly, and seasonal trends), and accounting and tax preparation services, to list only a few. Similarly, the number of servers on duty is likely to vary over time. Grocery stores open additional checkout lines during busy periods. Large restaurants open additional sections during busy hours and most restaurants stagger the starting times of their key staff to ensure maximum staffing during the peak periods. Airlines schedule additional customer service agents to be on duty during the peak daily and annual periods. Time-invariant arrival and service rates and the constant number of servers allowed us to estimate the average performance of a number of queueing systems provided the utilization ratio was less than 1.0. However, as we all well know, there are times when the short-term utilization ratio is greater than 1.0 and the queue naturally grows. For example, close to my former office at Northwestern University is a small snack bar that serves prepared sandwiches and an entrée or two during the lunch hours. Classes end at 11:50 each day and the queue for lunch
171
WHEN CONDITIONS CHANGE OVER TIME
grows rapidly between about 11:50 and noon. Around noon, the waiting time in the line is on the order of 10 minutes or more. By 12:15 or 12:20, the queue has dissipated and the waiting time is again close to zero. Thus, it is important that we also develop the capability to analyze queues in which the arrival rate, the service rate, and the number of servers vary over time. For such systems, as we will see, the utilization ratio may exceed 1.0 for brief periods of time. The output of such an analysis will not be a single steadystate average performance metric, as such a number is meaningless in the context of time-varying inputs. Rather, we will expect a plot or function showing some measure of the time-dependent behavior of the system. For example, we might want to see the time-dependent average number of customers in the system. Or, we might want to see a graph of the probability of waiting for service as a function of time. To analyze time-dependent queues, we again revert to Markovian queues in which the arrival rate is ÀJf) when there are n customers in the system at time t. Similarly, the departure rate from the system is μ„(ί) when there are n customers in the system at time t. Note that μ„(ί) is the departure rate or the rate at which the system transitions from state n to state n-\ at time t. Thus, μ„(ί) captures changes in the underlying service rate—perhaps nighttime workers tend to work slower than daytime workers—as well as changes in the number of servers on duty at any point in time. μ„(ί) is the rate of an exponential distribution and λη(ί) is the Poisson arrival rate in state n at time t. Under these conditions, equations (3.7) and (3.8) give the rate of change in the state probabilities over time as a function of the time-dependent stateprobabilities. For ease of reference, we repeat those equations here. dPo(0
dt
dm dt
— ^ ( 0 ^ ( 0 + ^ ( 0 ^ (0
(3·7)
■-K-AW-Át) -[A,(0 + ft(0]*î(0
+μ, + 1 (0^ + 1 (0
ι = 1,2,...
(3.8)
Instead of writing these equations as differential equations, we can approximate them as first-order difference equations as follows: Ρ {ί + Αή Ρ
°
~ °^ At
= -λ0(ήΡ0(ή
+
μι(ήΡ1(ή.
(3.42)
/>(ί + Δ 0 - ^ ( 0 ^,.,(0^(0 At
-[Α,(0 + μ ; (0]^(0 +μΜ(ήΡΜ(ή
i = 1,2,...
(3.43)
172
QUEUEIN6 THEORY
Solving (3.42) and (3.43) for P¡(t + At), we obtain Ρ0(ί + Δί) = Ρ 0 (ί) + {-λο(θΡο(0 + Λ ( θ Λ ( ' ) } Δ ί P,(t + Δί) = /> (f ) + {A,.,(i)P,_,(t)-[A ; (ή + μ.(t)]P.(t) + μΜ(t)PM(f
(3.44) )}Δί
(3 45)
Given an estimate of the state probabilities at some time t, we can use (3.44) and (3.45) to find an estimate of the state probabilities at some point in time Δί units into the future. For example, if the queueing system exhibits a daily pattern in the arrival and service rates as well as the number of servers on duty at any time of the day, then we might have At =1 minute. We would then need to solve for 1440 probability mass functions, one for each minute of the day. There are two problems with such an approach. First, (3.45) is an infinite set of equations, which make solving it numerically challenging at best. To resolve this problem, we will truncate the state space at a large state number (a large number in the system). This number should be sufficiently large so that the probability of exceeding this number in the system at any point in time is very small. The second problem is that we need the state probabilities at some point in time to begin the process. We can begin at time t = 0 with the steady-state probabilities at that time, provided the utilization ratio is less than 1.0 at that time. If it is not, we can begin the process at some other point in time for which the utilization ratio is less than 1.0 and simply renumber the time intervals so that this other time is now viewed as time t = 0. Note that even though the utilization ratio does not need to be less than 1.0 at each instant of time, at some points in time—in fact, at most points in time—we would expect it to be less than 1.0. For some point in time, it must be less than 1.0, or the queue will grow without bounds. Using the steady-state probabilities at time t = 0 will allow us to initiate the process, but those probabilities are likely to be wrong. To handle this, we assume that the system is cyclic, meaning that the time-dependent arrival and service rates cycle over some period of time (e.g., a day) as does the number of servers on duty. This means, for example, that the conditions at t - 0 should be the same as those at time t = 1440 assuming that Δί = l.Thus, we can compute and compare Pi(0) and Ρ,·(1440). If the absolute difference IP,-(1440) - P¡(0)\ is small enough for every state /, we can stop; otherwise, we would set i^O) to the newly computed P,(1440) and continue recomputing all state probabilities at all times ¿.This would continue until the state probabilities at time t = 0 are very close to those at time t = 1440. This is, in fact, what the Time-Dependent Queueing Analyzer does, though it actually uses a fourth-order Runge-Kutta approximation to the differential equations (3.7) and (3.8) instead of the first-order difference equations developed in (3.44) and (3.45). The program will automatically adjust the maximum number of states used as well as the value of Δ/ to help the state-probabilities converge to stable values. The program allows the user to specify (i) a sinusoidal arrival rate over the course of a day as well as (ii) the starting time of full-
173
WHEN CONDITIONS CHANGE OVER TIME
time and part-time employees and (iii) the duty schedule for full- and part-time employees. For example, a full-time employee might work for 8 hours straight. Alternatively, a full-time employee might work for 8 hours, but be off for 45 minutes from the beginning of the fifth hour until 15 minutes before the beginning of the sixth hour. A part-time employee might work for 3 hours straight. The outputs of the program include a graph showing (i) the arrival rate over time, (ii) the time-dependent number of servers on duty at each point in time, (iii) the steady state average number in the system [computed using the MIMIs results above in equation (3.24) along with (3.2), (3.3), and (3.4)] provided the utilization ratio at that point in time is strictly less than 1.0, and (iv) the timedependent average number in the system at time t, given by MaxN
L(t)=2nPM
( 3 · 46 )
where MaxN is the maximum number of states used in the computations. Note that this gives the approximate rate at which the system accumulates personminutes of delay at time t. Figure 3.28 is a sample of the output from this program. The blue line shows the arrival rate of customers as a function of time. The black line shows the service capacity (with a mean service rate of 2.5 customers per hour) at each point in time. Fourteen full-time servers are utilized starting at times 0, 180 (4 servers), 300,420,660 (3 servers), 1140 (3 servers), and 1380. Note that the service capacity more or less tracks the arrival rate. Two key observations, however, are
Figure 3.28. Sample time dependent queueing analyzer output. (See color insert)
174
QUEUEING THEORY
important. First, there are times at which the instantaneous service capacity is less than the instantaneous arrival rate. In fact, there are two such intervals: between 135 and 179 minutes and between 1306 and 1379 minutes. At these times, we cannot compute the steady-state results (shown in red) and so the steady-state number in the system is shown as 0 at these times. Second, while the aggregate capacity roughly tracks the arrival rate, it is shifted slightly later than the arrival rate curve. Thus, as the arrival rate is increasing (between 1080 and 360) the service capacity is quite close to the arrival rate and is actually below the service capacity at times. After the peak arrival rate (at 360 minutes), the aggregate capacity exceeds the arrival rate to help dissipate the queue that has slightly built up. The steady-state results are shown as a jagged line, while the results of equation (3.46) are shown as a smooth line near the bottom of the graph. Note that the time-dependent results are much smoother than are the steady-state results. Figure 3.29 shows the probability of waiting as a function of time. The arrival rate and the service capacity are shown as in Figure 3.28, The steady-state results are shown as a jagged line, with the probability of waiting set to 1.0 for those times during which the utilization ratio exceeds 1.0. The smoother line nearer the bottom of the graph shows the probability of waiting at time t derived from the time-dependent results. This is given by MaxN
KaiM) = Σ P-W. n=s(t)
where s(t) is the number of servers at time t.
Figure 3.29. Sample probability of waiting results. (See color insert)
CONCLUSIONS
175
Figure 3.30. Steady state (red) and time-dependent (green) probability mass functions. (See color insert)
Figure 3.30 (a) and (b) compare the steady-state probability mass function and the time-dependent probability mass function at t = 130 and / = 1300, respectively. These are times at which the steady-state results significantly overestimate the number in the system as indicated by the long tail of the (red) probability mass functions. As indicated, these times are just minutes before the utilization ratio exceeds 1.0. Figure 3.30, along with the fact that it is possible in time-varying queues for the arrival rate to exceed the aggregate capacity for brief periods of time, illustrate the importance of using time-dependent queueing results when the arrival rate, service rate, or the number of servers change over time.
3.8
CONCLUSIONS
In this chapter, we have outlined key results from queueing theory, a mathematical approach to the analysis of service quality as a function of the customer demand or arrival rate, the service rate, and the number of servers. The chapter began with a simple example, which showed that (a) variability in the arrival or service processes leads to the development of queues even when the average number of arrivals is less than the average number of service completions possible per unit time and (b) the performance of a queueing system degrades as the utilization ratio approaches 1.0. Section 3.2 outlined the key inputs and outputs of most queueing analyses while section 3.3 identified important relationships between several output metrics. In particular, section 3.3 presented Little's Law, which states that the
176
QUEUEING THEORY
average number of customers in a queue is equal to the arrival rate multiplied by the average time in the queue. This applies to both the entire system as well as the queue before service begins. Section 3.4 presented a framework for the analysis of Markovian queues or systems in which the arrival process is Poisson and service times are exponentially distributed. We then applied these results to a number of important queueing systems including single server queues, multi-server queues, selfservice or infinite server queues, as well as queues with finite capacity. Section 3.5 presented important exact and approximate steady-state results for nonMarkovian queues. Section 3.6 presented two ways of analyzing queueing systems numerically. The first is appropriate for Markovian systems. In this approach we numerically solve the steady-state balance equations for the state probabilities. These are then used to compute key performance metrics such as the average number of customers in the system. The second approach is more general and uses simulation. The key problems with simulation, however, are (a) the results are only a single realization of a random process, (b) the variability in the results increases as the utilization ratio increases, and (c) for utilization ratios close to 1.0, the initial conditions can significantly impact the outputs. Section 3.7 briefly outlined an approach for analyzing Markovian systems in which the arrival rate, service rate, or the number of servers change over time. For such systems, stationary or time-invariant queueing results are not likely to adequately reflect the true performance of the system. Instead, a numerical approach similar to that outlined in this section is preferred. There are a number of other important results for the analysis of queues in service systems. One of the more important areas is that of priority queueing, in which some customers get priority over other customers. A hospital emergency room is one example of a priority queueing system: emergency patients are given priority over non-emergent patients. This is the topic of section 9.2.
3.9
PROBLEMS
1. For any combination of the spread in the service time distribution and the average service time in Figure 3.2, Figure 3.3, and Figure 3.4, what is the relationship between the average waiting time, the average waiting time given that a customer has to wait, and the probability of waiting a) assuming that the average waiting time is strictly greater than 0; b) assuming that the average waiting time is equal to 0. 2. If the service time distribution is Erlang-k with parameters λ and k, and a mean time of k/λ, a) Find the distribution of the additional service time, given that the current customer has been served for τ0 time units.
PROBLEMS
177
b) Write down an equation for the expected additional service time given that the customer has been served for τ0 time units. Recall that the expected value of a non-negative random variable can be computed as E(X) = j[l-F(x)]dx as shown in equation (B.59). o c) Develop a spreadsheet to compute the expected additional time in the server for any value of A, k, and τ0. d) Use the spreadsheet developed in part (c ) to compute the expected additional time in the server for A = 5, k = 6 and τ0 = 1.0. What is the expected additional time in the server under these conditions? How does this compare to the unconditional expected time? 3. Dr. Hold Please is concerned because many of her patients have complained of not being able to get through to her office when they try calling and that they are put on hold for a long time when they finally do get through. After collecting data, she finds that patients call her office at a rate of 10 per hour. Furthermore, being a former Industrial Engineering major, she is able to verify that calls arrive according to a Poisson process with this arrival rate. She also finds that the receptionist spends an average of 5 minutes on the phone per patient and that this time is exponentially distributed. She has three phone lines that the receptionist manages. In other words, a maximum of three patients can be in the phone system at any time (presumably with one talking to the receptionist and two on hold). She realizes that this is an M/M/Í queue with a finite number allowed in the system. Using the values of A, μ, s, and N (A = 10, μ = 12, s = 1, and N = 3), find a) The probability that the system is empty (P0) b) The probability of being in each other state (Pi, P2, P3). Be sure that the sum of the state probabilities equals 1 ! c) The average number of people waiting on hold (Lq). Note that Lq = 2F 3 + P2. d) The effective arrival rate (Ae//= A(l - PN)). e) The average time spent waiting on hold in minutes (Wq) f) The average number of callers per hour who get a busy signal (λΡΝ) 4. The Erlang-k distribution is the sum of k independent and identically distributed exponential random variables, each with parameter k\i. In other words, if X¡ is the ith exponentially distributed random variable and Ek is the Erlang-k random variable, then Ek = Χχ + X2 + — + Xk. a) What is the mean and variance of any one of the exponential distributions that make up the Erlang-k distribution? Note that both the mean and the variance should depend on the parameter k of the Erlang-k distribution. b) What is the mean and variance of the Erlang-k distribution? Recall that the mean of the sum is the sum of the means and the variance of the sum (of independent random variables) is the sum of the variances.
178
QUEUEING THEORY
c) What is the coefficient of variation (standard deviation divided by the mean) of the Erlang-k distribution? d) Suppose the service time distribution in a single-server queue has an Erlang-k distribution. Find the average number of people in the system assuming the arrivals follow a Poisson process. e) What is the average time in the system (W), the average time in the queue (Wq), and the average number in the queue (L ? )? 2 f) If k = l,show that you get the result for the MIMI1 queue (e.g., Lq =
).
Show that your result from part (e) reduces to this value for the MIMI1 queue. g) As k -> »o, show that you get the result for the MIDI! queue (e.g., Lq - —
2
-). Show that your result from part (e) reduces to this value for
the M/D/Í queue. 5. Consider the problem associated with repairing military vehicles. A particular base is in charge of maintaining four vehicles. Each vehicle breaks down at the rate of once per month (according to a Poisson process). Thus, if there are four working vehicles, the total rate at which the repair facilities sees breakdowns is four per month. When one vehicle is already broken down, the repair facility sees arrivals at the rate of three per month. In other words, this is a system with a finite population. For now, there is only one repair crew. It takes the crew 0.5 months to repair a vehicle.
4À
3/1
2Ä
À
μ
μ
μ
μ
<XMX> In other words, the state transition diagram looks like the following: where λ = 1 and μ = 2, and the state n indicates the number of broken vehicles. a) Write down the state probabilities in terms of P0, the probability that the system is in state 0, which would mean that there are NO broken vehicles. b) Find the actual state probabilities (by using the fact that the sum of the five state probabilities must be equal to one).
PROBLEMS
179
c) Find the expected number of vehicles being repaired. d) Find the effective arrival rate of vehicles to the repair facility. (Note that this should be 4λΡ0 + 3λΡ, + 2λΡ2 + λΡ3.) e) Find the average time in the system. f) Find the average time waiting for service. g) Find the average number of vehicles waiting to be repaired or serviced. h) The commander of the unit is not pleased with the average time that vehicles spend in the repair facility. He is thinking about one of two different options: 1. Double the size of the single crew (which would double the value of μ) but retain a single crew. 2. Add a second crew, which would work at the same rate as the original crew but could be available when there are two or more broken vehicles. Of these two options, which one will be more effective at reducing the total time in the system? Briefly justify your answer. 6. Ms. Sue M. Alldeeply is the head of a small litigation firm that deals in medical malpractice cases. Her specialty is obtaining large settlements from physicians who have wronged their patients. She employs a single receptionist who handles all incoming calls, collects some basic information on the caller, and then forwards the call to the attorney who should handle the caller. Ms. Alldeeply's secretary, Mr. Rob M. Blind, has a phone that allows for three calls—one that he would presumably be talking on and the other two which would be used for calls on hold, if need be. If all three lines are busy, the call is lost. Once the call is transferred to an attorney, the line is freed and Mr. Blind can then receive another call on that line. Ms. Alldeeply has hired you to analyze the phone system because she believes that there are some lost calls, based on anecdotal evidence, and some callers have complained about long wait times. After studying the system for a few days, you conclude that the distribution of time that Mr. Blind spends on the phone with an incoming call follows an Erlang-2 distribution. Remember that this is the sum of two independent, identically distributed, exponential random variables, each with parameter μ. The mean service time for an Erlang-k distribution is k/μ and the variance is k/μ2. Calls arrive according to a Poisson process with rate λ. Thus, the system can be modeled using the following state transition diagram. In this diagram, each state is given two values: The first is the state number and this corresponds to the number of exponentially distributed work units that remain in the system; the second number is the number of people in the system. Thus, from state (0, 0) we move to state (2, 1) when we have an arrival (who brings two exponentially distributed units of work with him/ her). Downward transitions occur at a rate of μ in all cases.
QUEUEING THEORY
μ
μ
μ
μ
μ
μ
Develop a spreadsheet model that will allow you to solve for (i) the state probabilities, (ii) the average number of people in the system, (iii) the effective arrival rate (be careful here since there are going to be two states for a system with Erlang-2 service times in which the arrival rate is 0), (iv) the average time in the system, (v) the average time waiting for service, (vi) the average number waiting for service, and (vii) the percentage of calls that are lost. You should make the spreadsheet sufficiently general so that you can solve for systems with an Erlang-k service (for k = 1 , 2 , . . . , 8) and up to four incoming lines. In other words, I would not set up a spreadsheet for this particular example alone. Use the spreadsheet to find the performance metrics for the case above if λ - 10 calls per hour, the mean service time is 5 minutes with k = 2 for the Erlang-k distribution, meaning that μ = 24. (You should get the values shown in the table below.) Average No in System Prob(Full) lambda effective Average time in system (min) Average waiting time (min) Average number waiting % lost calls
1.264 0.156 8.442 8.985 3.985 0.561 15.58%
Ms. AUdeeply has dinner one evening with a friend who is an OR specialist. He claims that if she trains Mr. Blind better, he can reduce the standard deviation of the service time by a factor of 2 and that the percentage of lost calls will go down by about 15 percent. Use your model to determine if this is correct. In particular, what are the values that you would fill in for the performance metrics shown in part (a)? Can you really reduce the percentage of lost calls by 15 percent? Instead of investing in training for Mr. Blind, Ms. AUdeeply contracts for a fourth phone line. What are the new performance metrics? In particular, what happens to the average waiting time?
PROBLEMS
181
d) Ms. Alldeeply, having installed a fourth incoming line, is now very concerned about the waiting time. She decides to invest in training for Mr. Brown to shorten the mean service time from 5 to 4 minutes. The distribution remains an Erlang-2, but the value of the μ changes from 24 to 30. What are the performance metrics in this case? 7. One common mistake that people make is to assume that a single server queue in which the mean service time is 0.1a is the equivalent of a 10 server queue in which each server has a mean service time of a. In other words, they assume that a single server operating 10 times as fast as each of 10 servers results in an equivalent system. Therefore, they tend to memorize the single server results only (e.g., L =
) and never fully learn the 1-p results for other more complex queues (e.g., the MIMIs) queue. a) On a single graph, plot the following four quantities with λ, the arrival rate, on the X axis ranging from 1 to 10 (start the axis at 0), and the following four quantities on the Y axis: • W (the mean total time in the system) for an M/M/l queue • W for an M/M/Í0 queue • Wq (the mean time waiting for service) for an M/M/l queue • Wq for an M/M/10 queue For the M/M/l queue, set the utilization ratio p = λ/μ = 0.9 for all values of A. In other words, adjust the service rate of the single server queue so that you hold the utilization ratio constant for all arrival rates. For the M/M/10 queue, hold p = Α/(10μ) = 0.9, again by adjusting the service rate. In other words, for each value of X, the utilization ratio should be 0.9 for both queues and the mean service rate in the M/M/l queue should be 10 times the mean service rate in the equivalent M/M/10 queue. If you do this correctly, the value of LMIMn should be the same for all arrival rates for the M/M/l queue and LMIMm should be the same for arrival rates, but LMIMn Φ LMIMIW. b) What can you conclude about the performance measures when you make the sort of mistake outlined above? 8. This is a basic review of a key point made in the chapter. a) Find the ratio of Wq (the average time waiting for service) for an M/M/l queue to the value of Wq for an MID/1 queue (one with deterministic service). Note that this should be independent of either the mean service time or the arrival rate. b) What can you conclude about the impact of service time variability on customer waiting time?
182
QUEUEING THEORY
REFERENCES Burke, P. J., 1956, "The output of a queueing system," Operations Research, 4, 6, 699-704. Clarke, A. B., and R. L. Disney, 1970, Probability and random processes for engineers and scientists, Wiley, New York. Fitzsimmons, J. A., 1973, "A methodology for emergency ambulance deployment," Management Science, 19, 6,627-36. Gross, D., and C. Harris, 1985, Fundamentals of Queueing Theory, 2nd ed., John Wiley & Sons, New York. Newell, G. F , 1971, Applications of Queueing Theory, M. S. Bartlett, ed., Monographs on Applied Probability and Statistics, Chapman and Hall, London, England.
PART
II
APPLICATION AREAS
Service Science, by Mark S. Daskin Copyright © 2010 by John Wiley & Sons, Inc
4 LOCATION AND DISTRICTING PROBLEMS IN SERVICES
"We have to expand our coverage. We need more towers," Audrey pleaded with her boss, Daniela, the vice president of communication technologies. As the director of marketing, Audrey knew better than anyone else that the competition was ramping up its advertising campaign in the region and already had better coverage. "Maybe so, but our capital budget is already overspent for the year. We simply can't afford more construction and installation at this time. I don't know where I will possibly get the budget," Michael, the division's budget director, retorted. He had been massaging the numbers for two days prior to the afternoon's meeting, knowing full well what Audrey would propose. "I am willing to add a few more towers but only if we can justify the expense in terms of increased market penetration. Too many of our towers seem to add little by way of extra coverage. I want a complete analysis on my desk before we make any more decisions about this, " Daniela replied. Audrey and Michael left Daniela's office wondering how they could possibly prove to her that the proposed new towers were cost effective and would add significant coverage. The problem seemed overwhelming.
Service Science, by Mark S. Daskin Copyright © 2010 by John Wiley & Sons, Inc
185
186
4.1
LOCATION AND DISTRICTING PROBLEMS IN SERVICES
EXAMPLE APPLICATIONS
Location decisions are critical in many services. Often such decisions are strategic in nature. The locations of schools, hospitals, fire stations, and ambulance bases are changed very infrequently. As such, a poor decision about how many schools to have, for example, and where they should be is likely to impact the operating costs incurred by the school district and the service levels perceived by the parents and students for years, if not decades, to come. Similarly, bad decisions regarding locations for cell phone towers result in excessive cost coupled with poor service, a disastrous combination for any service provider. Location models have been applied in contexts in which no physical facility is being sited. The decisions in many such contexts are tactical or operational in nature, but they are still critical to the proper functioning of the systems in question. Many of the models and techniques developed for long-term strategic location decision making are relevant and applicable in those contexts as well (Current, Daskin, and Schilling, 2002).
4.1.1
Locating EMS Vehicles in Austin, Texas
In the late 1970s, Austin, Texas operated an ambulance system as a third city service; third in the sense that the police and fire services are typically viewed as the first two critical services. Emergency medical services (or ambulances) are sometimes a part of the fire department. In the case of Austin, these services were provided by a third department. Ambulance crews were typically on duty for 24 hours and then were off duty for 24 hours. Because of this schedule, paramedics needed an apartment in which they could eat, sleep, and relax during the time that they were on call but not actively responding to a medical emergency. Paramedics were based in a dozen apartment buildings located throughout the city. Each ambulance was equipped with a large quantity of expensive equipment as well as controlled drugs used in the treatment of patients. For security reasons, much of this equipment as well as many of the drugs were removed from the ambulance and stored in the apartment when the crew was not responding to an emergency. This, however, introduced an additional delay in getting to the scene of an emergency, as the crew had to carry the equipment from the apartment to the emergency medical service (EMS) vehicle and securely stow it before the ambulance could begin traveling to the emergency scene. In a service in which 1 or 2 minutes one way or the other can mean the difference between life and death for a patient, such delays were deemed unacceptable. City officials wanted to identify permanent ambulance bases at which the EMS vehicles could be securely garaged to eliminate these delays. The questions facing the city officials were (1) how many ambulance bases should they have, (2) where should the ambulances be located, and (3) at what level should each ambulance operate. Two operating level options were possible. Basic Life Support (BLS) vehicles provided just that—basic life support. Such vehicles were less well equipped and the crews were trained at
EXAMPLE APPLICATIONS
187
a lower level than were their Advanced Life Support (ALS) counterparts (Eaton et al., 1985).
4.1.2
Locating Evacuation Sites in Florida
The Federal Emergency Management Agency (FEMA) required every county in the state of Florida to establish disaster recovery centers (DRCs). DRCs must be at least 2000 square feet in size, include heating, air conditioning, phone and fax lines, and not be in a flood plain, among other criteria. FEMA required Alachua County to locate at least three DRCs. The county is the twentieth largest county in the state by population. Nearly 220,000 people inhabit the entire county with roughly 100,000 people in Gainesville, the largest city in the county. County officials worked with students and faculty at the University of Florida to identify candidate locations (Dekle et al., 2005). A variety of objectives were considered, including (1) minimizing the average distance people must travel to the nearest DRC, (2) minimizing the maximum travel distance of any county resident to the nearest DRC, (3) minimizing the number of DRCs needed to satisfy the FEMA requirements while ensuring that all residents were within a given distance of the nearest DRC, and (4) maximizing the probability that at least one DRC would be working after a disaster. The third objective, minimizing the number of DRCs needed to ensure that each resident was within a given distance of the nearest DRC, was selected as the objective to be used. The county was divided into 6600 parcels of land, of which about 3900 met the basic FEMA requirements. As solving a problem this large was beyond the capabilities of the student team—and indeed beyond the capabilities of much commercial software—the data were aggregated into 198 demand points and 162 candidate locations. The problem was solved in two phases. In the first phase, a mathematical model was used to determine that three sites were needed to ensure that (nearly) all of the population was within 20 miles of the nearest DRC. The second phase refined the search for sites to ensure that the selected sites truly met the FEMA requirements.
4.1.3
Locating Meter Readers
Shlumberger is a large multi-national company that provides technology services to its customers. One division of Shlumberger deals with resource management services. In particular, this division provides gas, electric, and water meters to customers around the globe. One critical problem faced by Shlumberger was the location of receivers for automated meter readers, or AMRs. Receivers were typically placed on telephone poles. The range of a receiver was a function of the height of the pole and the surrounding environment. Each receiver was capable of handing at most 540 meters, though it was desirable for a number of reasons to limit the number of meters per receiver to significantly fewer meters.
188
LOCATION AND DISTRICTING PROBLEMS IN SERVICES
The basic problem was to locate the minimum number of receivers needed to read all meters in a given geographic area, while respecting the capacity limitations of the receivers. Shlumberger would typically determine the locations of the receivers by working extensively with a geographic information system (GIS). The process was painstakingly slow. In addition, the planners had no way of knowing how good the manually constructed solution was. Working with researchers at Indiana University and the University of North Carolina, Shlumberger planners developed an automated method of locating these receivers (Gavirneni, Clark, and Pataki, 2004). The approach was able to handle problems with over 116,000 customer locations and over 20,000 telephone poles as candidate receiver locations to solve a typical problem for a utility in Decatur, Illinois. The method reduced the planning time from six months to under one month. This time savings meant that fewer Shlumberger planners needed to be devoted to the process of locating receivers. In addition, the approach recommended the use of fewer meters than did the manually generated solution.
4.1.4
Locating Seeds in Brachytherapy
Prostate cancer will impact nearly 225,000 men each year in the United States and over half a million worldwide. In the United States, roughly one in eight men will die of the disease and worldwide the number jumps to about three in eight. Brachytherapy is a common treatment procedure in which between 60 and 150 tiny radioactive seeds are strategically placed in the prostate gland to attack the tumor. The traditional method of determining the number of seeds to use and their placement entails a pre-surgical examination, during which either ultrasound or computerized tomography images of the prostate gland are taken. Physicians then determine where to place the seeds. The key problems with this process are that the pre-surgical images may not be consistent with those taken several weeks later at the time of the surgery, the planning process is long and laborious, only a relatively small number of options can be explored, and there is no option for real-time changes during the surgical procedure if needed. Researchers at the Georgia Institute of Technology and the Memorial Sloan Kettering Cancer Center developed a computerized system of determining how many seeds to utilize and where they should be placed (Lee and Zaider, 2003, 2008). The goal is to locate the seeds so that at least 95 percent of the voxels (three-dimensional pixels) receive at least the required radiation dosage. The dosage to any voxel is required to be within a given range of the prescribed dosage. Because satisfying these conditions is nearly impossible for every voxel, the researchers identified locations that maximize the number of points satisfying the constraints or that minimize the sum of the deviations from the requirements over all points. The award-winning new method improves the seed placement, significantly reduces the planning time required for the surgery, and allows for real-time adjustments to the treatment plan in the surgical theater as needed.
TAXONOMY OF LOCATION PROBLEMS
189
These four examples indicate a portion of the range of problems to which location modeling has been applied in the service industry. Problem 24 outlines an example of location modeling applied in product selection, a very different context. Current, Daskin, and Schilling (2002) identify numerous other applications of location modeling. 4.2
TAXONOMY OF LOCATION PROBLEMS
There are many ways of classifying location models. One useful way is shown in Figure 4.1. To a large extent, the taxonomy is based on a classification of the "space" in which the problems are structured. This, in turn, leads to different assumptions about the nature of demand and about where facilities can be located. Also, problems structured in different ways result in the use of different solution techniques. 4.2.1
Analytic Location Models
Analytic models are the simplest of all of the models that have evolved in the analysis of location problems. Such models make very strong assumptions about the nature of demand and about where facilities can be located. For example, analytic models often assume that demands are uniformly spread across the service area. The best way to think about this is to think about the service area as a piece of bread that is covered uniformly with peanut butter. The thickness of the peanut butter is related to the density of demands. Such models assume that the demand is uniformly distributed, meaning that the thickness of the peanut butter is exactly the same everywhere. (Any parent knows that this is impossible, as evidenced by the numerous times that children refuse to eat a peanut butter and jelly sandwich because the peanut butter is not spread smoothly enough!)
Figure 4.1. Taxonomy of location models
190
LOCATION AND DISTRICTING PROBLEMS IN SERVICES
Direction of Travel Figure 4.2. Example service region and directions of travel
Analytic models are typically very easy to solve. In fact, simple calculus techniques are typically employed. To illustrate one such model, consider the problem of determining how many locations to use to minimize the facility construction costs plus the demand-weighted total distance between facilities and customers. We will assume that the region is a square with an area a square miles and that the region can be partitioned into diamonds, which correspond to the service regions for each of the facilities. Figure 4.2 illustrates such a service region with a facility at the center of the region. If we have N such regions (or N facilities), the area of each subregion is a/N, and the average distance between a demand node within a subregion and the facility in the center of the subregion is given by —. \JL· miles. [The reader is referred to the derivation of this formula 3\2JV in the online Appendix B, equation (B.61).] If each facility costs / dollars, the cost per demand per mile is c, and the demand density is p demands per square mile, then the total cost as a function of N, the unknown number of facilities to locate, is given by
TC(N) =fl[+ pca-J—.
(4.1)
If we equate the derivative of (4.1) with respect to N to 0 (ignoring the fact that N should really be integer-valued), we find that the optimal number of facilities is given by pc
N* = a
\2/3
(4.2)
If we substitute (4.2) into (4.1), we find that the optimal total cost is given by TC(N*) = ß/* + pc2
'
a
3\2N*
= 1.145fl/1/3(pc)2/3.
2/3
f
-,
x2/3
(4.3)
TAXONOMY OF LOCATION PROBLEMS
191
Figure 4.3. Simple analytic model of facility and transport costs
Equation (4.2) shows that the optimal number of facilities grows linearly with the area served. This makes sense. If we double the area served, we should double the number of facilities used. The optimal number of facilities also grows as the | power of the demand density and the unit transportation cost. It decreases with the | power of the unit facility cost. Thus, the number of facilities increases linearly with the area served and (somewhat more slowly) with the demand density and the unit transportation cost. The optimal number of facilities decreases with the unit facility costs. Equation (4.3) shows that the optimal total cost grows linearly with the area served. Again, this makes sense. If we double the area served, the total cost should double. The total cost also grows as the ^ power of the unit facility cost and as the | power of the demand density and the unit transportation cost. The second line of equation (4.3) is written in a somewhat strange manner. The first term in the braces comes from the fixed facility costs, while the second comes from the transportation costs of equation (4.1). Thus, the terms in the braces show that at the optimal number of facilities, the total transportation costs should be twice the total facility costs. Figure 4.3 shows the cost components for this simple model. The facility costs increase linearly with the number of facilities. The transport costs decrease with the number of facilities, since, as we have more sites, we get closer to the customers, on average. The total cost is U-shaped with a minimum at the point at which the transport costs are exactly twice the facility costs. See Simple Analytic Model.xls in the online appendix.
We can also use equations (4.1), (4.2) and (4.3) to determine how sensitive the total cost is to changes in the number of facilities. Let the actual number of
192
LOCATION AND DISTRICTING PROBLEMS IN SERVICES
Figure 4.4. Ratio of total cost to optimal cost as a function of the ratio of the number of sites to the optimal number of sites
facilities be given by TV = ßN*. In other words, if the actual number is less than the optimal number, then ß will be less than 1; on the other hand, if the actual number exceeds the optimal number, then ß will be greater than 1. We can then show that the ratio of the cost when we use TV facilities, TC(N), to the optimal total cost, TC(N*), is given by
TC(TV)
TC{N*)
=
ß + 2/Jß 3
(44)
This ratio is plotted as a function ß in Figure 4.4. For a broad range of the values of ß, the cost is almost the same as the optimal cost. In fact, if the number of facilities is between 63 and 153 percent of the optimal number, the total cost will be within 5 percent of the optimal total cost. If the number of sites is between 52 and 181 percent of the optimal number, the total cost will be within 10 percent of the optimal total cost. One of the key assumptions of this model is that the demand is uniformly distributed across the service area. We know that this is generally not true. For the lower 48 states in the United States, the population densities at the state level range from a low of 5 people per square mile in Wyoming to a high of 965 in New Jersey. The average for the lower 48 states is about 90 people per square mile. (Alaska has about 1 person per square mile and Hawaii is close to the national average at 110 people per square mile.) Table 4.1 shows the impact of this assumption when applied to data at the state level for the lower 48 states in the United States (along with Washington, DC). The first row of the table treats the entire country as a single service region. The area is about 3.11 million square miles, serving a population of about 280
TAXONOMY OF LOCATION PROBLEMS
193
TABLE 4.1. Aggregate vs. disaggregate use of simple analytic model for lower 48 states Approach Aggregate Disaggregate
Percent Difference
Value
Low Avg High Total
Area
Population
3,119,527 279,583,437 493,782 1,545 5,812,737 64,989 268,601 33,871,648 3,119,527 279,583,437
Density
Total Number Sites
Total Cost
89.6 5.0 159.4 964.7
514 1.00 9.56 47.00 460 10.5%
$1,540,757,810 $2,632,866 $28,761,694 $141,235,549 $1,381,784,120 10.3%
million people. For the example in Table 4.1, the unit facility cost was set to $1 million and the cost per demand per mile was set to $0.1. The aggregate model suggests that there should be 514 sites across the country at a cost of $1,541 billion. The next four rows of Table 4.1 show the impact of disaggregating the data to the state level. The rows corresponding to Low, Avg, and High give the low, average, and high values for the relevant parameters, excluding Washington, D.C. The next row gives the values that result from summing the corresponding results for the 48 states plus Washington, D.C. These results round the optimal number of sites to the nearest integer. Also, the results require at least one site per state. The disaggregate model suggests that there be only 460 facilities at a cost of $1,382 billion. The aggregate model overestimates the number of facilities by over 10 percent and also overestimates the cost by 10 percent. This is not surprising, as the aggregate model would allocate 16 facilities to Wyoming, while the disaggregate model allocates only 2 due to the low demand density in the state. The cost in Montana using the aggregate solution (assuming a uniform population across the country) is 150 percent above the optimal cost in Wyoming. Similarly, the aggregate model allocates 20 more sites to Montana than does the disaggregate model resulting in a 126-percent increase in cost for the aggregate model over the disaggregate model. At the other extreme, the aggregate model allocates 20 fewer facilities to California than does the disaggregate model resulting in a 7.2 percent increase in cost for that state. Thirteen too few facilities are allocated to New York by the aggregate model, resulting in an 18.3 percent increase in cost for the state. Clearly, aggregation results in distorted allocations of facilities to regions when densities are not uniform. Aggregation also results in using too many sites and an over-estimation of the total cost. Because of the very strong assumptions that such models make, analytic models are not terribly useful in determining exactly where facilities should be located. However, such models do provide important insights into the nature of the solution to many location problems. The basic techniques that are employed in the analysis of analytic models can be extended to more complex supply chain environments (Daganzo, 1991, 2003).
194
4.2.2
LOCATION AND DISTRICTING PROBLEMS IN SERVICES
Continuous Location Models
Despite their name, continuous location models typically assume that demands are located at discrete points in space. As such, these models relax the assumption that is typically made in analytic location models that the demands are uniformly distributed throughout the space. Continuous location models allow demands to be concentrated at specific points. Furthermore, these models do not assume that the demand intensities are the same at every point. In fact, they often are not the same. In continuous location models, the facilities can be located anywhere in the space. This again limits the applicability of these models. In locating evacuation sites in the Midwest portion of the United States, a facility located 10 miles east of Evanston, Illinois would not be very useful. This would place the facility in the middle of Lake Michigan! Similarly, a model that suggested that a new fire station be built in the middle of Central Park in Manhattan is not likely to be viewed very credibly by the city fathers (and mothers). Solving continuous location models typically requires the use of non-linear continuous optimization techniques. Often numerical procedures are employed in the solution of such models. The Weber problem is typical of continuous location models (Drezner et al., 2002). In this problem, there are n demand points. Demand point ;' is located at coordinate (x¡, y¡). The demand associated with point ; is h¡. The problem is to find the location of a single facility—the X and Y coordinates (X0, Y0)—to minimize the demand-weighted total (straight line) distance between the facility and the n demand points. In other words, the problem is Minimize
£h¡^¡{x¡ - X0 f + (y¡ -Y0f.
(4.5)
To visualize this problem, consider a piece of plywood. At the location of each of the demand points we drill a small hole in the plywood. Over each hole we position a frictionless pulley. We then hang a thread through each hole with a weight that is proportional to the demand at that point. All of the threads are then wrapped over the respective pulleys and tied to a single ring. The position of the ring at equilibrium is the Weber location. One way to solve for (X0, Y0) in equation (4.5) is through an iterative procedure known as the Weiszfeld procedure (Drezner et al., 2002). This procedure computes a series of solutions. We let (X*, Y0*) be the value of the X and Y coordinates of the solution on iteration k. The algorithm computes a series of solutions as follows.
ÉWVfo-^+Ov-r.tf + e
195
TAXONOMY OF LOCATION PROBLEMS
¿1
Yt1 = ^
7
^
^
=
=
^
(4·7)
While these formulae look complicated, they are quite easy to implement in Excel. Also, they tend to converge quickly for most data sets. The formulae use a slight modification to the Euclidean distance between two points. Instead of using the standard formula d[x., X^ ) = ^(ΛΓ. - X„ ) + (y¡ - Y0* ) , equations (4.6) and (4.7) use d(xj,X^)
= ^(xj-X^)
+ (.yy· - yo* ) + ε , where ε is a very small
number that is an input into the problem. The reason for this is that if the optimal solution lies on top of one of the input demand points, then we will end up dividing by 0 for one of the terms in (4.6) and (4.7). To avoid this, we make sure that all distances are slightly positive by adding a small value ε inside the square root term. To illustrate the solution to the Weber problem, consider the problem of finding the site which that minimizes the demand-weighted total distance between the facility and each of the 67 counties in the state of Pennsylvania. (Rather than using the great circle distance, the results below used the Euclidean or straight line distances using the longitude and latitude of each county.) Figure 4.5 shows
Figure 4.5. Weber problem solution using Pennsylvania county data
196
LOCATION AND DISTRICTING PROBLEMS IN SERVICES
a map of the state as well as the demand points. Five levels of demand points are shown by the diamonds, with the two largest counties (Philadelphia and Allegheny counties) shown with the largest black diamonds, the next three largest counties (Montgomery, Bucks, and Delaware) shown with the large dark diamonds, and so on. In this example, the algorithm begins with the tentative solution at (80.5,42) in the far northeast corner of the state. The solution rapidly converges to a site at (76.403, 40.355), which is very close to Lebanon County, Pennsylvania. The algorithm was run for 100 iterations. Within 10 iterations, the maximum percentage difference between the final coordinates was less than 0.1 percent and within 20 iterations, the maximum difference was less than 0.005 percent. The objective function also converges very quickly. By iteration 10, the objective function value is less than 0.05 percent above the best value and by iteration 20 it is within 0.0002 percent of the best value. Note that the solution is quite insensitive to the starting point. Starting the solution at each of the four "corners" of the state results in differences in the best X and Y coordinates on the order of 10"12 degrees longitude. This is on the order of 10"6 feet! See Weber in Pennsylvania.xls in the online appendix.
4.2.3
Network Location Models
Network location models assume that there is an underlying network for the problem. For example, the network might be the highways, arterials, and local streets in a city. Alternatively, the network might consist of only the interstate highway system in the United States. The network might be a set of water mains that are used to distribute water throughout a city. The focus of much of the literature on network location models is to find efficient algorithms—algorithms whose execution time grows as a polynomial function of the size of the problem—for location problems on specially structured networks. A tree is one common network structure that is frequently studied in network location theory. A connected tree—or simply a tree for the rest of this discussion—is a set of connected nodes such that there is exactly one way to go from any node to any other node. By "connected," we mean that there is some path between every pair of nodes. Because the network is a tree, there can be no cycles in the network. Figure 4.6 shows a schematic of the 10 largest cities in the United States. Selected links connect the cities creating a tree. Note that there is exactly one way to get from each city to each other city. The numbers beside the links are the link distances and the number next to each node is the demand associated with the node. These values are proportional to the population of the city. The total demand of all cities shown is 2188. Table 4.2 shows the shortest path distances between each pair of cities for the tree shown in Figure 4.6. Note that despite the actual proximity of New York and Philadelphia—they are really only about 78 miles away from each other—in the network shown in Figure 4.6,
197
TAXONOMY OF LOCATION PROBLEMS
Figure 4.6. Sample tree network for the 10 largest U.S. cities
TABLE 4.2. Shortest path distances on the tree shown in Figure 4.6
z New York Philadelphia Detroit Chicago Dallas Houston San Antonio Phoenix Los Angeles San Diego
a -a J3
"3 U
Q
0
1373
1373
468 706
0 905 667
468 905 0 238
1505 1729 1757 2604 2970 2901
1466 1690 1718 2565 2931 2862
1037 1261 1289 2136 2502 2433
a o
o o c cd υ
IS U
706 667 238 0 799 1023 1051 1898 2264 2195
3 0
§
o 'S o
l
Q
X
1505 1466 1037
1729 1690 1261 1023
1757 1718 1289 1051
224 0 476
252 476 0 847
799 0 224 252 1099 1465 1396
1323 1689 1620
1213 1144
'S o EL,
2604 2565 2136 1898 1099 1323
847 0 366 297
— oo
o
a <
s
2970 2931 2502 2264 1465 1689 1213
2901 2862 2433 2195 1396 1620 1144
366 0 663
297 663 0
O
00
e
the distance between the two cities is 1373 miles because you have to go through Detroit and Chicago to get to Philadelphia from New York in this tree. To illustrate the sort of algorithm that has been developed for such a tree network, we will try to find the location on the tree that minimizes the demandweighted total distance to all other cities. By demand-weighted distance, we mean the demand times the distance. Thus, if we locate the facility at New York,
198
LOCATION AND DISTRICTING PROBLEMS IN SERVICES
the contribution to the objective function of Detroit is 48,204 = (103)(468). Every other city would contribute to the objective similarly, and the total demandweighted distance if we locate at New York is 2,675,502. If we divide this by the total demand, we get the demand-weighted average distance, which is 1222.81 miles. Note that this is NOT the same as the average of all of the city distances to New York, which is given by (0 + 1373 + 468 + - + 2901)/10 = 1601.3. We could compute the demand-weighted total distance for every node and find the minimum. However, there is a better way to find the minimum. This algorithm was first proposed by Goldman (1971). We begin with any leaf node of the network. A leaf node is a node at the end of the tree, or a node that is connected to only one other node. If the demand at that node is half or more of the total demand in the tree, we stop; that node is the solution to the problem. If the demand at that node is less than half of the total demand in the tree, then we add the demand at that node to the demand at the node to which the leaf node is connected and remove the leaf node and the link associated with it. We continue in this manner until we find a node whose (modified) demand is half or more of the total demand in the tree. To illustrate this, we begin at New York in Figure 4.6. The demand in New York is 732, which is less than half the total demand. The total demand is 2188 and half of that is 1094. We therefore add the demand of New York to the demand at Detroit to get a modified demand at Detroit of 835. We remove New York and the link between New York and Detroit from the tree. Next, we can process Philadelphia. The total demand at Philadelphia is 159, which again is less than half the total demand in the tree. We add Philadelphia's demand to that of Chicago to get a modified demand at Chicago of 437. We remove Philadelphia from the tree along with the link connecting Philadelphia to Chicago. Next, we can process Detroit. The modified demand at Detroit is 835, which is less than half the total demand in the tree. We add this demand to that of Chicago to get 1272. We remove Detroit from the tree as well as the link between Detroit and Chicago. Next, we process Chicago. The modified demand at Chicago is 1272, which exceeds half the total demand in the tree. We stop with the optimal location at Chicago. If we evaluate the demand-weighted total distance at this node, we get a value of 2,213,386, which converts to a demand-weighted average distance of 1011.60. Table 4.3 shows the demand-weighted total and average distance if we locate at every one of the nodes. You can readily verify that locating in Chicago does, indeed, result in the smallest demand-weighted distance. This algorithm locates facilities only on the demand nodes of the tree. One key question that needs to be addressed is whether or not locating on the links might be better. This is a question that is often asked in network location problems. As we will see later, for this problem (of minimizing the demandweighted total or average distance), restricting our attention to locations on the nodes does not pose a problem. In fact, at least one optimal solution to the problem will consist of locating on a node. In other network location problems,
199
TAXONOMY OF LOCATION PROBLEMS
TABLE 4.3. Demand-weighted distances for each candidate city in Figure 4.6 ao c
ß υ
o
<
O
D e m 2675502 3460676 2336670 2213386 2497830 2914918 2720598 3628582 4173922 4212484 Wtd Tot Min? MIN Dem 1222.81 1581.66 1067.95 1011.60 1141.60 1332.23 1243.42 1658.40 1907.64 1925.27 Wtd Avg
with other objective functions, location on a link may be preferable to location on a node. Many other specialized algorithms have been developed for location problems on networks with an emphasis on tree networks. Many of these algorithms are beyond the scope of this text. 4.2.4
Discrete Location Models
In discrete location models, demands and candidate locations are discretized. What this means in practice is that the service region will be divided into many small sub-areas. We will associate a demand with each sub-area and we will typically assume that the demand of that sub-area originates at a single point within the sub-area. The process of aggregating demand within a zone to a single point in the zone introduces a number of different errors (Hillsman and Rhoda, 1978; Erkut and Bozkaya, 1999; and Francis, Lowe, and Tamir, 2002). In most practical contexts, these errors are likely to be relatively small, however, compared at least to the more heroic assumptions made by either analytic models or continuous location models. In addition to discretizing the demands, there will be a discrete set of candidate sites. For example, for the problem of locating ambulances in Austin, Texas, described above in section 4.1.1, the city was divided into 358 serial zones. A demand was associated with each serial zone. Actually, a number of different demand values were tested, including the historical call rate from the zone, the population of the zone, and the number of elderly individuals in the zone. Ambulance bases could be located at any one of the 358 zones in most of the analyses, though the set of candidate sites was limited in some cases to those zones in which the city already owned land. The distances between demand nodes and candidate facility sites can be any values the user chooses. For example, in physical location problems, the distances
200
LOCATION AND DISTRICTING PROBLEMS IN SERVICES
can be great circle distances, highway distances, travel times, or travel costs. In other contexts, the "distances" may have nothing to do with physical distances. For example, Stephen Baker, in a best-selling book entitled The Numerati, discusses a variety of mathematical modeling applications aimed at identifying worker, consumer, and voter characteristics (Baker, 2008). One way of developing these models is to use location theory. Each individual would be associated with a number of different characteristics (age, gender, home location, whether or not he or she was employed, income, whether he or she owned or rented a home, the number of cars the person owned, when he or she last traveled outside the United States, and so on). The "distance" between individuals would then be some measure of the difference between these characteristics. We could then ask a location model to find the "locations" of 10 individuals who are "representative" of the entire population in the sense that the sum of the "distances" between each individual and the nearest "representative" person is as small as possible. Some of the problems described by Baker can be modeled in this way, while others are better modeled using multiple regression techniques and other statistical procedures. Discrete location models can be further classified by the nature of the objective function used in the problem as shown in Figure 4.7. In one class of discrete location problems, we are concerned with covering demands or nodes. For every demand node, we associate a set of candidate facility nodes that can cover the demand node. Typically, demands at node a are said to be covered by a facility located at node b if the distance or time between a and b is less than some critical covering distance or time. For example, in locating emergency medical services, demands at node a may be covered by an ambulance at node b if the travel time from node b to node a is 8 minutes or less. The set covering model finds the minimum number of facilities (or, more generally, the minimum cost of the facilities) needed to cover all demand nodes at least once. As indicated below, there are many problems with the set
Figure 4.7. Taxonomy of discrete location models
TAXONOMY OF LOCATION PROBLEMS
201
covering model in practical contexts, not the least of which is that we often need more facilities to cover all demands than we can readily afford. The maximal covering model identifies the locations of p facilities that maximize the number of covered demands. This model recognizes that not all demands can be covered in all instances. The p-center model also locates p facilities. In this model, we again require that all demands be covered. The p-center model seeks the locations of p facilities so that the coverage distance (or time) is as small as possible while ensuring that all demands are covered within this distance (or time). Covering models are often used to analyze emergency services. In many cases there are guidelines that dictate the service standards in various communities for such services. For example, the National Fire Protection Association guideline 1710 establishes a 4-minute response time standard for the arrival of the first responder unit to the scene of a medical incident and 8 minutes or less for the arrival of an advanced life support vehicle to the scene of a medical emergency in areas in which the fire department provides emergency medical services (National Fire Protection Association, 2001). Average distance models represent the second major category of discrete location problems. We have already seen a problem in this category in section 4.2.3 in which we found the location of a single facility on a tree network to minimize the demand-weighted total distance between the facility and all other demand nodes. Models of this sort are particularly useful when trying to minimize the cost of distributing services. For example, a firm selling large "white goods" such as refrigerators, washing machines, and dryers will have to deliver these goods to customer homes. Models that minimize the average distance from a set of warehouses to customer homes will reduce delivery costs. The p-median model locates p facilities to minimize the demand-weighted total or average distance. The distance for each demand node is the distance from that node to the nearest of the located facilities. This distance is multiplied by the demand at that node and then the product is summed over all demand nodes to obtain the objective function value (as outlined in section 4.2.3). The fixed charge location model extends this to include the determination of the number of facilities to locate as well as their locations to minimize the combined facility and transport costs. The model of section 4.2.1 is the continuous approximation to the fixed charge location model. In the discrete version, the demands do not have to be uniformly distributed, any distances can be used between the demand nodes and the candidate sites, and the cost of constructing a facility can depend on the location of the facility. Finally, some models do not have either covering or average distance objectives. For example, the p-dispersion model locates a fixed number of facilities, p, to maximize the minimum distance between the facilities that are being located. Note that this model does not deal with the distances between facilities and customers; instead, it focuses only on the distances between facilities. Qualitatively speaking, the model attempts to spread the facilities out as much as possible. The measure of how "spread out" the facilities are is the
202
LOCATION AND DISTRICTING PROBLEMS IN SERVICES
minimum distance between any pair of facilities. The model attempts to maximize this distance. Kuby (1987) formulated this problem as an integer programming model. There are two key applications for the p-dispersion model. The first is in franchising. A company might well want to protect its franchisees against cannibalization of their market shares. By maximizing the distance between the closest pair of facilities, the company can do its best to prevent cannibalization while still locating a given number of facilities. The second application is much less benign and has to do with the location of strategic stockpiles of either weapons of defensive equipment such as medications in the event of a bioterrorist attack. Clearly, no country would want all of its reserves to be destroyed by a few coordinated attacks. As a result, such stores of equipment are often dispersed throughout the country, while ensuring that no two stockpiles are too close to each other. Some facilities are deemed undesirable. For example, no one wants either a solid waste repository or a nuclear waste repository in their backyard. Such facilities should ideally be placed as far from population centers as possible. A variety of models have been proposed for such facilities, though much of this literature is beyond the scope of this text. For a review of this literature, the reader is referred to Erkut and Neuman (1989). Some of these models are in the covering family and some are in the average distance family, though the objectives and constraints in these models are often significantly different from those discussed in this text. Some models of undesirable facility locations adopt approaches that do not fall into either category. Many of the undesirable facility location models are multi-objective because few facilities are truly completely undesirable. An ambulance base is an example of a facility that is generally desirable. On the other hand, no one wants to live right across the street from an ambulance base if the vehicles frequently leave the base with bells and whistles and sirens and flashing lights at 2 o'clock in the morning! Thus, even highly desirable facilities are, in some cases, somewhat undesirable. Similarly, while we all want to be far from solid waste dumps, we do not want to pay for our trash to be hauled excessively long distances. Thus, facilities that are inherently undesirable also inherit some properties of desirable facilities.
4.2.5
Outline of the Remainder of the Chapter
The remainder of this chapter focuses on discrete location problems. The primary emphasis is on covering and average distance models. Section 4.3 discusses covering models while section 4.4 deals with average distance or median models. These two modeling streams come together in section 4.5, which focuses on multiobjective location problems. Section 4.6 introduces districting, a problem that is intimately related to location problems. Section 4.7 introduces a number of simple models that can be used in franchise location problems. Finally, section 4.8 provides a brief summary of the chapter.
203
COVERING PROBLEMS
4.3
COVERING PROBLEMS
Covering models represent the most basic of discrete location models. In this section, we begin with the simplest of all location models, the set covering model. While this model is exceptionally simple to state and to formulate, it has been used in a broad range of facility location problems as well as other contexts. Despite its seeming simplicity, the model can be difficult to solve. Therefore, we outline a number of techniques that can be used to reduce the difficulty of solving this particular model. The set covering model requires all demand nodes to be covered. This is often overly expensive. Therefore, we outline two extensions to this model. Both extensions fix the number of available sites to p, a user input value. The maximal covering model maximizes the number of covered demands while the p-center model minimizes the coverage distance or time required to cover all demands.
4.3.1 Set Covering—Minimizing the Number of Facilities Needed to Cover All Demands The set covering model (Toregas et al., 1971) requires that all demand nodes be covered. In this and the remainder of section 4.3 we will discuss covering problems in terms of distance. The reader should realize that coverage can be formulated in terms of distance, cost, time, or any other set of criteria. In the set covering problem, we are given a set of demand nodes, I, and a set of candidate facility locations, J. For every candidate location ;' e / , we are also given the cost f¡ of locating at that candidate site. We are also given the distances, d¡¡, between candidate location j e J and demand node / e /. Finally, we are given the coverage distance, Dc. If the d¡¡ < Dc, then a facility at location j e J can cover demand node / e /; otherwise, it cannot. Mathematically, we can set an indicator parameter as follows.
^ e ..Jl " [O if not
^
The set covering model uses only a single class of decision variables. We define X¡ to be 1 if we choose to locate at candidate site j G J and 0 if not. With these inputs, we can now formulate the set covering problem as follows. Minimize
J^fjX,
s.t.
J^avX¡^l
VIE/
(4 9)
X, e {0,1}
V; e /
(4.10)
(4 8 )
The objective function (4.8) minimizes the total cost of all of the selected sites. Constraint (4.9) states that each demand node must be covered by at least one selected site. The term on the left hand side of the inequality in (4.9),
^a^Xj,
204
LOCATION AND DISTRICTING PROBLEMS IN SERVICES
Figure 4.8. Simple network for covering problems
is the number of selected candidate sites that cover demand node / e /. We will see this term repeatedly throughout section 4.3. In the location set covering model, we generally assume that all facility costs are identical. In that case, we can simplify the objective function to Minimize
ΣΧι·
(4Λ1)
This objective function simply minimizes the number of selected sites. Unless otherwise stated, we will assume that the set covering model uses objective function (4.11) instead of that shown in (4.8). To illustrate the set covering problem, consider the simple seven-node problem shown in Figure 4.8. The numbers beside each link are the link distances while the numbers beside each node are the demands per unit time at the node. For the set covering problem, we can ignore these demands because we are concerned only with whether or not a demand node is covered. We will use the demand values in subsequent formulations. The matrix of shortest path distances is shown in Table 4.4. If the coverage distance is 8, Table 4.5 shows the matrix of coverage coefficients, aih for this problem. The set covering problem for the network shown in Figure 4.8 and a coverage distance of 8 can now be formulated as follows. Minimize
X A+
XB+
Xc + XD+
Subject to
XA + XA+
XB+ XB+
Xc+
XA+ XA+
XD +
>1 >1
XF XF Xc
>1 >1 >1
XE+
XF+ XF
Xc XG
>1 >1
XE,
XF,
Xc
e{0,1}
XE+ Xc+
XB,
XG
XF
XD+ XD +
XB+
X A,
XF+
XE Xc+ Xc+
XA+
X E+
Xc,
XD+ XD,
COVERING PROBLEMS
TABLE 4.4. Table of shortest path distances for the network of Figure 4.8
A B C D E F G
A
B
c
D
E
F
G
0 7 4 5 12 7 14
7 0 11 12 5 14 11
4 11 0 7 16 3 11
5 12 7 0 15 5 9
12 5 16 15 0 14 6
7 14 3 5 14 0 8
14 11 11 9 6 8 0
TABLE 4.5. Table of coverage coefficients for the shortest path distances in Table 4.4 and a coverage distance of 8
A B C D E F G
A
B
c
D
E
F
G
1 1 1 1 0 1 0
1 1 0 0 1 0 0
1 0 1 1 0 1 0
1 0 1 1 0 1 0
0 1 0 0 1 0 1
1 0 1 1 0 1 1
0 0 0 0 1 1 1
206
LOCATION AND DISTRICTING PROBLEMS IN SERVICES
COVERING PROBLEMS
207
Although What's Best can readily solve small set covering problems, the set covering problem is inherently a difficult problem to solve. In fact, it falls in a class of problems that are called NP-hard problems. These are problems for which there is no known algorithm whose execution time is a polynomial function of the size of the problem (e.g., the number of nodes) that guarantees an optimal solution. Thus, the worst-case execution time required to solve such problems optimally grows exponentially with the size of the problem. It is worth noting that the set covering problem is NP-hard both in the case of objective (4.8) and in the case of the simpler objective (4.11). The reader is referred to Garey and Johnson (1979) for a more detailed discussion of the theory of NP-hard problems. To help solve the location set covering problem with objective (4.11) a number of reduction rules have been devised. These rules simplify the problem while ensuring that the algorithm still returns an optimal solution. 4.3.1.1 Column Reduction Rules. The first rule is a column reduction rule. Column Reduction Rule: If candidate site / covers every demand node covered by candidate site k plus at least one other demand node, then we can eliminate candidate site k from further consideration. Candidate site k is said to be
208
LOCATION A N D DISTRICTING PROBLEMS IN SERVICES
dominated by candidate site; since candidate site/ does everything that candidate site k does plus some more. Casually, we can think of this as the "bang for the buck" rule. We get more bang for our buck from node / than we do from node k, so why use node k at all? To illustrate this rule, consider again, the problem associated with Figure 4.8. The problem is restated below; beside each constraint we have identified the node whose coverage is being ensured. Let us focus on the column corresponding to locating at node C. Node C covers nodes A, C, D, and F. Node A, on the other hand covers nodes A, C, D, and F as well as node B. Therefore, node A does everything that node C does, plus more. We can eliminate node C from the problem. Similarly, node D is dominated by node A and we can eliminate node D from the problem.
xA +
Minimize Subject to
A) B)
*A
+
xA +
C)
*A
+
D)
*A
+
XB + XB
xc + xc +
XD +
XE
+
xc + xc +
XA
xc +
+
XD + XE
Xß,
xF
+
xG
>1 >1 >1 >1
Xa
>1
XF +
Xc
>1
XE +
XF
Xc
>1
XE,
*F,
XD + XD,
*c>
XF +
xF xF
XD +
G) XA,
XE +
XD +
XB +
E) F)
XB +
xG
e{0,l}
This leaves us with the problem shown below. Note that we now have only five decision variables instead of 7. The problem is becoming easier.
xA +
Minimize Subject to
XB
+
A)
XA
+
XB +
B)
XA
+
XB +
C) D)
xA + xA +
E) F)
XB +
xE XE +
XF +
xF
xE + x F
G) Xß'
XE,
Xa >1 >1
xF xF xF +
xA + XA,
XE +
xF,
>1 >1 Xa
>1
Xa
>1
Xa
>1
Xa
€ { 0 , 1}
Note that if two columns are identical, then, strictly speaking, the column reduction rule does not apply. However, we can eliminate one of the columns as both locations cover exactly the same nodes. We will use this property below. 4.3.1.2 Row Reduction Rules. The first row reduction rule is similar in spirit to the column reduction rule discussed in section 4.3.1.1.
209
COVERING PROBLEMS
Row Reduction Rule 1: If demand node m is covered by all nodes that cover demand node n plus at least one other node, then we can eliminate demand node m from the problem as the constraint associated with it is redundant. In other words, once we know that node n is covered, we can be sure that node m is also covered, so we do not need to worry explicitly about node m. To illustrate the use of this rule, consider the reduced problem shown above. Let us consider the rows associated with demand nodes A and C, respectively. Node C is covered by nodes A and F, while node A is covered by nodes A and F and also by node B. If we know that the constraint associated with node C is satisfied (as it must in an optimal solution), the constraint associated with node A must also be satisfied. We can eliminate the row associated with node A. Similarly, the constraint associated with node F shows that node F is covered by nodes A, F, and G. Again, if we satisfy the constraint associated with node C (by picking either node A or node F), we can be assured that the constraint associated with node F will also be satisfied. Finally, the constraints for nodes C and D are identical and so even though neither constraint is strictly dominated by the other, we need only one of these constraints and so we can eliminate the constraint associated with node D. The resulting problem is now given by the following formulation. Minimize Subject to
B) C) E)
XA + XB + XE+ XA+ XB+ XE
XF+
XA+
XF XB+
XE+
XB,
X E+ X E,
G) X A,
Xc >1
XF XF,
XG
>1 >1
Xc Xc
>1 €{0,1}
We can now again apply the column reduction rule to this problem, eliminating the columns associated with candidate nodes B and G, which are both dominated by node E. We now have the following problem with only three decision variables and four constraints. XA +
XE +
B)
XA +
XE
C) E)
XA+
Minimize Subject to
XF >1 XF
>1 >1
XF XF
>1 e{0,l}
XE+
G) X A,
XE+ XE,
This formulation leads to the second row reduction rule. Row Reduction Rule 2: If a constraint has only one variable in it, set that decision variable to 1 and eliminate any row that contains that decision variable. Also, eliminate the column corresponding to that decision variable.
210
LOCATION AND DISTRICTING PROBLEMS IN SERVICES
In this case, the row corresponding to demand node E contains only one decision variable. So we set XE = 1 and we can eliminate the rows corresponding to nodes B, E, and G, as they will now be satisfied by setting XE = 1. The new problem is: Minimize Subject to C)
XA + XA+
XF XF
X A,
XF XE
>1 e{0,l} =1
Just as the rows corresponding to demand node C and D above were the same and so we could eliminate one of them, so too can we eliminate one of two identical columns. In this case, we eliminate the column associated with node F (picking arbitrarily) and we are left with a trivial problem. We locate at nodes A and E as in the Excel solution. Note that we have been able to solve this problem using only the row and column reduction rules. We did not have to use any optimization software in this case!
4.3.2
Other Applications of Set Covering Models
Despite its simplicity, the set covering problem—along with its close cousin, the set partitioning problem in which inequalities (4.9) are replaced by equality constraints—has been used extensively in both facility location problems as well as other contexts. One of the most important applications of the set partitioning problem is to the assignment of crews to aircraft. In this context, each row of the problem corresponds to a flight leg. A flight leg is a single trip by a single aircraft at a particular time. Thus, an aircraft scheduled to fly from Chicago to Dallas at 8 A.M. on a particular Wednesday morning constitutes a flight leg. There is one constraint for each flight leg and the constraint is similar to constraint (4.9), except that it is an equality constraint. The constraint says that each flight leg must have exactly one flight crew on board. It is very reassuring to know that this constraint exists, particularly when you are sitting in seat 14C of the aircraft as it accelerates down the runway for takeoff! Instead of candidate facility locations, each decision variable now corresponds to a set of duties that a crew can perform. For example, a crew might fly the 8 A.M. flight from Chicago to Dallas on Wednesday morning, arriving at 10:30 A.M. The same flight crew might fly from Dallas to Denver that afternoon leaving at 2 P.M. and arriving at 3 P.M. local time. Finally, the crew might fly from Denver to Chicago leaving at 5 P.M. and arriving back in Chicago at 8:30 P.M. local time. Another alternative would have the crew fly from Chicago to Dallas, from Dallas to New York, spend the night in New York, fly from there to London, spend the
COVERING PROBLEMS
211
night in England and then fly back to Chicago on the second day. The first itinerary covers three flight legs all on the same day, while the second itinerary covers four flight legs over 3 days. The cost of the second flight leg is considerably larger than the first, since it must also account for the costs of having a crew "overnight" in New York and then in London, England. One of the difficulties with assigning crews to flight legs in this manner is that the number of possible columns is explosively large. In fact, when these problems are solved in practice, we do not explicitly enumerate every possible combination of flight legs. Rather, we do so implicitly. We solve a problem with a very small number of decision variables. Then, using the dual variables for each constraint, we can structure a new problem known as the "pricing" problem. The solution to the pricing problem tells us whether or not there are additional columns or decision variables that should have been included in the smaller problem. We then add those columns and resolve the problem. From this new solution, we get new dual variables associated with each flight leg. The process continues in this way until no more additional decision variables need to be added. The process is actually a bit more complicated since, at each stage, we really are solving the linear programming relaxation of the set partitioning problem. After we cannot profitably add any more decision variables to the problem, we solve an integer programming problem with the decision variables that we have in the problem. The process is known as column generation. A complete discussion of column generation is beyond the scope of this text. The key point is that the set partitioning problem, a problem closely akin to the set covering problem, is used in contexts that range far afield from facility location problems. Assigning airline crews to flight legs is only one of many applications of set covering and set partitioning problems. 4.3.3
Limitations of Set Covering Models
Despite its widespread applications beyond location modeling, the set covering problem has some serious limitations in terms of facility location problems. Some of these problems are outlined below. 4.3.3.1 There Are Multiple Optima for the Set Covering Model. One of the problems with the location set covering model should be apparent from the solution to the simple problem that we obtained using the row and column reduction rules. At the end of the process, we had a choice between node A or node F. We arbitrarily decided to locate at node A, but clearly we could also have chosen to locate at node F There are likely to be many alternate optima to a set covering problem. Unfortunately, the set covering model does not provide any guidance as to which might be better in practice. Problem 6 at the end of the chapter highlights this limitation of the set covering model.
212
LOCATION AND DISTRICTING PROBLEMS IN SERVICES
4.3.3.2 May Be Too Costly to Cover All Demands. The set covering problem requires that all demands be covered within the coverage distance. Often this is very expensive. To illustrate this, consider the problem with the 250 most populous counties in the contiguous United States. There are 171,100,691 people in these counties according to the 2000 census. Despite the fact that there are 3109 counties in the contiguous states, these 250 counties represent over 61 percent of the total U.S. population. Figure 4.10 shows the results of maximizing the number of covered demands for different numbers of facilities and different coverage distances. (We discuss the maximal covering model in section 4.3.4.) Each of the three curves, corresponding to coverage distances of 200, 250, and 300 miles, respectively, shows decreasing marginal coverage. In other words, the first few sites cover a lot of demand, while covering the last few demands requires many sites. In fact, it is often the case that about 90 percent of the demand can be covered with half of the number of sites needed to cover 100 percent of the demand. This is clearly shown in Table 4.6, which gives the raw data used in Figure 4.10. The values at the end of each set of columns show the number of facilities needed to cover all demands. For example, 26 facilities are needed to cover all demands with a coverage distance of 200 miles. With only 13 facilities, over 90 percent of the demands are covered. Figure 4.11 plots the solution. Although 37 of the 250 counties are not covered within 200 miles of the nearest facility, they represent less than 9 percent of the population in the 250 counties. Similar results hold true at coverage distances of 250 and 300 miles.
Figure 4.10. Percent covered vs. number of sites for three coverage distances
COVERING PROBLEMS
213
TABLE 4.6. Population and percent covered vs. number of sites for three coverage distances 200 miles No Sites
Number Covered
% Covered
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
0 41,276,512 65,030,133 87,998,361 100,256,176 112,393,465 121,817,012 129,038,958 135,948,958 141,622,055 145,541,572 149,457,467 153,049,741 156,042,968 158,452,564 160,750,609 163,031,832 164,849,131 166,390,477 167,896,394 168,576,016 169,132,694 169,661,794 170,139,220 170,557,159 170,858,063 171,100,691
0.00% 24.12% 38.01% 51.43% 58.59% 65.69% 71.20% 75.42% 79.46% 82.77% 85.06% 87.35% 89.45% 91.20% 92.61% 93.95% 95.28% 96.35% 97.25% 98.13% 98.52% 98.85% 99.16% 99.44% 99.68% 99.86% 100.00%
250 miles Number Covered
% Covered
0 46,126,641 76,489,976 101,761,687 114,569,314 127,298,629 135,296,056 141,387,092 147,005,847 150,921,742 154,742,570 157,783,225 160,776,452 163,590,285 166,249,804 167,814,942 169,320,859 170,557,159 170,858,063 171,100,691
0.00% 26.96% 44.70% 59.47% 66.96% 74.40% 79.07% 82.63% 85.92% 88.21% 90.44% 92.22% 93.97% 95.61% 97.16% 98.08% 98.96% 99.68% 99.86% 100.00%
300 miles Number Covered
% Covered
0 51,352,982 84, 530,150 110,584,175 125,605,585 138,644,869 146,520,568 152,611,604 158,696,615 163,292,132 166,842,037 168,648,858 170,307,787 171,100,691
0.00% 30.01% 49.40% 64.63% 73.41% 81.03% 85.63% 89.19% 92.75% 95.44% 97.51% 98.57% 99.54% 100.00%
It is often possible to cover 90 percent of the total demand with about half the number of facilities needed to cover all demands. Thus, insisting on 100 percent coverage, as does the set covering model, requires many more sites than would be required if we could live with only a few demands being uncovered. 4.3.3.3 Does Not Discriminate between Big and Small Demand Nodes. Finally, the set covering model does not distinguish between nodes with large demands and those with small demands. Covering Chicago in the set covering model is just as important as covering Peoria, Illinois. This too is a serious limitation associated with using the set covering model, particularly when there are limited resources.
214
LOCATION AND DISTRICTING PROBLEMS IN SERVICES
Figure 4 . 1 1 . Solution covering 90 percent of the demand at 200 miles with only 13 sites. (See color insert)
4.3.4 Maximal Covering—Maximizing the Number of Covered Demands with a Fixed Number of Facilities To address the problems associated with the set covering model, we can, instead, use the maximal covering model (Church and ReVelle, 1974). The inputs to the maximal covering model begin with those for the set covering model. Now, however, we need to know the demand associated with each demand node. The demand might represent the expected number of calls for emergency medical service from each serial zone in a city each year, for example. For the problem shown in Figure 4.8, these are the values enclosed in the rectangles next to each demand node. We denote the demand at demand node i e I by h¡. We also need to know the number of facilities to locate, which we designate as p. In addition to the location variables, X¡, we need a variable to indicate whether or not each demand node is covered by the sites we select. For each demand node i e /, we associate a coverage variable, Z„ which takes on a value of 1 if the demand node is covered and 0 if it is not covered by any of the selected sites. With this notation, we can formulate the maximal covering location problem as follows.
COVERING PROBLEMS
215
Maximize
V h iZ i
(4.12)
is I
s.t.
Υ α , , Λ ' , - Ζ , >0
Vie/
jeJ
ΣΧϊ=Ρ
(4.13)
(4.14)
*,e{0,l}
V/e/
(4.15)
Z,e{0,l}
Vie/
(4.16)
The objective function (4.12) maximizes the number of covered demands. Note that this is in terms of the demands at the nodes and not in terms of the number of nodes. Covering one demand node with a lot of demand may be much more valuable in terms of objective (4.12) than is covering many much smaller demand nodes. Constraints (4.13) link the coverage variables to the location variables. The first term of (4.13) is the term we have seen before in the set covering model. This term counts the number of selected facilities that cover demand node i e /. Constraint (4.14) limits the number of selected facilities to p. Constraints (4.15) and (4.16) are standard integrality constraints.
216
LOCATION AND DISTRICTING PROBLEMS IN SERVICES
217
COVERING PROBLEMS
When this model is run for the simple network shown in Figure 4.8 using a coverage distance of 5, we obtain the results shown in Table 4.7. Note that four facilities are needed to cover all demands. Even for this very simple (and randomly generated network), nearly 90 percent of the demands can be covered with half this number of facilities. This is consistent with the results shown in Figure 4.10 for the 250 most populous counties in the United States. 4.3.5 P-Center Problem—Minimizing the Maximum Distance with a Fixed Number of Facilities Instead of allowing some demand nodes or customers to remain uncovered, as does the maximal covering problem, the P-center problem again insists on complete coverage. In this sense, it is similar to the set covering problem. In the P-center problem, however, the number of facilities is fixed at P as in the maximal covering problem. The P-center problem finds the smallest coverage distance or time such that all demands are covered using only P facilities. Before turning to the formulation and solution of the P-center problem, it is worthwhile to take a slight detour to discuss a key property of the set covering, maximal covering, and P-center problems. Consider the simple two-node network shown in Figure 4.13. If we are restricted to locating on the nodes of the network and the coverage distance is less than 1.0, we need two facilities, one on each node. However, if we can locate on the nodes and the links, we can locate a single facility in the middle of the link between nodes A and B and we can cover both nodes with a single facility, as long as the coverage distance is 0.5 or more. This example shows that for the set covering model, allowing facilities to be located on the links and the nodes can reduce the number of facilities needed to TABLE 4.7. Maximal covering model results for the network shown in Figure 4.8 using a coverage distance of 5
Coverage distance := 5 Number of Sites
Locations
Number Covered
% Covered
0 1 2 3 4
B B, C B,C,G B,C,E,G
0 450 750 825 870
0.0% 51.7% 86.2% 94.8% 100.0%
218
LOCATION AND DISTRICTING PROBLEMS IN SERVICES
Figure 4,13. Simple two-node network
cover all demands. Similarly, for the maximal covering model, locating on the nodes and links of a network can increase the covered demand for a given number of facilities. In the case of the P-center problem, this feature of covering models is formalized even more. There are two variants of the P-center model. When we restrict the facilities to the nodes of the network, we are solving a vertex P-center problem; if we allow facilities to be located on the nodes and the links of the network, we are solving an absolute P-center problem. It should be clear from Figure 4.13 that the solutions to these two problems may differ. The solution to the vertex 1-center problem on the network of Figure 4.13 is to locate at either node with the objective function taking on a value of 1. The solution to the absolute 1-center problem is to locate a single facility at the midpoint of the link between nodes A and B; the objective function value in this case is 0.5. In this chapter, the set of candidate facility sites has been designated as / . This set could be any set of candidate sites. It turns out that we can augment the set of demand nodes by a finite set of additional points such that, if we restrict our attention to this augmented set of nodes, the optimal solution to the set covering or maximal covering problem will have the same value as that obtained by allowing ourselves to locate anywhere on the links (Church and Meadows, 1979). This same approach can be used in solving the P-center problem. This approach is beyond the scope of this text. Therefore, in the numerical examples outlined above and in the models discussed below, we will generally assume that the set of candidate sites is the same as the set of demand nodes. While we can formulate the P-center problem as a mixed integer programming problem, and we will do so in section 4.4.3, for now we can solve the vertex P-center problem using the maximal covering model alone. Consider the following algorithm, which assumes that all distances are integer-valued. Step 0: Set D,ow = 0 and Dhi = max {ά,λ Step 1: Set Dc
D
low
1
+D"
¡Ei,jW
L
, where
U
LJCJ
is the value of x rounded down to
the largest integer that is equal to or smaller than x. Solve the maximal covering problem with this value of the critical distance. Step 2: If all of the demand is covered, set DM = Dc; otherwise set Dlow = Dc + Í. Step 3: If Dlow = DM, stop; the optimal solution value is Dhi and the optimal locations correspond to the locations for the maximal covering problem with Dc = Dhi. If D,ow < Dhi, go to step 1.
219
COVERING PROBLEMS
TABLE 4.8. Results of using the maximal covering model to solve the four-center problem for the network of Figure 4.8 LowerBound
UpperBound
Coverage to Use
Covered Demand
All Covered?
Sites
0 0 5 5 5
16 8 8 6 5
8 4 6 5 5
870 825 870 870 870
Yes No Yes Yes Value = 5
A,E,G B, C, E, G A, C, E, F B, D, F, G B, D, F, G
In this algorithm, D,ow and D1" represent lower and upper bounds on the objective function for the P-center problem. Table 4.8 shows the results of using this algorithm on the network shown in Figure 4.8 when we are locating four facilities on the nodes of the network. We begin with Dlow = 0 and Dhi = 16. In step 1, this results in Dc = ^ ^ -
= 8. When
we solve the maximal covering problem with P = 4 and a coverage distance of 8, we find that we can cover all demands. In fact, we need only three facilities to do so, located at nodes A, E and G. In step 2, we set D1" = Dc = 8 and then, going 0+8 through step 3, we return to step 1. With a coverage distance of Dc = = 4, we cannot cover all of the demands and so we set Dhw = Dc + 1 = 5. The process continues until we can show that the smallest coverage distance such that all demands are covered with four facilities is a distance of 5. We locate at nodes B, D, F, and G. We can also embed the set covering model in an algorithm to solve the P-center problem as indicated in problem 7 at the end of the chapter.
4.3.6
Extensions of Basic Covering Models
"Thank you for calling the city's 911 line. Your call is important to us. All ambulances are busy serving other patients at this time. Please remain on the line and your call will be answered in the order in which it was received." Fade to background music for 1 minute. "Thank you for calling the city's 911 line. Your call ..." This would be a most unfortunate response if someone called for an ambulance. Unfortunately, it is not completely hypothetical. One study (Waxman, 2001) found that over 75 million people in the United States (about 25 percent of the population) live in areas in which emergency room diversions—refusals to accept additional patients—impede access to emergency care. In Los Angeles,
220
LOCATION AND DISTRICTING PROBLEMS IN SERVICES
two dozen emergency rooms were closed roughly one third of the time. Many other cities exhibited similar problems. In locating emergency services, it is often important to have some form of backup service available in case the nearest available facility is busy or unavailable for some other reason. One simple extension of the set covering model begins to deal with backup coverage. Consider again, constraint (4.9), which requires that each demand node be covered at least once. The difference between the left-hand side of the constraint, Χ,^/^Ο' an<^ t n e right-hand side of the constraint gives the number of extra times node / is covered. The hierarchical objective set covering model (Daskin and Stern, 1981) maximizes the total number of multiple coverages of nodes as a secondary objective. The model is formulated as follows. Minimize
W^Xj—'^Sl
s.t.
]Ta.Jfy.-S,>l
Vie/
(418)
X¡ 6 {0,1}
V/e/
(4.19)
5,>0
Vie/
(4.20)
(4Π)
jej
In this formulation, S¡ is the number of extra times that demand node i is covered above and beyond the one time that it has to be covered. The second term of the objective function maximizes the total number of extra coverages of nodes. To ensure that we first minimize the number of facilities required to cover all demand nodes at least once, we place a large weight, W, on the primary objective, that of minimizing the number of required facilities. Problem 8 asks you to show that if W > l/l, then the solution to the hierarchical objective location problem will use the minimum number of facilities needed to cover all demands. This model has three advantages over the traditional maximal covering model of equation (4.11) subject to equations (4.9) and (4.10). First, the model helps distinguish between some of the alternate optima to the set covering model. Second, it finds one of the optimal solutions that maximizes a measure of backup coverages. Finally, the model tends to result in all-integer solutions somewhat more often than does the traditional set covering model. Benedict extends this model to account for decreasing benefits of additional extra coverage and for the differential benefit of extra coverage for large demand nodes as opposed to nodes with relatively small demands (Benedict, 1983). Daskin, Hogan, and ReVelle (1988) also propose a number of extensions of the set covering model along similar lines. The maximum expected covering location model (Daskin, 1982, 1983) extends the maximal covering model to account approximately for ambulance busy periods. The model maximizes the expected number of demands that can
221
COVERING PROBLEMS
be covered by an available vehicle. The model assumes that the probability of a vehicle being busy at any location is given by q. This can be estimated approximately using the fraction of time that all vehicles are busy during a given time period (such as a month) divided by the total number of available vehicle hours (the total time all vehicles are on duty) during the time period. The model also assumes that vehicle busy periods are independent. With these assumptions, if there are n vehicles that can cover a demand node, the probability that all of them are simultaneously busy is given by qn. If there were one more vehicle able to cover the demand node, the probability of all of them being busy would be q"+i. Thus, the decrease in probability that all are busy due to adding the n + 1st vehicle capable of covering the node is given by q" - qn+1 = qn{\ - q). Now, instead of simply identifying whether or not a demand node is covered, we need to know how many times the node is covered. Therefore, we replace the coverage variable, Z„ by Zik, which we define to be 1 if demand node i e / i s covered k or more times, and 0 if not. We can now formulate the maximum expected covering location model as follows. p
Maximize
^^%W(1-9)Z,,
s.t.
Σ<νΓ;-ΣΖα2 0 jej
(4.21)
Vi G/
(4.22)
4=1
Σ*,·^ X. > 0 and integer 0
(4.23) V; e J VieI;k
= l,2,...,P
(4.24) (4.25)
The objective function (4.21) maximizes the expected number of demands covered by an available vehicle. Constraint (4.22) links the location variables and the coverage variables. As before, the first term counts the number of vehicles that cover demand node i. The second term counts the number of times demand node / is covered in terms of the coverage variables. At the optimal solution, these terms will be equal and the constraint will be satisfied by equality. Constraint (4.23) is identical to constraint (4.14). It states that we can locate at most P vehicles. Constraint (4.24) differs from constraint (4.15) in that it allows multiple vehicles to be located at a single node. Intuitively, it may be better to locate multiple vehicles at a node that covers lots of demand than it is to spread the vehicles out so that all demands are covered once. Constraint (4.25) simply states that the coverage variables must be between 0 and 1. At an optimal solution they will be either 0 or 1. In fact, we can show that if demand node / is covered n times, then we will have Z ;1 - Zi2 = — - Zin - 1 and Z1>+i = Z,,n+2 = ·■· = ZiP = 0. In other words, the first n such variables will take on a value of 1 and all other
222
LOCATION AND DISTRICTING PROBLEMS IN SERVICES
such variables for demand node / will take on a value of 0. This happens because each successive term of the objective function, for a given demand node i, is smaller than the preceding term by a factor of q, which we know is less than 1.
COVERING PROBLEMS
223
224
LOCATION AND DISTRICTING PROBLEMS IN SERVICES
Note that the optimal solution with P - 3 is to locate two vehicles at node B and one at node C, when q - 0.25. You should compare this to the traditional maximal covering solution shown in Figure 4.12, which ignores vehicle busy periods. That model located three facilities at B, C, and G. It predicted that 94.8 percent of the demands (or 825 of 870 demands) would be covered. However, if the probability of a vehicle being busy is 0.25, the expected number of covered demands that result from locating at B, C, and G is 618.75, or 71.1 percent of the total demand. This can be increased to 648.875 demands or 74.4 percent by moving one vehicle from node G to node B as a second vehicle at that location. It is also worth noting that in the traditional maximal covering solution, all demand nodes except node D are covered exactly once. In the expected covering solution, nodes D and G are not covered at all, but nodes B and E are covered twice. Table 4.9 and Figure 4.15 show the results of increasing the number of vehicles located for three different values of the probability of a vehicle being busy. Several points are clear from these results. First, for any probability of the vehicle being busy, the expected coverage increases as we increase the number of vehicles located. Second, for any number of vehicles located, the expected coverage decreases as the probability of a vehicle being busy increases. Finally, as the busy probability increases, the likelihood of collocating two or more facilities at a single site increases. For example, for a busy probability of 0.1, we first locate two facilities at the same node when we use seven facilities. At that point, two facilities are located at node G. When the probability of a vehicle being busy increases to 0.25, we collocate two facilities at node B once we utilize only three facilities. Finally, some of the rows near the bottom of Table 4.9 are shaded in gray. This indicates that there is at least one node that is covered four (or possibly more) times. For these solutions, it is possible that the approximation introduced by considering only the first four coverages of a node may be affecting the solution. Note that this only occurs when we are locating many vehicles. The approximation is also more likely to impact the solution when the probability of a vehicle being busy is large.
225
226
LOCATION AND DISTRICTING PROBLEMS IN SERVICES
Figure 4.15. Expected coverage vs. number located for the network of Figure 4.8
4.4 MEDIAN PROBLEMS—MINIMIZING THE DEMAND-WEIGHTED AVERAGE DISTANCE In many problems, we are more concerned with the demand-weighted average distance or total distance than we are with whether or not individual demand nodes are covered within some standard. For example, in many services in which deliveries occur, the total demand-weighted distance is a good proxy for the total delivery cost. This is particularly true when shipments occur in truckload quantities. Minimizing the demand-weighted total distance will tend to minimize the total delivery cost. In this section, we formulate and solve such problems. 4.4.1
The P-median Problem
The P-median problem (Hakimi, 1964,1965) locates P facilities on the nodes of a network to minimize the demand-weighted total distance between each demand node and the nearest facility. To formulate this problem, we need a new decision variable that will tell us how the demand nodes are assigned. In particular, we let Y¡j be 1 if demand node i e I is assigned to a facility at candidate location j e J, and 0 if this assignment is not made. With this notation, we can formulate the P-median problem as follows: Minimize Σ Σ Μ / Λ s.t.
Σγα
=1
v
(4.26) 'e/
(4.27)
MEDIAN PROBLEMS—MINIMIZING THE DEMAND-WEIGHTED AVERAGE DISTANCE
Yv-Xj<0
Vie/; ; e /
ΣΧ>=Ρ
227
(4.28)
(4.29)
jeJ
*,e{0,l}
V/e/
(4.30)
^ye{0,l}
VieI;jeJ
(4.31)
The objective function, (4.26), minimizes the demand-weighted total distance. Since the total demand is fixed in this model, we can divide the objective function value by the total demand, ]¡T h¡, to obtain the demand-weighted average distance. Constraint (4.27) ensures that each demand node is assigned exactly once. Constraint (4.28) stipulates that the assignments can be made only to open or selected facility sites. If we do not chose to locate at candidate site j , in other words, if Xj — 0, this constraint ensures that we do not assign any demand nodes to candidate site /. Constraint (4.29) states that we must locate exactly P facilities. Finally, constraints (4.30) and (4.31) are standard integrality constraints. Note that we can relax constraints (4.31) so that we simply state that the assignment variables must be non-negative. The model will automatically result in binary values for the assignment variables, except when two facilities are equi-distant from a demand node. In that case, the two variables may take on fractional values, but we can readily round one up to 1 and the other down to 0 and obtain an equivalent solution with the same objective function value. It is also worth noting that, unlike the covering models we discussed in section 4.3, we can show that at least one optimal solution to the P-median model consists of locating only on the demand nodes of the network. See problem 8 at the end of the chapter. Constraints (4.28) are the disaggregate version of the forcing or linkage constraints. For large problems that are generally solved using programs that go beyond the capability of Excel, we definitely want to use this form of the constraint. In such cases, there will almost certainly be a constraint generator program that will ensure that all of these constraints are included correctly in the model. However, for small problems that we solve in Excel, writing out all of these constraints by hand is tedious and is likely to result in errors. In such cases, we can use the aggregate version of the forcing constraints shown below. Σ^-|/|Χ,<0
V/e/
( 4.32)
This constraint states that the total number of nodes that are assigned to a facility at node/, ^Υ^, must be less than or equal to the total number of demand is/
nodes, l/l, times whether or not we locate at candidate site /. If we do not locate at this site, we cannot assign any demand nodes to the site; if we do locate there, then we can assign any and all demand nodes to the site if the model thinks that doing so is desirable.
228
LOCATION AND DISTRICTING PROBLEMS IN SERVICES
The key problem with the aggregate form of the forcing or linkage constraint, (4.32), compared to its disaggregate version, (4.28), is that the aggregate form is much more likely to result in fractional values for the location variables when we solve the linear programming relaxation of the problem. For small problem instances, this is not an issue since the amount of work that the Solver or What's Best must do is very small; for large problems, the disaggregate form of the constraint should be used.
The optimal solution with P = 3 is to locate three facilities, one each at nodes B, C, and E. Table 4.10 shows the effect of varying the number of facilities. The average distance decreases quickly as shown in Figure 4.17 and then it tapers off. Even for this small network, the average distance as a function of the number of demand nodes behaves in a way that is qualitatively similar to that found using the analytic model discussed in section 4.2.1 and shown as the transport cost in Figure 4.3. The results shown in Table 4.10 also clearly show that a greedy algorithm— find the best single site, locate there, hold that site fixed, find the best second site conditional on the location of the first, and so on—will not result in an optimal solution. If we lock in node B as a facility site and then solve the problem again, the optimal solution is to locate at nodes B and C with a demand-weighted average distance of 3.483. This is more than 25 percent greater than the
229
LOCATION AND DISTRICTING PROBLEMS IN SERVICES
TABLE 4.10. Varying the number of facilities located for the network of Figure 4.8 Number of Sites 0 1 2 3 4 5 6 7
Locations B C,E B,C,E A, B, C, E A, B, C, E, G A, B, C, E, F, G A, B, C, D, E, F, G
Avg Dist 6.615 2.764 1.615 1.052 0.534 0.259 0.000
Figure 4.17. Average distance vs. the number of facilities for the network of Figure 4.8
optimal distance of 2.764 found by locating at nodes C and E when we use only two facilities. 4.4.2
The Fixed Charge Location Problem
The P-median problem implicitly assumes that the cost of locating a facility is the same at each candidate site. Therefore, constraining the number of facilities to be equal to P is equivalent to constraining the facility construction costs. In many practical contexts, however, the facility costs vary significantly with the location of the sites. It may be preferable to locate at a more remote but cheaper location than to locate at a nearby but expensive site. The fixed charge location
MEDIAN PROBLEMS—MINIMIZING THE DEMAND-WEIGHTED AVERAGE DISTANCE
231
model recognizes the differences in facility costs across the candidate sites and minimizes the total facility costs plus the total transportation costs. The latter are taken as a constant multiplied by the demand-weighted total distance. This constant is the cost to ship one unit of demand one unit of distance. The formulation of this problem is nearly identical to that of the P-median model. We now need only one other input, the cost per demand per mile, for which we use the symbol a. The formulation of the fixed charge location model is given below. The objective function, (4.33), minimizes the sum of the fixed facility costs and the demand-weighted total distance multiplied by the cost per demand per mile. Note that the demands and the fixed costs must be expressed in terms of the same units of time. Thus, if h¡ is the demand per year at demand node i, then f¡ should be the annualized fixed cost of locating a facility at candidate site ;. The constraints are identical to the constraints for the P-median problem, except that we can exclude constraint (4.29), which limits the number of facilities to P. The fixed charge location problem will automatically determine how many facilities to locate to minimize the combined facility location costs and the transportation costs. This model is the discrete analog to the analytic location model discussed in section 4.2.1. ye/
jeJ
ie/
•
a r Ί
(4.33)
V
Vie/
(4.27)
Y„-X,*O
V/ el; j eJ
(4.28)
^ 6 {0,1}
V/e J
(4.30)
^{0,1}
Vi e /; j e /
(4.31)
s.t.
232
MEDIAN PROBLEMS—MINIMIZING THE DEMAND-WEIGHTED AVERAGE DISTANCE
233
TABLE 4.11. Fixed charge location model solutions as a function of the cost per item per mile Cost of Item/Mile 0.2 0.4 0.59 0.8 1.25 1.55 1.65 1.7 5 20
Sites G A, G B,F E,F C,E B,C, E A, B, E, F A, B, E, F, G A, B, C, E, F, G A, B, C, D, E, F, G
Total Cost
Fixed
Dem.-Miles
2243 3416 4149.65 4788 6006.25 6677.75 6807.75 6844.5 8175 9550
750 1750 2300 2600 3000 4500 5100 5850 7050 9550
7465 4165 3135 2735 2405 1405 1035 585 225 0
The optimal solution is to locate three facilities at nodes B, C, and E, respectively, resulting in a total cost of $6677.75. Table 4.11 shows the results of using a range of values for the cost per item per mile. As is evident from the table, as the unit transportation cost increases, we use more sites and increasingly expensive sites. As the unit transportation cost increases, the fixed cost goes up and the total demand-miles decrease. 4.4.3
A Return to the Vertex P-Center Problem
We now return to the vertex P-center problem in which there is a candidate set of facility sites corresponding to the nodes of the network. We want to find the locations of P facilities to minimize the maximum distance between any demand node and the nearest facility to the node. We now let Q be a decision variable that represents this distance. The vertex P-center problem can now be formulated as follows: Minimize
Q
s.t.
Ση=ι
Vie/
Y„-x,*o
V« el;
(4.34) (4.27) jeJ
(4.28) (4.29)
jeJ
Vie/
(4.35)
*ye{0,l}
\fjeJ
(4.30)
y;,-e{o,i}
y i el; j eJ
(4.31)
jeJ
234
LOCATION AND DISTRICTING PROBLEMS IN SERVICES
The objective function, (4.34), minimizes the maximum distance, Q. The constraints are identical to those of the P-median problem with the addition of constraint (4.35). The first term of this constraint, ¿^d^Y^, computes the distance between demand node / and the facility to which the node is assigned. This value must be less than Q, the maximum distance, for all demand nodes.
The optimal solution with P = 4 is to locate at nodes A, D, E, and G resulting in a maximum distance of 5 between demand node B and the facility at E and between demand node F and the facility at D. Table 4.12 shows the impact of changing the number of facilities on the P-center objective function. As more sites are located, the maximum distance goes down.
TABLE 4.12. Effect of changing the number of facilities on the maximum distance No Sites
Max Distance
0 1 2 3 4 5 6 7
14 7 6 5 4 3 0
Sites G D,E A,D,E A, D, E, G B, C, D, E, G A, B, C, D, E, G A, B, C, D, E, F, G
MEDIAN PROBLEMS—MINIMIZING THE DEMAND-WEIGHTED AVERAGE DISTANCE
235
236
4.5
LOCATION AND DISTRICTING PROBLEMS IN SERVICES
MULTI-OBJECTIVE MODELS
Most facility location problems represent long-term strategic decisions, such as how many distribution centers to have and where they should be, how many fire stations to deploy, where public schools should be located, and so on. As such, there are likely to be many stakeholders with an interest in the solution. These stakeholders include government officials, members of the public, the operators of the facilities, the users of the facilities, and so on. Each of these groups may have its own different objectives. For example, in locating ambulances, the city government may want to keep costs contained. Hospital personnel and physicians may want to reduce the maximum response time to reduce morbidity and moribundity. The public may be equally concerned about average response times and coverage as well as cost. In the private sector, a firm trying to assess its strategic positioning in a market and to determine whether it wants to be the low-cost firm or the high-service firm should explore the tradeoff between these two options. Multiple and conflicting objectives are common in many service-related problems. They are particularly prevalent in long-term decisions such as facility location problems. As indicated in Chapter 2, the goal of multi-objective analysis is to identify the set of non-inferior or non-dominated solutions. This section outlines two different multi-objective location problems. In the first, we identify the tradeoff between coverage within a given distance and the average distance between the demand nodes and the nearest facilities. In the second class of multi-objective problems, we examine the tradeoff between minimizing the average distance—the P-median objective—and minimizing the maximum distance—the P-center objective.
4.5.1
Covering-Median Tradeoff
Consider again the solutions shown in Figure 4.12 and Figure 4.16. Figure 4.12 gives the solution to the maximal covering problem when we locate three facilities. The optimal solution is to locate at nodes B, C, and G covering 825 of the 870 demands. The demand-weighted average distance corresponding to these three locations is 2.534. If we minimize the demand-weighted average distance, however, we find the solution shown in Figure 4.16, in which we locate at nodes B, C, and E, resulting in a demand-weighted average distance of 1.615. This solution, however, covers only 750 of the 870 demands within 5 distance units. Clearly, there is a tradeoff between covering demands within any given standard and minimizing the demand-weighted average (or total) distance. Recall that the P-median model may be formulated as follows. Minimize sj.
Σ^ΜΛ
£ye =i
(4.26) VIG/
(427)
MEDIAN PROBLEMS—MINIMIZING THE DEMAND-WEIGHTED AVERAGE DISTANCE
Y9-Xi*o
Vi
eI;jeJ
237
(4.28) (4.29)
jeJ
*,-e{0,l}
VjeJ
(4.30)
Υ,ε&Λ}
Vi e /; j e /
(4.31)
We can also transform the maximal covering model into exactly this form, meaning that we will be using exactly the same constraints as in the P-median problem and an objective function that is similar to (4.26). To do so, let us now define j3,y to be 1 if demand node i e I cannot be covered by a facility located at j ε / . In other words, we define μ
_fi
"
[0
ifd„>zr
ud.
Note that this is the opposite of the way in which a,·,· was defined above. This definition allows us to count the number of uncovered demands using ^¡T ^ hß^Y^. jsj
¡el
If demand node i e I is assigned to a facility at j e / (meaning Y¡¡ = 1) and the facility cannot cover the demand node (meaning /?¡, = 1), then we count the demand (h¡) at the node as being uncovered; otherwise, we do not count the demand at the node. Notice that this is functionally the same as the objective in (4.26) except that we have replaced the true distance, dih by the indicator variable, βψ Also, notice that minimizing the uncovered demand, given by Σ Σ ^ Λ ' ' s e c l u i v a l e n t to maximizing the covered demand. jeJ
iei
In short, we can write the multi-objective problem of minimizing the demand-weighted total distance and minimizing the uncovered demand as follows. Minimize Minimize
ΣΣΜΛ
(4.26)
jeJ is I jeJ
(4.36)
tel
s.t.
Vi 6 /
(4.27)
jeJ
Υ„-Χ,<0
Vi
el;jej
(4.28) (4.29)
^•€{0,1}
VjeJ
(4.30)
n-e{0,l}
Vi e I; j eJ
(4.31)
The constraints are identical to those of the P-median problem. The two objectives can be combined into a single-weighted objective as follows:
238
LOCATION A N D DISTRICTING PROBLEMS IN SERVICES
Minimize
W^ £ hji^ yW ie/
Α
+ (1 - W ) £ £ Α,.0^
+ ι
/W
is/
=ΣΣ .-[^ ( -^)^]η·
, . ,,,-v
yW is/
Combining the objectives in this way allows us to solve the problem using any algorithm or model that can solve the P-median problem. We simply need to replace the original distances by Wd/; + (1 - W))3¡,- for suitable values of the weight W between 0 and 1. Large values of the weight favor the P-median objective, while small values favor minimizing the uncovered demand. Alternatively, we can convert (4.36) into a constraint and utilize the constraint method of solving the multi-objective problem.
239
240
LOCATION AND DISTRICTING PROBLEMS IN SERVICES
Figure 4.21. Tradeoff between coverage and average distance using three and four facilities for the network of Figure 4.8
Figure 4.21 plots the tradeoff values shown in Table 4.13. You should be able to identify the one solution that could not have been found using the weighting method. See Problem 13. 4.5.2
Center-Median Tradeoff
Just as we can consider the tradeoff between the average distance and the covered demand, so too can we consider the tradeoff between minimizing the average distance, the P-median objective, and minimizing the maximum distance, the P-center objective. The formulation of this multi-objective model is as follows: Minimize
^LWiPa
(4.26)
Minimize
Q
(4.38)
jeJ is I
MEDIAN PROBLEMS—MINIMIZING THE DEMAND-WEIGHTED AVERAGE DISTANCE
S.t.
Yv-XjiO
241
Vie/
(4.27)
Vi e /; j e 7
(4.28) (4.29)
Vie/
(4.39)
^ ■ 6 {0,1}
V/e/
(4.30)
n-6{0,l}
Vi e /; / e /
(4.31)
jsJ
Note that this is simply the P-median problem with the addition of objective (4.38) and constraint (4.39). We can solve this using the constraint method by eliminating (4.38) and replacing (4.39) by X ^
y
< ô -
Vie/
(4.40)
where ß m a x is now an input. The problem with this approach is that it adds a constraint to the P-median model. Any algorithm or computer program that solves the P-median would have to be modified to incorporate constraint (4.40). An alternative approach would be to simply add a large value to all distances greater than Qmax in the objective function of the original P-median problem. If we now define Pii
·ήά,>0Γ
fi max ij ~~ ' '
0 if d„
we can simply solve Minimize
ΣΣΗ>{ά·ΐ+ψβϋ)Υϋ jeJ
iel
(4.41)
subject to the traditional P-median constraints. Note that (4.41) is a P-median objective function with the original distances, dih replaced by d^ + Ψβψ This problem can be solved using any program or algorithm or code for the P-median problem. If the solution entails the assignment of a demand node to a facility that is more than ß m a x away, we simply increase the penalty W and resolve the problem. Note that while this may look like the weighting method, it is really the constraint method because we are using the very large weight to tell the program not to assign any demands to facilities that are more than g max away. In other words, we are using the large penalty W to enforce constraint (4.40).
242
LOCATION AND DISTRICTING PROBLEMS IN SERVICES
MEDIAN PROBLEMS—MINIMIZING THE DEMAND-WEIGHTED AVERAGE DISTANCE
243
Figure 4.23 shows the tradeoff curves that result from the use of this model for three, four, and five facilities. These are relatively uninteresting tradeoff curves. For this simple network, we essentially have to choose between minimizing the average and minimizing the maximum distance. For other problem instances, the tradeoff is much more dramatic. Figure 4.24 shows the center-median tradeoff when the demand nodes represent the 250 largest counties in the contiguous United States and we locate 10 facilities. The 10-median solution (shown at the far left of the graph) has an average distance of 121.728 miles, but a maximum distance of 554 miles, which is 60 percent greater than the maximum distance for the 10-center solution shown at the far right of the figure. This solution has a maximum distance of 346 miles, but the demand-weighted average distance is 153.142 miles for this solution, or 26 percent greater than the average for the 10-median solution. In all, 26 non-inferior
Figure 4.23. Tradeoff between average and maximum distance for three, four, and five facilities using the network of Figure 4.8
244
LOCATION AND DISTRICTING PROBLEMS IN SERVICES
Figure 4.24. Center/median tradeoff for 250 largest counties with 10 facilities
solutions were found, of which only six are supported solutions, or solutions that could, in theory, have been found using the weighting method. A number of good compromise solutions exist. For example, one solution has an average distance of 141.585 miles, 16 percent above the minimum possible value, and a maximum of 379, only 10 percent above the minimum value. Another solution has an average distance of 132.944 miles, 9 percent above the minimum, and a maximum distance of 418 miles, 21 percent above the minimum possible value. Figure 4.25 shows this solution. Finding such compromise solutions is often critical in the effective analysis of practical problems. The SITATION software was used to find the solutions shown in Figure 4.24. This software implements the constraint method using the weighted objective shown in (4.41). For the 10-median problem, the value of W was set equal to 1. Thereafter, the value of W was set to 1000 and was doubled, as discussed above, whenever the solution that was returned entailed an assignment between a demand node and a facility at a distance greater than Qmax. The final value of W was 8000. Finding all 26 solutions took less than 5 minutes on a laptop computer.
4.6
DISTRICTING PROBLEMS
In many service contests, we must divide a service area into districts. For example, households must be assigned to primary, secondary, and high school educational districts. Homes and businesses are also assigned to different taxing authority districts. Most states are divided into districts for state representatives and for
DISTRICTING PROBLEMS
245
Figure 4.25. Compromise solution with average distance of 132.9 miles and a maximum of 418 miles
state senators. States are also divided into Congressional districts. By law there are 435 Congressional districts. Each state is guaranteed at least one Congressional district and the remaining 385 representatives are apportioned according to the state population. There are nearly 32,000 five-digit zip code tabulation areas used by the U.S. Census Bureau. Zip codes are further subdivided into regions for carrier routes. The 50 states are partitioned into 11 regions for the organ transplantation purposes. Some regions are relatively small geographic areas. Region 1 includes five of the six New England states of Connecticut, Maine, Massachusetts, New Hampshire, and Rhode Island. Region 9 includes New York and Vermont. Other regions are quite large. Region 5 includes Arizona, California, Nevada, New Mexico, and Utah. Region 8 encompasses Colorado, Iowa, Kansas, Missouri, Nebraska, and Wyoming. For-profit service providers also are interested in districting. Telephone service areas are designated by area codes, some of which now overlap. Delivery services often divide a service area into regions with service provided on Mondays to one region, on Tuesdays to another region, and so on. Again, to accommodate the schedules of the firms' customers, these regions may overlap. Companies
246
LOCATION A N D DISTRICTING PROBLEMS IN SERVICES
often divide a city into different regions for sales, advertising, and marketing purposes. Districting problems are similar to location problems at some level. We can see the similarity at a qualitative level by considering Figure 4.25. The nodes connected to one of the facilities can be thought of as belonging to the service district associated with the facility. Each demand node is connected to its closest facility. As such, we could draw borders between the regions. The regions within the borders would be convex in the sense that if we drew a line between any two points within a single region, all of the points on the line would also be in the region. Convexity is a desirable property to be maintained in many districting problems. If we define a set of reference nodes and assign every demand node to the nearest reference node, the assignments will result in (approximately) convex regions. We can think of the reference nodes as the facility locations in a location problem. Thus, one way of stating a districting problem is to find a set of reference nodes such that, when each demand node is assigned to the closest reference node, some objective is achieved. One common objective that is used in districting problems is to minimize the range of demands that are assigned to each district. Note that assigning the demand nodes to minimize the range of assigned demands is itself a difficult problem even if we do not impose the constraint that nodes are assigned to the nearest reference node. To see that this is so, consider the problem of partitioning the nodes into only two districts such that the demand assigned to each district is as close to half the total demand as possible. If we ignore the issue of assigning demand nodes to the closer reference node, this problem is the classic partition problem. The partition problem asks whether or not there is a partition (a division into two sets) of a set of integers (e.g., the demands of the nodes) such that the sum of all integers in one of the sets in the partition is the same as the sum of the integers in the second set. Clearly if there is such a partition, the range in the assigned demand is 0. But the partition problem is a known to be an NP-hard problem (Garey and Johnson, 1979), meaning that there is no known optimal algorithm whose execution time is a polynomial function of the number of integers. Before formulating this districting model, let us develop a bit of intuition about the problem using the small instance shown in Figure 4.26. Part (a) of the figure shows four nodes or zones—A, B, C, and D—which we have to district. The demand of each zone is shown in the zone. The total demand is 36. If we did not have to deal with the contiguity issue—the frequently imposed requirement that all the portions of a region be contiguous to one another—we could group zones A and C together into one district and zones B and D into another district. Each district would have a total demand of 18 and the range in assigned demand would be 0. Unfortunately, this would be a very strange districting plan and would be unacceptable in most contexts.
247
DISTRICTING PROBLEMS
A 6
B
C 15
12
D 3
(a) 4 Nodes or Zones
(c) Range = 1 5 - 6 = 9 Figure 4.26. Simple districting example
Accepting t h e contiguity condition, t h e best districting plan with two districts is shown in part (b) of t h e figure. Z o n e s A and B are in t h e first district with a total d e m a n d of 21 and zones C and D are in t h e second district with a total d e m a n d of 15. The resulting range is 6. If we require t h r e e districts, t h e best plan is shown in part (c) of t h e figure. N o w t h e range is 9. Thus, increasing t h e n u m b e r of districts may degrade t h e objective function in this case. N o t e that this was not t h e case in any of t h e location models m e n t i o n e d so far in this chapter. We can n o w formulate t h e problem of identifying P reference nodes, assigning each d e m a n d n o d e t o t h e nearest reference node, so that t h e range in t h e district d e m a n d s is as small as possible. To d o so, we need to define t h e following additional decision variables: t/ max Umm
maximum total d e m a n d of any district minimum total d e m a n d of any district
In addition, we need to define t h e following indicator parameter, which is an input.
_ r i if¿„>4 7 ** [O if not Thus, ttijk is equal to 1 if candidate reference node k e J is farther from demand node i e I than is reference node / e J. With this additional notation, the districting problem can be formulated as follows:
248
LOCATION AND DISTRICTING PROBLEMS IN SERVICES
7-7-max
(4.42)
Tjmin
Vie/
Υ,-Χ^Ο
V/ el; j
(4.43) GJ
(4.44) (4.45)
VjeJ
(4.46)
VjeJ
(4.47)
Vi e I; j e J
(4.48)
Jf y €{0,l}
VjeJ
(4.49)
n-e{0,l} o
Vi e I;j eJ
(4.50)
Vi e I;j eJ
(4.51)
¡e/ ¿e/
~XI
The objective function (4.42) minimizes the difference between the total demand assigned to the district with the most demand, i/max, and the total demand assigned to the district with the least demand, Umm. In other words, it minimizes the range in the assigned district demands. Constraint (4.43) requires each demand node to be assigned to a district or to a reference node. Constraint (4.44) stipulates that assignments can be made only to reference nodes (or facility locations). Constraint (4.45) states that there are to be P reference nodes or districts. Constraint (4.46) defines t/max, the total demand assigned to the district with the most demand, in terms of the assignment variables. The left-hand side of the constraint simply sums the total demand assigned to the district with reference node j e J. This total must be less than or equal to the value of t/max for every reference node j e J. Since the objective function wants to make t/max as small as possible, the value of t/max will equal the largest district total demand. Constraint (4.47) similarly defines the minimum total demand assigned to a district, Umm, in terms of the assignment variables. Because we are trying to maximize t/min, the constraint will be binding for at least one district. The key difference between constraint (4.47) and constraint (4.46) is the presence of the second term (ΐ-^Γ;)Σ'Ιί iel
οη
^ e left-hand side of (4.47). Without this term, there will almost
certainly be some candidate reference node that is not selected and, as a result, does not have any demand assigned to it. The value of the first term on the lefthand side of (4.47) is 0 for such reference nodes. We want to ignore such reference nodes in the computation of Umm. The second term on the left-hand side of (4.47) ensures that if a reference node is not selected (1 - X¡) = 1, the left hand side will be equal to the total demand, ensuring that the constraint will not be the one that determines the value of Umm.
249
DISTRICTING PROBLEMS
Constraints (4.48) are the closest assignment constraints. The left-hand side, Σα*^/*> c o u n t s the total number of times that demand node i is assigned to a ksJ
reference node that is farther away from / than is reference node /. If we use reference node ;', the right-hand side of the constraint will be 0 and we are then precluded from assigning demand node / to any of the reference nodes that are farther from i than is reference node j . If, on the other hand, we do not select reference node;', then the right-hand side of the constraint is 1 and we may assign demand node i to a reference node farther from i than j , assuming no other constraints preclude such an assignment. Figure 4.27 illustrates the use of these constraints for a single-demand node /.There are five candidate reference nodes,/l,/2,/3,/4, and j5. We have selected reference nodes ft and /4. The closest assignment constraints for this demand node and these reference nodes would be: YlJ2 + Y^ + YiJ4 + YiJ5
=l
YiJ4 + Y,j5<\-Xß = l Y¡J5
Xj\ = Q
Xj2 = l
Xj3 = °
Χμ = χ
^-5 = 0
Figure 4.27. Figure illustrating closest assignment constraints (4.48)
250
LOCATION A N D DISTRICTING PROBLEMS IN SERVICES
solution. The remaining two constraints above will be satisfied by these assignment variable settings as well. Constraint (4.49) ensures that the variables associated with the selection of reference nodes are binary. Constraints (4.50) state that demand nodes must be uniquely assigned to reference nodes, while the alternative constraints (4.51) allow demand nodes to be split between reference nodes. Either constraints (4.50) or constraints (4.51) may be used, but not both, as constraints (4.50) will override constraints (4.51) if both are present in a single model.
DISTRICTING PROBLEMS
251
252
LOCATION AND DISTRICTING PROBLEMS IN SERVICES
253
DISTRICTING PROBLEMS
Table 4.14 shows the results of using this districting model on the network of Figure 4.8 with both the binary and continuous versions of the assignment variables, constraints (4.50) and (4.51) respectively. The objective function is shown in the column labeled Range in both tables. It should be immediately clear that the range in assigned demands to each district does not either increase or decrease monotonically with the number of districts. The second observation we can make is that, for a specified number of districts, the range that we obtain by using the continuous assignment variables—constraints (4.51)—is less than or equal to the range we obtain when using the binary assignment variables, constraints (4.50). This is to be expected, since the binary constraints represent a more restrictive condition on how we assign demands to districts than do the continuous constraints. In some districting problems, there seem to be overriding concerns that mitigate against the use of convex regions, or the sort or regions that would be obtained by imposing the closest assignment constraint (4.48). Consider, for example, the 19 U.S. Congressional districts in Illinois as shown in Figure 4.30. Roughly half of the districts are in the upper northeastern part of the state, in and around the city of Chicago, where roughly half of the state's population lives. Looking at the other districts, however, it is immediately evident that establishing convex districts was not first and foremost on the minds of the lawmakers when they established these districts! Consider the " C " shaped district in the western part of the state, District 17. This district wraps around a portion of District 19 in the southern part of the state, which is also anything but convex. District 15 TABLE 4.14. Results of using the districting model on the network of Figure 4.8 Integer Assignments # Districts 2 3 4 5 6 7
Ref Nodes B,D B,E,G B, D, E, F A, B, C, E, G A, B, C, E, F, G A, B, C, D, E, F, G
Range
Max
Min
30 70 180 175 175 205
450 320 325 250 250 250
420 250 145 75 75 45
Range
Max
Min
0 52.5 180 175 175 205
435 325 325 250 250 250
435 272.5 145 75 75 45
Fractional Assiginments # Districts 2 3 4 5 6 7
Ref Nodes C,G B,E,F A, B, C, E A, B, C, E, G A, B, C, E, F, G A, B, C, D, E, F, G
254
LOCATION AND DISTRICTING PROBLEMS IN SERVICES
Figure 4.30. U.S. Congressional districts in Illinois. (See color insert)
in the southeastern part of the state includes a long tail running down the eastern portion of the state. One also has to wonder about the shape of District 11. Although it is difficult to see on a map of this scale, the districting in the Chicago metropolitan area is just as bad in terms of convexity. We can contrast this with what one might obtain by solving (heuristically) the model represented in (4.42) through (4.50) using the 1348 five-digit zip code tabulation areas employed by the U.S. Census Bureau as the demand nodes. Each zip code has an average of 9213 people, though the zip codes range in population from a minimum of 0 to a maximum of 113,984 people. One such solution is shown in Figure 4.31. The green squares represent the 19 reference nodes that were selected by the heuristic. Each of the 1348 zip codes is connected to the nearest reference zone by a light blue line. Zip codes in the same district are colored with the same color. These districts look far more convex than do the districts that are actually used by the state. The range in the demand assigned to the 19 districts is 71,875 out of a total population of 12,419,268, or about 0.6 percent of the population. This is also about 11 percent of the average district population of 653,645. Figure 4.32 and Figure 4.33 show two other heuristic solutions to the districting problem. The range of assigned demand shown in Figure 4.33 is about 12.4 percent of the average demand of any district. This range is too large for a political districting problem. In fact, the courts have typically ruled against plans that have more than a 1-percent difference
DISTRICTING PROBLEMS
255
Figure 4 . 3 1 . Sample results of districting at the zip code level in Illinois. (See color insert)
Figure 4.32. Another heuristic solution to the districting problem in Illinois. (See color insert)
256
LOCATION AND DISTRICTING PROBLEMS IN SERVICES
Figure 4.33. A third heuristic solution to the districting problem in Illinois. (See color insert)
between the most populous and least populous districts (Bullock, 1982). We can take a solution similar to one identified in Figure 4.31 and then subdivide zip codes at the margin between two districts to further equalize the population assigned to each district. One way to do this would be to simply use a map and to try to adjust the Congressional districts manually. Another way, which can be used to gain insight into where to begin adjusting the zip codes manually, would be to use optimization. To see one way of doing this, we will backtrack slightly to formulate a different version of the districting problem formulated above. In this model, we will allow (1) fractional assignments of demand nodes to reference nodes and (2) some demand nodes to be assigned to reference nodes that are not the closest reference nodes. We let W¡j be 1 if demand node / e / can be assigned to candidate reference node ;' e J. For a demand node to be assigned to a reference node, partially or completely, we will require that it be allowed to be assigned to all closer selected reference nodes. We will limit the total number of extra allowable assignments over and above the minimum number of assignments needed, given by l/l, to wex,m. In addition, for each demand node we will compute the distance to the closest reference node and the distance to the most remote reference node to which the demand node is assigned. For demand node i e /, the closest reference node will be at a distance Z),min, while the most remote reference node to which the demand node is allowed to be assigned will be at a distance Ζ)™"χ. We will limit the maximum difference between these two values across all demand
257
DISTRICTING PROBLEMS
nodes, Dex"a, so that demand nodes are still assigned to close, if not the closest, reference nodes. This limit will be denoted by dex,m~a"owed. The maximum distance between any demand node and any candidate reference node will be denoted by d™\ Finally, for each demand node, i e /, let us index the reference nodes j e J in ascending order of their distance from the demand node. Thus, j{m] will indicate the reference node / e J that is the m'h closest reference node to demand node i e /. With this additional notation, we can formulate an extended version of the districting problem as follows. Minimize
rrmax
(4.42)
Trmin
s.t.
Vie/
(4.43) (4.45)
))Σ* h*
is I
j rmin
iel
W„ < X,
y^wv w
W
¡j¡m -
i,j,{m}
x
^
m W
i,k[n\
+(i-
x
„\ > ] )
Vye/
(4.46)
Vye/
(4.47)
Vi e I; j e J
(4.52)
Vi e I; j e J
(4.53)
Viel
(4.54)
n = 1,2,..., m -1; m = 2,3,...,\J\; Vie/
(4.55) (4.56)
Dfn
DrzdW
r\exira ^ r\max
r\min
Vi e I; j eJ
(4.57)
Vi e I; j e J
(4.58)
Vie/
(4.59)
r\extra ^ jextra-allowed
(4.60)
X;e{0,l}
Vye/
(4.49)
0<^<1
Vi e I; j e J
(4.51)
%6{0,1}
Vi e /; y e /
(4.61)
Constraints (4.42) through (4.51) are identical to those of the earlier districting model; constraints (4.52) through (4.61) are new to this model. The objective
258
LOCATION A N D DISTRICTING PROBLEMS IN SERVICES
function (4.42) again minimizes the range in the assigned demand. Constraint (4.43) ensures that each demand node is fully assigned to reference nodes. Constraint (4.45) states that we are to define P districts, each with its own reference node. Constraints (4.46) and (4.47) define the maximum and minimum demand assigned to the districts. Constraint (4.49) is the integrality constraint on the reference node selection variables, while constraint (4.51) is the non-negativity on the assignment variables. Turning now to the new constraints, constraint (4.52) states that demand node i cannot be assigned to a district with reference node y unless reference node y is selected. This is similar to constraint (4.44) linking the assignment and reference node selection variables. Constraint (4.53) states that demand node i cannot be assigned to a district with reference node / unless such an assignment is allowed. Constraints (4.54) and (4.55) are the closest assignment constraints. Note that constraint (4.54) is technically not needed, as it is identical to one of the constraints in (4.52). We repeat it here so that we have a complete characterization of the relationship between the variables W¡¡ and the reference node selection variables, X¡. Constraint (4.55) states that demand node i cannot be assigned to the mth closest reference node unless the demand node can also be assigned to each closer reference node, W^., = 1 , or the closer reference node was not selected 1 - X¡[„] = 1. Note that in the earlier model, the number of closest assignment constraints given by (4.48) grew as the square of the number of nodes. The number of constraints represented by (4.55) grows as the cube of the number of nodes. Constraint (4.56) limits the number of extra allowable assignments over and above the minimum needed by constraint (4.43) to wex"a. This will tend to prevent assignments of demand nodes to very remote districts. We further constrain the assignment of demand nodes to remote districts in constraints (4.57) through (4.60). Constraint (4.57) defines the minimum distance between a demand node and the reference nodes to which it can be assigned. If demand node i can be assigned to reference node/, or W¡¡ = \, then the right hand side of the constraint will be djj, the distance between demand node i and reference node y; otherwise, it will equal the maximum distance in the problem data, dmm. Constraint (4.58) defines the distance between demand node i and the most remote reference node to which it can be assigned. The difference between Df"ax and D™n is the extra allowable distance for demand node i. Constraint (4.59) defines the systemwide maximum difference to be the largest of these node-specific differences. Finally, constraint (4.60) limits the system-wide difference to ¿ex'ra-allowed\ a u s e r input. Clearly, constraints (4.59) and (4.60) can readily be combined. (See problem 23.) Constraint (4.61) states that the allowable assignment variables must be binary.
Details of this model can be found in Simple Districting Example Extended 2.xls in the online appendix.
259
DISTRICTING PROBLEMS
By changing dex'm~allowed and wex,m, we can trace the tradeoff between the range in the assigned demand to the districts and the degree of violation of the closest assignment constraints. (See problem 14 regarding the use of deam~a,iowed and wextm to force the model above to assign demand nodes to the closest reference nodes.) Table 4.15 shows the results of applying the model to the network shown in Figure 4.8. Throughout the table, we used wex'ra = 100 to make constraint (4.56)
TAB LE 4.15. Results of using the enhanced districting model on the network of Figure 4.8 (a) Impact of Fractional Assignments and Extra Distance on Three Districts # Districts Ref Nodes 3 3 3
B,E, G B,E,F B,F, G
Range
Max
Min
Split Demands
Condition
70 52.5 0
320 325 290
250 272.5 290
None A A,E
Integer Assignments Fractional Assignments Extra Distance = 1
(b) Impact of Fractional Assignments and Extra Distance: on Four Districts # Districts Ref Nodes 4 4 4 4 4 4
Range
B, D, E, F 180 A, B, C, E 180 A, B, F, G 90 B, C, E, F 50 B, D, E, F 43.33333 0 A, C, D, F
Max
Min
Split Demands
Condition
325 325 262.5 250 250 217.5
145 145 172.5 200 206.6667 217.5
None None C,E g A, g Β,Ε
Integer Assignments Fractional Assignments Extra Distance = 1 Extra Distance = 2 Extra Distance = 3 Extra Distance = 4
(c) Impact of Fractional Assignments and Extra Distance on Three Districts, Holding Original Reference Nodes Fixed at B, E, G # Districts Ref Nodes
Range
Max
Min
Split Demands
3 3
B,E, G B,E,G
70 60
320 310
250 250
None C
3
B,E,G
60
310
250
C
3
B,E,G
0
290
290
A,C
Condition Integer Assignments Forced Ref Nodes, Fractional Assignments Forced Ref Nodes, Fractional Assignments, Extra Distance = 1,2,3,4 Forced Ref Nodes, Fractional Assignments, Extra Distance = 5
260
LOCATION AND DISTRICTING PROBLEMS IN SERVICES
non-binding except for the rows labeled in the comments column as integer solutions; for those columns we had w"'ra = 0. Part (a) of the table shows the results of allowing fractional assignments and extra distance when we use three districts. Allowing fractional districts results in a change in the reference nodes and a decrease in the range of assigned demands. Demand node A is split between two reference nodes. [This result could have also been obtained using the model of (4.42) through (4.51), excluding constraint (4.50).] In the final row of part (a), we show that by allowing demand nodes to be assigned to districts other than the closest district, we can reduce the range in assigned demand to 0. Again, the reference nodes change. Nodes A and E are partially assigned to different reference nodes. The extra distance, dextm~a"OW€d, was set to 1. Part (b) of Table 4.15 is qualitatively similar to part (a). In part (b) we have four districts. Again, increasing the value of dextm~altowed allows us to reduce the range in assigned demand. One notable feature of these solutions occurs in the row in which ¿ex'm-aHowed = 2. In that case, node G is completely assigned to reference node F instead of the closer reference node E. Thus, node G is not truly split between reference nodes, but it is not assigned to its closest reference node. This is indicated by using a lower-case "g" in the Split Demands column rather than an upper case "G." This also occurs when dex,ra~a"owed = 3. Part (c) of the table shows the impact of allowing fractional assignments and increasing the value of dex"a'allov"!d, while holding the reference nodes fixed at the original values, B, E, and G. Fractional assignments help us reduce the range in assigned demand from 70 to 60. Increasing dex'ra~allowed has no effect until ¿extra-aiiowed _ <^ a t yy^jch point we can reduce the range to 0 by partially assigning nodes A and C. Returning now to the Congressional districting results shown in Figure 4.31, we could use the enhanced districting model while fixing the reference nodes at those shown in the figure to further reduce the range in assigned demand by allowing zip codes to be assigned to multiple districts and allowing them to be assigned to reference nodes other than the closest reference node. Note that when we do so, constraints (4.55) can be greatly simplified to read ^ I ^ W
« = l,2,...,m-l; m=
2,3,...,P;
Vie/ The number of such constraints now grows linearly with the number of demand nodes and as the square of the number of districts. We return to the concept of adjusting a tentative districting plan to reduce the range in assigned district populations in section 6.6. One natural question that arises is why do the Congressional districts look so different from those found using an optimization approach. There are several answers. First, Congressional districts are often established to protect incumbents in a process known as gerrymandering. Second, there is a desire to identify
DISTRICTING PROBLEMS
261
political districts that include a majority of people from various minority groups (e.g., African Americans) to ensure representation of these groups within the Congress. In addition to these concerns, there is also generally a concern that districts be compact as well as convex. A compact district is one that is close to round in some sense as opposed to being long and narrow. One way to effect compact districts is to minimize the distance (weighted or unweighted) between demand nodes and a central point within each district. It should be clear from a quick examination of Figure 4.31 (e.g., the large district in the southeastern part of the state), that the central point within a district to which we measure the distance for compactness purposes might differ from the reference node (shown as a square) used to define the districts. Finally, we outline one additional approach to political districting (Mehrotra, Johnson, and Nemhauser, 1998). This approach allows us to define districts a priori that meet any and all of the criteria we choose, including convexity, compactness, equal population, representation of minorities, and so on. We will define a (potentially) very large number of candidate districts. The set of candidate districts will be / , indexed by j . Let a¡j be 1 if demand node i is included in candidate district / and 0 if not. Note that this is an input. Also, let Cj be a measure of the "cost" of using candidate district ;'. The cost might include measures of the convexity of the district and the compactness of the district as well as other metrics that identify the desirability of using the district. Low values of c¡ will be taken as being more desirable. Finally, let us define X¡ to be 1 if we select candidate district / and 0 if we do not select it. The districting problem can now be represented as the following variant of a set partitioning problem. Minimize
^ci^j
(4.62) (4.63)
ΣΧί = Ρ X¡ e {0,1}
(4.64) V; e /
(4.65)
The objective function (4.62) minimizes the cost of the selected districts. Constraint (4.63) states that each demand node must be in exactly one selected district. Constraint (4.64) states that we are to select P districts and constraint (4.65) is the binary constraint on the district selection variables, X¡. The problem with using this model for districting is that the potential number of districts is 2m. For the Illinois problem at the zip code level, this would be over 10405 candidate districts. Given that there are only about 10112 atoms in a fully packed universe, this is a huge number! Admittedly, many of these districts would be terrible and we could rule them out a priori. However, the number of potentially good districts is still very large. To deal with this problem, we usually generate candidate
262
LOCATION AND DISTRICTING PROBLEMS IN SERVICES
districts as needed using a process known as column generation as outlined in section 4.3.2.
4.7
FRANCHISE LOCATION PROBLEMS
In this section, we outline three different models that are useful in franchise location decisions. Such decisions are critical, as overexpansion can result in cannibalization of existing markets as well as the opening of unprofitable locations. The decision in the summer of 2008 by Starbucks to close 600 of its stores is a reflection of such problems. At the same time, an excessively conservative approach to new store development can result in unrealized profit potential. In addition, such a policy can leave the door open to competition to capture markets. The first model is the p-dispersion model mentioned above in section 4.2.4. This model seeks the location of p facilities so that the minimum distance between any pair of facilities is maximized. The second model is an extension of the fixed charge location model. In this case, we allow the demand at a node to depend on the distance between the node and the nearest facility that can serve the node. The objective is to determine the number of facilities to open as well as their locations to maximize the profit associated with the set of stores. Finally, we introduce a simple model of competition in which there are q existing stores of our competitors and we wish to locate p of our own stores to maximize the demand that we capture.
4.7.1
The p-Dispersion Model or How to Avoid Facility Crowding
As its name suggests, the p-dispersion model is concerned with dispersing p facilities throughout a service region so that no two facilities are too close to each other. Note that the problem has nothing to do with where demand is located. As such, the model is likely to be of only limited use in franchise store location decisions, though it is useful in locating strategic reserves of medical supplies in the event of a national disaster or a pandemic disease outbreak as well as locating nuclear weapons. As before, we let X¡ be 1 if we locate at candidate site; ε J and 0 if we choose not to locate at this candidate site. We define W to be the distance between the two closest selected facility sites. We also let djk be the known, input distance between candidate site locations j , k e /. dmm is the largest distance between any two candidate site locations. With this notation, we can readily formulate the p-dispersion problem (Kuby, 1987) as follows: Max
W
s.t.
W
(4.66) Vj,keJ
(4.67)
263
FRANCHISE LOCATION PROBLEMS
ΣΧί=Ρ
(4.68)
fei
X¡ ε {0,1}
V; e /
(4.69)
The objective function (4.66) maximizes the minimum distance between any pair of selected sites. Constraint (4.67) states that the minimum distance between any two sites—the value we are trying to maximize—must be less than the distance between nodes) and k if we locate at both these nodes (making (2 - X¡ - Xk) = 0). If we do not locate at both nodes j and k, then (2 - X¡ - Xk) > 1 and the right hand side of the constraint will be greater than or equal to dmax. Constraint (4.68) requires us to select p facilities. Clearly the model is of no interest unless p is greater than or equal to 2. Finally, constraint (4.69) is the standard integrality constraint. As one would expect, the distance, W, decreases as we increase the number of locations since the facilities must be closer together. The reader is encouraged to experiment with the implementation of this model for the network of Figure 4.8 which can be found in Simple P Dispersion Model.xls in the online appendix.
4.7.2
A Simple Profit Maximization Model
As indicated above, one of the weaknesses of the p-dispersion when applied to franchise location is that it fails to account for the demand at the demand nodes. In fact, there is no concept of a demand node in the p-dispersion model. To remedy this problem, in this section we briefly outline an extension of the fixed charge location model discussed in section 4.4.2 in which we determine the number of facilities to locate and their locations to maximize the profit that can be obtained from a set of facilities. At each candidate location i there is some nominal demand, hf. This is the demand that we would realize from location / if a facility is also located at node i. If a facility is not located at i, then the demand that is realized from demand node / decreases in some way with the distance between node / and the nearest facility. We can let h¡(d¡¡) be a function of the distance, which specifies the actual demand that is realized at node / if we assign the demand to a facility at / at a distance d^ from demand node i. We require h¡(d¡¡) = h¡(0) = hf. That is, the function must be such that if we use a distance of 0, the function returns the nominal demand, hf, at node i. One such function is h, (d„ ) = max {0, hf - b^ }, where b¡ > 0
(4.70)
Function (4.70) shows that the demand at node i decreases linearly with the distance until the demand becomes 0, after which the demand remains at 0. In other words, any facility that is more than hf ¡b¡ from demand node / will not see any demand from node i. Another function that we can use is given by
264
LOCATION AND DISTRICTING PROBLEMS IN SERVICES
Figure 4.34. Example demand functions
* )
=
7 Γ Τ ^
where A >0
(4.71)
Figure 4.34 shows seven different demand functions: three straight lines of the form of function (4.70) and four curved lines of the form of function (4.71). In all cases, the nominal demand is hf = 1000. The key feature of both functions is that we can compute the realized demand at node / if the node is closest to a facility at j a priori, as a model input since we know the distance between the two sites, d¡¡. If we now let p¡ be the revenue per item purchased by consumers at node i and c,y be the unit cost of serving a customer at location i from a facility at node /, we can formulate the problem of maximizing the profit as follows: Maximize
s.t.
ΣΣΜ^/ΧΛ-ca)Y>,~Y.fiXi
jsj ie/
£y,
Y
„- -X,<0 Σ xi = p
X
, €{0,1} = {0,1}
V
(4.72)
jej
Vie/
(4.73)
V/ e I; j eJ
(4.28) (4.29)
V/e/
(4.30)
Vi e I; j e J
(4.31)
265
FRANCHISE LOCATION PROBLEMS
The objective function (4.72) maximizes the profit, which is given by the number of demands at a site multiplied by the difference between the price paid by each demand minus the cost of serving that demand. This is summed over all demands and candidate facility sites from which the demands can be served. From this quantity we need to subtract the fixed cost of opening the selected facilities. Constraint (4.73) is similar to constraint (4.27) of the fixed charge location problem, but constraint (4.73) does not require every demand node to be assigned to a facility. Clearly if it is not profitable to serve demands at a particular demand node from any facility, the demands should not be served or assigned to any facility site. The remainder of the constraints are identical to those of the fixed charge location problem. This model is therefore a minor modification of the fixed charge location model. An application of this model to the network of Figure 4.8 can be found in Simple Profit Maximization Example.xls in the online appendix. The details of this implementation are again left to the reader. Table 4.16 provides the base case inputs for a sensitivity analysis of the profit maximization model using the simple network of Figure 4.8. The demand function given in (4.70) was employed for all nodes. The second column of Table 4.16 gives the nominal demand, hf, and the third gives the slope, fc,.The fourth column gives the price, p¡, while the final column gives the fixed cost of locating a facility at that node,/;. Note that the fixed costs at each site exceed the nominal demand at that site multiplied by the price, meaning that the example was constructed in such a way that a single demand node can never generate enough demand by itself to warrant the establishment of a facility at the site. To perform the sensitivity analysis, the demand function of every node was modified to be /i,(d,y) = max{0, h° -abfi^. The parameter a can be changed to modify the sensitivity of all demand nodes to the distance to the nearest facility in a systematic way. Similarly, in the objective function, we set the cost per item per mile, ciy to be ωάή. By systematically varying the parameter co, we can vary the shipment cost throughout the network. Thus, the new objective function is Σ Σ ' Ί Ή Κ Λ jej
tel
~ω^η)^ϊί
_
Σ·^0· ^ jej
e re er t o a a s t n e
f
demand factor and co as
the cost per item per mile factor. TABLE 4.16. Base case inputs for sample profit maximization model Nominal Demand
Nominal Demand
Nominal slope, Decrease in Demand per Unit Distance
Price
Fixed Cost
A B C D E F G
95 140 110 235 160 75 65
4 3 2 2 7 2 3
10 10 10 10 10 10 10
1000 1500 1200 2500 1800 800 750
266
LOCATION AND DISTRICTING PROBLEMS IN SERVICES
Table 4.17 and Figure 4.35 show typical results from the model as we vary the cost per item per mile (ω) of serving demands. Let us focus first on the fixed facility costs of Figure 4.35, the second term in the objective function (4.72). For very low transportation costs, it is useful to establish only one facility at the very low cost site, node G. This is the model of many Internet-based firms that locate distribution centers at low-cost sites and that ship using a low-cost common carrier. As the shipment cost or transport cost increases, it becomes valuable to have more sites at increasingly expensive locations closer to the demands. As we increase the number of sites, we actually attract demand, and the demand increases in the example from 693 to 785 units and eventually to 803 units. As the transport costs continue to increase, however, some demand nodes cease to be profitable to serve. At this point, the system begins to contract, reverting to lower-cost facilities that serve less and less demand. Table 4.18 and Figure 4.36 depict the results of varying the demand factor, a. If the demand is constant (completely insensitive to the distance to the nearest facility), the optimal solution is to locate at two relatively inexpensive sites. As demand becomes sensitive to demand, the facility at node B (with a nominal demand of 140) moves to node E (with a higher nominal demand of 160). As the sensitivity to demand continues to increase, we again go into a contraction mode. Node E is dropped and the system operates with a single facility at node B, a
TABLE 4.17. Results of varying the cost per item per mile in the profit maximization model using the network of Figure 4.8
Demand Factor = 1 Cost of Item/Mile
Sites
Assigned Demands
Total Profit
Fixed Cost
Revenue— Shipping
0 0.025 0.05 0.1 0.2 0.5 0.95 1 1.3 1.35 1.8 1.85 2 3.1 3.25 4
G G A, G A, G A, G A, G A, G E,F E,F B,F B,F F F F —
A, B, C, D, E, F, G A, B, C, D, E, F, G A, B, C, D, E, F, G A, B, C, D, E, F, G A, B, C, D, E, F, G A, B, C, D, E, F, G A, B, C, D, E, F, G A, B, C, D, E, F, G A, B, C, D, E, F, G B, C, D, E, F B, C, D, E, F C,D,F C,F C,F —
6180 6034.4 5924.95 5749.9 5399.8 4349.5 2774.05 2617 1773.1 1643.15 678.4 581.55 366 54 0 0
750 750 1750 1750 1750 1750 1750 2600 2600 2300 2300 800 800 800 0 0
6930 6784.4 7674.95 7499.9 7149.8 6099.5 4524.05 5217 4373.1 3943.15 2978.4 1381.55 1166 854 0 0
Demai 693 693 785 785 785 785 785 803 803 736 736 404 179 179 0 0
Figure 4.35. Results of varying the cost per item per mile in the profit maximization model using the network of Figure 4.8
TABLE 4.18. Results of varying the demand factor in the profit maximization model using the network of Figure 4.8
Cost/item-mile = 1 Demand Factor
Sites
Assigned Demands
Total Profit
Fixed Cost
Revenue— Shipping
0 1 2 3 4 5 6 7 8 9 10 15 18 19 20 22 23
B,F E, F E, F E, F E, F E, F E, F F F F F F F F F F —
A, B, C, D, E, F, G A, B, C, D, E, F, G A, B, C, D, E, F, G A, B, C, D, E, F, G B, C, D, E, F B, C, D, E, F B, C, D, E, F
3010 2617 2294 1971 1727 1560 1393 1251 1159 1067
2300 2600 2600 2600 2600 2600 2600
5310 5217 4894 4571 4327 4160 3993 2051 1959 1867 1775 1315 1039
C,D, F C,D,F C,D,F C,D,F C,D,F C,D, F
D,F D,F D,F —
975 515 239 175 125 25 0
800 800 800 800 800 800 800 800 800 0
975 925 825 0
Dema: 880 803 726 649 596 565 534 308 292 276 260 180 132 120 110 90 0 267
268
LOCATION AND DISTRICTING PROBLEMS IN SERVICES
Figure 4.36. Results of varying the demand factor in the profit maximization model using the network of Figure 4.8
relatively inexpensive node that is fairly centrally located. Finally, for very high sensitivity of demand to distance, no service is provided.
4.7.3
A Simple Model of Competition
Finally, we present a model that is an extension of the maximal covering model discussed in section 4.3.4. In this case, a competitor already has Q facilities located at various places on the network. We want to locate P facilities to maximize the number of demands that we capture. We fully capture the demand at demand node i if the distance between our closest facility to demand node i is strictly less than the distance between node i and our competitor's closest facility to i. We split the demand at node i equally with our competitor, if the distance between i and our closest facility is exactly the same as the distance between i and our competitor's closest facility. Finally, if our competitor is closer to i than we are, we do not capture any of the demand at node i. To implement these conditions in a model, we need to redefine the coverage indicators as follows: b "
_{i iH< ß ' [0 if not
c
"
_Ji *
if not
269
FRANCHISE LOCATION PROBLEMS
where D' is the distance between demand node i and our competitor's closest facility. We also need to account separately for demand nodes that we capture fully and those that we share equally with our competitor. We will define Z, to be 1 if we fully capture demand node / and 0 if we do not fully capture the node. We will also define V¡ to be 1 if we share the demand at node i with our competitor and 0 if we do not. With this notation, the maximum capture model can be formulated as follows: Maximize
s.t.
^ h¡ Z¡ + 0 . 5 ^ h¡ V¡ isl
(4.74)
isl
YJbijX¡-Zi>Q
(4.75)
ícllXrVl>0 ^ + Z;<1
(4.76) Vie/
ΣΖ,=Ρ X¡ e {0,1}
(4.77)
(4.14) V; e /
(4.15)
The objective function (4.74) maximizes the captured demand. This consists of two components. The first is the demand that we fully capture and the second is the demand that we split equally with our competitor. Constraints (4.75) and (4.76) link the location variables to the coverage variables. These constraints are analogous to constraint (4.13) in the maximal covering model. Constraint (4.75) defines the fully covered variables. If we locate at least one facility that is strictly closer to node i than any of our competitor sites (e.g., if ^JbijXj >1), then demand node i can be counted as fully captured (i.e., Z¡ - 1); otherwise, node i cannot be fully captured. Similarly, in constraint (4.76), if we locate at least one facility that is as close as any of our competitor's facilities to demand node i (e.g., if '^cijXj > 1), then we can share the demand at node i (i.e., we can set V¡ = 1); otherwise, we cannot share the demand at node i. Constraint (4.77) states that demand node i cannot be counted as being both fully captured and shared. Finally, constraint (4.14) states that we locate exactly P facilities and constraint (4.15) is the integrality constraint on the location variables. Note that because the objective function wants to make the full coverage variables, Z¡, and the shared coverage variables, Vh as large as possible and because constraint (4.77) provides an upper bound on the sum of these variables, we do not need any explicit constraint, as in (4.16), on these variables. Again, the details of the implementation of this model are relatively straightforward and can be found in Simple Max Capture Example.xls in the online appendix. Figure 4.37 displays the results of applying this model to the network of Figure 4.8 for various competitor locations. Each set of competitor locations is the best that the competitor can use if she wants to maximize the demand
270
LOCATION AND DISTRICTING PROBLEMS IN SERVICES
Figure 4.37. Results of the maximum capture model for three competitor location sets using the network of Figure 4.8
covered within five distance units. Note that the demand that we capture increases as we add facilities, but we can never capture all of the demand since we will inevitably share some demand with our competitor. The more sites our competitor has, the lower is the demand that we can capture for any number of sites we locate.
4.8
SUMMARY AND SOFTWARE
This chapter has introduced facility location modeling. After a number of example problem contexts were examined, a simple taxonomy of location models was developed in section 4.2. The section also gave examples of analytic, continuous, and network-based location models. In section 4.3, a variety of covering models was discussed, the first of two broad classes of discrete location models. Set covering, maximal covering, maximal expected covering, and P-center models were outlined in this section. In section 4.4 the second broad class of discrete location models was examined. These models minimize the average distance between demand nodes and the facilities assigned to serve them. Section 4.5 introduced multi-objective location problems. These problems are critical in service network design as there are often competing constituencies with conflicting objectives. The goal of multi-objective analysis is to identify solutions that provide good tradeoffs between the objectives. Section 4.6 introduced a problem that is inti-
PROBLEMS
271
mately related to location problems, the problem of districting. A variety of districting models was formulated in this section. In section 4.7, problems that arise in the context of franchise locations were examined. Three models were discussed. The first tries to disperse a given number of facilities throughout a service area. The second attempts to locate facilities to maximize the system-wide profit. The third model begins to recognize competitive features; it tries to locate a given number of "our" facilities to capture as much demand in a region as possible given the locations of our "competitor's" facilities. The chapter focused on solving these problems using Excel. For largerproblem instances, other techniques are likely to be required. Two approaches are possible. One is to use stand-alone commercial optimization software. The second is to use specialized location-modeling software. The SITATION program available on the author's website is one such software tool. SITATION solves a variety of problems including the set covering model, the maximal covering model, the F-center problem, the P-median problem, and the uncapacitated fixed charge problem. In addition, the software allows the user to find the tradeoff between coverage maximization and average distance minimization. SITATION also allows the user to map the solutions. Problem 22 gives you an opportunity to explore the SITATION software further.
4.9
PROBLEMS
1. Do you always get the same location for the 1-median on a tree when you use Goldman's algorithm, independent of the order in which you process the leaf nodes? Justify your answer. 2. If we want to find the 1-center on a tree (the location that minimizes the maximum distance between the facility and any node), we can use the following algorithm. a) Start at any node. Find the farthest node from this node and call the farthest one node A. b) Find the farthest node from node A and call it node B. c) Locate the 1-center at the point (possibly on a link) that is halfway between A and B on the unique path between A and B. Use this algorithm to find the 1-center for the tree shown in Figure 4.6. 3. To find the location of two centers on a tree, we can proceed as follows. a) Find the 1-center of the tree using the algorithm outlined in Problem 2. b) Delete the link on which the 1-center falls. If the 1-center falls on a node, delete one of the two links incident to the 1-center on the path from node A to node B. This divides the original tree into two separate trees. c) Use the algorithm in problem 4.2 on each of the two trees to find the 1-center on each tree. The objective function to the 2-center problem is the larger of the two objective function values for the two trees.
272
LOCATION AND DISTRICTING PROBLEMS IN SERVICES
Use this algorithm to find the 2-center solution for the tree shown in Figure 4.6. 4. For the dataset shown in State Populations and Areas.xls in the online appendix, a unit fixed cost per facility of $2 million, and a unit cost per mile of $0.05, find: a) The number of facilities to locate to minimize the facility and transport costs assuming a uniform distribution of demand across the 48 states plus Washington, DC. How many sites do you use and what is the estimated total cost? Use the approach outlined in section 4.2.1. b) The number of facilities to locate assuming you solve the problem 49 times, once for each state and for Washington, DC. Be sure you locate at least one facility per state (and in DC). How many sites do you use and what is the total cost? c) How do the number of sites and total cost compare between the solutions found in parts (a) and (b) above? What can you conclude about the impact of assuming a uniform distribution of demand? 5. Consider a simple network with demand nodes at the corners of a square with sides of one mile. Facilities can be located on only the nodes. The coverage distance is 1.5 miles. a) Set up the set covering problem for this network in Excel. b) Solve the set covering problem without requiring that the four decision variables be binary. What is the optimal solution? What is the value of the objective function? Is the solution an all-integer solution? c) Now add the requirement that the location variables be binary. Resolve the set covering problem. Where do you locate facilities? What is the value of the optimal solution? 6. Find all alternate optima to the set covering problem for the network shown in Figure 4.8 with a coverage distance of 8. a) For each of the solutions evaluate how many nodes are covered two or more times? b) For each of the solutions evaluate the demand-weighted total distance associated with the solution. 7. Outline an algorithm to solve the P-center problem. The algorithm should repeatedly solve the set covering model in a manner similar to the way in which the algorithm of section 4.3.5 used the maximal covering model. Use the algorithm to solve the 3-center problem on the network of Figure 4.8. 8. Show that if the value of W strictly exceeds l/l, the number of demand nodes, in (4.17), the model will always use the minimum number of facilities needed to cover all demands at least once.
PROBLEMS
273
9. What would happen in the maximal expected covering problem if the probability of a facility being busy, q, was very large (very close to 1)? Justify your answer. 10. Show that at least one optimal solution to the P-median problem consists of locating facilities only on the demand nodes. To do this, assume that there is an optimal solution that entails locating at least one facility on a link. Show that you can move this facility to one or the other of the nodes that define the link without increasing the value of the objective function. 11. Using the results of Table 4.11, find the values of the cost-per-item-per-mile at which two successive solutions result in the same cost. Do so for all consecutive pairs of solutions in the table. 12. Returning to the results in Table 4.11, suppose a system is designed for a unit transportation cost of 0.4. Now suppose the cost per item per mile doubles as a result of increases in driver wages and fuel costs. If the facilities cannot be moved, by what percentage is the total cost greater than the optimal cost associated with a cost per item per mile of 0.8? 13. For the tradeoff curves shown in Table 4.13 and Figure 4.21, identify the solution that could not have been found if we had used the weighting method of finding the tradeoff between the two objectives. Why could we not find that solution using the weighting method? 14. What values of dex,m-al,owed and we"ra can be used in the districting model of section 4.6 to force the model to assign each demand node to only the closest selected reference node? How would your answer change if you wanted to enforce integer assignments to the closest reference node as opposed to allowing fractional assignments to the closest reference nodes in the case of ties? 15. Consider the set partitioning approach to Congressional districting formulated in (4.62)-(4.65). Since we have to aggregate the actual population into demand nodes, we may still want to allow a small number of demand nodes to be in multiple districts. Formulate an extension of this model that penalizes the assignment of a demand node to more than one district by an amount q for each additional assignment of the node to a district over and above the first assignment. 16. Consider the maximum capture model. Now, however, we share the demand at any site with our competitor in the following manner. If the closest facility for our competitor to demand node i is D'lhem and our closest distance is D'us, then our share will be D'lhem/(D'lhem + D'us). Formulate a maximum capture model in this case. Note that this will be a modification of the Pmedian model and not of the maximum covering model. 17. Consider again the Weber problem for the state of Pennsylvania shown in Weber in Pennsylvania.xls in the online appendix. Extend the model to find
274
LOCATION AND DISTRICTING PROBLEMS IN SERVICES
the locations of two facilities. Each facility will serve the demands that are nearer that facility. What this means is that at each iteration, the spreadsheet must decide which of the two facilities is closer to each demand point and compute the next location for each facility based only on the demands assigned to that facility. In the event of a tie in the two distances (which might happen if you start the two facilities at the same location, for example), you should randomly assign the demand to one or the other of the two facilities. a) Which two counties are the closest to the two Weber points? b) What is the value of the objective function? c) Plot the series of solutions for the two Weber points if you start each one at (77,41). d) Plot the series of solutions if you start one of the Weber points at (80,42) and the other at (75,42). e) Do the objective function values for parts (c) and (d) differ? 18. The data in PA 12 County Data for Problem Sets.xls in the online appendix represent the 12 largest counties in the southeastern part of Pennsylvania. These 12 counties account for nearly 50 percent of the population in the state, despite the fact that there are 55 other counties in the state. a) Using these data, solve the set covering problem with coverage distances of 0,5,10,... , 65. Plot the number of facilities needed to cover all demand as a function of the coverage distance with these 14 values of the coverage distance. b) Solve the maximal covering problem for: i. a coverage distance of 10 miles and P = 0 , 1 , . . . ,12 ii. a coverage distance of 15 miles and P = 0 , 1 , . . . , 9 iii. a coverage distance of 20 miles and P = 0 , 1 , . . . ,7 Plot the percent coverage versus the number of facilities sited for each of the three coverage distances on a single graph. c) Solve the P median problem for P- 1, 2, ... , 12. Plot the demandweighted average distance as a function of the number of facilities sited. Compare the results for P = 1 to those of P = 2 and discuss whether or not you think a greedy algorithm will provide the optimal solution to the P median problem. d) Solve the P center problem for P = 1,2,... , 12. Plot the objective function distance as a function of the number of facilities sited. You will probably have to solve the problem by iteratively using the maximal covering spreadsheet that you developed in part (b). e) Solve for the tradeoff between the demand-weighted average distance and the maximum distance using the constraint method. You should
PROBLEMS
275
constrain the maximum distance. The objective that you use should be minimizing 0.999 times the demand-weighted average distance plus 0.001 times the maximum distance so that you primarily minimize the average distance but, from among any alternate optima, you select the one with the smallest possible maximum distance. Solve for the tradeoffs for P = 5, P = 6, and P = 1 and plot the results on a single graph. Which solutions could you not find using the weighting method? f) Use the districting formulation of (4.42)-(4.49) and (4.51) to minimize the range in assigned demand to districts when you use two, three, four, and five districts. Plot the range in assigned demand against the average demand per district as a function of the number of districts. Qualitatively discuss how the results would change if you used constraint (4.50) as opposed to constraint (4.51). Note that there is quite a bit of setup involved in this part of the problem. You should begin by reordering the input matrix and data so that the counties are in alphabetical order in the rows and the columns. 19. One of the important issues in facility location modeling is the following. If you are given a problem on a network (e.g., the network shown in Figure 4.8) composed of nodes and links, when do you get the same solution (in terms of the objective function value) if you restrict the facility locations to be on the nodes as opposed to the case in which you allow facilities to be on the nodes and the links. Clearly life is much easier if you know that restricting the candidate sites to be the set of nodes does not hurt you since you then have a finite set of candidate locations as opposed to the infinite set of candidate locations you would have if you could locate on the nodes and links. a) For the set covering problem, do you get the same results if (i) you can locate only on the nodes and (ii) you can locate on the nodes and links? Prove that you either do get the same results or show by example that the results will be different depending on where you are allowed to locate. b) Repeat part (a) for the maximal covering problem. c) Repeat part (a) for the P-center problem. d) Repeat part (a) for the P-median problem. 20. Consider the following hierarchical objective problem, meaning that you have a hierarchy of objectives. You first want to optimize the first objective. Then from among all the alternate optima to the first objective, you want to optimize the second objective, and so on. In this problem, we will deal only with two objectives. Consider the problem of first minimizing the number of facilities needed to cover all nodes within D) distance units and second, from among all the alternate optima to this problem, finding the solution that maximizes the number of demands that are covered within D2C distance units, where
276
LOCATION AND DISTRICTING PROBLEMS IN SERVICES
D2 < D). Let Xj be a decision variable that is 1 if we locate a facility at candidate site / and 0 if not. Let Z, be a decision variable that is 1 if demand node i is covered within D2 distance units and 0 if not. Finally, let h¡ be the demand at node i, άη be the distance between demand node i and candidate site j , ajj be an indicator input that is 1 if άή < Dl and 0 if not, and a2 be an indicator input that is 1 if d^ < D2 and 0 if not. a) With this notation, formulate the problem of first minimizing the number of facilities that are needed to cover all nodes in Dl and then, from among all the alternate optima, maximizing the number of demands that are covered within D2. Note that you should be able to formulate this as a single objective model with appropriate weights on the two objectives. b) For the seven-node problem of Figure 4.8, solve the problem for D) = 8 and D2 - 6. Where do you locate facilities? Now many demands are covered within D2 = 6? 21. You are concerned with locating emergency helicopter bases for the Department of Homeland Security (DHS) in the 10-county region surrounding Chicago. If you locate a helicopter in county X, it can adequately serve emergencies in county Y if the distance between the two counties (the centroids of the counties) is less than or equal to 18 miles. The distance matrix and county populations are given in 10 County Data Around Chicago.xls in the online appendix. a) Find the minimum number of helicopter bases that are needed to serve all 10 counties adequately with a coverage distance of 18. b) Now suppose that DHS has funds for only a limited number of bases. In particular, the director of DHS has categorically ruled out using the number that you found in part (a) above. Find the optimal number of people (population) that can be adequately served by 1, 2, ... , N helicopters, where N is the number you found in part (a). Clearly draw the tradeoff curve between the number of bases (on the X axis) and the percent of the total 10-county demand that can be served (on the Y axis). Also, provide a table giving the number of bases, the population covered, and the percent of the population that is covered. c) Repeat part (b) with a coverage distance of 24 miles instead of 18 miles. d) Find the smallest coverage distance such that every county can be covered or served adequately with only four helicopters.
PROBLEMS
277
22. The counties sorted 250.grt dataset in the online appendix represents the coordinates and populations of the 250 largest counties in the lower 48 states of the United States. The total population of these counties is over half the total U.S. population despite the fact that there are over 3100 counties in the lower 48 states alone (not counting those in Alaska and Hawaii). Use this dataset along with the SITATION software to answer the following questions: a) Find the locations that maximize the demand that can be covered within 250 miles for P = 2,4, 6, 8, and 10. b) Find the locations that maximize the demand that can be covered within 300 miles for P = 2, 4, 6, 8, and 10. c) Plot the results for parts (a) and (b) on a single graph with the percent of the total demand covered on the vertical axis and the number of sites located on the horizontal axis. d) Find the smallest possible distance such that all demands are covered using only eight facilities. e) Find the smallest possible distance such that all demands are covered using only six facilities. f) Find the minimum number of facilities needed to serve all demands within 250 miles. g) Find the minimum number of facilities needed to serve all demands within 300 miles. h) Find the locations that minimize the demand-weighted average distance using P = 2, 4, 6, ... ,20. Plot the average distance as a function of the number of facilities located. Looking at the results, is a greedy or myopic algorithm likely to find optimal solutions to this problem? i) For the case of P = 20, how many possible combinations of 20 locations out of 250 candidate sites are there? 23. Show how constraints (4.59) and (4.60) can be combined. 24. Digital cameras are characterized by two key dimensions: the optical zoom ratio and the number of megapixels of resolution in the charge coupled device (CCD) (or other technology) used to record the image. Thus, we can think of all potential buyers as being distributed in this space. We might discretize this space so that we consider the following combinations of zoom ratio and megapixels:
278
LOCATION A N D DISTRICTING PROBLEMS IN SERVICES
Megapixels Zoom
6
7
8
10+
none
200 500 300 200 150
100 600 350 400 200
50 750 400 500 250
300 400 500 350 200
3x 5x 8x 12x
The table estimates the number of weekly sales we would get from each of 20 combinations of the zoom ratio and megapixels. In addition, we can estimate the number of sales we would get of one manufactured camera model from people wanting to buy a different model, as shown below. In essence, we will try to locate the cameras to be manufactured in the space of camera characteristics as described by the zoom ratio and the number of megapixels. Megapixels Zoom none 3x 5x 8x 12x
6 15%
7 10% 20%
8
10+
25%
This table applies to people who want to buy a camera with a 3x optical zoom and 7 megapixels. If such a camera is made, then 100 percent of the market will buy that camera. If it is not made, then 10 percent of the market will downgrade to the next lower level of zoom (in this case no zoom), 15 percent will downgrade to the next lower level of megapixels, 25 percent will upgrade to the next higher level of megapixels, and 20 percent will upgrade to the next higher level of zoom ratio. Note that 30 percent of the demand for the 3x/7 camera is lost if this model is not made. This information is also shown in the table below, for all combinations of desired camera (shown in the rows) and manufactured camera (shown in the columns). In essence, this table gives the maximum fraction of the demand for a given camera (in a row) that can be accommodated or assigned to a manufactured camera (in a column). Again, if a particular camera is manufactured, then all potential buyers will buy that camera, even if having them buy some other camera might be more profitable for the manufacturer.
279
280
LOCATION AND DISTRICTING PROBLEMS IN SERVICES
Finally, we can estimate the profit per sale of each type of camera as shown below: Profit per Camera
+ o
^ΟΓ^ΟΟτ-1 ^ ^ ^ ^. OJ
O
(U
O
O
ω
O
-Io
+
ao
+ ¿> o v o r - o o ^ H
^ Ο Γ - Ο Ο ^ Η ν Ο Γ - - Ο Ο ^ Η ^ Ο Ι ~ - 0 0 ^ ^
X
X
X
X
X
X
X
X
X
X
X
X
<
N
(
N
—
(
N
^ ^ _
(
N
Profit Sale 20 25 28 30 25 30 33 35 30 35 38 40 35 40 43 45 40 45 48 50 If we have only a limited number of possible camera combinations that we can produce (due to production limits), we may want to identify the combinations that maximize the total profit. Define the following notation: Inputs and Sets / set of desired camera (zoom ratio/megapixel) combinations J set of possible camera (zoom ratio/megapixel) combinations or models that can be produced. Note that, as described above, / and / are the same; however, they need not be the same, in principle. h¡ demand for camera (zoom ratio/megapixel) combination i e / fa maximum fraction of the demand for camera combination i ε / that can be assigned to camera combination j e J η profit per camera sold for camera combination j e J p maximum number of camera models that can be produced Decision variables X¡ 1 of camera model j e / is produced; 0 if not Yi¡ fraction of demand for ιcamera combination i e / that is satisfied by camera model j e J a) Using the notation above, formulate the objective of maximizing the profit of all cameras sold. This should be in terms of Y¡¡ and should NOT involve fa. b) Formulate the constraint that at most 100 percent of the demand for camera combination / e / can be satisfied, for every such camera combination. Clearly state the values of the indices for which such a constraint applies. c) Formulate the constraint that the fraction of demand for zoom/megapixel combination / e / must be less than or equal to fa if we produce camera model y e / and 0 if we do not. Clearly state the values of the indices for which such a constraint applies.
REFERENCES
281
d) Formulate the constraint that stipulates that we produce exactly p models. e) The problem with the formulation above is that it does not enforce the logical condition that if a model y e / i s produced, then all people wanting that model will buy it. For example, if we produce both the 5x/6 and 5x/7 cameras, the model above will assign 25 percent of the weekly demand for the 5x/6 cameras to the more profitable 5x/7 camera. We need a constraint to ensure that if camera model/ e / is produced, then 100 percent of the people wanting that combination will buy that model. Formulate such a constraint. Hint: This is a simple extension of the constraints identified in part (c). f) The graph below shows the profit corresponding to 0 models produced and to 20 (all possible) models produced. A straight line connects those two points. Draw what you believe to be the relationship between profit and the number of models produced. Also, briefly, in one to two sentences, justify your answer.
REFERENCES Baker, S., 2008, The Numerati, Houghton Mifflin Co., Boston, MA. Benedict, J. M., 1983, "Three hierarchical objective models which incorporate the concept of excess coverage to locate EMS vehicles or hospitals." (M. S. Daskin, advisor), M.S. Thesis, Department of Civil Engineering, Northwestern University, Evanston, IL. Bullock, C. S. III., 1982, "The inexact science of congressional redistricting." American Political Science Association, 15, Summer, 431^438. Church, R. L., and M. Meadows, 1979, "Location modeling utilizing maximal service distance criteria." Geographical Analysis, 11, 358-379. Church, R. L., and C. ReVelle, 1974, "The maximal covering location problem." Papers of the Regional Science Association, 32,101-118.
282
LOCATION A N D DISTRICTING PROBLEMS IN SERVICES
Current, J., M. S. Daskin, and D. Schilling, 2002, "Discrete network location models," in Facility Location Theory: Applications and Methods, Z. Drezner and H. Hamacher (eds.), 81-118, Chapter 3, Springer-Verlag, Berlin. Daganzo, C. F , 1991, "Logistics systems analysis." Lecture Notes in Economics and Mathematical Sciences, 361, M. Beckmann and W. Krelle (eds.), Springer-Verlag, Berlin. Daganzo, C. F , 2003, "A theory of supply chains," Lecture Notes in Economics and Mathematical Sciences, 526, W. Trockel and G. Fandel (eds.), Springer-Verlag, Berlin. Daskin, M. S., 1982, "Application of an expected covering model to EMS system design," Decision Sciences, 13,3,416-439. Daskin, M. S., 1983, "A maximum expected covering location model: Formulation, properties and heuristic solution," Transportation Science, 17, 48-70. Daskin, M. S., K. Hogan, and C. ReVelle, 1988, "Integration of multiple, excess, backup and expected covering models," Environment and Planning B, 15,15-35. Daskin, M. S., and E. H. Stern, 1981, "A hierarchical objective set covering model for emergency medical service deployment," Transportation Science, 15, 2, 137-152. Dekle, J., M. S. Lavieri, E. Martin, H. Emir-Farinas, and R. L. Francis, 2005, "A Florida county locates disaster recovery centers," Interfaces, 35,2,133-139. Drezner, Z., K. Klamroth, A. Schöbel, and G. O. Wesolowsky, 2002, "The Weber problem," in Facility Location Theory: Applications and Methods, Z. Drezner and H. Hamacher (eds.), 1-36, Chapter 1, Springer-Verlag, Berlin. Eaton, D., M. S. Daskin, D. Simmons, B. Bulloch, and G. Jansma, 1985, "Determining emergency medical service vehicle deployment in Austin, Texas." Interfaces, 15, 1, 96-108. Erkut, E., and B. Bozkaya, 1999, "Analysis of aggregation errors for the P-median problem," Computers and Operations Research, 26,1075-1096. Erkut, E., and S. Neuman, 1989, "Analytical models for locating undesirable facilities," European lournal of Operational Research, 40,275-291. Francis, R. L., T. J. Lowe, and A. Tamir, 2002, "Demand point aggregation for location models," in Facility Location Theory: Applications and Methods, Z. Drezner and H. Hamacher (eds.), 209-234, Chapter 7, Springer-Verlag, Berlin. Garey, M. R., and D. S. Johnson, 1979, Computers and Intractability: A Guide to the Theory of NP-Completeness,^. H. Freeman and Co., New York. Gavirneni, S., L. Clark, and G. Pataki, 2004, "Schlumberger optimizes receiver location for automated meter reading," Interfaces, 34, 3, 208-214. Goldman, A. J., 1971, "Optimal center location on simple networks," Transportation Science, 5, 212-221. Hakimi, S. L., 1964, "Optimum locations of switching centers and the absolute centers and medians of a graph," Operations Research, 12, 3, 450-59. Hakimi, S. L., 1965, "Optimum location of switching centers in a communication network and some related graph theoretic problems," Operations Research, 13, 3, 462-475. Hillsman, E. L., and R. Rhoda, 1978, "Errors in measuring distances from populations to service centers," Annals of Regional Science, 12, 74—88. Kuby, M., 1987, "Programming models for facility dispersion: The P-dispersion and maximum dispersion problems," Geographical Analysis, 19, 315-329. Lee, E. K., and M. Zaider, 2003, "Mixed integer programming approaches to treatment planning for brachytherapy—Application to permanent prostate implants," Annals of Operations Research, 119,147-163.
REFERENCES
283
Lee, E. K., and M. Zaider, 2008, "Operations research advances cancer therapies," Interfaces, 38,1, 5-25. Mehrotra, A., E. J. Johnson, and G. L. Nemhauser, 1998, "An optimization based heuristic for political districting," Management Science, 44, 8,1100-1114. National Fire Protection Association, 2001, NFPA 1710: Standard for the Organization and Deployment of Fire Suppression Operations, Emergency Medical Operations and Special Operations to the Public, Quincy, MA 02269. Toregas, C , R. Swain, C. ReVelle, and L. Bergman, 1971, "The location of emergency service facilities," Operations Research, 19,1363-1373. Waxman, H. A. (prepared for), 2001, National Preparedness: Ambulance Diversions Impede Access to Emergency Rooms. U.S. House of Representatives (ed.). Washington, DC.
5 INVENTORY DECISIONS IN SERVICES
Brian waited patiently as the shoe sales clerk went into the back room to find the shoes he wanted. The sales clerk returned 5 minutes later with three boxes of shoes. "Good," Brian thought, "He found just what I wanted." "I'm afraid we do not have your size 9 in stock, but I brought out an 8j and a9\- Maybe one of them will fit. Also, we have the black in your size. Are you sure you really need another pair of brown shoes?" the sales clerk said as he plopped the three boxes at Brian's feet. "Maybe the store at the other end of the mall has my size," Brian suggested as he stood up to leave.
5.1 WHY IS INVENTORY IN A SERVICE MODELING BOOK? Inventory is generally not considered a part of service operations. In fact, many authors assert that one of the key differentiators between the service and manufacturing sectors of the economy is that goods can be inventoried, and services cannot be carried in inventory. If a flight leaves from Chicago to New York on
Service Science, by Mark S. Daskin Copyright © 2010 by John Wiley & Sons, Inc 285
286
INVENTORY DECISIONS IN SERVICES
Monday at 9:00 A.M. with 38 empty seats, the airline cannot put those empty seats into an inventory bank for later sales. The potential revenue from those seats is simply lost. If a lawyer in private practice elects to go on vacation for 2 weeks at the end of August, she cannot put that time into inventory for later billing to clients. The time is simply lost. However, a basic understanding of inventory theory and the modeling of inventory decisions is essential to understanding the service industries. To see why this is the case, let us first consider a local shoe store. If the owner of the store expects to sell shoes, she must maintain an inventory of shoes for sale. She must balance the cost of holding inventory against the cost of lost sales that result when a customer wants to buy a pair of shoes but the store does not have the style, color, or size needed by the customer. In addition, the owner does not want to have to pay for too many shipments from the various suppliers. Thus, she would like to have relatively few large shipments from a small number of suppliers. However, this means that she will have a relatively meager assortment of shoes because she is ordering from a small number of suppliers. Such a small assortment might not meet the needs of her clientele and, as a result, she may lose customers. Also, since she wants to receive relatively few shipments per year to avoid excess shipping costs, she will necessarily have to order in larger quantities, resulting in larger average inventory-carrying costs. In short, how should she balance the desire for low inventories with the need to satisfy her customers and to avoid large shipping costs? Alternatively, consider again the case of an airline. Once an aircraft departs with an empty seat, the potential revenue from that seat is lost. The seat cannot be sold again. Thus, the airline has a desire to fly with as large a load factor as possible. (The load factor on a flight is the ratio of the number of seats that are sold to the number of passenger seats on the aircraft. Typically, airlines operate with a fleet-wide load factor of roughly 80 percent.) One way to do this would be to discount the fares to attract additional customers. But doing so only increases the breakeven load factor, or the load factor the airline must achieve to cover its costs. Also, if the load factor is very high, it is unlikely that new passengers will be able to make a reservation on the flight on which they want to fly as that flight is likely to be full. Like shoe customers, many of these flyers may elect to travel using other carriers. To manage the inventory of seats available on each flight, airlines have instituted complex and sophisticated yield and revenue management systems that set prices for the seats and the number of seats that can be sold at each fare level. The problem is further complicated by the fact that some of the seats on a Chicago to Los Angeles flight leaving at noon may be for passengers flying directly from Chicago to Los Angeles. Other passengers on the flight might be continuing to destinations in the Far East, while still others may have originated on the East Coast of the United States earlier in the day. Passengers for whom the Chicago to Los Angeles flight leg is only one of several on which they will be flying typically do not pay for that flight leg separately; rather, they buy a single ticket for all of the flight legs (including return flights) in their itinerary.
EOQ—A BASIC INVENTORY MODEL
287
Finally, consider the problem faced by an individual employee who needs to determine how much money to set aside in a flexible spending account (FSA). These accounts operate as follows. An employee can place money in such an account on a monthly basis for qualifying health care expenditures. The money that is set aside is tax free. Thus, if an employee is in a 30 percent tax bracket, one dollar spent from post-tax dollars is the equivalent of about $1.43 of FSA money. Thus, the employee would prefer to spend money on health care expenditures from the FSA account rather than using post-tax dollars on health care. There are two problems that the employee faces. First, the amount of money to set aside on a monthly basis for a particular year must typically be determined during the open enrollment period, which is generally sometime in the fall of the year preceding the year in which the money can be spent. At the time the employee must decide how much to set aside, he does not typically know what his expenditures during the coming year will be. The second complication is that the money in an FSA account is there on a "use-it-or-lose-it" basis. If the employee does not incur qualifying expenditures of at least the amount in the FSA account, the funds placed in the account are lost. In essence, the amount of money in the FSA account is an inventory of money that must be managed by the employee. Similar problems arise in the purchase of seasonal goods. There is likely to be a single point in time at which the purchases can be made. If an inventory remains at the end of the season, the goods must be sold at a significant loss. On the other hand, if too few are purchased, the retailer will incur lost sales (and disgruntled customers). Most of the examples we have discussed so far entail uncertain demand: In the case of the shoe store, the demand for shoes is uncertain. In the airline case, the demand for seats at any given fare is uncertain. In the FSA example, the need for money for health care expenditures is uncertain. To understand how to deal with problems with uncertain demand, it is useful to begin by examining a very simple model in which the demand is known with certainty.
5.2
EOQ—A BASIC INVENTORY MODEL
The economic order quantity (EOQ) model is, perhaps, the most basic of all inventory models. This model deals explicitly with the tradeoff between ordering very infrequently to avoid multiple shipping charges and ordering in small quantities (but very often) to avoid large inventory-carrying costs. Figure 5.1 illustrates the key relationships and tradeoffs associated with this simple inventory model. The model assumes that inventory is used at a constant rate of R units per unit time as shown by the slope of the on-hand inventory. Note that all of the downward sloping lines—whether they are dashed lines or solid lines—have the same slope. The solid lines represent the case in which orders occur relatively infrequently. An order of size Q arrives and is depleted at rate R. Exactly QIR time periods later, the inventory is completely expended and another order of size Q arrives. The process repeats. The total ordering cost
288
INVENTORY DECISIONS IN SERVICES
Figure 5.1. Basic economic order quantity relationships
per unit time (e.g., per year) is relatively low because the order size is large and relatively few orders per unit time are needed to satisfy the demand. On the other hand, the inventory-carrying cost is large because the average inventory on hand is QI2. The dashed lines represent a case in which we place orders twice as often. Therefore, the ordering costs per unit time are twice as large as they are in the solid line case, but the inventory holding cost is half what it is in the solid line case. To make this more concrete, the EOQ model makes the following assumptions: • • • • • •
There is no lead time for shipments from the supplier. Backorders are not permitted. There is only a single SKU (stock keeping unit) of interest. There are no quantity discounts associated with large orders. The demand is deterministic. The demand is static.
We will use the following notation in discussing the EOQ model: Inputs R C h H S
Annual usage rate Unit cost of an item Holding cost per year per dollar of inventory carried Annual holding cost per year per item of inventory carried (equal to hC) Fixed cost per order including all fixed order placement costs and shipping costs.
289
EOQ—A BASIC INVENTORY MODEL
Decision variable Q Order quantity With this notation, we can write the total annual cost of buying, ordering, and holding inventory of the item in question as a function of the order quantity, Q, as follows: TC{Q) = CR + [^S
+ [^hC.
(5.1)
The first term of equation (5.1) gives the total cost of purchasing R items every year, excluding the fixed ordering costs. Each item costs C dollars and we must buy R every year to satisfy demand. Each year there will be R/Q orders placed and the fixed cost of placing an order is S. Thus, the second term represents the fixed ordering costs. If each order is for Q units, on average there will be Q/2 items on hand. Thus, the annual holding cost is given by the final term of (5.1). It is worth noting that the first term of (5.1) does not depend at all on the order quantity, Q. We simply need to pay the supplier CR every year to buy R units. We can buy them one at a time or all at once, or even buy them once every decade. The annual purchase cost of the R units will be the same: CR. Therefore, in finding the optimal order quantity, we can ignore this term. All future references to the total cost will omit this term for this reason. Figure 5.2 plots the ordering cost, the second term of (5.1), and the inventorycarrying cost, the third term of (5.1) as a function of the order quantity, Q. In this case, the unit cost was C = 100, the holding cost rate was h = 0.15, and the annual holding cost per item was, therefore, H =15. The fixed ordering cost per order was S = 5000 and the annual demand was R = 150,000. The fixed cost per year, shown as the downward sloping dashed line in Figure 5.2, decreases rapidly with the order quantity as fewer and fewer orders need to be placed each year as the order size increases. On the other hand, the inventory-carrying cost, shown as the linear dashed line, increases with the order quantity. For small order sizes, the total cost, shown as the heavy solid line, is dominated by the fixed order costs. The total cost, therefore, initially decreases with the order quantity. At some point, however, the inventory-carrying costs dominate and the total cost begins to increase with the order quantity. To minimize (5.1), we will treat Q, the order size as a continuous variable. We can then take the derivative of the total annual cost and equate it to 0 to obtain the order size that minimizes the total annual cost. [Note that because the total cost function is convex, or U-shaped, we can be sure that the value that we obtain in this way actually does minimize (5.1).] The resulting optimal order quantity is given by
Q> = M.
(5.2)
290
INVENTORY DECISIONS IN SERVICES
Figure 5.2. EOQ cost components
This equation makes sense. As the annual demand, R, increases, the optimal order size also increases. Similarly, as the fixed cost per order, S, increases, the optimal order size goes up so that we place fewer orders per year. Also, as the cost of the item, C, or the carrying cost rate, h, increases, the optimal order size decreases. With the values used to generate Figure 5.2, the optimal order size is 10,000 units and we order 15 times per year (R/Q* = 150,000/10,0000 = 15). The optimal total cost, if we order Q* units, is given by TC*(Q*) = y/2hCRS.
(5.3)
For the case illustrated in Figure 5.2, the optimal total cost is $150,000 per year. Again, this excludes the cost of purchasing the items, which is fixed at $15,000,000, and is independent of the order quantity. In deriving the optimal total cost, we can show that at the optimal order quantity, the fixed ordering cost given by the second term of equation (5.1) is exactly equal to the inventory holding cost, given by the third term of equation (5.1). This is also evident from Figure 5.2. The minimum of the solid total cost curve occurs at the point at which the fixed cost and holding cost curves intersect. Figure 5.2 suggests that the total cost curve is relatively flat at the optimal point. This means that small changes in the order quantity should not have a big impact on the total cost. To verify this, suppose the actual order quantity is Q = aQ*. In other words, instead of ordering exactly the optimal quantity, Q*, we order a multiple a of that quantity. In this case, the total ordering and inventory-carrying cost (excluding again the purchase cost of the items) is given by
291
EOQ—A BASIC INVENTORY MODEL
Figure 5.3. Percent error in total cost as a function of deviations in the order quantity
TC(aQ*) = - ^ + ^ h C y ' aQ* 2 = y/2hCRs(— + - \
\2a
2)
(5.4)
Equation (5.4) shows that the ratio of the total cost when the order quantity is Q = aQ* rather than the optimal order quantity Q* to the optimal total cost is
TC(aQ*)J± TC{Q*)
{2a
ay 2)
V
}
Figure 5.3 plots the ratio of the total fixed and inventory-carrying cost as a function of a, the fraction of the optimal order quantity that is actually ordered. As expected, the error is 0 percent when a - 1 or we order exactly 100 percent of the optimal order quantity. More importantly, the difference in total cost is less than 1 percent as long as the order quantity is between 87 percent and 115 percent of the optimal order quantity. If the order quantity is between 73 percent and 137 percent of the optimal quantity, the total cost is still less than 5 percent more than the optimal total cost. When we order half the optimal order quantity or twice the optimal amount, the total cost is only 25 percent more than the optimal total cost.
292 5.3
INVENTORY DECISIONS IN SERVICES
EXTENSIONS OF THE EOQ MODEL
As indicated in section 5.2, the economic order quantity model makes a number of very restrictive assumptions. In this section, we begin to relax some of these assumptions. 5.3.1
Positive Travel Time
Perhaps the most obvious assumption made by the EOQ model is that the orders show up instantly, as soon as the inventory from the last order is exhausted. This assumption is easy to relax as long as the lead time—the time between when an order is placed and when it is received—is deterministic or perfectly predictable. If the lead time is τ time units (measured in the same time units as the annual demand and all of the other parameters of the model), then we simply place an order when there are TR units on hand. In the example that led to Figure 5.2, if the lead time is exactly 3 days, then we should reorder when there are 1233 items 3
in inventory because 1233 = 150,000»Í1365 5.3.2
Backorders
The standard EOQ model assumes that we do not allow stockouts or backorders. In fact, even when demand is entirely deterministic, allowing backorders can be beneficial. Figure 5.4 modifies Figure 5.1 to allow for backorders in each inventory cycle. B items are backordered each cycle and the demand for these items is filled when the new order of size Q arrives, resulting in a maximum inventory during each cycle of / = Q - B items. Note that the average inventory is no longer III items because there is a period of time during each cycle of duration BIR during which there is no inventory on hand.
Time
Figure 5.4. EOQ model with backorders
293
EXTENSIONS OF THE EOQ MODEL
In this case, the objective is to minimize the sum of three cost components: (a) the fixed ordering costs, (b) the inventory-carrying costs as in the standard EOQ model, and (c) the backorder costs. We must now optimize over two decision variables: the order quantity, Q, and the maximum number of backordered items per cycle, B. If we let pC be the cost per item per year that is backordered (analogous to the holding cost per item per year of hC), then we can show that the optimal order quantity is
O*
=f¿3l\P±E
= 0*
\˱R
(5 6)
The optimal maximum number of backorders is given by B =Q
* *°°ip(P+hy
Finally, the optimal total cost is given by TC{Q*, B*) = y/2hCRSj-2—. \ p +h
(5.7)
Equations (5.6) and (5.7) emphasize the relationship between this model and the standard EOQ model. Equation (5.6) shows that the optimal order quantity in the presence of backorders is larger than when backorders are not permitted. In fact, the two are equal only when the penalty cost per dollar of backordered items, p, is infinite, or at least extremely large relative to the holding cost per unit per year, h. The total cost, on the other hand, is always less than the total cost of the EOQ model that does not allow for backorders. Again, the two are equivalent, only when the penalty cost per dollar of backorders is extraordinarily large. For the example of Figure 5.2, if the penalty cost per dollar of backorders is 0.12, the optimal order size is 15,000, as opposed to 10,000 for the E O Q model. Only 10 orders are placed each year, as opposed to 15, when backorders are not permitted. The optimal maximum backorder quantity is 8333, a large quantity relative to the order size. The total cost including the penalty costs for backorders, however, drops from $150,000 in the EOQ case to $100,000 in this case; a savings of 33.3 percent. If the penalty per dollar of backordered items is 0.341, slightly more than twice the holding cost per dollar of 0.15, the optimal order size drops to 12,000, the maximum number of backordered items goes down to 3667, and the total cost increases to $125,000, including the backorder penalty costs. Figure 5.5 plots the percentage savings in total cost as a result of allowing backorders versus the ratio of the backorder penalty cost to the holding cost (plh). The savings exceeds 10 percent of the E O Q cost as long the backorder cost is less than four times the holding cost.
294
INVENTORY DECISIONS IN SERVICES
Figure 5.5. Percent savings in total cost as a function of the backorder/holding cost ratio
Time Figure 5.6. EOQ model with production at the beginning of each phase
5.3.3
Production versus Order Delivery
Another extension to the basic EOQ model is to allow for a production phase at the beginning of each cycle, as shown in Figure 5.6. When inventory is depleted, a production phase begins, as opposed to inventory being delivered from a supplier. Production occurs at an annual rate of P units and so inventory is accumulated during the production phase at a rate of P - R units. The fixed cost, S, can now be thought of as a fixed setup cost for production. In this case, we can show that the optimal maximum inventory on hand is
a*
Production
:
2RS P-R _n* hd
P
UEOQ
IP-R
(5.8)
295
EXTENSIONS OF THE EOQ MODEL
The optimal total cost is
JlhCRsJ^-. 5.3.4
(5.9)
Multiple Items
One of the other major limitations of the standard EOQ model is that it assumes that there is a single SKU. In fact, it is often the case that multiple items or SKUs are ordered at a single time. In this section, we outline three different ways of dealing with inventory problems with multiple SKUs. The first approach is the naïve approach, in which each SKU is treated independently. To illustrate this approach, consider the problem illustrated in Table 5.1. Three items are considered: a low-quality item, a medium-quality item, and a high-quality item. The demand is dominated by the medium-quality item. The cost of purchasing the high-quality item from the supplier is twice that of the low-quality item. The holding cost rate is 20 percent per item per year for all three of the SKUs. Finally, the fixed cost is divided into two parts: a fixed cost per order and an incremental cost per line item on the overall order. Thus, if all three items are ordered jointly, the fixed cost is composed of a single payment of $125, which is the fixed cost per order, plus a line-item cost of $75 for each of the three items, resulting in a total fixed cost of $350. In the naïve approach, each item is treated independently. In other words, we simply apply equation (5.2) to find the optimal order quantity for each SKU. Table 5.2 illustrates the results. The total annual cost is $7000. By dividing each item's demand by the order size, we find that the items are ordered 2.5,10, and 5 times per year for the low-, medium-, and high-quality items, respectively. See Multi-item EOQ (individual orders).xls in the online appendix.
In fact, since the fixed cost of placing an order is divided into two parts—a cost per order and a line-item or SKU cost—we might want to try to improve on the cost by placing a single order for all three items and simply determining the TABLE 5.1. Example inputs for multiple SKU examples
Cost Fixed Order Cost Incremental Order Cost Total Fixed Cost Annual Demand Holding Cost Rate Holding Cost
Low
Medium
High
125 125 75 200 100 0.2 25
200 125 75 200 1000 0.2 40
250 125 75 200 200 0.2 50
296
INVENTORY DECISIONS IN SERVICES
TABLE 5.2. Naive model results
Fixed Cost Per Year Order Size Avg Inventory Inventory Cost Total Cost Overall Cost
Low
Medium
High
500.00 40.00 20.00 500.00 1000.00 7000.00
2000.00 100.00 50.00 2000.00 4000.00
1000.00 40.00 20.00 1000.00 2000.00
TABLE 5.3. Optimal total cost with a single joint order Line-Item (SKU) Order Cost Fixed Cost Per Order Order Size Avg Inventory Inventory Cost Total Cost Overall Cost
Low
Medium
High
649.52 1082.53 11.55 5.77 144.34 1876.39 6062.18
649.52
649.52
115.47 57.74 2309.40 2958.92
23.09 11.55 577.35 1226.87
joint order frequency. Let S0 be the fixed cost per order (the $125 value above). Furthermore, let / be the set of items to be ordered jointly, S¡ be the line-item or SKU cost per item for SKU j e J, and h¡, R¡, and c¡ be the cost per dollar per year of inventory, the demand per year, and the purchase cost per item of SKU / e J. Finally, we let X be the unknown number of orders per year. This is only the decision variable. The total annual cost can be written as a function of the number of orders per year, X, as follows: M TC(X)= So + Σ 5 , X + V
yw
X
J
(5.10)
Taking the derivative of (5.10) with respect to the number of orders per year, X, and setting the derivative to 0, we obtain
X* = 5
So+Σ ;
V
yw
Y
(5.11)
J
Applying this formula to the data shown in Table 5.1, we find that the optimal number of orders per year, X, is 8.66. The total cost, as shown in Table 5.3, is $6062, or a reduction of 13.4 percent relative to the naive approach.
EXTENSIONS OF THE EOQ MODEL
297
See Multi-item EOQ (single order).xls in the online appendix.
In comparing the single joint order with the naive approach, we find that we are ordering much too often for the low-quality products. Therefore, we might consider a third approach, in which we determine how often each year to place orders and then, how often to include each SKU in the grand order. In other words, we may elect to place an order every month, but to include the low demand items only every quarter. While there are a number of approaches to solving this problem (Chopra and Meindl, 2004), perhaps the easiest way to do so is to let the Excel Solver attack the problem. Note that this problem is inherently non-linear. The Excel Solver is better for such problems than is What's Best, which focuses on linear optimization problems.
298
INVENTORY DECISIONS IN SERVICES
See Multi-item EOQ (suborders).xls in the online appendix.
5.3.5
Limited Space or Value of the Goods in Inventory
A final limitation of the EOQ model that can be relaxed relatively easily is that there are no capacity restrictions on the size or value of the inventory on hand at any time. To relax this assumption or limitation, we introduce the following notation in line with our previous notation: Inputs and sets / set of SKUs to be analyzed Sj fixed cost per order of purchasing item y e / Rj annual demand of SKU j & J
299
EXTENSIONS OF THE EOQ MODEL
hj Cj ßj y
annual holding cost per dollar of inventory of item j e J cost per item of SKU j & J value or size of a single item of SKU ; e 7 maximum allowable value or size of all items in inventory
Decision variables Qj
order quantity for item j e J
With this notation, we can find the optimal order quantities by solving the following optimization problem.
ye/
s.t.
S¿j
L
j€j
Σ/?,.β,<7
(5.13)
Ôy>0
(5.14)
ye/
y/e/
The objective function (5.12) minimizes the sum of the ordering costs and the inventory holding costs. As before, it ignores the fixed annual cost of purchasing the items, which would be given by ]£c-Ä-. Constraint (5.13) limits the total ye/
value or size of the inventory. Clearly, if ß, refers to the physical size of the items, then y must also refer to size and they must be in compatible units (e.g., cubic feet). Finally, constraint (5.14) simply requires all order quantities to be non-negative. If the solution to (5.12) without considering constraint (5.13) happens to satisfy the constraint, then we are done. In that case, each of the order quantities would simply be the corresponding EOQ value as given by (5.2). If these values violate constraint (5.13), the optimal order quantities can be computed using the following equation:
Qf = J,
' '
\hjcj + aßj
V/e/
(5.15)
In this equation, a is an unknown multiplier. As a increases, the order quantity will decrease. Eventually, for a sufficiently large value of a, the order quantities will be just small enough so that they satisfy constraint (5.13). As shown below, the value of a can be found using a number of spreadsheet-based techniques. If the constraint coefficients, p}, are all proportional to the unit costs, c¡, then (5.15) can be further simplified to Q* = XQfOQ
VjeJ
(5.16)
300
INVENTORY DECISIONS IN SERVICES
where
λ=
ΪΛ0Γ' jeJ
(5 17)
·
In other words, the optimal order quantities are each proportional to the standard EOQ values given by (5.2), in this case.
EXTENSIONS OF THE EOQ MODEL
301
302
INVENTORY DECISIONS IN SERVICES
EXTENSIONS OF THE EOQ MODEL
303
304
5.4
INVENTORY DECISIONS IN SERVICES
TIME-VARYING DEMAND
The standard economic order quantity model assumes that the demand rate is constant over time. For many products and services this is simply not the case. In fact, for many retailers in the United States, the Christmas holiday season generates a large percentage of their annual sales. For example, more than one in every six dollars spent in the retail jewelry business is spent in December. Other big months in this industry are February (with nearly 9 percent of all sales due in part to Valentine's Day) and May (with 9.3 percent of all annual jewelry sales due partially to Mother's Day). Most department stores exhibit similar trends with December accounting for a disproportionately large percentage of the sales revenue. The ratio between gasoline sales in July to those in December is over two to one. Conversely, the dollar value of fuel dealerships sales (e.g., home heating fuel) in January is over twice that in the summer months of June, July, and August. Other retail outlets experience significantly less seasonal fluctuation. The monthly dollar value of grocery sales ranges from a low of 7.77 percent of the annual sales in February to a high of 8.72 percent in May (U.S. Census Bureau, 2009). This low range of fluctuation reflects the fact that people have to eat year-round. In this section, we outline two different approaches to dealing with seasonal demand, depending on whether or not the planning horizon is finite or (effectively) infinite. A finite horizon would occur if we need to plan for a single year, and we do not care about what happens after the end of that year. For many typical demand profiles, this may be perfectly fine as we are likely to want to place an order in January in any case. More generally, however, it may be that we need to plan for a long time horizon. What occurred this past January, in terms of sales, is likely to occur again next January. Any plan that artificially truncates the planning horizon at the end of a year (or any other month) may miss opportunities to save money that would accrue due to the use of a longer (effectively infinite) planning period. We will begin, however, with a finite planning horizon model. Specifically, we will consider the problem of planning for time-varying monthly demands. Figure 5.15 illustrates the monthly percentage of the annual sales for paint and wallpaper stores. Relatively little home remodeling apparently occurs during the holiday season (November and December) and the deep winter (January and February). The peak is in July (exactly the month we decided to repaint our bedroom and bathroom). As before, we will assume that there are two relevant costs associated with the management of inventory at a store selling paint and wallpaper: the fixed cost associated with ordering any inventory, S, and the holding cost per item per year, H = hC. We will assume that orders can be placed only for an entire month's worth of inventory. In other words, if we place an order at the beginning of January, it can cover January's inventory needs, or January and February's needs, and so on. It cannot cover January and part of February's needs, however, with a new order to arrive in mid-February.
TIME-VARYING DEMAND
305
Figure 5.15. Percent of annual dollar sales by month for paint and wallpaper stores
Figure 5.16. Inventory on hand for inventory computation
To illustrate the computation of the amount of inventory on hand, consider the three cases illustrated in Figure 5.16, each of which corresponds to receiving inventory at time 1, the beginning of January. If we had only ordered enough inventory for one month, the inventory begins at 200 and declines steadily to 0 at the end of the month. The average inventory on hand during this time is 100
306
INVENTORY DECISIONS IN SERVICES
units. If we had ordered for two months, in addition to the 100 average units for January, during January we would hold all 1400 units of inventory to be used in February. During February, the average inventory would be 700. Thus, ordering for two months would result in 100 + 1400 + 700, or 2200 item-months of inventory. Finally, if we order for three months, during January and February we would have an additional 300 units of inventory to be used in March. In March, the average inventory would be only 150 units. Thus, ordering for three months would result in 2950 item-months of inventory. We can now let c¡¡ be the cost of (1) placing an order and (2) holding inventory that arrives at the beginning of month / and that lasts for / months. In the example above, if the cost of holding an item in inventory for one month is $2, and the fixed cost of placing an order is $1000, then we would have cn = 1000 + 2 · 100 = 1200, c12 = 1000 + 2 · 2200 = 5400 and c13 = 1000 + 2 · 2950 = 6900. This definition of costs allows us to represent the inventory planning problem with monthly demands as a shortest path problem. Figure 5.17 shows the structure of such a shortest path problem if we need to plan for the first six months of a year. Darker lines represent larger inventory quantities. Thus, the darkest, topmost line represents placing a single order at the beginning of the year for six months of inventory. At the other extreme, the links connecting successive nodes
Figure 5.17. Inventory planning as a shortest path problem
307
TIME-VARYING DEMAND
represent six separate orders, each for a single month's inventory. Notice that the number of nodes is one more than the number of periods for which we are planning. In the example shown in Figure 5.17, we are planning for six months, and so there are seven nodes. The link between the June and July nodes, for example, represents the inventory purchased at the beginning of June for use during that month. Now consider the demand data shown in Table 5.4. These values correspond to a paint store with annual sales of 10,000 units. The projected sales in each month are proportional to the national average values shown in Figure 5.15. If the fixed cost of placing an order, shipping the items, and receiving them is $10,000 and the monthly carrying cost per item is $2, the optimal solution, as shown in Figure 5.18, is to order every three months, in January, April, July, and October. The total cost is $69,467, as shown in the computations below. cyeB_i4pf = 10,000 + 2J — + 1.5·706 + 2.5·795[ = 16,809 ^Apr-Jul
= 10,000+ 2 {— + 1.5-945+ 2.5-9391 = 18,406 = 10,000 + 2 { ^ U l . 5 - 9 5 7 + 2.5-897J = 18,370 = 10,000 + 2 J — + 1.5·662 + 2.5·60ΐ} = 15,882
Total Cost = 69,467 See Time Dependent Demand as Shortest Path.xls in the online appendix. TABLE 5.4. Example monthly demand data
Month January February March April May June July August September October November December
Demand Rate 716 706 795 876 945 939 1014 957 897 891 662 601
308
INVENTORY DECISIONS IN SERVICES
(Áug)
(sep)
(octj
(NOV) (¡Dec)
Uan)
Figure 5.18. Optimal solution to the inventory problem of Table 5.4 with a fixed order cost of $10,000 and a per unit monthly carrying cost of $2
For finite horizon planning models of the sort outlined above, the first order must be placed so that inventory arrives at the beginning of the first period (e.g., for January). In some cases, this may not be the optimal strategy. We now present a model in which time wraps around itself in the model. In other words, there is technically no end of the planning horizon. An order can be placed to arrive at the beginning of November for four months of inventory. This order will then satisfy demands in November, December, January, and February. We simply assume that the demand in next year's January will be identical to the demand this year in January. To model such an infinite planning horizon problem, we define the following notation. Inputs and sets P set of planning periods (e.g., the set of months in a year, or the set of days in a week or in a month) c¡¡ fixed order cost plus inventory-carrying cost of an order that arrives at the beginning of period i and is to be used for inventory during the next j periods. This is calculated as before but with the appropriate wrap-around notation, so that an order that arrives in November (e.g., i = 11) for four periods would serve demand in November, December, January, and February a¡¡k 1 if an order that arrives at the beginning of period i, to be used for the next j periods satisfies the inventory needs of period k; 0 if not In other words, aijk = \ if i < k < i + j - 1, and a¡jk = 0 otherwise, where we allow the appropriate wrap-around of the indices. That is, if we are planning monthly, and i - 11, meaning that an order arrives at the beginning of November, and j = 4 meaning that the order is for four periods, then ÜNOVANOV = ÜNovADec = Q-NOVAMI = ÖMM,«* = 1 whilefljvov,4,z= 0 for all other months Z. Decision variables X¡¡
1 if an order arrives at the beginning of period i and is to be used for inventory during the next ;' periods; 0 if not
With this notation, we can formulate the problem as follows: \p\
Min ΣΣ€αΧα
(5-18)
309
TIME-VARYING DEMAND
TABLE 5.5. Comparison of infinite horizon and finite horizon annual costs for the data of Table 5.4 with a per unit per month holding cost of $10
Finite Horizon Model Fixed Cost
Total Cost
First Order
Order/Yr
Total Cost
% Over Infinite Horizon Cost
1,000 2,500 5,000 6,500 8,000 8,700 9,000 9,500 10,000 25,000 50,000 80,000 100,000 250,000 500,000
61,995 79,995 109,995 127,505 143,065 150,025 152,695 156,585 159,695 245,155 347,335 437,795 494,755 794,755 1,062,145
January January January January January February February February January January January January January January April
12 12 12 11 10 9 8 7 6 5 4 3 2 2 1
61,995 79,995 109,995 127,505 143,065 150,065 152,735 156,625 159,695 245,155 347,335 437,795 494,755 794,755 1,096,075
0.00% 0.00% 0.00% 0.00% 0.00% 0.03% 0.03% 0.03% 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 3.19%
s.t.
\p\
Σ ^ < 1
VIEP
(5.19)
7=1
\P\
Σ Σ « Λ = 1 *kGP
(5·20)
X:je{0,l}
(5.21)
ieP 7=1
VieP;j
= l,...,\P\
The objective function (5.18) minimizes the total cost. If an order arrives at the beginning of period i for the next j periods (i.e., for periods i,i + 1,... ,i + j-l), then the cost including the fixed costs of placing an order as well as the inventorycarrying costs are c¡¡ and Xt)■. = 1. This cost then contributes to the objective function. Constraint (5.19) states that in each period, we can place at most one order. Constraints (5.20) ensure that the demand in each period is served or covered by exactly one order. Constraints (5.21) are standard integrality constraints. Table 5.5 compares the results of using this model with the finite horizon (shortest path) model discussed earlier in this section for the demand data shown in Table 5.4. The holding cost per unit of inventory per month was fixed at $10, while the fixed cost per order was varied from $1000 to $500,000. Note that what is important is not the absolute value of the fixed cost, but rather the ratio of the fixed cost per order to the holding cost per item per month. To understand why this is so, imagine what would happen if we changed the units from dollars to
310
INVENTORY DECISIONS IN SERVICES
Euros or to the Israeli Shekel. As long as the ratio remained the same, the order policy would remain unchanged. In most cases, the two models agree completely. Only in those cases in which the infinite horizon model of (5.18)-(5.21) begins with an order in a month other than January are the costs different. In only one case—the last one shown in Table 5.5—is the percentage difference between the costs of the two models significantly different. Note that in both models, as the fixed cost increases relative to the holding cost, we order less frequently and in larger quantities, holding more inventory each period. This is as expected. See Time dependent demand with wrap around.xls in the online appendix.
5.5
UNCERTAIN DEMAND AND LEAD TIMES
The models discussed so far ignore uncertainty in either the demand or the lead time, which is the time between when an order is placed and when the order is received. In fact, both are likely to be uncertain or stochastic. Thus, there is a need to plan for this uncertainty. Throughout the discussion below, we treat only the case in which there is a continuous review of the inventory on hand. An alternative approach, which leads to the need for more inventory to ensure a given customer service level, is to make inventory replenishment decisions periodically. The reader interested in such systems can consult any one of a number of operations management and supply chain texts, including Chopra and Meindl (2004). To motivate the need to account for variations in both the demand and the lead time, consider an inventory manager who knows that the average daily demand is 3 units and that the average lead time is 4 days. If both the lead time and the demand are deterministic or not subject to random variations, there will never be any stockouts if the manager places an order when the inventory gets to 12 units (or 3 units per day times 4 days for the lead time). Just as the inventory runs out, a new shipment will appear and a new inventory cycle will begin. Now, however, suppose the lead time is again deterministic, but the demand is subject to variability. Specifically, suppose the demand follows a Poisson distribution with a mean of 3 units per day. If the inventory manager again orders when the inventory on hand gets to 12 units, the probability of not being able to meet all of the demand before the shipment arrives is simply the probability of 13 or more demands. This is 0.424. (The reader should verify that he or she knows how to compute this from the Poisson distribution.) If the manager decides to order when the inventory hits 20 (as opposed to 12), the probability of stocking out drops to 0.012. However, on average, there will be more inventory left in the system when the new order arrives. The average inventory left when a shipment arrives is the safety stock. Alternatively, we can think of the safety stock as the difference between the reorder point (the inventory at which we place an order for more of the product) and the expected demand during a lead time.
UNCERTAIN DEMAND A N D LEAD TIMES
311
To illustrate these concepts further, consider the simulation results of a stochastic inventory system shown in Figure 5.19. The simulation runs until 400 demands are realized. The reorder point (shown with the heavy black line) is 12 and the lead time is fixed at 4 days. After each demand is realized, the inventory is updated. When the inventory reaches the reorder point, a new order for 55 units (the order size) is placed and the time until the arrival of the new order is computed. If an order has arrived between the time of the previous customer's demand and the current customer's demand, the order quantity is added to the inventory on hand. The mean daily demand is 3 units. Seven orders are placed in the example shown. The demand during each of the seven lead times does not exceed the available inventory and so no stockouts occur. The fact that no stockouts are shown in Figure 5.19 is a coincidence. In fact, the same conditions are likely to result in stockouts as shown in Figure 5.20. In
Figure 5.19. Stochastic inventory simulation (no stockouts)
Figure 5.20. Stochastic inventory simulation (with stockouts)
312
INVENTORY DECISIONS IN SERVICES
Figure 5.21. Stochastic inventory simulation with exponentially distributed lead times
this case, three of the seven orders result in stockouts, as shown by the diamonds, which indicate negative or backordered inventory. Finally, if the lead time itself is subject to variability, there is an even greater likelihood of a stockout during a lead time for a fixed reorder point. Figure 5.21 shows the results of a simulation under identical conditions, except that the lead time is now exponentially distributed with a mean of 4 days. Again, seven orders are placed over the course of roughly 130 days. A small number of backorders occur during the first lead time. The second lead time is very short and no backorders occur. The third lead time is longer and results in about 10 backordered items. Over 30 items are backordered during the fourth lead time. The fifth and sixth lead times are very short. In fact, the sixth lead time is nearly instantaneous. Finally, the seventh lead time is long enough to result in nearly 20 backorders. In the case of stochastic demand or lead times, there is a need to determine not only how much inventory to order each cycle, but also when to order during each cycle, or the reorder point. The reorder point determines the magnitude of the safety stock or average inventory left at the end of a cycle. Although there are many different approaches to solving this problem, perhaps the easiest way to attack the problem is to determine the order size using the EOQ model. Then, all we need to do is to determine when to place the order as a function of the demand and lead time uncertainty and the goals of the inventory system or manager. Two performance metrics are typically employed. The fill rate is the fraction of the total demand that is filled from inventory. The cycle service level is the probability that an inventory cycle will not entail a stockout. If the demand during any period (e.g., any day) is relatively large, then it can often be approximated quite well by a normal distribution. We let μά be the demand during a single (e.g., daily) period, σ\ be the variance of the demand during any period, and L be a random variable denoting the duration (in periods)
313
UNCERTAIN DEMAND AND LEAD TIMES
of the lead time with mean and variance ßL and σ\ respectively. The mean demand during a lead time is given by the product of the per period demand and the average duration of the lead time. In other words, VLT = ßdßLIf the demands in each period are independent, and the lead time is constant or deterministic, the variance of the lead time demand is given by °LT = ^Lad-
In other words, the variance of the demand during a lead time is simply equal to the variance of the per period demand, σ\ , multiplied by the number of periods in a lead time, ßL, If there is variability in the lead time as well, the variance of the demand during a lead time is given by σΙτ = μΙ_σ2ά + μ2ασΙ,
(5.22)
where the second term accounts for the variability of the lead time. We can now use the mean and variance of the demand during a lead time to determine the appropriate reorder point for a given level of service. We will begin with the cycle service level. If the inventory manager wants to ensure that the probability of a stockout during an inventory cycle is less than or equal to a, then the probability that the demand is less than or equal to the reorder point during a lead time must be at least 1 - a. In other words, we require Φ
fROP-ßLT^
>1-α,
where Φ(χ) is the cumulative normal distribution evaluated at x, and ROP is the reorder point. Solving for the reorder point, we find ROP = ßLT + z1.aoLT,
(5.23)
where the probability of a standard normal random variable being less than or equal to Z\-a is 1 - a. To compute the fill rate, we need to compute the expected number of demands during a cycle that are backordered or not filled from inventory, E(B). Clearly, all such demands will occur during a lead time or after an order has been placed. This is given by E(B)=
J
(x-ROP)f(x)dx,
314
INVENTORY DECISIONS IN SERVICES
where f(x) is the distribution of demand during a lead time. With normally distributed demands with a mean ßLT and a variance of a2LT during a lead time, we can show that this is equal to E(B) = -ss
1-Φ
( ss V \^LT
+(^LT^
'
SS ^
(5.24)
y^LT J
Jl
In (5.24), ss is the expected safety stock given by ROP - ßLT = ROP - μφά and B is a random variable denoting the number of backordered items per cycle. The fill rate is then given by fill rate = 1 - ^ 9 , Q
(5.25)
where Q is the order quantity, or average inventory used during a cycle. Solving for the reorder point that ensures that the fill rate is at least β is difficult, even if the order quantity, Q, is known. We would need to solve
i-^l-ß. Q
Solving for the expected number of backorders and substituting (5.24) for E(B), we obtain
-(ROP-ßLT) 1-Φ
({ROP-μ^λ
+ aLT<¡>
\ROP-ßLT)
-Q(l-ß).
(5.26)
This is clearly a rather intimidating equality to solve for the reorder point, ROP, because the reorder point appears in the arguments of both the cumulative standard normal function as well as the standard normal density function.
UNCERTAIN DEMAND AND LEAD TIMES
315
316
5.6
INVENTORY DECISIONS IN SERVICES
NEWSVENDOR PROBLEM AND APPLICATIONS
The analysis of section 5.5 assumed, in effect, that the inventory system would continue indefinitely. In other words, we were interested in minimizing the long run average cost per unit time. In many contexts, however, a single decision must be made about inventory levels before the demand is realized. If there is excess inventory on hand after the realization of the demands, the additional inventory is sold at a salvage price that is typically below the original purchase cost. Thus, the vendor incurs a loss on any excess inventory on hand at the end of the period. On the other hand, if the manager orders too little, there is a large likelihood of a stockout that incurs a loss of goodwill, a loss of potential sales and, possibly, additional penalty costs. Consider, for example, the problem faced by a small boutique dress shop. Each year it has to determine how many high fashion dresses of each size, color, and style to order. Each dress costs $100 to purchase and sells for $300. Thus, the store makes $200 on each sale. However, unsold dresses at the end of the season must be sold below cost to a salvage shop for only $70. Thus, the boutique loses $30 on any dress that is not sold at the end of the season. Prior to the season, the manager has estimated the probability of selling anywhere between zero and six dresses of a particular size, color, and style. These values are shown in Table 5.6.
NEWSVENDOR PROBLEM AND APPLICATIONS
317
TABLE 5.6. Example probabilities of dress sales
Sales
Probability
Buy 3
0 1 2 3 4 5 6 Total
0.05 0.10 0.15 0.20 0.25 0.15 0.10 1.00
-90 140 370 600 600 600 600 485
TABLE 5.7. Net profit as a function of number of dresses purchased
Purchase 2
3
4
-30 200 200 200 200 200 200
-60 170 400 400 400 400 400
-90 140 370 600 600 600 600
-120 110 340 570 800 800 800
188.5
354
485
570
Sales
Probability
0
1
0 1 2 3 4 5 6 Total
0.05 0.10 0.15 0.20 0.25 0.15 0.10 1.00 Net Profit
0 0 0 0 0 0 0 0
5 -150 80 310 540 770 1000 1000 597.5 MAX
6 -180 50 280 510 740 970 1200 590.5
Suppose the boutique buys three dresses. If no dresses are purchased, the boutique loses $90 or three dresses times a loss of $30 per dress. If one dress is sold, the boutique makes $200 on the sale, but loses $60 on the two unsold dresses for a net profit of $140. If two dresses are purchased, the stores nets $370, or two sales at $200 each minus a loss of $30 on the single unsold dress. Finally, if the demand is three or more, the boutique makes $600. These values are also shown in Table 5.6. Multiplying the probabilities by the net profits and summing the resulting values gives an expected profit if the store buys three dresses of $485. Table 5.7 summarizes the expected net profit as a function of the number of dresses purchased. In this case, it is best to purchase five dresses, resulting in an expected profit of $597.50. 5.6.1
Basic Model
The model for this sort of problem is called the newsvendor problem, as its original application is to a newsvendor, like a local convenience store, that sells daily
318
INVENTORY DECISIONS IN SERVICES
newspapers. As before, the manager of the store must determine how many papers to purchase from the publisher. The purchase price is c per paper and the sale price is p per paper. If, at the end of a day, any papers are not sold, they can be salvaged at a price of s per paper. Clearly, for the problem to make sense we require p> c> s. The probability that the demand will be exactly y papers is given by /(y) and D is the maximum demand. If the manager purchases X papers, the expected profit is given by X
D
E(profit\purchaseX) = ^{p-c)yf(y) + £ y=0
(p-c)(X)f(y)
y=X+l
-ÍL(x-y)f(y)(c-s).
(5.27)
y=0
The first term in (5.27) gives the expected profit due to the sale of X or fewer papers. The second term gives the expected profit when the demand exceeds X, the number of papers purchased. In this case, the sales are limited to X. Finally, the last term gives the expected salvage costs when the sales are X or less. Equation (5.27) can be written as E(profit\purchase
x X) = ^(p-s)yf(y)-(p-s)XF(X)
+ (p-c)X,
(5.28)
where F(y) is the probability that the demand is y or less. Now, suppose we purchase X + 1 items. The incremental profit of the last item is E{additional profit ¡purchase X +1)
= \Z(p-s)yf(y)-(p-s)(x+i)F(x+V+(p-c)(x+i)\ -¡t(p-s)yf(y)-(p-s)XF(x)+(p-c)x\ = -(p-s)F(X) + (p-c).
(5.29)
If this incremental profit is positive, it is advantageous to increase the number of purchased papers from X to X + 1. This condition is given by F{X)
319
NEWSVENDOR PROBLEM AND APPLICATIONS
F{Z)>BZ1=
P-c
p-s
(p-c) + (c-s)
(5.30)
In (5.30), the term in the numerator,/? - c, can be thought of as the cost of underage or cu. This is the marginal net profit that is lost if we do not have enough inventory to satisfy all of the demand. Similarly, the second term in the denominator, c - s, can be thought of as the cost of overage, c0. This is the marginal net cost if we have inventory left over at the end of the season. Thus, the critical fraction in (5.30) can be written as p-c _ cost of underage _ cu (p-c) + (c-s) cost of underage + cost of overage cu + c0 To illustrate the use of condition (5.30), consider, again, the example shown in Table 5.6. In this case, we have cu= p - c = 300 - 100 = 200 and c0 = c - s = 100 - 70 = 30. The critical fractile in (5.30) is therefore = 0.87. Condition v ' 200 + 30 (5.30) says that we should order five items since F(4) = 0.75 and F(5) - 0.9. In other words, 5 is the smallest value of the number of items we can order such that F(Z) > 0.87. When the demand is normally distributed with mean μ and variance σ 2 (or can be well-approximated by the normal distribution), condition (5.30) states that we want to purchase a quantity Q such that
JQZJL] = E^. = S^, ^ σ
;
p-s
cu+c0
(5.31)
where Φ(χ) is the cumulative standard normal distribution evaluated at JC. Solving for Q, we get Q = μ + Z(p-C)i(p-S)0, where za is the value of the cumulative standard normal distribution such that the probability of obtaining a value less than or equal to za is «. The use of this formula is illustrated in the next subsection.
5.6.2
Determining FSA Allocations
At many firms, employees can set aside pre-tax dollars to be used for qualifying health care expenditures. Employees must typically decide how much to set aside for the coming year (e.g., 2011), sometime near the end of the preceding year (e.g., November of 2010). Any funds that are not used by the end of the year for which they are set aside are lost completely. Unfortunately, next year's expenditures are not known at the time the decision about how much to set aside needs to be made.
320
INVENTORY DECISIONS IN SERVICES
The objective of a rational employee should be to maximize his or her expected post-tax, post-health-care income. Let us define the following inputs and decision variables: Inputs / a x
gross income the marginal tax rate the health care expenditures, a random variable, which we will assume is normally distributed with a mean μ and variance σ2
Decision variable Y
by
the amount of money to set aside in the FSA account for health care expenditures
With this notation, the expected post-tax, post-health care income is given
Gross income - taxes - FSA allocation - expected additional health care costs = I-a(I-Y)-Y-j(x-Y)f{x)dx
(5.32)
Y
If we equate the derivative of this expression with respect to Y, the amount of money to set aside for health care expenditures, to zero, we find that the optimal value satisfies the condition F(Y) = a
(5.33)
or
or Υ = μ + ζασ. In the United States, the peak marginal tax rate is 35 percent, so the largest possible value of za is -0.385. Thus, under the current tax laws in the United States, the amount of money that you set aside in an FSA account should be less than the amount you expect to spend on health care costs in the coming year. To evaluate the actual expected post-tax, post-health-care funds available, we need to evaluate the final integral in (5.32). To do so, it is useful to know that
321
NEWSVENDOR PROBLEM AND APPLICATIONS
Figure 5.24. Example post-tax post-health care funds
fx —
exp — I
f—\ dx= \ χφ\
=
\dx
μΦ^)-σφ^~μ
where φ(χ) and Φ(χ) are the standard normal density and cumulative distributions evaluated at x respectively. After some algebra, and using the expression above, we find that expression (5.32) becomes (/-Υ)(1-α) + (μ-Υ) Φ
Υ-μ
-σφ
Υ-μ
(5.34)
Figure 5.24 shows the available post-tax and post-health-care expenditure funds available to an individual in the 35-percent tax bracket, earning $100,000 as a function of the FSA allocation. (Note that this computation assumes that all income is taxed at the marginal rate, which is an overestimation. This should not significantly affect the optimal allocation, but the total available funds may be larger than those computed in the figure.) The individual's health care expenditures are normally distributed with a mean of $3000 and a standard deviation of $1000. The optimal allocation in this case is $2615, resulting in $62,680 in posttax, post-health-care available funds. While the error associated with not using
322
INVENTORY DECISIONS IN SERVICES
an FSA account at all is only slightly more than 1 percent, the difference is $680, which is not money to sneer at, by any standards. For any allocation between $2000 and $3000, the difference is less than 0.1 percent, or about $63—enough for a nice dinner for two. A natural question at this point in time is how does this result in (5.33) compare with the more general theoretical result shown in (5.31)? In this case, if we under-allocate funds to the FSA account, we have to spend a post-tax dollar on health care. Instead of this costing us 1 - a, it costs us $1, and so the cost of underage is a. Similarly, every dollar allocated to the FSA that is not spent is lost, but we did not have to pay taxes on that dollar and so it really only cost us 1 - a dollars. Thus c„ = a and c0 - 1 - a, resulting in a critical ratio in (5.31) of a.
5.6.3
Contracting for Services
As a final example of the newsvendor problem, we consider the issue of contracting for services. For example, a homeowner may want her driveway plowed during the winter storm season. She must contract with a company for a given number of plowings during the coming winter. For example, she may elect to contract for five plowings at $50 each or a total of $250 for the winter. As in the FSA allocation example, if the number of snowfalls is less than the number she contracts for, she still has to pay the full $250. If it snows more than the contracted number of times, the service will still plow her driveway, but at a premium rate of $80 per additional snowfall. If the owner can estimate the probability mass function of the number of snowfalls during the coming winter, the key question is how many plowings she should contract for to minimize her expected cost. To formalize this, suppose she contracts for K plowings at a cost of c per snowfall. If the number of snowfalls exceeds K, she must pay e for each additional snowfall. Clearly, we require e > c. Otherwise, she should not contract for any plowings; she should simply pay e per plowing. Finally, let f(x) be the probability that there will be exactly x snowfalls during the coming winter. The expected cost to the homeowner is then Cost(K) = cK + e%U-K)fU)j>K
(5-35)
The first term of (5.35) captures the cost of the plowings for which she has contracted. The second term represents the expected number of additional plowings multiplied by the cost per additional plowing. Similarly, if she contracts for K + 1 plowings, the expected cost is given by Cost(K + l) = c(K + î) + e ^
(j-K-l)f(j).
(5.36)
j>K+l
Subtracting (5.35) from (5.36), we find that the incremental cost of the (K + l)sl plowing is
Figure 1.1 Gross domestic product over 60 years Based on the U.S. Department of Commerce, Bureau of Economic Analysis, National Income and Product Accounts Table 1.1.5 Gross Domestic Product (Seasonally adjusted at annual rates)
Figure 3.28 Sample time dependent queueing analyzer output
Figure 3.29 Sample probability of waiting results
Figure 3.30 Steady state (red) and time-dependent (green) probability mass functions
Figure 4 . 1 1 . Solution covering 90 percent of the demand at 200 miles with only 13 sites
Figure 4.30 U.S. Congressional districts in Illinois
Figure 4.31 Sample results of districting at the zip code level in Illinois
Figure 4.32 Another heuristic solution to the districting problem in Illinois
Figure 4.33 A third heuristic solution to the districting problem in Illinois
Figure 7.22 Time dependent queueing analyzer results for 25 employees with starting times as found using the optimization model of section 7.5
Figure 7.23 Time dependent queueing analyzer results for 25 employees with improved starting times
Figure 9.10 Approximating the number of extra servers required by the normal approximation
Figure 9.11 Extra servers needed vs. offered load for three levels of service
Figure 9.16 Example simulation results: Total time and waiting time
Figure 9.17 Example simulation results: P(abandon), P(busy), P(wait)
Figure 10.20 Illustration of Kruskal's MST algorithm for the network of Figure 10.8
323
NEWSVENDOR PROBLEM A N D APPLICATIONS
Incremental Cost(K —> K + l) = c-e ^ =
j>K+l
/(/)
(5.37)
c-e{l-F(K)}.
If this incremental cost is positive, then we should contract for K plowings; otherwise contracting for K + 1 plowings is better than contracting for K plowings. In other words, we want to find the smallest value of K such that (5.37) is positive. That is, we want the smallest value of K such that c-e{l-F{K)}>0 eF(K)>e-c
^
F(K)>6-^. In (5.38) e - c is the cost of underage as this is the incremental cost that has to be paid if the homeowner contracts for too few plowings. The cost of overage, or contracting for too many plowings, is simply c. Thus, again, the right-hand side of (5.38) is simply the cost of underage divided by the sum of the cost of underage plus the cost of overage. To illustrate the use of these equations, consider the probability mass function shown in Table 5.8. As discussed above, suppose the cost per contracted plowing, c, is $50 and the cost per additional plowing, e, is $80. With these values, the critical fractile in (5.38) is = 0.375. Thus, from Table 5.8 the homeowner *■ 80 should contract for four plowings. Table 5.9, which gives the expected cost for each possible number of contracted plowings, confirms that contracting for four plowings results in the minimum expected cost. TABLE 5.8. Sample probability mass function for the number of snowfalls Snows
Probability
Cumulative
0 1 2 3 4 5 6 7 8 9 10 TOTAL
0.05 0.08 0.10 0.12 0.15 0.12 0.10 0.09 0.08 0.06 0.05 1.00
0.05 0.13 0.23 0.35 0.50 0.62 0.72 0.81 0.89 0.95 1.00
324
INVENTORY DECISIONS IN SERVICES
TABLE 5.9. Expected cost for each number of contracted plowings Contract for
Expected Cost Min?
5.7
0
1
2
3
4
5
6
7
8
9
10
380
354
334.4
322.8
320.8 MIN
330.8
350.4
378
412.8
454
500
SUMMARY
Inventory decisions are critical to the provision of many services. For example, imagine a surgeon trying to perform an operation without an adequate supply of sutures, clamps, and scalpels, not to mention appropriately typed blood in case of an emergency. No retail establishment can remain in business very long without an inventory of goods to sell. Restaurants maintain an inventory of food to be served. In addition, restaurants, car rental agencies, airlines, and hotels implicitly maintain an inventory of tables, vehicles, seats, and rooms for use by patrons. The economic order quantity model finds the optimal balance between the fixed costs of placing and receiving orders on the one hand and the cost of carrying inventory on the other hand. If the order quantity is too large, excessive inventory-carrying costs will be incurred, though the fixed ordering costs will be relatively low. Conversely, if we order very frequently with small quantities per order, the carrying costs will be low but the fixed order placement costs will be high. At the optimal order quantity, the annual fixed costs equal the annual inventory-carrying costs. Fortunately, it turns out that the total cost is relatively insensitive to the exact order quantity or frequency. As Figure 5.3 shows, if the order quantity is within 25 percent of the optimal order quantity, the total cost will be within 5 percent of the optimal total cost. In section 5.3, we relaxed a number of the assumptions made in the classical economic order quantity model. Specifically, section 5.3.1 introduced lead times. Section 5.3.2 introduced backorders. Somewhat counter-intuitively, allowing backorders reduces the total cost even if the cost per backorder is very large. Section 5.3.3 considered the situation in which inventory is produced over a finite time as opposed to being ordered from an outside vendor. The case of multiple items per order was examined in section 5.3.4. Finally, section 5.3.5 introduce constraints on the available space for inventory or the maximum value of the inventory that can be maintained at any time. The economic order quantity model assumes that demand occurs at a known constant rate at all times. In fact, demand is likely to vary over time. Very few winter coats are sold in June, but a large number are sold in the fall and early winter months. Section 5.4 introduced time-varying demand. Problems with a finite time horizon can be formulated as variants of the shortest path problem. When we need to capture seasonality in an (effectively) infinite time horizon, the
PROBLEMS
325
problems can still be formulated as integer linear programming problems, but not as shortest path problems. Uncertain demand and uncertain lead times were the focus of section 5.5. The key decision in this case, in addition to the order quantity, is how much safety stock to maintain. The larger the safety stock, the better the customer service as measured by the fill rate and the cycle service level. The fill rate can also be improved by increasing the order quantity at the expense of increased average inventory-carrying costs. Finally, section 5.6 introduced the newsvendor problem. This is an inventory problem in which a one-time decision about how much inventory to acquire must be made before demand is realized. If the demand falls short of the quantity ordered, the excess inventory must be sold at a loss. If the demand exceeds the quantity ordered, there is a cost associated with either procuring emergency inventory or a loss of goodwill with respect to the customers. The newsvendor model can be applied to a range of problems beyond simple inventory management.
5.8
PROBLEMS
1. Consider the flexible spending account problem described in section 5.1. If an employee who has set aside $200 per month, or $2400 for the year finds herself with $500 left in the account in the middle of December, what sorts of actions can she take to spend the available money? 2. Derive equations (5.6) and (5.7) for the extension of the EOQ model to include backorders. 3. Derive expressions (5.8) and (5.9) for the extension of the E O Q model to include a production phase at the beginning of each cycle. 4. For what values of the production rate, P, is the maximum inventory in the model of section 5.3.3 the same as that of the standard EOQ model. For other values of the production rate, is the maximum inventory on hand more or less than that of the standard E O Q model? 5. For what values of the production rate, P, is the total cost in the model of section 5.3.3 the same as that of the standard E O Q model. For other values of the production rate, is the total cost more or less than that of the standard EOQ model? 6. Show that for the finite horizon model of section 5.4, it may actually be optimal to order for a portion of a period. To do so, consider a six month problem with demands of 100 every month except during the third month when the demand is 200. Let the holding cost per unit per period be $10 and the fixed order cost be $10,000. First, show that the optimal policy if we can order only every month is to order once at the beginning of the planning horizon with a total cost of $30,500. Alternatively, we can order two times, once at the beginning of month 1, again at the beginning of month 3, and again obtain a total cost of $30,500. Next, consider ordering at a time a months from the beginning of month 3. We want 0 < a < 1 meaning that we
326
INVENTORY DECISIONS IN SERVICES
will now place a second order in the middle of month 3. Show that for a = 0.25, the total cost can be reduced (slightly) to $30,375. Note that this is only 0.4 percent less than the cost if we restrict the orders to be monthly orders. 7. Consider the problem of determining how many permanent nurses to have in a department of a hospital. The actual number needed on any shift depends on the current number of occupied beds. From historical records, the hospital has estimated the information in the following table: Nurses Needed
Probability
8 9 10 11 12 13 Total
0.10 0.20 0.40 0.15 0.10 0.05 1.00
a) Find the expected number of nurses needed. b) Suppose it costs the hospital $240 per shift for a permanent employee nurse. If the number of nurses required for a given shift exceeds the number of permanent nurses, the difference is made up using temporary nursing staff. The cost per temporary nurse per shift is $300. Find the expected cost if the hospital hires 10 permanent nurses. c) Find the optimal number of permanent nurses to hire [using the same cost numbers given in part (b)]. You can show that the optimal number C -C of nurses to hire is the smallest value of H such that F(H)>— -, where F(H) is the cumulative distribution of the number of nurses needed evaluated at H, CE is the cost of an extra (temporary) nurse, and CR is the cost of a regular (permanent) nurse. d) For the number of nurses you found in part (c), find the expected number of regular or permanent nurses over and above the number needed. e) For the number of nurses you found in part (c), find the expected number of temporary nurses used each shift. f) This model assumes that there is no value in having an additional regular nurse on the unit over and above the number needed. Suppose there was a value of doing so (e.g., a dollar benefit of $125 per extra nurse per shift). Would this make it desirable to hire more nurses than in part (c) or fewer nurses than in part (c). Briefly justify your answer. 8. Consider the monthly demands shown below. Assume that you place orders so that deliveries arrive at the beginning of a month.
327
PROBLEMS
Month January February March April May June July August September October November December
Demand Rate 1600 1700 1700 1650 1550 1700 1800 1850 2000 2200 2500 2800
a) If the fixed cost of placing an order and receiving it is $10,000 and the per item per month carrying cost is $2, find the optimal times to order to minimize the total annual cost of satisfying all demands. What is the total cost? When do you order? b) Holding the inventory carrying cost per item per month at $2, solve the problem for the following values of the fixed cost per order: i) 3000 ii) 3250 iii) 3500 iv) v) vi) vii)
3600 4000 5000 6000
viii) 10,000 ix) x)
15,000 25,000
xi) 50,000 xii) 200,000 For each value above, record the number of orders and the total cost. Plot the total cost versus the fixed order cost. How does the number of orders per year change as the fixed cost of placing and receiving an order increases? 9. For the same demands shown in problem 8, solve for the optimal time to order, the number of orders, and the total cost if you treat the problem as having an infinite time horizon if the carrying cost per item per month is again $2 and the fixed cost per order is $10,000.
328
INVENTORY DECISIONS IN SERVICES
a) What is the total cost? b) How many times should the firm place orders? c) What is the first month of the year in which orders should be placed? d) How does this total cost compare to the total cost in part (a) of the problem when the time horizon is treated as being finite? e) Why is the total cost in this case less than the total cost found in problem 8a? 10. Consider the problem faced by a small village that needs to contract with one of two different vendors to repair street lights. The first vendor, NightLights, has proposed charging $5200 per month for the first 52 lights that need to be replaced and an additional $115 per light for each additional light beyond that. The second vendor, AfterDark, is proposing to repair the first 40 lights each month for $4500 but then will charge $120 per light after the first 40 are repaired. The number of lights that fail each month follows a Poisson distribution with a mean of 45 per month. Village Commissioner Smith, who has a bachelor's degree in accounting, has argued that the village should clearly contract with NightLights since their cost per light in the base contract is lower than that of AfterDark ($100 versus $112.5) and their cost per light over and above the contracted number is also less than that of AfterDark ($115 versus $120). a) Is Commissioner Smith correct? If not, explain qualitatively why he is wrong. b) What is the expected cost of contracting with each firm? c) Which firm should the village hire to minimize its expected cost? 11. Develop a spreadsheet to simulate the flexible spending account problem described in section 5.6.2 for an individual with a gross income of $100,000, a marginal tax rate of 35 percent, and health care expenditures that are normally distributed with a mean of $4000 per year and a standard deviation of $1200. Recall that if U and V are independent uniform (0,1) random variables, then Y! = V-21n(Z7)cos(2;rV) and Y2 = V-21n(t/)sin(2/rV) are independent, normally distributed random variables with a mean of 0 and a variance of 1. To do this problem, first generate 10,000 values for U and another 10,000 values for V. Keep these values fixed throughout the entire problem. In other words, you should use the same set of random variables for all parts of the problem. a) Simulate 10,000 cases with an FSA allocation of $1000. What is the average post-tax, post-health-care expenditure money available to such an individual? b) Repeat part (a) above with FSA allocations of $0 to $6000 in increments of $500. What is the best FSA allocation to use from among these cases? What is the average post-tax, post-health-care expenditure money available in that case?
PROBLEMS
329
c) For the 13 cases simulated in part (b), plot the average post-tax, posthealth-care money available as a function of the FSA allocation. d) What is the optimal allocation as given by condition (5.33)? What is the optimal expected post-tax, post-health-care expenditure money available as given by (5.34)? e) Using the FSA allocation computed in part (d), simulate 10,000 years of data (or alternatively, you can think of this as 10,000 similar people). What is the average money available after taxes and health care expenditures? How does this compare to the theoretical value in part (d)? Are the values statistically significantly different? 12. Consider the problem faced by two different retail chains. One uses megastores to sell its product but has relatively few of them in each city. The other uses smaller, more local stores. In a particular city, each faces an annual demand of 144,000 items. In both cases, the fixed ordering cost is $1000 per store per order and the holding cost is $2 per item per year. The megastore company has only 4 stores in the region, while the local store company has 36 stores. a) Compute the demand per store for each of the two firms, assuming that the demand in the region is evenly distributed between the stores of each firm. b) Compute the optimal order quantity for a single store for each of the two firms. c) Compute the total annual cost per store for each of the two firms. d) Compute the total annual cost for each of the two firms. Note that this is simply the total cost per store per year multiplied by the number of stores that the firm has in the region. e) What can you infer about the value of aggregation in inventory systems? f) What if any disadvantages does the megastore face? g) Derive a general formula for the total cost for a firm that has N stores, an overall annual demand of R units, a fixed cost per order of S, and a per unit per year holding cost of H = hC, as in the economic order quantity model. To do so, it will be useful to follow the steps outlined above using this notation instead of the actual numbers. h) How does the total inventory cost for a firm depend on the number of stores that it has in a region? 13. There are 250 people on the 11:05 A.M. American Airlines flight 153 from Chicago to Tokyo. Because this is an overseas flight with a duration of 13 hours and 20 minutes, the airline feeds you a meal. Past experience has shown that 60 percent of the passengers on a flight will choose the chicken dinner and the remaining 40 percent will choose the beef dinner. In other words, the probability of a passenger choosing chicken (which we will call success) is p = 0.6 and the probability of beef (a failure) is q = 0.4.
INVENTORY DECISIONS IN SERVICES
a) Find the expected number of passengers who want chicken on flight 153. b) Find the standard deviation and the variance of the number who want chicken on flight 153. c) If the airline loads 160 chicken dinners and 110 beef dinners (a total of 20 extra meals), what is the probability that all passengers will be able to get their preferred meal? Hint: Let X be a random variable that is the number of people who want chicken. Clearly, 250-X is then the number who want beef. Write down the conditions under which everyone gets their preferred meal in terms of X and then find the probability that X is in that range. d) In part (c), the airline had 10 extra meals of each type. Assuming they load N extra meals of each type, what is the smallest value of N (the number of extra meals of each type) that will ensure that the probability of being able to give every passenger his or her preferred meal is at least 0.90? A small bed and breakfast, Babette's B&B, has seven bedrooms that can be rented. The owner, Babette, maintains a pristine establishment and rooms are in high demand. Thus, she can accept virtually as many bookings as she chooses. However, if she overbooks and everyone shows up, she must pay for any "overflow" guests to stay at the local chain hotel at a personal cost of $150. She makes $100 per night per room that is rented. Past experience has taught her that 25 percent of the guests who book rooms actually fail to show up. a) Write down a function f(G), which gives the revenue that Babette will make as a function of G, the number of guests (rooms) that actually show up for any evening. Note that f(G) should increase at first as additional guests translate into additional revenue until the bed and breakfast is full. After that, the function should decrease as she has to pay for the "overflow " guests to stay elsewhere. b) If Babette accepts seven reservations for an evening (i.e., she does not overbook), what is her expected revenue? c) If Babette accepts eight reservations for an evening (i.e., she overbooks by one room), what is her expected revenue? d) Find the optimal overbooking policy. What is the expected revenue in this case? By how much does it exceed the expected revenue found in part (b) above when she does not overbook at all? e) If Babette can reduce the no-show rate from 25 percent to 12.5 percent (i.e., she can cut it in half) by calling guests two days in advance of their arrival date to confirm their reservation, what should the new policy be? What is the expected revenue in this case? How does it compare to that found in part (d)?
331
PROBLEMS
f) How does this problem differ mathematically from the newsvendor problem discussed in section 5.6? 15. Nursing costs are among the larger expenses for hospitals. The number of nurses needed on a unit during any shift depends on the number of beds that are occupied. In this problem and the next several problems, which follow up on problem 7, we explore the optimal hiring policy for nurses. Hospitals typically have two types of nurses available to them: staff nurses and temporary nurses. Staff nurses are hired by the hospital and are paid a salary. They work their assigned shifts, whether there is a need for them or not. If the number of available staff nurses for any shift is less than the number of nurses needed to staff a unit, the hospital can hire temporary nurses. On a per-shift basis, staff nurses are paid less than temporary nurses despite the fact that the staff nurses are likely to be better acquainted with hospital procedures, with the physicians, and perhaps even with the medical conditions presented by the patients in the unit (Davis, 2009). In this and the next three problems, when we speak of the hospital hiring S staff nurses, we really mean that there are S staff nurses available for the shift in question. Because staff nurse may work only one in every three shifts, what this means is that the hospital really has to have 35 staff nurses. To keep things simple, we will just stick with the terminology "the hospital hires S staff nurses" when we mean that there are S staff nurses available for the shift. In this problem, we will explore the staffing of a critical care unit in which the nurse-to-patient ratio is 1:1. (This is a very high ratio as many intensive care units do not operate at this level on average. However, this will make the problem easier at this point.) Staff nurses are paid $240 per eight-hour shift and temporary nurses are paid $300 per shift at the hospital in question. The distribution of the number of occupied beds, out of the B that are in the unit, is given by 0 P(])
j + A-B Δ(Δ + 1)/2 0
j<max(B-R,0) max(B-R,0)<j
B
where ;' is the number of occupied beds, B is the total number of beds in the unit, Δ = B + 1 - max(ß - R,0) and R is a parameter used to control the minimum number of beds for which there is a non-zero probability of occupancy. Note that this will result in a (truncated) discrete triangular distribution with the mode (or maximum probability) corresponding to the case in which all beds in the unit are occupied. In our case, we will have B = 4, R = 3, and Δ = 4. This results in the following probabilities of having ; beds occupied.
332
INVENTORY DECISIONS IN SERVICES
0.0 j -0 0.1 j = 1 0.2 iy = 2 p(j) = \0.2 0.3 i = 3 0.4 i = 4 a) What is the expected number of occupied beds? b) Write down a function c(S, j) that gives the cost to the hospital of hiring S staff nurses if there are j occupied beds on a unit. c) If the hospital hires four staff nurses for the unit, what is the expected cost? d) If the hospital hires no staff nurses for the unit, what is the expected cost? e) If the hospital hires three staff nurses for the unit, what is the expected cost? f) Find the optimal number of nurses to hire for the unit. What is the expected cost in this case? g) Show that the optimal number of staff nurses is given by the smallest value of H such that P{H) > (cT - cs )/cT, where P(j) is the probability that there will be) or fewer occupied beds in the unit (the cumulative probability function), cT is the cost per temporary nurse per shift, and cs is the cost per staff nurse per shift. h) Interpret the ratio given in part (g) in terms of the critical fractile discussed in section 5.6. 16. In this problem, we will continue the nurse hiring problem, but we will consider a more complex case. In this case, we have a standard medical/surgical unit with 25 beds (B = 25). Past records have shown that the number of occupied beds can be approximated by the function given in problem 15 with R = 9 and Δ = 10. This results in the following bed-occupancy probabilities: Beds Occupied
Probability
Beds Occupied
Probability
0-15 16 17 18 19 20
0 1/55 2/55 3/55 4/55 5/55
21 22 23 24 25
6/55 7/55 8/55 9/55 10/55
The maximum patient-to-nurse ratio that the hospital wants to permit for this unit is 2.5:1. As in problem 15, a staff nurse costs $240 per shift and a temporary nurse costs $300 per shift.
PROBLEMS
333
a) Find the expected number of occupied beds. b) Using a spreadsheet, compute the number of nurses needed for each number of occupied beds. c) Find the expected cost if the hospital hires 10 staff nurses for the unit. d) Find the expected cost if the hospital hires nine staff nurses for the unit. e) Find the optimal number of staff nurses to hire and the resulting expected cost. 17. Repeat problem 16 using a temporary nurse cost per shift of $340. a) What is the new optimal number of staff nurses to hire? b) If the hospital maintains the policy it had in problem 16), what is the expected annual additional cost, compared to the optimal annual cost, if there are 1095 = 3 · 365 shifts per year? 18. Return to the cost figures of problem 16. Now, however, the hospital management wants to reduce the patient to nurse ratio to improve patient safety. The proposed patient to nurse ratio is 2.25:1. a) Find the optimal number of staff nurses to hire and the resulting expected cost. b) If there are 1095 = 3 · 365 shifts per year, what is the additional annual cost of this change compared to the annual cost resulting from the optimal policy in problem 16? c) If the hospital actually has 400 beds (with 16 units of 25 beds, each of which is probabilistically identical to the unit we have analyzed), what is the expected additional annual cost of this policy? d) There are about 1.2 million hospital beds in the United States (based on a population of 300 million and about four beds per 1000 people, a number that is lower than that of most Western countries). This means that there are about 48,000 25-bed units of the type analyzed in this problem. Extrapolate the annual cost increase of this change in the patient-to-nurse ratio to the national level. 19. You are the manager of a local tax preparation office. Each January, before the tax season begins, you have to determine how many temporary accountants to hire. Each accountant can process five tax returns a day. You will be contracting with each employee for 50 days of time (or 250 returns). You pay each accountant $9000 for the tax season. In addition to these hired accountants, you can hire even more part-time staff who you pay $60 per return that they complete. You charge $70 per return. You estimate that the demand for returns this year is normally distributed with a mean of 9000 and a standard deviation of 2500 based on previous years. For this problem, you may find the following useful.
334
INVENTORY DECISIONS IN SERVICES
where φ(χ) = standard normal density function evaluated at x Φ(χ) = cumulative standard normal density function evaluated at x a) Let Q be the capacity of the tax office for employee-completed returns (as opposed to those filled out by extra staff who are paid $60 per return). For now, do not worry about the fact that Q must be a multiple of 250. Write down an expression for the expected number of returns that are completed by employees as a function of Q. b) Write down an expression for the expected number of returns completed by the staff (those paid $60/return) as a function of Q, the capacity of the office for returns completed by employees. c) Write down the employee cost as a function of Q (again ignoring the fact that the real capacity is a multiple of 250). d) Write down an expression for the profit as a function of Q. e) Develop a spreadsheet that computes each of the four terms above as a function of Q. Have Q vary in increments of 250 from 0 to 16,250. Plot the profit as a function of Q. f) What is the optimal value of Q? How many hired employees does this correspond to (i.e., divide Q by 250)? g) Suppose you do not want more that 500 (on average) returns to be filled out by the staff (those paid $60/return) since many of those returns have errors and later cost you in goodwill. Now how many employees should you hire? What is the percentage decrease in profit compared to the profit found in part (f)? 20. Consider the problem of determining how many overbookings to take at a car rental agency. Suppose we know that the distribution of no shows is as shown in the table on the facing page. The firm obtains a net profit of $30 per rental per day. However, the firm has to pay to place customers with a competitor when the number of desired rentals exceeds the number of available cars. The cost to the firm of doing this, including an estimate of the loss of goodwill is $50 per rental per day. a) Find the expected number of no-shows. Find the variance and standard deviation of the number of no-shows.
335
PROBLEMS
Number of No-Shows
Probability
0 1 2 3 4 5 6 7 Total
0.05 0.07 0.10 0.12 0.24 0.19 0.15 0.08 1.00
b) Set up a spreadsheet to compute the expected cost per day as a function of the number of overbookings accepted. The number of overbookings will go from 0 to 7, clearly. Clearly show the expected cost in each case. c) What is the optimal number of overbookings? d) Use the fractile method to find the optimal number of overbookings. e) Develop an Excel spreadsheet that will simulate 1000 days of operation for a specified number of overbookings. For each possible number of overbookings, find the mean cost and the standard deviation of the mean cost. What is the optimal number of overbookings that you obtain from this approach? Does it differ from the optimal number you obtain in either part (a) or part (c)? If so, how does it differ and why does it differ? Clearly show the simulation of the first 10 days when you allow four overbookings. Also, clearly show in a table the mean cost and the standard deviation of the mean. Important Note: When you run the simulations for each different number of overbookings, use the same set of random numbers. In particular, you should generate 1000 uniform (0,1) random numbers using the ToolslData AnalysislRandom Number Generation option of Excel with the following inputs shown below. You should use a random number seed of 3287. You will then need to convert these uniform random numbers into random numbers drawn from the distribution shown above to get the number of no shows each day. Why is it important to use the same random numbers for each of the eight simulations? f) Clearly, the problem we have discussed is very stylized and idealized for a true car rental firm. Briefly discuss at least two ways in which it fails to capture what fully goes on in a car rental agency?
336
INVENTORY DECISIONS IN SERVICES
21. You are the City Manager for a small city (e.g., Highland Park, Illinois). The table below gives your estimate of the number of snowfalls during the coming winter, during which you will need to have snowplowing services as well as the probability of each such number of snowfalls. # Snowfalls
Probability
0 1 2 3 4 5 6 7 8 9 10 Total
0.04 0.06 0.08 0.11 0.15 0.18 0.14 0.10 0.07 0.04 0.03 1.00
Your problem is to determine the optimal number of snowfalls to contract for in advance of the winter. You pay $300,000 for each snowfall you contract for, but if it does not snow that many times, you are still obligated to pay for the contract at that amount. In other words, if you contract for five snowfalls, you pay $1,500,000 to the company whether it snows 0 , 1 , 2, ... , 5 times. If
337
PROBLEMS
it snows more than the number you contract for, you pay $425,000 per snowfall. The goal is to minimize the expected cost. a) Find the expected number of snowfalls. b) If you contract for three snowfalls, find the expected number of additional snowfalls that you will have to pay for. c) Develop a spreadsheet to compute the expected number of additional snowfalls when you contract of K snowfalls (K = 0, ... , 10). d) Add to the spreadsheet the expected cost of contracting for K snowfalls. e) Find the optimal number of snowfalls to contract for. Note that the first three rows of the spreadsheet should look like the table below. # Snowfalls
Probability
Cum Prob
1-Cum
E(# Additional snowfalls)
Contract
E(Extra $)
E(Cost)
0 1 2
0.04 0.06 0.08
0.04 0.10 0.18
0.96 0.90 0.82
4.81 3.85 2.95
$0 $300,000 $600,000
$2,044,250 $1,636,250 $1,253,750
$2,044,250 $1,936,250 $1,853,750
f) Now suppose that you want to be sure that the maximum additional cost is under $1,500,000. Now how many snowfalls should you contract for? What is the increase in the expected cost compared to the case in which this constraint is not present? 22. Consider the simplified problem faced by the admissions office of a mediumsized liberal arts college. The college wants to have a freshman class of 2000. From previous experience, they know that 40 percent of the students they admit will actually decide to come to the college. If the number that decide to come exceeds 2000, there is an additional cost to the college in terms of housing the students for the fall quarter in expensive housing. This amounts to $3000 per student. On the other hand, if fewer than 2000 decide to accept the offer of admission, the college loses tuition revenue. This cost is $8000 per student. a) If the college admits N students, what is mean and variance of the number of students who actually decide to go to the college? b) What is the approximate distribution of the number of students who will enroll at the college as a function of N? For the next two parts of the problem, you may find the following useful:
338
INVENTORY DECISIONS IN SERVICES
where φ(χ) = standard normal density function evaluated at x Φ(χ) = cumulative standard normal density function evaluated at x c) By what expected number of students will the college be short of its target class of 2000? Hint: Think about this in two parts: (1) if the number who decide to come to the college is less than or equal to 2000 and (2) if the number who decide to come is more than 2000. d) What is the expected number of students that the college will have to house in expensive housing as a function of N? (i.e., what is the expected amount by which the number of students enrolling at the college exceeds 2000?) e) Note that you should be able to do this problem even if you did not get the last two parts. Find the optimal number of students to admit to minimize the expected cost—the cost of having too few students come (at $8000 per student) and the cost of having too many come (at $3000 per student). Recall that the key condition is that 8000P(# enrolling < 2000) = 3000P(# enrolling > 2000) 8000P (# enrolling < 2000) = 3000 [1 - P (# enrolling < 2000)] 3 = — = 0.2727. v 5 ; 3000 + 8000 11 It may also be useful to know that Φ(-0.60459) = 3/11, where Φ(χ) is the probability that a standard normal random variable is less than or equal to*. 23. Professor Yao teaches civil engineering at a large engineering college. While he has a parking place near his office, he often needs to attend meetings at other locations on the campus. Rather than walk the half hour to these meetings, he frequently drives his car and parks in a metered spot. It costs 25 cents for each 20 minute period at the meters. The distribution of time for his meetings is given below (in minutes): P (# enrolling < 2000) =
3000
Time in Minutes
Probability
Less than 45 45-60 61-75 76-90 91-105 106-120
0.0 0.1 0.2 0.5 0.1 0.1
REFERENCES
339
a) Because the meetings are nominally called for an hour, Professor Yao generally deposits only 75 cents into the meter. What is the probability that the time will have expired when he arrives back at his car? b) If the fine for a parking ticket is $15, and the probability of being caught with an expired meter is 0.1 given that the time has expired, how much money should Professor Yao deposit to minimize his expected cost? What is his expected cost? c) Using the value found in part (b), what is the expected amount by which Professor Yao overpays the parking meter? d) Again, using the value found in part (b), what is the expected fine that Professor Yao pays? e) If Professor Yao persists in paying only for one hour of parking, what is the expected cost per meeting to him? What is the expected fine that he has to pay? How much can he save per meeting by adopting the optimal policy? 24. In 2009, the H1N1 or "swine" flu was a major problem in the United States. News reports fueled the flames of public fears about a pandemic outbreak of the flu. For two or three months in the fall of 2009, the vaccine was available, but only in very limited supply. Health care workers, young children (believed to be those who would be most affected by the disease), pregnant women, and those with compromised immune systems were given priority in receiving the vaccine during these months. In many ways, ordering vaccines for the flu—whether it is the H1N1 flu or simply a standard flu—is very much like the newsvendor problem. The government must contract months in advance for the number of doses it wants to procure. Because the lead time in developing and manufacturing the vaccine is very long, the government has only one chance to place an order; if the country runs out of the vaccine, additional supplies cannot be procured. Also, any unused vaccine must be destroyed, as the formulation of the vaccine differs from year to year and outbreak to outbreak. In addition, the demand for the vaccine is uncertain prior to the flu season. Briefly discuss at least one of the additional complications associated with managing the distribution of a flu vaccine compared to the problems addressed in a simple newsvendor problem. REFERENCES Chopra, S., and P. Meindl, 2004, Supply Chain Management: Strategy, Planning and Operation, Prentice Hall, Upper Saddle River, NX Davis, A., 2009, "The nurse shortage crisis," IE 490 Report, Department of Industrial Engineering and Management Sciences, Northwestern University, Evanston, IL. U. S. Census Bureau, 2009, "Monthly & annual retail trade," retrieved July 23,2009 from http://www.census.gov/retail/.
6 RESOURCE ALLOCATION PROBLEMS AND DECISIONS IN SERVICES
"Sarah, come on down," Steven Wilson called to his 20-year-old daughter who was nearing the end of her summer vacation. "Looks like you got your course assignments from college. I hope you did better than last term, when you couldn't register for two of the courses in your major. " Sarah bounded down the steps to open the envelope from her college. She really liked school but was frustrated that she could not take the courses she wanted. "Oh no!" she exclaimed when she opened the letter. "I got into three of the four courses, but I still am closed out of the seminar with Professor Morgan. He is supposed to be the best teacher in the department. I don't understand why I keep getting closed out of his courses. " "I don't understand why I am paying a third of the gross national product to that college only to have you not get the courses you want, " her father exclaimed, even more exasperated than his daughter.
Service Science, by Mark S. Daskin Copyright © 2010 by John Wiley & Sons, Inc
341
342
6.1
RESOURCE ALLOCATION PROBLEMS A N D DECISIONS IN SERVICES
EXAMPLE RESOURCE ALLOCATION PROBLEMS
Many service related problems boil down to resource allocation problems. For example, in an educational setting, we may need to allocate rooms and times of the day or week to classes. We may need to assign faculty to courses. At an even more contentious level, we may need to allocate offices to faculty. In many cases, students express preferences for courses and they then need to be assigned to courses (as outlined in Chapter 2). Many MBA programs operate in this manner. Also, many colleges require freshmen to take one or more seminars. During the summer before the start of their freshman year, students express preferences for the myriad of seminars that might be offered. The college or university administration must then assign students to seminars, or alternatively, allocate seminar seats (course capacity) to students. Disappointment, frustration, and resentment often occur when students—like Sarah in the vignette above—fail to get their desired courses or seminars. Repeated events of this sort do not make for happy alumni! Resource allocation problems are also prevalent in health care. Medical students must be assigned to residency programs. This is done in a nationwide system, known as "the match" (National Resident Matching Program, 2009). Over 24,000 medical students are assigned to programs annually. Similar programs exist for the assignment of rabbinical students to congregations (Bodin and Panken, 2003). On a routine basis, rooms and nursing staff must be allocated to individual patients. The nurse rostering problem, discussed in more detail in the next chapter, entails assigning nurses to shifts. Patient scheduling, also discussed in the next chapter and in Chapter 9, requires the assignment of patients to appointment times, or the allocation of appointment slots to patients. In transportation, gates must be allocated to aircraft. Similarly, in taxi operations, customers must be assigned to vehicles. In trucking operations, loads must be assigned to vehicles, and in some cases, to times of the day. In each of these examples, the problem can be viewed as that of assigning or allocating resources to customers, or vice versa, to minimize or maximize some objective subject to constraints on the customers and on the resources. Table 6.1 summarizes a number of the examples discussed briefly above. In assigning classes to room/time combinations, the classes can be thought of as the customers, while each room/time combination (e.g., room M228 at 10 A.M. on Monday/Wednesday/Friday) can be thought of as the resource. Assigning a class with an expected enrollment of 65 students to a room with only 50 seats means that we expect 15 students to be denied enrollment in the course. In general, universities try to avoid such situations (though many students may not think so during the week after registration closes). Similarly, assigning such a class to a large auditorium with a capacity of 500 students would also not result in an ideal learning environment. Thus, the objective in this case penalizes assigning a course to a room that is either too big or too small. The constraints stipulate that each course has to be assigned to a room/time combination and that each
Aircraft
Customer loads
Assign times of the day to customer loads
Times of the day
Gates
Minimize penalties for deviations from the desired delivery times
Congregations
Rabbinical students
Allocate gates to aircraft
Maximize aggregate student and residency program satisfaction Maximize aggregate rabbinical student and congregational satisfaction Minimize expected patient waiting time, physician idle time, and physician overtime Minimize passenger walking distances
Residency programs
Medical students
Assign residency opportunities to medical students Allocate rabbis to congregations
Appointment time slots
Minimize aggregate student dissatisfaction
Seminars
Students
Assign seminar space to students
Patients
Each faculty member must be assigned to an office Each student assigned to exactly one seminar
Maximize aggregate faculty satisfaction
Offices
Faculty
Assign offices to faculty
Allocate appointments to patients
Each course must be assigned to exactly one faculty member
Maximize aggregate faculty and department satisfaction
Faculty
Courses
Each load must be assigned to a starting time
Each aircraft must be assigned to a gate
Each student must be assigned to (at most) one program Each congregation must be assigned no more than its desired number of rabbis Each patient must be assigned to a scheduled appointment
Each class must be assigned to a single time
Minimize penalties for over and under capacity
Room/time combination
Customer constraint
Classes
Objective
Allocate rooms and times to classes Allocate faculty to courses
Resource
Customer
Example problem
TABLE 6.1. Example resource allocation problems
No more than a specified number of patients may be assigned to any appointment slot No more than one aircraft may be at any gate at any time At each time of the day, the number of vehicles in use must be less than or equal to a given value
Each rabbi must be assigned to (at most) one congregation
Each room/time combination can have at most one class allocation Each faculty member must be assigned to the required number of courses Each office assigned to no more than one faculty member Number of students assigned to each seminar must be less than or equal to the seminar capacity Program capacities must not be violated
Resource constraint
344
RESOURCE ALLOCATION PROBLEMS AND DECISIONS IN SERVICES
room/time combination can be assigned at most one course. This latter constraint ensures that we do not have two or more classes scheduled for the same room at the same time. In assigning faculty to courses, the faculty can be considered the resource and the courses can be thought of as the customers. Each course must be assigned to a single faculty member and each faculty member can be assigned to teach no more than a given number of courses. This number often depends on factors such as the seniority of the faculty member, how much other activity (research, administration, and professional service) the faculty member is engaged in, and how many courses he or she taught in the preceding term(s). The assignments are limited by the ability of faculty members to teach courses, in other words, by the expertise of the faculty. Introductory courses might be taught by anyone, while advanced Ph.D.-level courses may be specific to a single person. Additional constraints may require each faculty member to teach a minimum number of undergraduate classes and at least one graduate class. Both the faculty and the administration (the department chair) have preferences for the assignment of courses. For example, a department may choose to give priority to junior faculty members, as they are the most vulnerable. Other departments give senior faculty their first choice. In addition, individual faculty members might express preferences for certain courses over others. The objective function maximizes a combination of the faculty preferences—perhaps weighted in some way by seniority—and the departmental goals. Assigning faculty to office space is generally done on an incremental basis because most faculty members remain in the same office for years. However, when departments move from one building to another, as mine did on several occasions, all faculty must be assigned to new office space. This is generally a very contentious process, as offices frequently differ in size, view, and proximity to the department office. (For some faculty, being close to the office may be desirable; others view the department office as an obnoxious facility to be avoided at all costs.) Faculty may express preferences for certain offices. The objective is then to maximize the aggregate satisfaction of the faculty, generally weighted by the seniority of the faculty members. The constraints ensure that each faculty member is assigned to an office and that at most one faculty member is in any office. The problem of assigning students to seminars is similar, as discussed in Chapter 2. Students typically rank their seminar preferences with 1 indicating the student's most preferred seminar. A dean must then assign students to seminars to minimize the total of all preference values over all students/seminar assignments. The constraints stipulate that each student has to be assigned to a seminar and that the capacity of each seminar cannot be violated. Assigning medical students to residencies and assigning rabbis to congregations are similar in a number of ways. The medical students or rabbis to be assigned can be thought of as the customers and the residency programs or congregations can be viewed as the resources. In both cases, an assignment is not
EXAMPLE RESOURCE ALLOCATION PROBLEMS
345
possible unless both parties (e.g., the medical student and the residency program) want to be paired. As before, the objective is to maximize an appropriately weighted combination of preferences for the customers (medical or rabbinical students) and the resources (residency programs or congregations) as well as a penalty for not assigning a customer at all and for not meeting the needs of the resources. The constraints stipulate that any person can be assigned to at most one position and that the capacity limits of the resources are obeyed. Both problems are often further complicated by the so-called "two body problem," in which spouses need to be assigned simultaneously to programs in the same city. The problem of assigning patients to appointment times is even more complicated, as the model needs to account for four sources of uncertainty. First, the actual patient arrival times vary around the scheduled time; a patient scheduled for an appointment at 11 A.M. may actually show up at 10:50 or at 11:15 (or any other time for that matter). Second, the time a physician spends with a patient will vary depending on the needs of the patient. Thus, a patient scheduled for a half-hour appointment may need only 10 minutes of a physician's time, while another person scheduled for half an hour may need over an hour of time from the physician. The former case is likely to result in idle time for the medical staff, while the second case will induce delays for subsequent patients. Third, and in part as a result of the other two sources of uncertainty, some patients will not show up at all for a scheduled appointment. Fourth, many clinics and physician offices want to reserve some time slots for emergency patients who show up (effectively) unannounced. These four sources of uncertainty complicate the problem; the resulting models are likely to be stochastic. Section 3.1 illustrated the impact of service time and patient arrival time uncertainty on the expected patient waiting time. The objective is to minimize a suitably weighted function of patient waiting times, physician idle times, and the amount of time a physician and his or her staff have to work beyond the nominal end of the scheduled appointment period. As a result of the inherent uncertainty in the problem, and because the medical profession is loath to accept idle time, multiple patients are often scheduled at the same time and appointment schedules are typically "front loaded" with many patients assigned to appointments early in the daily schedule. In fact, the well-known Bailey-Welch rule (Bailey and Welch, 1952) assigns two patients to the first appointment slot and then schedules patients at regular intervals after that with the length of the interval between scheduled appointments equal to the average appointment time. By scheduling two appointments at the beginning of the day, the schedule reduces the likelihood of physician idle time. By ignoring the variability in the time a patient spends with a physician, the rule favors reduced idle time over patient waiting time delays. Assigning aircraft to gates is similar to many of the problems we have already discussed. Aircraft can be thought of as the customers and the gates as the resources. The problem is to assign aircraft to gates to minimize the total
346
RESOURCE ALLOCATION PROBLEMS AND DECISIONS IN SERVICES
passenger walking distance. On any particular flight at an airport like O'Hare Airport in Chicago, some passengers will be terminating. Thus, their walking distance can be thought of as the distance between the gate and the front of the terminal at which they are arriving. Other passengers will be connecting to other flights. For them, the relevant distance is the distance between their arrival and departure gates. The problem is to assign each incoming aircraft to an available gate to minimize the total passenger walking distance. The problem is complicated by a number of issues. First, not every plane can be accommodated at each gate. Second, the exact itinerary of each passenger on board a plane may not be used in all cases; instead an airline may use estimates of the fraction of passengers transferring to each of a number of subsequent flights. Third, the problem is dynamic in that decisions must be made now accounting for future uncertainty regarding the actual arrival times of later flights as well as gate delays for planes already at their gates. At the time that an assignment must be made for a particular inbound aircraft, the assignments for subsequent flights might not have been made; nevertheless, those assignments will impact the walking distance of the passengers on the flight being assigned. Finally, we have recently been working with a local truckload carrier. The carrier is interested in leveling the workload of its fleet over the course of a day. One way of doing so is to ask the consignees it serves to accept deliveries either earlier or later than the requested time. Thus, loads (the customers, in this case) must be assigned to delivery times (the resources). If a consignee is asked to accept a load at a time other than the requested time, a penalty is imposed on the carrier. The penalty may be a function of how much earlier or later the load is to be delivered to the consignee, the particular consignee in question, and whether the delivery will be early or late relative to the requested time. Thus, each load must be assigned to a time. The objective is twofold: to minimize the maximum number of vehicles needed to execute a given set of deliveries and to minimize the penalties for early or late shipments.
6.2 HOW TO FORMULATE AN ASSIGNMENT OR RESOURCE ALLOCATION PROBLEM As indicated in Table 6.1, assignment or resource allocation problems can be thought of as allocating resources to customers. For every feasible resource/ customer assignment, there is a penalty or cost. The objective is to minimize the sum of all penalties associated with the assignments that are made subject to constraints that say that each resource is not over-utilized and that each customer is assigned at least the required number of resources. More formally, we can define the following notation: Inputs / K
set of resources set of customers
HOW TO FORMULATE AN ASSIGNMENT OR RESOURCE ALLOCATION PROBLEM
pjk
Sj dk
347
penalty associated with assigning resource ;' e J to customer k e K. As discussed in section 6.3, if the assignment of resource j G J to customer k e K is not permitted, we can set pjk = °°, or some effectively large number. supply of resource j e J, or the maximum number of customers that can be served by or assigned to resource j e J demand of customer k e K, or the minimum number of resources that must be assigned to customer k e K
Decision variables Xjk 1 if 1 unit of resource je J is allocated to customer k e K; 0 if not With this notation, we can formulate the basic assignment or resource allocation model as follows:
Min s.t.
Σ Σ Ρ Λ ^Xjk>dk
YJXjk<sj
IceK
Xjk e{0,1}
(6.1) VkeK
(6.2)
V/e/
(6.3)
\/jeJ;keK
(6.4)
The objective function (6.1) minimizes the sum of all of the penalties for assignments made between customers and resources. Constraint (6.2) states that each customer k e K must be allocated at least dk resources. Constraint (6.3) limits the number of customers assigned to resource j e / to at most s¡. Finally, constraint (6.4) states that each resource can be used to satisfy at most one unit of a customer's requirements. Note that the traditional assignment problem in the operations research literature has every supply equal to 1 (s¡ = 1, for every / e / ) and every demand equal to 1 (dk = 1, for every k e /Q.The formulation above is a slight generalization of this model. Also note the similarity between this and the transportation problem discussed in Chapter 2. The key difference is that in the transportation problem we allow a resource to be used to satisfy multiple demands of a single customer [that is, we replace constraint (6.4) by Xjk > 0], whereas this model allows a resource to satisfy only a single unit of a customer's demand. It is also worth noting that, as discussed in section 6.3, this model can be structured as a network flow model. Hence, the integrality constraints in (6.4) can be replaced by simple bounding constraints (0 < Xjk < 1) and the problem can be solved very efficiently using network flow algorithms.
348
RESOURCE ALLOCATION PROBLEMS AND DECISIONS IN SERVICES
HOW TO FORMULATE AN ASSIGNMENT OR RESOURCE ALLOCATION PROBLEM
349
350
RESOURCE ALLOCATION PROBLEMS AND DECISIONS IN SERVICES
See Example for infeasibility MODEL 1 Feasible Solution.xls in the online appendix.
6.3
INFEASIBLE SOLUTIONS
In many cases, it is important to allow for infeasible solutions. For example, in assigning students to seminars, it may not be possible to assign all students to one of their top three choices. In assigning nurses to shifts, it may be that no one wants to work on Saturday night; nevertheless, someone must be assigned to that time. Similarly, when student volunteers are asked for the times that they are available to work, it may not be possible to staff all required periods with a student volunteer while still obeying the other constraints of the problem. These constraints may limit the amount of time any volunteer works and may impose minimum and maximum values on the number of volunteers on duty during any period. Infeasible solutions can often be modeled using a dummy resource with unlimited capacity. Assigning a customer to the dummy resource is associated with a very large penalty cost. Thus, any feasible solution that does not entail the use of the dummy resource will cost less than using the dummy resource at all. If the optimal solution to the modified problem including the dummy resource utilizes the dummy resource, then we know that there is no feasible solution to the original assignment problem. In other problems (e.g., the problem of staffing a schedule using student volunteers with limited availability), we may also need to include a dummy customer with unlimited capabilities. To illustrate the need to allow for infeasibility, consider the problem of assigning staff to morning and afternoon shifts over a five day period. Each of the 10 shifts consisting of Monday through Friday, AM and P.M., must be staffed by exactly two volunteers. There are five volunteers and we have agreed to alio-
351
INFEASIBLE SOLUTIONS
cate four shifts to each volunteer. Figure 6.3 illustrates the input data for such a problem. A number in a cell indicates that the volunteer is available for the given shift. The lower the number, the more the volunteer prefers that shift. Thus, Ashley is available to work during the A.M. shift on Monday, but not during the A.M. shift on Thursday and she prefers Monday A.M. to Monday P.M. In this example, each volunteer is available for five shifts and there are five volunteers. Thus, there are 25 volunteer/available shift combinations. Only 20 volunteer/ available shift combinations are needed based on the requirement that each shift be staffed by exactly two volunteers. Figure 6.4 shows one feasible solution to the problem in which each volunteer works exactly four shifts, each shift is staffed by exactly two volunteers, and volunteers work only those shifts for which they are available. Now suppose that Tamar is not available on Wednesday P.M., but is available on Tuesday P.M., as shown in Figure 6.5. Again, each volunteer is available for five shifts, but only needs to be assigned to four shifts. To satisfy the feasibility conditions for Wednesday P.M., Thursday P.M., and Friday A.M. and P.M., we Monday Name Ashley Jacquie Keren Sarah Tamar
Tuesday
Wednesday
A.M.
P.M.
A.M.
P.M.
A.M.
1 5
2 1
3 2
4 3
5 4
2
3
4
Friday
Thursday
P.M.
A.M.
P.M.
A.M.
P.M.
4 3 1
5 4 5
1 5
2 1
3 2
Figure 6.3. Example ranking of shifts by volunteers (feasible case)
Name Ashley Jacquie Keren Sarah Tamar
Monday A.M.
1 0 0 0 1
Tuesday
Wednesday
Friday
Thursday
P.M.
A.M.
P.M.
A.M.
P.M.
A.M.
P.M.
A.M.
P.M.
0 1 0 0 1
1 1 0 0 0
1 1 0 0 0
1 1 0 0 0
0 0 0 1 1
0 0 1 0 1
0 0 1 1 0
0 0 1 1 0
0 0 1 1 0
Figure 6.4. Example assignment of volunteers to shifts
Name Ashley Jacquie Keren Sarah Tamar
Monday
Tuesday
Wednesday
A.M.
P.M.
A.M.
P.M.
A.M.
1 5
2 1
3 2
4 3
5 4
2
3
4
1
Thursday
Friday
P.M.
A.M.
P.M.
A.M.
P.M.
4 3
5 4 5
1 5
2 1
3 2
Figure 6.5. Revised availability of volunteers (infeasible case)
352
RESOURCE ALLOCATION PROBLEMS A N D DECISIONS IN SERVICES
should assign Keren and Sarah to these shifts, as they are the only two people who have volunteered for these shifts. This, however, will leave Thursday A.M. with only one available volunteer, Tamar. Clearly, there is no feasible solution to this problem as stated. Now, however, if we add a dummy period to which any volunteer can be assigned once (meaning that a volunteer might work only three real shifts plus once during the fictitious or dummy shift) and a dummy volunteer who can work any shift and can work up to 10 shifts, we can find a feasible solution. Using the dummy employee to staff a shift would indicate that there are fewer than two real volunteers assigned to that shift. To avoid using the dummy shift and dummy volunteer, we should penalize the use of such assignments. Figure 6.6 shows sample penalties that might be used to model this problem. If a volunteer is assigned to a shift that she is willing to work, the penalty is only one unit. If we use the dummy shift or the dummy volunteer, we incur a penalty of 100, which exceeds the total of all penalties associated with a feasible solution that uses only volunteers during their available times. Finally, if we have to assign a volunteer to a time that she does not want to work, we incur an even larger penalty of 100,000. With these penalties, we can readily tell from the objective function value whether or not the solution is feasible (in which case the objective function value would be exactly 20), uses the dummy volunteer or the dummy shift (in which case the objective function value will exceed 100 but will be less than 2000), or is still infeasible (in which case the objective function would exceed 100,000). Figure 6.7 shows an optimal solution to the problem with the dummy time period and a dummy volunteer. Note that Tamar is assigned to only three real
Figure 6.6. Penalties for using dummy shifts and volunteers
Figure 6.7. An optimal solution using a dummy shift and a dummy volunteer
353
INFEASIBLE SOLUTIONS
shifts and that there is only one real volunteer, Keren, staffing the Thursday P.M. shift. The objective function value is 249, indicating that 19 shifts are staffed by volunteers who are willing to work at those times and that one dummy shift and one dummy volunteer assignment (each with a penalty cost of 100) are used. In the absence of the dummy volunteer and dummy shift, we would assign Tamar, for example, to the Thursday P.M. shift and incur a cost of 100,000 for this assignment and a total cost of 100,049. Note that even this solution allows for infeasibility in the sense that it allows volunteers to be assigned to times that they do not want to work. To make these ideas somewhat more concrete, we will consider a number of different formulations of this problem. In this variant of the problem, volunteers indicate not only the times that they are willing to work, but also their rank orderings with 1 being their most preferred shift and 5 being their least preferred shift. The basic inputs to the problem are given below. Inputs J K pjk Sj dk ajk
set of volunteers set of shifts to be staffed ranking of volunteer j e J for shift k e K.lî the volunteer does not rank a particular shift, the volunteer cannot work that shift. supply of volunteer j e /, or the number of shifts to which the volunteer must be assigned demand of shift k e K, or the number of volunteers that must be assigned to the shift if volunteer j s J can be assigned to work shift k e K; 0 if not.
_ri
ifPjk>o
Alternatively, we have a¡k ~ 1 Q ·*
_ Q.
Decision variables Xjk 1 if volunteer je J is assigned to work shift k e K; 0 if not With this notation, we can formulate the basic model as follows. Min
ΣΣΡ*Χ*
(6-5)
keK jcj
s.t.
dk
\fkeK
(6.6)
V/G/
(6.7)
VjeJ;keK
(6.8)
ksK
Xjke{0,l}
The objective function (6.5) minimizes the sum of all of the rankings over all assignments of volunteers to shifts. Constraint (6.6) states that the number of volunteers assigned to shift k e K must be equal to the required number, dk, for
354
RESOURCE ALLOCATION PROBLEMS AND DECISIONS IN SERVICES
Figure 6.8. Network flow diagram corresponding to preferences of Figure 6.3
each shift. Furthermore, the only volunteers that can be assigned to a shift are those who are available during that shift; that is, those for which ajk = 1. Other volunteers will not count toward the required number of volunteers during a shift due to the presence of the ajk coefficient in the summation. Constraint (6.7) states that volunteer j e J must be assigned the required number of shifts, s¡. Finally, constraints (6.8) are the standard integrality constraints. Figure 6.8 shows the network flow diagram corresponding to this assignment problem. In this case, the lower and upper bounds on all of the source-volunteer links are 4 and the unit costs on those links are 0. The lower and upper bounds on the shift-sink links are 2 and the unit costs are 0. The volunteer-shift links have a lower bound of 0, an upper bound of 1, and a unit cost equal to the preference value shown in Figure 6.3. The figure omits the return arc from the sink to the source for simplicity. Although the formulation above is technically correct, there are a number of reasons why it may result in an infeasible solution. The first reason is that the total number of required number of shifts, ^ dk, may not equal the number of volunteer shifts to be assigned, ¿-isr Assuming ¿^dk ^¿¿sr jej
keK
we
can
resorve
jeJ
this infeasibility by changing constraints (6.6) and (6.7) to inequalities, as shown below. ^ajkXjk>dk VkeK
(6.9)
JSJ
Y Xik < s,
L· 'k
'
V; e /
(6.10)
Constraint (6.9) states that we must assign at least dk volunteers to shift k e K, while constraint (6.10) stipulates that volunteer; e / can be assigned to at most
355
INFEASIBLE SOLUTIONS
Sj shifts. In terms of the flow diagram shown in Figure 6.8, this corresponds to setting the lower bound on the source-volunteer links to 0 and the upper bound on the shift-sink links to infinity. If ^dk > ^ s ; - , the required keK
jej
number of shifts to be assigned exceeds the number of available shifts. The relaxations shown in (6.9) and (6.10) will not help resolve this problem. Furthermore, as shown in the example of Figure 6.5, it is possible that the volunteers' availability may not result in a feasible assignment of volunteers to shifts, even when the aggregate need for volunteers is less than the aggregate supply of volunteers. To resolve these infeasibilities, we may elect to assign volunteers to shifts for which they have not volunteered. We can do this by eliminating the ajk coefficients from constraint (6.9), as shown below. VkeK
£*,*><**
(6.11)
JeJ
To ensure that constraint (6.11) assigns volunteers to unwanted shifts only when absolutely necessary, we must set the penalty for such an assignment to a very large number. The number should be larger than the total possible value of the objective function if all volunteers are assigned to shifts that they are willing to work. One bound on this is given by Y i , J- m a x {L/ ) i t }J . In other words, we •^"i
keK
jej
'
compute the largest penalty for volunteer j e J, assume that all shifts to which the volunteer is assigned incur that penalty (a very conservative assumption), and that the volunteer is assigned to his/her maximum number of shifts. We would set the penalty for any unwanted volunteer/shift combination to a value larger than this number. Figure 6.9 shows the revised network flow diagram. The dashed links between volunteers and shifts correspond to shifts that the volunteer did not rank and therefore does not want to be assigned to. These links have a lower bound of 0, an upper bound of 1 and a cost of 100,000 to ensure that they are selected only as a last resort. Alternatively, we can add a dummy shift, with a required demand, dD = 0, meaning that we do not need to assign any volunteers to the dummy shift, indexed by D, but if we need to, we can. We might need to do so if we employed constraints (6.7) or if there were lower bounds on the minimum number of shifts to be assigned to each volunteer. Similarly, we can add a dummy volunteer with "infinite" capacity, or a capacity that is as large or larger than the total number of required shifts. Thus, we set sv - ¿¿ dk, where V is an index for the dummy keK
volunteer. We now augment the sets of shifts to K= KVJ{D\ to include the dummy shift and the set of volunteers to J = / u { V] to include the dummy volunteer. We now set the penalty for the use of the dummy volunteer or the dummy shift to a large number, such as pjD = pVk = pVD = Y s · max \pjk}. We then set the penalty ■^"i ¡el
keK
356
RESOURCE ALLOCATION PROBLEMS AND DECISIONS IN SERVICES
Figure 6,9. Network flow diagram with non-selected assignments included to ensure feasibility
for assigning a volunteer to a shift that he or she does not want to an even larger number, such as
¿_,dk+\
\k^K
J
pjD. In this way, the model will prefer to assign
volunteers to shifts for which they have volunteered. Next, it will use the dummy volunteer to fill shifts, indicating that the shift will not be fully staffed by real volunteers. The new model is identical to the model using objective function (6.5) together with constraints (6.11), (6.10), and (6.8), except that we replace set K by ¿ a n d set J by J everywhere. Figure 6.10 shows the revised network flow diagram with a dummy volunteer and dummy shift added. Links from the dummy volunteer to each time period have a lower bound of 0, an upper bound of 1, and a unit cost of 100, again to ensure that they are used only when needed (and before any assignments are made between a real volunteer and shifts that the volunteer did not select). Similar bounds and costs apply to the links between volunteers and the dummy shift. To illustrate these models, Table 6.2 shows the results of applying the various models outlined above to the two datasets shown in Figure 6.3 and Figure 6.5. Each volunteer can be assigned up to four shifts (s¡ = 4, Vy e J) and each shift requires two volunteers (dk = 2, Vk e K). In the first row of the table, we use the basic model with the feasible inputs. The objective function value is 56. Note that if each of the five volunteers had been assigned to their first four choices, the objective function value would be only 50 (1 + 2 + 3 + 4 = 10 times 5 volunteers). This is not possible and so some volunteers must be assigned to their fifth choice, resulting in an aggregate objective function value of 56. In the second row, we
357
INFEASIBLE SOLUTIONS
Figure 6.10. Adding a dummy volunteer and dummy time period to the network flow diagram
TABLE 6.2. Summary of ways of handling infeasibility Dataset
Model
Penalties
Objective Value
Figure 6.3 Figure 6.5
(6.5), (6.9), (6.10), (6.8) (6.5), (6.9), (6.10), (6.8)
Rankings Rankings plus pjk = 100,000
56 Infeasible
Figure 6.5
(6.5), (6.11), (6.10), (6.8)
Rankings plus pjk = 100,000
100,049
Figure 6.5
(6.5), (6.11), (6.10), (6.8)
if ajk = 0
if a,k = 0
Rankings plus pjk = 100,000 if ajk = 0 and dummy shift with pjD = 100 and dummy volunteer with pvk = 100
149
use the infeasible dataset of Figure 6.5 and the basic model. The result is that the problem is infeasible. In the third row, we change from constraint (6.9) to constraint (6.11), allowing the assignment of volunteers to non-chosen shifts, but at a large penalty of 100,000. A feasible solution exists, but the objective function value is 100,049. In the final row, we add a dummy shift (with demand dD = 0) and a dummy volunteer each with capacity Sv = 10. The penalty for the use of the dummy volunteer or shift is 100. The objective function value is now 149, indicating that we have used one shift for the dummy volunteer.
358
RESOURCE ALLOCATION PROBLEMS A N D DECISIONS IN SERVICES
See
Example for infeasibility MODEL 1 Feasible Solution.xls. Example for infeasibility MODEL 2 INFeasible Solution.xls. Example for infeasibility MODEL 3 Allowing Unwanted Assignments.xls. and Example for infeasibility MODEL 4 with Dummy Volunteers and Shifts.xls in the online appendix.
6.4
ASSIGNING STUDENTS TO FRESHMAN SEMINARS
At Northwestern University, each of the roughly 1000 freshmen in the Weinberg College of Arts and Sciences must take a seminar in the fall quarter and a second seminar in either the winter or spring quarter. During the summer prior to their first fall quarter at the university, incoming students are asked to express their preferences for up to 10 seminars out of approximately 70 that are offered during the fall quarter. Each seminar has a capacity for 15 students. Students rank their choices with 1 being the best. If they are indifferent between two seminars, they can assign them the same rank order. Thus, a student's rankings might be similar to those shown in Table 6.3. The student whose preferences are shown is indifferent between the first two seminars: Who Owns the Past? and The Nature and Culture of Ritual. Therefore, these seminars are both ranked 1. The student is indifferent between the next two seminars which are then both ranked 3 since there are two seminars tied for the top ranking. Up until about 2001, students expressed a preference for 20 seminars. An assistant dean in the college spent two weeks working half-time to assign freshmen to seminars. Some students ended up with their twelfth choice or worse. "Welcome to Northwestern! Thank you for spending $40,000 on your daughter's education. She will be attending her twelfth choice seminar this fall." Clearly, this was not a warm welcome to an expensive private institution. TABLE 6.3. Sample student rankings of seminars Seminar
Ranking
Who Owns the Past? The Nature and Culture of Ritual Language and Childhood Language and Sexual Identity Modern Case for Atheism The Founding of America The Press and Presidential Politics Political Parties Teens, Tweens, and Adolescents African American Novels—Mid-20th Century
1 1 3 3 5 6 6 6 9 10
ASSIGNING STUDENTS TO FRESHMAN SEMINARS
359
Around 2001, the college began using an optimization-based algorithm for assigning students to seminars. The model used is basically that shown in (6.12)-(6.15).
Min
X
X
pjkXjk
(6.12)
£eStudents y'ESeminars
s.t.
ajkXjk=l
X/ke Students
(6.13)
Xjk£l5
Y/e Seminars
(6.14)
y/ e Seminars; k e Students
(6.15)
£ ye Seminars
2, )eStudents
Xjk G {0,1}
The penalties, pjk, associated with assigning student k to seminar / depend on how the student has ranked the seminar. If the student has not selected the seminar, the constraints will not permit the assignment of the student to the seminar and so the corresponding pjk term need not be defined. The decision variable, Xjk is 1 if student k is assigned to seminar j , and 0 if not. Similarly, ajk is 1 if student k can be assigned to seminar j . These terms are used to solve a series of problems. Initially, it is set to 1 only if the seminar is one of student /c's first choice seminars. The program for assigning students to seminars tries to solve this problem. Typically, it is not possible to assign all students to their first choice seminars, and so the optimization model is infeasible. Next, it is modified to equal 1 if the seminar is one of student /c's first or second choice seminars. The optimization problem is again rerun. This process continues until students can be assigned to any of the 10 seminars they selected. In addition, the program tries to assign students to seminars in a greedy manner. Working down the list of students, it assigns as many students as possible to their first choice seminar. Then, the program again works its way down the list assigning as many unassigned students as possible to their second choice seminar. This greedy process continues until all students have been assigned. Figure 6.11 illustrates hypothetical data for 900 students. The actual data are confidential and cannot be displayed. In the sample dataset, 165 students have selected seminar 193 as their first-choice seminar. Of the 1786 first choice listings (accounting for tied first choices), nearly 10 percent is represented by this one seminar. As each of the 75 seminars in the sample problem has a capacity of 15, clearly 150 of these students will not be assigned to this seminar. Although this is slightly extreme, it is not unrealistic. In one quarter, there were two seminars selected as the first choice by about 100 students. Table 6.4 presents results from using the model on the sample dataset. The third column shows that 734 of the 900 students were assigned to their first choice seminar when the greedy algorithm was used. An additional 96 students were placed in their second choice seminar. Twenty-nine students were placed in their fourth choice seminar or worse. The objective function value using the greedy algorithm was 1214.
360
RESOURCE ALLOCATION PROBLEMS A N D DECISIONS IN SERVICES
Figure 6.11. Pareto chart of sample seminar first choices
The problem is infeasible if students are to be assigned to only their first or second choices as shown in the fourth and fifth columns of the table. If students can be assigned to one of their top three choices, there is a feasible solution that entails assigning 697 students to their top choice, 142 to their second choice, and 61 to their third choice. The objective function value of 1164 is about 4 percent better than that found using the greedy algorithm. If students can be assigned to one of their top four choices, the objective function value decreases slightly to 1162, as shown in the remaining columns of the table. When students can be assigned to one the top five or more choices, the model uses only the top four choices. The last seven columns of the table present alternate optima to the problem. It is worth noting that the penalties, pjk, need not be linear in the choices to which a student is assigned. Table 6.5 shows the results of using the model with concave costs, or costs that increase at a rate that is less than linear with the choice number. For example, the penalty associated with assigning a student to his or her first choice seminar is 15 (or 15 times the rank order of the choice), while the penalty associated with assigning a student to his or her tenth choice seminar is 105, or about 10 times the rank order of the choice. Note that this means that even if every student could be assigned to his or her first choice seminar, the objective function value would be 13,500. The greedy algorithm results in the same assignments as those shown in Table 6.4. The objective function value is now 17,566. If only the top three
σι
ui
9 10
1 2 3 4 5 6 7 8 9 10
Objective Value
Penalty
Assigned to Choice
1214
734 96 41 10 6 3 4 5 1 0
Greedy
Infeasible
Top 1
Infeasible
Top 2
1164
697 142 61
Top 3
1162
703 137 55 5
Top 4
TABLE 6.4. Results for student/seminar assignment model with linear costs
1162
702 140 52 6
Top 5
1162
702 138 56 4
Top 6
Model Allows
1162
701 142 51 6
Top 7
1162
704 136 54 6
Top 8
1162
701 141 53 5
Top 9
1162
702 138 56 4
Top 10
Ul
15 29 42 54 65 75 84 92 99 105
1 2 3 4 5 6 7 8 9 10
Objective Value
Penalty
Assigned to Choice
17,566
734 96 41 10 6 3 4 5 1 0
Greedy
Infeasible
Top 1
Infeasible
Top 2
17,088
710 126 56 8
703 130 67
17,129
Top 4
17,081
711 127 54 5 3
Top 5
17,081
711 127 54 5 3
Top 6
Model Allows Top 3
TABLE 6.5. Results for student/seminar assignment model with concave costs
17,081
711 127 54 5 3
Top 7
17,081
711 127 54 5 3
Top 8
17,081
711 127 54 5 3
Top 9
17,081
711 127 54 5 3
Top 10
ASSIGNING STUDENTS TO INTERSESSION COURSES
363
choices are permitted, the model of (6.12)-(6.15) results in an objective function value of 17,129. This can be reduced further to 17,088 and 17,081 if the fourth and fifth choice seminars are permitted, respectively. It is worth observing that the total solution time for all of the problems solved in either Table 6.4 or Table 6.5 is under 4 seconds on a laptop computer. Thus, very large problems (with over 9000 variables, in this case) can be solved very quickly as long as the network structure is preserved. Finally, in any real implementation of an optimization model in general, or an assignment or resource allocation problem of this sort in particular, it is important to allow the user of the model to exercise control over the results. In this case, for example, the model in which the optimization problem is embedded allows the dean's office to pre-assign some students to specific seminars prior to running the optimization model. This was needed because some students— football players in particular who would miss many Friday afternoon seminars— could not be assigned to seminars that meet at certain times. In addition, the model provides additional output metrics for the dean's office. The university has found that seminars in which there is a significant gender bias tend not to work very well. Thus, while a seminar composed of either all women or all men is fine, a seminar with only one or two women out of 15 students (or equivalently one or two men out of 15) does not lead to adequate student participation from all members of the class. The program flags such seminars so that the dean's office can manually change the assignments of students after the optimization model has been run.
6.5
ASSIGNING STUDENTS TO INTERSESSION COURSES
Not all assignment-like problems are as straightforward as the student/seminar assignment problem outlined in section 6.4. This section summarizes one such problem that proved to be more complicated. The Illinois Math and Science Academy (IMSA), located in Aurora, Illinois, is a residential high school for elite students in Illinois. The school houses slightly over 600 of the best tenth-, eleventh-, and twelfth-grade high school students in Illinois. Students go on to the best universities and colleges in the country from IMSA. Students who score less than a perfect score on the math SAT exam are almost viewed as being deficient by their peers. The school tries to be accessible to all students regardless of family income; students pay no tuition, with all costs borne either by the state or by private donations. Simply put, the students at IMSA are the best and the brightest from across the state. During the second week of January each year, IMSA students can enroll in one or more of roughly 60 special classes that are offered during the week. Classes are scheduled for the morning (M), afternoon (A), evening (E), or all day (D). Students must get 2 credits, which can be composed of either a single all day class or two classes from the morning, afternoon, or evening. Clearly,
364
RESOURCE ALLOCATION PROBLEMS A N D DECISIONS IN SERVICES
students cannot take two morning classes (or two afternoon classes or two evening classes). During the fall quarter before January, students express their course preferences. A faculty member then assigns students to intersession classes based on their preferences. To simplify the task of assigning students, the students are grouped. The top priority would be juniors and seniors who did not receive their first choice class the previous year. The next group would be composed of students who got their preference forms in early, and so on. Typically, there would be between 50 and 100 students per group. Clearly, this process was both time-consuming and suboptimal. Many personhours of time were spent trying to assign students to classes. Also, by grouping students, there was a strong possibility that decisions made early in the process would "paint the solution into a corner," making subsequent assignments overly constrained. This created a vicious circle. Students near the bottom of the list this year, who received their third or fourth choice, would end up in the first group next year, and so on. In the fall of 2007, IMSA tried an optimization-based approach. The model is similar to the student/seminar assignment problem of section 6.4. Specifically, we define the following notation. Only notation that differs from that identified in section 6.4 is defined. Inputs J K Oj ßjm
set of classes that we subdivide into subsets for the morning (M), afternoon (A), evening (£), and all-day (D) classes set of students maximum number of extra students that can be assigned (with some large penalties) to class j e J penalty for assigning the m'h extra student to class ;' e / (We assume that j3¿m+1 > ßjm, meaning that it is less and less desirable to assign additional students to each class.)
Decision variables Yjm 1 if m or more extra students are assigned to class j e J With this notation, the problem can be formulated as follows:
Min s-t.
Σ | Σ ΡΑ+2ΣΡ**/4+ΣΣ0Λ
(6 ΐ6)
Σ
V/ceK
(6.17)
Σ*,*-ΣΧΗ
VeJ
( 6 · 18 )
^Xik
VkeK
(6.19)
kzK
lj<={MuAuE}
jeM
jzD
«Α+2Σ«Α=2
keK
jsD
m=\
J
/ W m=l
·
365
ASSIGNING STUDENTS TO INTERSESSION COURSES
Σ***ι
VkeK
(6.20)
VkeK
(6.21)
VkeK
(6.22)
^ε{0,1}
VjeJ;keK
(6.23)
y»,e{0,l}
V/ e / ; m -1,...,
jeA
oy
(6.24)
The objective function (6.16) minimizes the total assignment penalties over all students. Note that if a student elects or is assigned to an all-day class, then he or she is not assigned to another class. Therefore, to avoid under-penalizing such assignments, we multiply the total penalty for the all-day assignments, ^pjkXjk,
jeD
by 2. The last term of the objective function captures the penalties
associated with assigning too many students to a class. We include the possibility of over-assigning students to a class to help ensure feasibility. Constraint (6.17) requires each student to be assigned to 2 credits' worth of courses with all-day courses counting as 2 credits. Constraint (6.18) limits the number of students assigned to a class to the capacity of the class. The next constraints state that a student can be assigned to at most one morning class (6.19), one afternoon class (6.20), one evening class (6.21), and one all-day class (6.22). Finally, constraints (6.23) and (6.24) are the integrality constraints. Unfortunately, due to the presence of the 2 in constraint (6.17), which states that an all-day class satisfies a student's entire requirement for 2 credits, the problem has now lost its network structure. It is almost amazing how such a small change can destroy the network structure of a problem. As a result, solving the linear programming relaxation of this problem may not result in an all-integer solution. In particular, the program may decide to assign a student to one morning class and to half an all-day class. The reader should verify that such an assignment (for the linear programming relaxation) will satisfy all of the constraints. Despite this difficulty, the problem is still very similar to a network flow problem. Figure 6.12 shows a network model that approximates this problem. Table 6.6 gives the lower and upper bounds and unit costs for each of the different types of links. Beginning at the left side of Figure 6.12, links between the source and each student node (e.g., St 1) have a lower and upper bound of 2, meaning that each student must get 2 credits as in constraint (6.17) and a unit cost of 0. For each student, we construct (up to) four nodes representing morning (M nodes), afternoon (A nodes), evening (E nodes), and all-day (D nodes). Links between the student node and the M, A, or E nodes have a lower bound of 0, indicating that a student does not need to take one of these courses and an upper bound of 1, accounting for constraints (6.19) through (6.21). The unit cost on these links is 0. Links between the student and the all-day (D nodes) have an
366
RESOURCE ALLOCATION PROBLEMS AND DECISIONS IN SERVICES
CI 1
St1 CI 2
Cl 3
Sink
Source CI 4
Cl 5
/
St 3
/
/
Cl 6
Figure 6.12. Network diagram approximating the IMSA class assignment problem
TABLE 6.6. Link parameters for network flow diagram in Figure 6.12 To
Lower Bound
Unit Cost
Upper Bound
2 0 0 0 0 0
0 0 0
M, A, or E
Student node Μ,Α, Ε D Class node Class node Sink
0
2 1 2 1 2 s, (capacity)
D (solid) M, A, or E
Sink Sink
0 0
0
2SJ
ßin,
1
D (dashed)
Sink
0
ßin,
2
From Source Student node Student node Μ,Α,Ε D Class node for (solid) Class node for Class node for (dashed) Class node for
Pik Pik
upper bound of 2, indicating that a student taking an all-day course gets credit for 2 units. These links are shown with a bolder line in Figure 6.12. The next set of links connect the time of day nodes (M, A, E, or D) to the class nodes (e.g., Cl 1). In the diagram, classes 1 and 2 are morning classes and
ASSIGNING STUDENTS TO INTERSESSION COURSES
367
are therefore connected to M nodes, class 3 is the only afternoon class and is therefore connected to the A nodes, class 4 is the only evening class and is connected to the E nodes and, finally, classes 5 and 6 are all-day classes connected to the D nodes. Each of these links has a lower bound of 0, indicating that the student in question does not need to be assigned to the class. For the morning, afternoon, and evening classes, the upper bound is 1, corresponding to the first term on the left-hand side of constraint (6.17). The upper bound on the links connecting the all-day classes to the D nodes is 2, indicating that students taking such courses get 2 credits. This corresponds to the second term on the left-hand side of constraint (6.17). The unit cost on each link connecting a time-of-day node to a class node is the penalty associated with assigning the student in question to that class. Finally, there are links connecting the class nodes to the sink. The solid nodes represent the nominal capacity of the classes. Each such link has a lower bound of 0 (no students need to be assigned to a class) and a unit cost of 0. The upper bound is equal to the class capacity for the morning, afternoon, and evening classes and twice the class capacity for the all-day classes, since the model is really assigning student credits. The dashed lines are included to help ensure feasibility. It may not be possible to assign all students to classes they have selected while still obeying the capacity constraints. Thus, the dashed (and curved) links shown in Figure 6.12 between the class nodes and the sink allow for over-loading classes. In Table 6.6, each such link allows at most one extra student to be assigned to a class. There is a large penalty associated with assigning an extra student to a class. The return link between the sink and the source is not shown in Figure 6.12 for simplicity. While formulation (6.16)-(6.24) can undoubtedly be solved using integer programming software, we instead used the network flow formulation shown in Figure 6.12 to get an approximation to the solution. Using data from the fall of 2007,628 students had to be assigned to 62 courses. Enrollment capacities ranged from unlimited for some of the independent study courses to a low of 9 for one of the trips that students could select. We assigned a penalty of 10 for a firstchoice, 20 for a second choice, 30 for a third choice, and 40 for a fourth choice. The first student beyond the capacity of a course was penalized an additional 100 penalty points, the second an extra 200 points, and every student beyond the second additional student was penalized 300 points. The solution is illustrated in Figure 6.13 and Figure 6.14. In each figure, the darker bar on the left of each group represents the solution to the network flow or linear programming relaxation. The lighter bars on the right of each group represent a feasible all-integer solution that the program found using a heuristic approach starting with the linear programming solution. In Figure 6.13, there are a total of 1246 student assignments shown for both the network flow (linear programming) and integer heuristic solution. This corresponds to two choices for each of the 623 students with valid preference rankings. Students assigned to all-day classes are counted twice. The linear programming solution resulted in an objective function value of 16,960
368
RESOURCE ALLOCATION PROBLEMS AND DECISIONS IN SERVICES
Figure 6.13. Number of IMSA students assigned to first through fourth choices
Figure 6.14. Class assignments relative to capacity
IMPROVING THE ASSIGNMENT OF ZIP CODES TO CONGRESSIONAL DISTRICTS
369
(10 · 879 + 20 · 289 + 3 0 - 7 3 + 4 0 - 5 ) with no classes oversubscribed. However, 90 students were partially assigned to all-day courses, meaning that the flow from the associated student node to the D node in Figure 6.12 was 1, when an allinteger solution to the integer programming problem would correspond to a flow (of credits) of 0 or 2. The heuristic resolved these fractional assignments to the all-day courses, but resulted in a solution with an objective function value of 18,110, or 6.781 percent greater than the linear programming solution. The increase of 1150 was composed of 750 additional penalty points due to assigning students to worse choices than in the linear programming solution and 400 penalty points due assigning one extra student, above and beyond the course capacity, to four courses as shown in Figure 6.14. The dashed links in Figure 6.12 and the associated overcapacity variables, Yjm, in the formulation allow the model to assign more students to a class than the nominal capacity, s¡, of the class. This helps to ensure that the model results in a feasible solution and it helps to identify classes whose capacity might beneficially be increased. These variables and links do not, however, always ensure that a feasible solution can be found. In fact, of the 628 students in the database, five failed to submit correct forms. In one case, no preferences were recorded for the student. In three cases, the student expressed a preference for only one class, but it was either a morning or afternoon class. Without additional information, the model cannot assign such students to two credits of classes. The final student ranked three classes, but all were afternoon classes. Again, there is no feasible way of satisfying constraint (6.17) for this student. It is worth remembering that IMSA students are among the best and the brightest in the country. If roughly 1 percent of them had trouble completing the preference form, we can expect that there will be data errors leading to infeasibility in other problem settings as well. As discussed in section 6.3, ensuring that the optimization problem returns useful information even in the face of infeasible inputs is critical in most practical contexts.
6.6 IMPROVING THE ASSIGNMENT OF ZIP CODES TO CONGRESSIONAL DISTRICTS Chapter 4 outlined an approach to districting problems. The example discussed at length in that chapter dealt with identifying contiguous and compact Congressional districts. These differ dramatically from the existing districts for at least two reasons. First, many Congressional districts are, in effect, gerrymandered to increase the likelihood that the incumbent will be re-elected. In fact, well over 95 percent of the incumbent U.S. Representatives running for reelection are typically re-elected for this and other reasons. Second, the Voting Rights Act provides for the establishment of minority districts to ensure that a minimum number of the Representatives are (likely to be) minorities. Achieving these political and diversity-based objectives often requires that the districts deviate significantly from the compact shapes we tried to identify in Chapter 4.
370
RESOURCE ALLOCATION PROBLEMS A N D DECISIONS IN SERVICES
The Voting Rights Act also requires that the populations of the various districts in a state be approximately equal. The actual districts in Illinois differ by at most slightly more than 100 people using the census on which the districts are based. By way of contrast, the range in district populations found using the approach in Chapter 4 was nearly 72,000. While more sophisticated approaches might be used to identify improved districts, in this section we outline a postprocessing approach based on an assignment-like model for reducing the range in district populations. There are at least two reasons for the large range in the district populations found in Chapter 4. First, we were working at the zip code level for the state. Each zip code could be assigned to only a single district. The average population of the 1349 zip codes is over 9200. The maximum population is nearly 114,000, while 35 zip codes have populations of 100 or less. Assigning zip codes in an allor-nothing manner to districts makes it difficult to attain a small range. Second, the heuristic approach used to generate results such as those shown in Figure 4.31 does not optimize the assignment of zip codes to seed nodes when alternate optima exist. Thus, if a zip code centroid is equidistant to two seed nodes, the assignment of the zip codes to a seed node is arbitrary. In this section, we outline an approach that resolves both of these problems, while possibly allowing some violation of the compactness and contiguity conditions outlined above. The approach allows the population of zip codes that are close to equi-distant between two (or more) seed nodes to be split between the districts represented by these seed nodes. Specifically, consider a particular zip code j . In Chapter 4, we assigned each zip code to one of its nearest seed nodes. In other words, we assigned zip code j to seed node m only if dim = min (d- ), where Seeds is the set ntSeeds
of selected seed nodes. In this chapter, we will assign zip code / to seed node m to if d¡ — min (d¡)<5, where δ is a user=specified small distance. In other words, as long as seed node m is no more than δ more miles from zip code / than is the closest seed node to zip code j , we are willing to assign some (or all) of the demand at zip code j to seed node m. Specifically, we introduce the following notation: Inputs and sets the set of already-selected seed nodes for the districts Seeds the set of zip codes to be assigned Zips distance from zip code j e Zips to seed node m E Seeds population of zip code / e Zips h, maximum allowable difference between (a) the distance between a zip code and a seed to which the demand at the zip code is assigned and (b) the distance between a zip code and the closest seed
1d
0
»-±,M*s
otherwise
IMPROVING THE ASSIGNMENT OF ZIP CODES TO CONGRESSIONAL DISTRICTS
371
Decision variables Zjm population at zip code / e Zips that is assigned to seed node m e Seeds U maximum population assigned to any district L minimum population assigned to any district With this notation, we can formulate the problem as follows: Min *·'·
U-L
(6.25) a
Σ
me Seeds
in>zin>=hi
VjeZips
Σ Z,m = Σ hi
Σ
m e Seeds j e Zips
(6.26)
(6-27)
j e Zips
Σ
z
¡m >L
Vm e Seeds
(6.28)
£
Zjm
V m e Seeds
(6.29)
V; e Zips; m e Seeds
(6.30)
je. Zips
jeZips
Zjm > 0
The objective function (6.25) minimizes the range in the assigned population across all districts. Constraint (6.26) states that the population in each zip code must be fully assigned and only to one of the seeds to which the demand in the zip code can be assigned. One problem with constraint (6.26) is that, while it ensures that all of the population is assigned, it does not preclude over-assignment of demand. In particular, it allows Zjm > 0 as long as ajm = 0 for some j e Zips and m e Seeds. In fact, it may be advantageous to make such an assignment if doing so will increase the lower bound in (6.28). Constraint (6.27) precludes this from happening by stating that the sum of all of the assignment variables must be equal to the total population under consideration. Constraints (6.28) and (6.29) define the lower and upper bounds on the assigned populations across all districts respectively. Finally, constraints (6.30) state that the assignment variables must be non-negative. Table 6.7 shows the results of using the seed nodes shown in Figure 4.31 in the model above. As shown in Figure 4.31, the heuristic algorithm suggests that the range in assigned population across the 19 districts is 71,875, or about 0.6 percent of the total state population of 12.42 million people. However, if we optimize the assignment of zip codes to seed nodes, we find that the range can be reduced to 61,697, or about 0.5 percent of the population. If we allow zip codes to be split between the nearest seed node and a seed node that is up to 1 mile further from the zip code than the nearest seed, the range can be reduced to 24,586, or 0.2 percent of the state population. Finally, if we allow the population in a zip code to be split between seed nodes that are up to 2 miles more distant than the nearest seed node, the range can be reduced to 0. Given that zip
372
RESOURCE ALLOCATION PROBLEMS AND DECISIONS IN SERVICES
TABLE 6.7. Results for the districting seeds shown in Figure 4.31 Condition
Distance
Range
#Extra
Max Extra
Rows
Nearest, Heuristic Optimized Optimized Optimized
0 0 1 2
71,875.00 61,697.00 24,586.35 0.00
0 47 157 273
1 4 5 5
n/a 42 139 220
codes are fairly large geographic entities—the average area of a zip code in Illinois is nearly 43 square miles or more than 6.5 miles on a side if it were a square—allowing a 2-mile window is not unreasonable. Table 6.7 also summarizes information on the size of the optimization problem that must be solved. The sum of the ajm coefficients must be at least equal to the total number of zip codes since, for each zip code, there is at least one seed node that is the nearest seed node, even if we do not allow zip codes to be assigned to seeds other than the nearest one. The column labeled # Extra gives the sum of the ajm coefficients minus the total number of zip codes. The column labeled Max Extra indicates the maximum number of seeds to which any individual zip code can be assigned. Finally, the column labeled Rows gives the number of constraints like (6.26) for which there are two or more non-zero coefficients on the left hand side. This is the number of zip codes which can possibly be split between multiple seed nodes. As the distance, δ, increases, the number of extra assignments, the maximum number of seed nodes to which a zip code can be assigned, and the number of zip codes that can be split between seeds all tend to increase.
6.7
SUMMARY
A large number of service-oriented problems can be structured as resource allocation or extensions of the basic assignment problem. Table 6.1 outlined a number of potential applications of such models. The basic resource allocation or assignment model was formulated in section 6.2. Section 6.3 discussed the problem of infeasibility in resource allocation problems. The basic lessons are that the inputs to a resource allocation problem in particular, and to most optimization problems in general, are likely to be infeasible, at least before extensive data cleaning. To the extent possible, it is always a good idea to formulate optimization problems in a way that anticipates infeasibilities and that allows the model to return meaningful results even in the face of data errors and infeasibilities. Sections 6.4 and 6.5 discussed the application of assignment-like models to two similar problems: the assignment of freshman to seminars at Northwestern University and the assignment of students to intersession classes at the Illinois Math and Science Academy. Section 6.6 outlined an extension of the districting
373
PROBLEMS
model of section 4.6 in which we allow zip codes to be assigned to seed nodes other than the closest seed node. This allowed us to reduce the range in the population assigned to the most and least populous districts. This too is an extension of a basic assignment or resource allocation model.
6.8
PROBLEMS
1. For the problem of assigning loads to starting times discussed in section 5.1, why would a consignee not want a shipment to be delivered early relative to the desired time? 2. How can the network flow model of Figure 6.12 be modified to handle students who either fail to submit a preference form or whose preference form does not allow for the assignment of those students to 2 credits? How would these changes be reflected in the mathematical formulation of the problem given in (6.16)-(6.24)? 3. Explain why the solution to the network flow model of Figure 6.10 will never include non-zero flow on the student-dummy seminar links when the lower bound on each source-student link is 0. 4. Consider the problem of assigning aircraft to gates at an airport during a hubbing period when flights arrive at more or less the same time to facilitate passenger transfers. Let us define the following notation: Inputs and sets / set of aircraft to be assigned to gates K set of gates to which the aircraft can be assigned ajk 1 if aircraft j e. J can physically be docked at gate k e K;0if not dmn distance between gate m e K and gate n e K (Note that both indices refer to the set K.) dm0 distance from gate m ε Κ and the front of the terminal Pj number of passengers arriving on flight j e J Ρμ number of passengers arriving on flight j e J who are transferring to flight i e / (Again, note that both indices refer to the set of flights, J.) Ρβ number of terminating passengers (those going to the front of the terminal) on flight j e J (Note that we must have Ρί=ΣΡα+Ρ}ο·) Decision variables Xjk 1 if flight / e / is assigned to gate k e K;0 ii not a) With this notation, and ignoring the problems associated with departing passengers who originate at the airport, write down the objective function
374
RESOURCE ALLOCATION PROBLEMS AND DECISIONS IN SERVICES
of minimizing the walking distance of all passengers. Note that the objective function will almost certainly be non-linear in this case. b) Write down the constraint that each flight has to be assigned to a gate that can accommodate the flight. c) Write down the constraint that states that at most one flight can be assigned to a single gate. d) Now define the following additional notation. Let Yijmn be 1 if flight i e J is assigned to gate m e K and flight; e J is assigned to gate n e K. Rewrite the objective function using this new variable. e) Write down constraints that link the new Yijmn and the original single flight/ single gate decision variable, Xjk. 5. Consider the multi-objective problem of assigning loads to starting times to (1) minimize the maximum number of vehicles needed to serve a set of demands and (2) minimize the sum of all penalties associated with not starting a load at the desired start time. Define the following notation. If you use additional notation, clearly define it as well. Inputs and sets / set of loads to be assigned T set of all possible load starting times (For example, we may allow loads to be dispatched every 15 minutes, meaning we would have 96 possible starting times in a day.) Kj set of possible starting times for load j e J pjk penalty for assigning load j & J to starting time k e K¡ ajkl 1 if load j e J starting at time k e K¡ is still using a vehicle at time te T; 0 if not. (This will be a string of Os for times before the starting time, k e K¡, followed by a string of Is corresponding to the duration of load j e J, and ending with a string of Os until the end of the last time period.) Decision variables Xjk 1 if load j e J is assigned to starting time k e K¡; 0 if not Z maximum number of vehicles needed to serve all demands a) Formulate the problem as a weighted-objective problem. Clearly define any additional notation that you use. b) Formulate the problem of minimizing the sum of all penalties for assigning loads to starting times other than the desired starting times subject to a constraint on the number of vehicles needed to serve all loads. c) What do you think the tradeoff curve looks like when you plot the number of vehicles used or needed on the X axis and the sum of the penalties on the Y axis? Clearly sketch the tradeoff curve.
REFERENCES
375
d) Do you think that the formulation that you identified in part (b) above will always result in an all-integer solution to the problem if the integrality constraints on the assignment variables are relaxed? REFERENCES Bailey, N. T. J., and J. D. Welch, 1952, "Appointment systems in hospital outpatient departments," The Lancet, 259,1105-1108. Bodin, L., and A. Panken, 2003, "High tech for a higher authority: The placement of graduating rabbis from Hebrew Union College—Jewish Institute of Religion," Interfaces, 33, 3,1-11. National Resident Matching Program, 2009, Results and Data: 2009 Main Residency Match, National Resident Matching Program, Washington, DC.
7 SHORT-TERM WORKFORCE SCHEDULING
"I have worked both of the last two weekends, Bob. I just can't work this Saturday. My fiancé and I are going to see his parents out of town. You have to find someone else to cover for me. Please! I need this weekend off." "Ellen, I'm sorry. You know that we lost two of our best customer service agents in the last two months. I am trying hard to replace them, but you are the best person here. I need you on Saturday. I'll make it up to you as soon as we get a few new people hired. I promise. "
7.1
OVERVIEW OF SCHEDULING
Workforce management and planning are critical activities for any enterprise, but are particularly important in the service industries where contact with customers is of vital concern. We distinguish between long-term workforce management and short-term workforce scheduling. Long-term workforce management deals with issues such as plans for hiring and firing or releasing employees, the mix of skill sets that the employees should have, training schedules and plans, and promotion opportunities. Shorter-term workforce scheduling deals with determining the
Service Science, by Mark S. Daskin Copyright © 2010 by John Wiley & Sons, Inc
377
378
SHORT-TERM WORKFORCE SCHEDULING
Figure 7 . 1 . Workforce management and services
number of employees to have on duty at each time of the day, the assignment of employees to shifts, and the assignment of tasks to employees. After a brief overview of workforce management and scheduling, this chapter focuses on short-term workforce scheduling. The next chapter explores workforce management in greater detail. Figure 7.1 illustrates the relationship between the demand for services, the scheduling of those services, customer satisfaction, and workforce management. For example, a patient may want to see a physician (generally an internist) for a checkup. This generates the demand for a service. The patient calls his or her health maintenance organization (HMO) for an appointment and is scheduled to see the next available internist for a checkup in five weeks at 3 P.M. The long delay between the call for an appointment and the next available slot is due in part to decisions made at the workforce management level. The HMO management has decided how many primary care physicians and how many specialists of each type to hire as well as the hours that they are to work. This, in turn, affects the availability of slots for checkups for otherwise healthy patients. On the day of the checkup, the patient arrives at the HMO 10 minutes before the scheduled 3 P.M. appointment time. Typically, the patient may have to wait until 3:45 or later to see the physician, as many doctors are running late by that time in the afternoon. While some patients may have come to expect this level of service, others may be dissatisfied. This will, in turn, impact the future demand for services. In fact, many patients decide to switch from HMO coverage—which is less expensive but provides fewer options for care and often is associated with longer delays—to a PPO (Preferred Provider Organization)—which typically affords the patient greater choices in selecting a physician and sometimes comes with shorter delays at greater dollar expense—when they get older and think they will be more likely to need extensive health care coverage. Figure 7.2 expands on the relationship between service quality and key workforce management and scheduling decisions. In this case, consider the problems faced by the senior management of a consulting firm. The firm can anticipate the need for its services. In response to this anticipated need, the firm makes decisions about how many employees to hire or to release over time, the skill sets that those employees should have, and the promotion and training programs
379
OVERVIEW OF SCHEDULING
of the firm. For example, a company might decide that it needs 10 more C programmers and 3 more project managers, but that it has too many Java coders. It could release some of the Java coders or it could retrain some of them to fill the need for the C programmers. In making decisions about the long-term personnel plans, the firm should take into account the availability of external labor. If there are many external "spot market" C programmers, it may not be advisable to hire many internal C programmers. Instead, it may make more sense to hire these people on a project-by-project basis as external contractors. The available workforce, coupled with external contractors, can be assigned to different projects on a monthly basis (though, typically, reassignments between projects are rare). Within each project, employee scheduling must be done accounting for any requested or required time off for personal vacations or training courses. The assignment of employees and perhaps external contractors to a project will impact the level of service perceived by the client. This, in turn, will affect the demand for future services, creating a feedback loop as shown in Figure 7.2. Figure 7.3 drills deeper into the relationship between scheduling, customer satisfaction, and costs. Consider, for example, the problem of staffing a call
Anticipated Demand for Services
Level of Customer Service
Hiring/Releasing Promotion and Training Project Staffing
Available External Labor
Employee Scheduling
Figure 7.2. Workforce management and scheduling decisions and their impact on service quality
Employee Needs by Time of Day
Typical Shift Patterns and Costs
Customer Service Employee Costs Figure 7.3. Short-term scheduling and customer service
380
SHORT-TERM WORKFORCE SCHEDULING
center. The number of calls for service by time of day is often well-known from past historical records. This, coupled with the distribution of time an employee spends answering each inquiry, determines the minimum number of employees needed at each time of the day. Also, to ensure adequate service, management may elect to have more than the minimum number on duty at each point in time. At many organizations, employees work set shifts. For example, the day shift might be from 8 A.M. until 4 P.M. The evening shift might start at 4 P.M. and end at midnight, while the so-called graveyard shift might commence at midnight and end at 8 A.M. Other shift patterns might be superimposed on these basic shifts. For example, some employees (including many nurses) work three 12-hour shifts each week rather than five 8-hour shifts. Thus, there may be 12-hour shifts superimposed on the three 8-hour day, night and graveyard shifts. The 12-hour shifts might begin every 4 hours beginning at midnight. Given the hour-by-hour needs for staff and the schedule of shifts that can be worked, management must decide how many employees to allocate to each shift to meet the demand for staff. If more staff are assigned to a time period, service will generally improve but costs will also be higher. This creates a tradeoff between increased cost and improved service. The remainder of this chapter focuses on short-term workforce scheduling. We begin with a simple model and then incorporate additional facets of the problem in subsequent sections. The final two sections—sections 7.5 and 7.6— discuss how the relationship between employee costs and customer service can be incorporated within a single model.
7.2 7.2.1
SIMPLE MODEL Example of a Naïve Approach
To motivate the need for careful scheduling of employees, consider the simple example shown in Table 7.1. Sixteen 1-hour time periods beginning at 5 A.M. are shown in the table. For each time period, the table provides the number of employees required to be on duty, for example, at a small fast-food restaurant. In the early morning, business begins to pick up and additional employees are needed. The peak occurs between 12 noon and 1 P.M. when 13 employees are needed. At 1 P.M. the need for employees begins to taper off, going from 11 down to 4 at the end of the evening. Employees at the establishment work 8-hour shifts with no time off during the shift. A naive approach to the problem would be to schedule two blocks of employees: One group would begin at 5 A.M. and the other would begin a 1 P.M. Since 13 employees are needed on duty between noon and 1 P.M., we would have 13 employees during the first shift. Similarly, we would have 11 employees during the second shift to satisfy the need for staff between 1 and 2 P.M. Using this naive approach, we would need 24 employees.
381
SIMPLE MODEL
TABLE 7.1. Example workforce requirements by time of day
7.2.2
TOD
Start
End
Required
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
3 6 8 8 7 8 9 13 11 9 9 8 9 7 7 4
Basic Model
We can do significantly better than this, however, if we allow employees to start at times other than 5 A.M. and 1 P.M. Let us define the following inputs and decision variables. Inputs and sets K set of time periods J set of possible starting times for an employee akj 1 if an employee who starts at time y e J is on duty during time period k e K and 0 otherwise rk number of required employees during time period k ε Κ Cj unit cost of an employee starting at time j & J Decision variables X¡ number of employees starting at time j e J Note that we have introduced a cost associated with an employee who begins his or her shift at time / e J. This will prove useful as we proceed with increasingly more complex and realistic extensions of the basic model. With this notation, we can formulate the problem of minimizing the cost of the employees subject to the requirement that at each point in time k e K, the number of employees on duty is greater than or equal to the required number, rk. Note also that we distinguish between the set of time periods for which we have employee needs, K, and the set of possible starting times for employees, J. Finally, note that
382
SHORT-TERM WORKFORCE SCHEDULING
the use of the coefficients ajk will allow us to incorporate more complex work structures than simply one that says that an employee starts at time j and works consecutively for the next 8 hours. With this notation, we can formulate the basic scheduling problem as follows: Min
J^cjXj
s.t.
J^ak¡XjZrk
(71)
VkeK
(7_2)
jeJ
X¡ > 0 and integer
V; e J
(7.3)
The objective function, (7.1), minimizes the total cost of all employees. Constraint (7.2) states that the number of employees on duty at time k,
^akjX¡,
must exceed the number required to be on duty at that time, rk. Constraint (7.3) states that the number of employees starting at each time period must be nonnegative and must be an integer.
SIMPLE MODEL
383
384
SHORT-TERM WORKFORCE SCHEDULING
See Example for naive approach and simple optimization.xls in the online appendix .
7.2.3
Model in Network Form
Constraint (7.3) stipulates that the number of employees starting at each time must be a non-negative integer. However, in the discussion of the model shown in Figure 7.4, Figure 7.5, and Figure 7.6, we did not discuss enforcing integrality. In fact, as long as the coefficient matrix given by the akj terms consists of columns of Os, followed by Is and then followed again by Os (as shown in Figure 7.5), the optimal decision variable values will naturally be all-integer. In fact, the model can be represented as a network flow problem as shown in Figure 7.7. The number of nodes is equal to the number of elements in the set K, plus 1. For the problem discussed in section 7.2.2, there are 17 nodes as shown
EXTENSIONS OF THE SIMPLE MODEL
385
Figure 7.7. Network representation of simple scheduling problem
in Figure 7.7. Three different types of links are shown in the figure. The solid and dashed links above the nodes are the decision variables representing the number of employees to start at each time period. Thus, the solid link from node 0 to node 8 represents the number of employees to start at time 0 (the beginning of time period 1) and who end their service at the end of period 8. The lower bounds on each of these links are 0 and the upper bounds are a very large number (e.g., the sum of all of the requirements, ^ rk). The dashed links from nodes 9, 10, keK
... , 15 to node 16 also represent decision variables, though they can be omitted if all the unit costs (on the decision variable links above the nodes) are 1. The solid light links below the nodes, connecting a node with the preceding node, are used to enforce the constraints. The lower bound on the link from node k to node k - 1 is equal to the number of employees required during period k, or simply, rk. This means that the flow on such a link must be at least rk. The upper bound is again a very large number and the unit cost is 0. Because the model can be represented as a network flow problem, we do not need to explicitly enforce the integrality restrictions in constraints (7.3). Minimizing the total cost of the flow in Figure 7.7 is now equivalent to minimizing (7.1), the total cost of the employees, subject to constraints (7.2).
7.3
EXTENSIONS OF THE SIMPLE MODEL
The simple scheduling model outlined in section 7.2 makes numerous assumptions. For example, it assumes that all employees work the same number of hours. It assumes that only one type of employee is needed, or that all employees are identical in terms of skills. In this section we outline a number of extensions of the basic model that still allow us to preserve the network flow properties outlined in section 7.2.3. More complex extensions, including problems in which employees can take breaks and problems in which 24-hour coverage of a service is required, are discussed in section 7.4.
7.3.1
Part-time Employees
Many service providers employ personnel who work different numbers of hours. For example, hospitals routinely employ nurses who work differing numbers of hours. Some part-time nurses work as few as 20 hours per week; other part-time nurses work 24 or 28 hours per week. Full time nurses work 36 or 40 hours per
386
SHORT-TERM WORKFORCE SCHEDULING
Figure 7.8. Network flow diagram with overtime links
week. Traveler nurses also work 36 hours each week, while temporary nurses are contracted for 16 or 24 hours per month (De Grano, Medeiros, and Eitel, 2009). Many restaurants and fast-food establishments also deal with employees whose total number of work hours vary significantly. To illustrate this, consider again the problem of staffing a restaurant to meet the personnel needs shown in Table 7.1. Now, in addition to full-time employees who work an 8-hour shift, we can employ part-time employees who work only 3 consecutive hours. Full-time employees are paid $80 for an 8-hour shift, or $10 per hour. Part-time employees are paid $42 for a 3-hour shift, or $14 per hour. Thus, while part-time employees are more expensive on a per-hour basis, they provide greater flexibility since we do not have to hire them for a full 8-hour interval if doing so is not cost effective. Such part-time employees can readily be accommodated in the network flow model, as shown in Figure 7.8. The additional links are shown above the nodes with light lines. The link from node 0 to node 3, for example, represents part-time employees who start at the beginning of the day and who end their workday at the end of period 3. The lower bounds for these links are 0, the upper bound is again a very large number, and the unit cost is the cost of a single part-time employee, or $42 in the example discussed above. The unit costs on the 8-hour employee links would now be changed to $80. As before, we have included links near the end of the day representing part-time employees who actually work less than 3 hours. These two cases are shown with dashed lines. As before, they could be omitted. If no part-time employees are used, we need 17 full-time employees. At $80 per employee, the total cost is $1360 per day. However, if we can hire part-time employees, we end up with 15 full-time employees at $1200 plus 3 part-time employees costing $126 for a total of $1326. This represents a savings of 2.5 percent of the labor cost of the establishment. While this may seem like a small improvement to some, most employers would be glad to reduce their payroll expenditures by 2.5 percent without degrading service.
7.3.2
Overtime
Just as part-time employees could be accommodated within the network flow structure, so too can employees who work overtime. Continuing with the example
387
EXTENSIONS OF THE SIMPLE MODEL
Figure 7.9. Network flow diagram with part-time and overtime links
TABLE 7.2. Summary of costs and employee counts for the example of Table 7.1 Case Unit Costs Full Only Full/Part Full/Over Full/Part/Over
Total Cost
% Savings Over Full Only
1360 1326 1360 1302
0.00% 2.50% 0.00% 4.26%
Full-Time
Part-Time
Overtime
80 17 15 17 9
42 0 3 0 6
110 0 0 0 3
outlined above, an employee might work 2 hours of overtime for a total of 10 hours. For each additional hour worked, the employee would be paid time-anda-half, or 50 percent more per hour than he or she earns during the original 8 hours. Thus, the total cost of an overtime employee working a 10-hour shift would be $110. The average cost per hour for such an employee is then $11 per hour as opposed to $10 per hour for a regular full-time employee. Figure 7.9 shows the resulting network flow diagram, assuming that overtime employees work exactly 10 hours (and not 9 or 10). Including overtime employees in the optimization model can only reduce the total cost even though they cost more per hour, on average, than do regular fulltime employees. The reason for this is simply that we do not have to use the overtime employees, but we can if doing so enables us to reduce the total cost. In fact, using the hourly requirements shown in Table 7.1, the total cost can be further reduced to $1302 by using both part-time and overtime employees. In this case, we use nine full-time employees, six part-time employees, and three overtime employees. Table 7.2 summarizes the results of using only full-time employees, full-time and part-time employees, full-time and overtime employees, and finally full-time, part-time, and overtime employees. Interestingly, allowing overtime employees
388
SHORT-TERM WORKFORCE SCHEDULING
without utilizing part-time employees is of no benefit in this example, but using all three types of employees results in a savings of over 4 percent in the payroll. 7.3.3
Cross-trained Employees
The examples discussed so far assume that employees are identical in their skills and that only one type of employee is needed. This is simply not true in many contexts. For example, in a fast-food establishment, there are employees trained to prepare the food while others are trained to interact with customers. We will call these two types of employees cooks and customer service representatives (or CSRs) respectively. Expanding on the problem of Table 7.1, Table 7.3 gives example requirements for cooks and CSRs for each of 16 periods during a day. If there are only two types of employees—cooks and CSRs, in this case—then we can solve for the optimal number of each type to start at each time period independently using the models outlined above. However, in many cases, there is a third class of employees, cross-trained employees, who can work on either task. These employees are typically higher paid employees, as they have more skills than their single-skilled counterparts and they afford management greater flexibility in assigning work over the course of a day. In this case, a cross-trained employee might be assigned to work with the cook staff during one hour and to serve as a CSR in the next hour. To model this problem, we need to introduce additional inputs and decision variables. We will assume, for simplicity, that all employees work an 8-hour shift. The new notation that is required is as follows. TABLE 7.3. Example cook and CSR requirements TOD
Start
End
Cook
CSR
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
3 4 4 4 3 4 5 8 8 5 3 5 7 2 2 2
1 2 4 5 3 3 4 6 5 5 5 6 4 3 3 4
389
EXTENSIONS OF THE SIMPLE MODEL
Inputs rk sk Cj dj e¡
number of cooks required to be on duty at time k e K number of CSRs required to be on duty at time k e K cost p e r shift of a cook w h o starts at time j e J cost p e r shift of a C S R w h o starts at time j e J cost per shift of a cross-trained employee who starts at time / e 7
Decision variables Xj number of cooks who start at time j e J Y¡ number of CSRs who start at time j s J Z¡ number of cross-trained employees who start at time j e J Wk number of cross-trained employees assigned to work as cooks in period k e K Note that the X, Y, and Z variables are indexed j e J to indicate that they refer to the possible starting times. The W variables, on the other hand, are indexed by k e K to signify that they refer to the different time periods for which we have specified personnel requirements. With this notation, the problem can be formulated as follows:
Σ<τ*0 + JEJ JEJ
Σ^,
(7.4)
JEJ
VkeK
(7.5)
VkeK
(7.6)
VkeK
(7.7)
Xj > 0 and integer
VjeJ
(7.8)
Y¡ > O and integer
V/e/
(7.9)
Z · > 0 and integer
V;e/
(7.10)
Wk > 0 and integer
VkeK
(7.11)
f
XV0 + Σανζί· -wk ¡El
{JEJ
YjakjZj-Wk>Q
J
*Sk
The objective function (7.4) minimizes the total payroll cost, which consists of the cost of the cooks, the cost of the CSRs, and the cost of the cross-trained employees. Constraint (7.5) states that we must have at least the minimum number of cooks on duty in each period k e K. The number on duty consists of the number of cooks who started at a time that allows them to be on duty during period k e K plus the number of cross-trained employees assigned to work as cooks during this time period. Similarly, constraint (7.6) states that we must have at least the minimum number of required CSRs on duty in each period k e K. The term in parenthesis represents the number of cross-trained employees who are assigned to work as CSRs in period k G K. This is simply the total number
390
SHORT-TERM WORKFORCE SCHEDULING
of cross trained employees on duty during period k e K minus the number who are assigned to work as cooks during this period. Constraints (7.7) ensure that the number of cross-trained employees working as CSRs is non-negative in each period k e K. Finally, constraints (7.8)-(7.11) are standard non-negativity and integrality constraints. For the problem shown in Table 7.3, with c, = 80, d¡ = 96, and e¡ = 120 for all j e J, the total cost is 1936 if we do not allow cross-trained employees to be hired. The solution entails using 11 cooks and 11 CSRs. However, if cross-trained employees can be used, the total cost can be reduced nearly 5.8 percent to 1824. This solution uses nine cooks, nine CSRs, and two cross-trained employees. Call centers represent another context in which cross-trained employees are useful. Call centers are used by firms to interact with customers. Call centers are discussed in detail in Chapter 9. Many call centers operate on a global basis and so there is a need for employees who speak many different languages. Crosstrained employees in such centers speak two or more languages. In other call centers, employees must deal with multiple functions including order processing, returns, and general customer service. Again, cross-trained employees would be able to answer multiple call types. Finally, call centers for software firms must be able to help customers with a wide range of programs (e.g., word processing, spreadsheets, presentation software, database systems, Internet browsers, and e-mail programs). Cross-trained employees are capable of helping clients with two or more systems. While call centers would seem to be a natural application of the model outlined above, most call centers have automated routing software that directs each incoming call to an appropriate customer service representative. Thus, any particular cross-trained CSR may switch between call types multiple times during any hour or period. More sophisticated models are needed to determine the appropriate number of cross-trained employees in these contexts (Tekin, Hopp, and Van Oyen, 2009).
7.4
MORE DIFFICULT EXTENSIONS
Many service providers, such as hospital emergency rooms, operate 24 hours per day. Also, in most systems, employees have time off between when they start and finish their duty period. Thus, an employee might work from 8 A.M. until noon, have an hour off for lunch, and then work an additional 4 hours from 1 P.M. until 5 P.M. Both of these cases preclude the use of network optimization techniques.
7.4.1
Employees with Breaks
In this section, we consider problems in which employees are scheduled to take a break during their working hours. Consider again the basic network structure shown in Figure 7.7. An employee who starts work at the beginning of the day and works for 8 consecutive hours is represented by a unit of flow on the link
391
MORE DIFFICULT EXTENSIONS
B 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
TOD 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
C | D | E | F | G | H | 2
0
1 1 1 1 0 1 1 1
3 1 1 1 1 0 1 1 1
4
1 1 1 1 0 1 1 1
5
1 1 1 1 0 1 1 1
6
1 1 1 1 0 1 1 1
I | J | K | L | M | N | O | P | Q | R 7
1 1 1 1 0 1 1 1
a kj Matrix 8
1 1 1 1 0 1 1 1
9
10
11
12
13
14
15
16
1 1 1 1 0 1 1
1 1 1 1 0 1
1 1 1 1 0
1 1 1 1
1 1 1
1 1
1
Figure 7.10. Sample coefficients akg indicating if an employee who starts work at time j is on duty at time k
from node 0 to node 8. By flow conservation, such an employee clearly contributes to the requirements for each of the first 8 hours, which are represented by the links from node 8 to 7, from node 7 to node 6, and so on. If an employee has his or her fifth hour off, an employee starting at the beginning of the day would not be able to contribute to the requirements represented by the link between node 5 and node 4. There is no way to represent this as a network flow problem. The problem can still be modeled using the basic formulation given in (7.1)(7.3). The key difference between this problem and the scheduling problem discussed earlier is that each column of the coefficients, akj, is given by a series of 0s, followed by a string of Is, and then a string of 0s in the earlier problem. If employees take breaks, the string of Is is itself interrupted by a single 0 or multiple 0s. Figure 7.10 shows such a matrix in which employees are given a break during the fifth hour of their 8-hour duty cycle. Thus, cell C33 is 0 in this matrix, whereas it is 1 in the matrix shown in Figure 7.5. When employees take a break during the fifth hour of their duty cycle, the linear programming relaxation of (7.1)-(7.3) results in an objective function value of 19.8. Ten of the 16 decision variables are fractional. In fact, 10 of the 13 non-zero decision variables are fractional! When we enforce integrality, the objective function value increases to 20. Six of the 16 decision variables are 0 and the remaining 10 are positive. It is worth noting that the linear programming relaxation objective function value (19.8) can be rounded up to 20 to obtain a lower bound on the objective function value of the integer programming problem. In many cases, this will actually be the integer programming objective function value, as it is in this case. Recall that, in this case, we needed only 17 employees when no breaks were permitted, but we need 20 employees when each individual has the fifth hour off.
392
SHORT-TERM WORKFORCE SCHEDULING
We also know that the total cost of the solution in the case in which employees take breaks must be greater than or equal to the total cost of the solution for the same requirements when employees cannot take breaks.
7.4.2
24-hour Scheduling
Many services, including all emergency services, operate 24 hours each day, seven days a week. In such services, it is not uncommon for an individual's duty cycle to begin one day and to end the next day. To model such cases, we commonly have time "wrap around" midnight so that 3 A.M. one day is the same as 3 A.M. the next day. Thus, an employee who starts at midnight and works for 8 consecutive hours as well as an employee who starts at 11 P.M. and also works for 8 consecutive hours will both satisfy the staffing requirements between 3 A.M. and 4 A.M. In other cases, the problem may be cast on a weekly basis with time wrapping around some hour of the week (e.g., midnight on Sunday). When we use this "wrap around" approach to modeling time, the network flow model outlined above breaks down. To understand why, consider a simple 24-hour problem with 4-hour time periods. Figure 7.11 illustrates how the network model of Figure 7.7 would be adapted to the 24-hour "wrap around" case. The light solid links correspond to the requirement links and the requirements are shown as numbers inside rounded rectangles. Thus, there must be nine staff members on duty between midnight and 4 A.M., eight between 4 A.M. and 8 A.M., and so on until we need four between 8 P.M. (20 hours) and midnight (0 or 24 hours).These values would be the lower bounds on these links. The upper bounds would be infinite and the unit costs would be 0. The heavier dashed links between nodes that are two nodes apart (e.g., between node 0/24 and node 8) represent shifts that employees could work. To minimize the number of required employees, the lower bound on these links would be 0, the upper bound would be infinity, and the unit cost would be 1. However, in an optimal solution to the problem as
Figure 7.11. Network diagram for 24-hour scheduling
MORE DIFFICULT EXTENSIONS
393
structured, none of these links would be used! We would simply have nine units of flow circulating counterclockwise on the six solid links. (Note that the maximum requirement during any 4-hour period is nine staff members.) The total cost of this solution is 0, and no employees need to work any shifts! Clearly this is a nonsensical solution. While the problem cannot be structured as a network flow problem, it can be represented using the structure of formulation (7.1)-(7.3) if we define the akj coefficients correctly. For example, we would define a3a.m.,n pm. = 1, meaning that an employee who starts work at 11 P.M. (the j value) is on duty between 3 A.M. and 4 A.M. (the k value) the next day, assuming employees work at least 5 hours and that they are on duty during the fifth hour of a duty cycle.
394
SHORT-TERM WORKFORCE SCHEDULING
See 24 hour example.xls in the online appendix .
7.5
LINKING SCHEDULING TO SERVICE
So far, we have assumed that the service manager has determined a priori the minimum number of employees that he or she wants to have on duty at each period of time. But how can a manager know how many staff to employ at each time? Clearly, as the number of employees on duty increases, the labor costs increase, but the service level will also generally improve. How can a manager trade off the costs of extra employees against the benefits of improved service if
395
LINKING SCHEDULING TO SERVICE
the minimum number of employees to employ at each period of time is determined a priori! In this section, we introduce a model that optimizes an aggregate measure of service—the accumulated number of person hours in the system—for a given staffing level. As the staffing level is changed, we can trace out the tradeoff between improved service as measured by reductions in the number of person hours in the system and the cost of providing the service. We can now formulate the problem of determining how many employees to start at each point in time during a day to minimize the accumulated personhours of time in the system subject to a constraint on the total number of employees used. We define the following notation. Inputs and sets K set of all time periods J set of possible starting times for e m p l o y e e s s™n m i n i m u m n u m b e r of e m p l o y e e s w h o must b e o n duty during period k e K P total number of employees that can be employed akj 1 if an employee who starts work in period je / i s on duty during period k ε Κ; 0 if not Vkmm number of person-hours of time in the system that are incurred in period k e K if we employ the minimum feasible number of employees in that period ßkm incremental benefit in person-hours associated with employing the mth extra employee in period k e K Decision variables X¡ n u m b e r of employees w h o begin their shift in period j e J Ykm 1 if there are at least m extra employees (beyond the value of s™n) on duty and eligible for assignment in period k e K How do we compute the quantities s™m, Vkmm, ßkml Recall from Chapter 3, that if the arrivals to the system are characterized by a Poisson process with rate Xk in each time period k e K, the service times are independent, identically distributed exponential random variables with mean Ι/μ, and there is a single line for service from which customers are served in a first-come-first-served manner, then the steady-state average number of people in the queue is given by
_ hvV(V/0' D o,*(0, V(')=,^J ^>o.»('), (s-l)\(s-\)2' where
ρ0Λ°)= Σ _/=0
(\/μϊ , {Kin)' fi
s!
S/i
ψ-Κ
(7.12)
396
SHORT-TERM WORKFORCE SCHEDULING
and s is the number of servers on duty. We use the notation LqJc(s) and Po,k(s) a s opposed to the simpler notation Lq and P0 to emphasize (a) that these quantities (and the ones to follow) depend on the number of servers on duty, a decision variable, and (b) that they depend on the time period k e K. We also use Xk to allow the arrival rate to vary over time. (Note that technically we should use sk, since the number of servers on duty may change over time. We omit this added notation for simplicity.) Using (7.12) and Little's Law, we can derive the average waiting time as
p wq,k(s)=^= *r'7« t (3-1)\(ζμ-λ,) o*wX k
The average time in the system is then given by Wk(s) = W^k(s)
+
1 L P I = ^ μJ V A -= ^ O " P0jc0k{s)+ (s) + -1. μ ( * - 1 ) ! ( * μ - \ ) 2 °'kK ' μ
(7.13)
If customers arrive at a rate of Xk per hour in period k, then XkWk(s) is the rate at which person-hours of time in the system are accumulated when we have s servers on duty at time k. But XkWk(s) is nothing more than Lk(s), the average number of people in the system when there are s servers on duty at time k. For λ λ equation (7.13) to hold, we require * < 1 or s™m > — at each point in time s k μ μ k, where s™n is the minimum number of servers needed for steady-state conditions to prevail at time k. Vkmin is then given by XkWk (s™ n ). Finally, we have ßkm = XkWk(m) - XkWk(m - 1). Knowing how to compute the critical quantities defined above, we can formulate the problem of minimizing the accumulated number of person-hours of time subject to a fixed number, P, of employees as follows: Min s.t.
k^K I
m=l
(7.14)
J
VkeK ye y
(7.15)
m-1
(7.16) Xj > 0 and integer
V/e/
(7.17)
o^n^i
VkeK;m = l,....,P
(7.18)
The objective function (7.14) minimizes the total number of accumulated person-hours of time in the system. If there are no extra employees on duty at any time during the day, then the number of person hours is given by Σ ^Α™"· k&K
As additional employees are used, the total number of accumulated person-hours p
of time in the system decreases. Constraints (7.15) define ^Ykm, the number of
LINKING SCHEDULING TO SERVICE
397
extra employees on duty at time k e AT, as the difference between the number of employees on duty at time k, ^ak¡X¡,
and the minimum number that must
be on duty for steady-state conditions to prevail, s™n. Constraint (7.16) limits the total number of employees to P. Constraints (7.17) and (7.18) are standard integrality, non-negativity and upper bounding constraints. Finally, note that since ßjm > ßj,m+i (ϊ·β·, the incremental benefit of the m'h extra employee is always greater than the incremental benefit of the m + I s ' extra employee), we will naturally have Yjm > Y¡¡m+\, we do not need to impose this logical condition explicitly since it will naturally hold in any optimal solution.
398
SHORT-TERM WORKFORCE SCHEDULING
399
400
SHORT-TERM WORKFORCE SCHEDULING
401
LINKING SCHEDULING TO SERVICE
See Scheduling with service actual.xls in the online appendix .
Table 7.4 shows the results of exercising the model for nurse levels ranging from 20, the minimum feasible number, to 32. The column labeled OFV gives the objective function value, which is the accumulated number of person-hours of time in the system using the given number of nurses. Note that this value decreases sharply at first and then levels out, as indicated by the column labeled Improvement, which gives the difference in objective function values between two successive rows of the table. Also note that since an average of 10 patients arrive in each of 24 hours and the average service time is f of an hour, the smallest possible expected accumulated time in the system is 160, or 1 0 · 2 4 · ( | ) . By the time we are using 32 nurses, the accumulated time in the system is very close to this value, indicating that there is almost no waiting time to see a nurse. The final three columns of the table give the total cost, staff cost, and waiting cost assuming that the cost per employee per day is $640 and the cost per patienthour of time in the system is $125. Figure 7.20 plots the three cost values as a function of the number of nurses. Using 25 nurses minimizes the total cost for the parameters shown. At this number of nurses, the objective function value is TABLE 7.4. Sample results for nurse scheduling problem with service determination Nurse Level 20 21 22 23 24 25 26 27 28 29 30 31 32
OFV 301.82 243.43 210.38 191.45 181.97 174.70 170.36 167.38 165.07 163.72 162.62 161.83 161.31
Improvement
Total Cost
Staff Cost
Wait Cost
58.39 33.15 18.83 9.48 7.27 4.34 2.98 2.31 1.35 1.11 0.79 0.52
50,527.44 43,868.37 40,364.68 38,650.73 38,106.33 37,837.62 37,934.87 38,202.47 38,554.23 39,025.43 39,527.04 40,068.28 40,643.87
12,800.00 13,440.00 14,080.00 14,720.00 15,360.00 16,000.00 16,640.00 17,280.00 17,920.00 18,560.00 19,200.00 19,840.00 20,480.00
37,727.44 30,428.37 26,284.68 23,930.73 22,746.33 21,837.62 21,294.87 20,922.47 20,634.23 20,465.43 20,327.04 20,228.28 20,163.87
402
SHORT-TERM WORKFORCE SCHEDULING
Figure 7.20. Staff, Waiting, and Total Cost as a function of the number of nurses
approximately 175, meaning that on average patients wait approximately 3.75 , 175-160 15 n n „ r , minutes (or = = 0.0625 hours) to see a nurse. 240 240 The results above assume that we can have nurses start work at any hour of the day. In many hospitals and other service environments, employees start at only specified times. For example, rather than (perhaps) having one or more new people start (or end) their shift each hour, a hospital may have nurses start work only every fourth hour (e.g., midnight, 4 A.M., 8 A.M., and so on). We can readily use the model outlined above to explore the impacts of such policies. All we have to do if employees can start only every fourth hour, for example, is to constrain the number of employees starting in hours other than the permitted starting hours to be zero. Figure 7.21 compares the objective function value—the total number of person hours of time in the system—for the case in which nurses are allowed to start work at any hour versus the case in which they can start only every fourth hour. Clearly restricting them to starting every fourth hour degrades the objective function value. In fact, while there is a feasible solution with as few as 20 nurses when nurses can start at any hour, there is no feasible solution with fewer than 23 nurses when they are restricted to start every fourth hour. This solution is not plotted in the figure as the total number of person-hours of time exceeds 965 (and it would consequently plot well off the vertical scale used in the figure). When the number of nurses employed is relatively small, there are large percentage differences between the objective function of the unconstrained and the constrained cases. This trend is even more apparent in Table 7.5, which shows the total number of person-hours in the system as a function of the number of nurses employed and the times at which the nurses can start a shift. In general, as we
403
LINKING SCHEDULING TO SERVICE
Figure 7.21. Comparison of total person hours in the system when nurses start every hour versus when the can start every fourth hour
TABLE 7.5. Total person hours in the system as a function of the number of nurses employed and how frequently they can start a shift Nurse Level
Every Hour
2 Hour Starts
4 Hour Starts
6 Hour Starts
8 Hour Starts
20 21 22 23 24 25 26 27 28 29 30 31 32
301.82 243.43 210.28 191.45 181.97 174.70 170.36 167.38 165.07 163.72 162.62 161.83 161.31
NFS NFS 291.86 220.55 200.40 184.96 176.88 172.35 168.51 166.23 164.66 163.61 162.61
NFS NFS NFS 965.07 230.01 206.67 189.06 179.83 173.53 170.39 167.71 165.28 164.12
NFS NFS NFS NFS NFS NFS NFS NFS NFS NFS NFS 594.87 217.64
NFS NFS NFS NFS NFS NFS 978.08 227.78 201.64 184.03 178.31 172.77 168.83
restrict the starting times to every other hour, every fourth hour, and then to every eighth hour, the objective function degrades and the minimum number of nurses for which we can find a feasible solution increases from 20 (in the unconstrained case) to 22, 23, and 26 respectively. Interestingly, restricting nurses to start every sixth hour is even worse—in terms of both the objective function value and the minimum number of nurses needed to find a feasible
404
SHORT-TERM WORKFORCE SCHEDULING
solution—than is the case in which nurses are restricted to starting every eighth hour. Another way to think about this is as follows. At the optimal number of nurses shown in Figure 7.20, the total time in the system is about 175 person hours. The cost minimizing number of nurses is 25. To achieve this level of service, we need to employ 27 nurses if we restrict nurses to starting every other hour, 28 nurses if we restrict them to starting every fourth hour, and 31 nurses if we permit nurses to start only every eighth hour. When nurses can start only every sixth hour, we would need to employ 36 nurses to achieve the same level of service provided by 25 nurses who can start at any hour.
7.6
TIME-DEPENDENT QUEUEING ANALYZER
In Chapter 3, we introduced a time-dependent queueing analyzer that numerically integrates the Chapman-Kolmogorov equations to find the time-dependent state probabilities for Markovian queues. This model does not require that the steadystate condition apply at every instant of time. Thus, the solution to a staff scheduling problem obtained using the approach outlined in section 7.5, in which we imposed this condition, can be taken as a feasible solution in the time-dependent queueing analyzer. We can then use the time-dependent queueing analyzer to get both an improved estimate of the true cost associated with the schedule suggested by the optimization model of section 7.5 and to search for a better set of starting times. Note that the results of the time-dependent queueing analyzer are more likely to reflect the true conditions than is the model of section 7.5, which uses static queueing theory results. Figure 7.22 shows the results of using the optimal starting times with 25 employees as found using the model of section 7.5. Note first that the service capacity, as shown in the black line, (roughly) follows the demand profile shown in the blue sinusoidal line. However, the peak time-dependent expected number in the system is shifted to the right of the peak in the demand profile. The total employee cost associated with this solution is $16,000 per day (or 25 employees times $640 per employee per day). The time-dependent queueing analyzer predicts a total of 176.99 person-hours of delay. This is close to the value of 174.70 predicted by the steady-state model used in section 7.5. At $125 per person-hour of time in the system, this corresponds to a cost of $22,123.92 for time in the system and a total cost of $38,123.92. We can actually do slightly better than this by shifting a few employees so that the peak service capacity occurs slightly after the peak demand. Figure 7.23 shows one such solution. Again, 25 employees are utilized with an employee cost of $16,000. The number of person-hours of time in the system is reduced about 1.3 percent to 174.63. The total cost is now $37,828.79. The key is that it is generally a good idea to adjust the starting times of the employees so that the peak service capacity occurs about 1 mean service time after the peak in the demand rate. This
Figure 7.22. Time dependent queueing analyzer results for 25 employees with starting times as found using the optimization model of section 7.5. (See color insert)
Figure 7.23. Time dependent queueing analyzer results for 25 employees with improved starting times. (See color insert)
405
406
SHORT-TERM WORKFORCE SCHEDULING
is approximately what has happened as we transition from Figure 7.22 to Figure 7.23.
7.7
ASSIGNING SPECIFIC EMPLOYEES TO SHIFTS
Once we determine how many employees to have on duty during each period and when employee shifts should begin, we are left with the problem of assigning individual employees to those shifts. This is generally a complicated problem that needs to account for work rules of the company, federal and state regulatory restrictions and guidelines, union contracts, and individual employee preferences. To illustrate the complexity associated with assigning employees to particular shifts, we consider the problem of assigning nurses to shifts in a hospital. This problem has been the subject of numerous research studies (e.g., Burke et al., 2002, 2004; Cheang et al., 2003; De Grano, Medeiros, and Eitel, 2009; Bard and Purnomo, 2005a, 2005b, 2007; Purnomo and Bard, 2007;Thompson and Parr, 2007; Wright, Bretthauer, and Côté, 2006). Nurse scheduling is difficult for a number of reasons. First, there is currently a national shortage of nurses. Furthermore, the shortage is likely to get worse in the coming years as the population ages. Also, relatively few young people are entering the profession. In addition, nursing schools are finding it difficult to attract faculty, as qualified instructors can often earn significantly more in practice than they can teaching. This shortage, and the likelihood that it will persist or get worse in the coming years, means that any schedule must respect the preferences of individual nurses allowing them to manage their personal and professional lives. A failure on the part of a hospital to do so will induce nurses to leave the hospital and/or to leave the profession. Hospitals and patients also have a vested interest in keeping patient-tonurse ratios low. There is considerable evidence that higher patient-to-nurse ratios are correlated with increased in-patient mortality rates and increased medication errors (Fitzpatrick, While, and Roberts, 1999; Gold et al., 1992; Kane et al., 2007; Rogers et al., 2004; Seago, 2008; Seago, Williamson, and Atwood, 2006; Stanton and Rutherford, 2004). Nurses may also suffer adverse health impacts from poor shift schedules including peptic ulcers, coronary heart disease, and compromised pregnancy outcomes (Knutsson, 2003), and higher rates of colorectal cancer (Schernhammer et al., 2003) and breast cancer (Schernhammer et al., 2001). Two forms of constraints typically apply in nurse scheduling as well as other personnel scheduling problems. Hard constraints must be satisfied while soft constraints should be obeyed if possible. Often, violations of soft constraints are penalized in the objective function. A typical hard constraint might stipulate that an employee must have an 8-hour break between every shift and that no shift can extend for more than 12 hours. Another hard constraint might limit the number of hours an employee can work each week. For example, medical residents are limited to 80 hours per week. Residents must also have at least one
ASSIGNING SPECIFIC EMPLOYEES TO SHIFTS
407
24-hour period each week during which they are not assigned any work duties. While 80 hours may seem like a lot of time, historically residents worked significantly more hours each week and actually were in residence at many hospitals 24 or 36 hours at a time. Another hard constraint often found in nurse scheduling is that a nurse cannot work more than six consecutive days. A related soft constraint might penalize any schedule that calls for a nurse to work more than five consecutive days without a day off. Nurse schedules typically take one of three forms. A cyclic schedule develops a set of different cycles of work (e.g., schedule 1 might be Monday, Wednesday, and Friday 8 A.M. to 8 P.M.; schedule 2 might be Tuesday, Wednesday, Thursday, and Friday 4 P.M. to midnight plus Sunday 8 P.M. to 8 A.M.). Nurses rotate through a series of schedules in such a way that the staffing needs of all shifts are satisfied throughout the planning horizon and work rules for the nursing staff are obeyed. As an example of a violation of a typical work rule, schedule 2 could not precede schedule 1 because the nurse would then effectively have to work from Sunday at 8 P.M. through Monday at 8 P.M., a 24-hour period. Nurses (and most other employees for that matter) are restricted to shifts that are significantly shorter than this. Note also, that the two schedules above account for 36 and 40 hours of work respectively, again reflecting the fact that different nurses may be contracted for different numbers of hours of work each week and/or the nursing staff may not always work the same number of hours each week. Cyclic schedules tend to be very inflexible. Self-scheduling allows nurses to sign up for individual shifts with limits on the total number of nurses permitted per shift by the hospital administration. Fairness can be an important issue when using self-scheduling because those who sign up early often get the preferred schedules while those who sign up late (either due to their own tendency to procrastinate or due to a monthly rotating order of signups) often get the less desirable schedules. Bailyn, Collins, and Song (2007) describe a recent effort in implementing such approaches at a unit consisting of 70 RNs. Preference scheduling allows nurses to express preferences for specific shifts during the planning horizon. Preferences may be either positive, indicating that the individual wants to work at that time, or negative, indicating they do not want to be on duty then. The objective is then to maximize the total staff preferences, perhaps in combination with penalties for violating some of the soft constraints. De Grano, Medeiros, and Eitel (2009) describe an approach to nurse scheduling that is based on the use of auctions as opposed to optimization. In summary, there are numerous approaches that have been developed for the assignment of personnel to particular shifts. Each approach has its advantages (e.g., simplicity and fairness) and its disadvantages (e.g., rigidity and a failure to address personnel preferences). An approach that works well in one context may not work particularly well in another setting. Any approach that is developed must address both hard and soft constraints. A key advantage of model-based approaches, however, is that they tend to
408
SHORT-TERM WORKFORCE SCHEDULING
depersonalize the scheduling problem. This can be of value to both employees and to managers.
7.8
SUMMARY
After a brief overview of workforce planning in general, this chapter focused on short-term workforce management problems. Section 7.2 introduced a basic model that identifies the starting times of employees to minimize either the number of employees or the cost of the employees needed to staff a facility. Under appropriate conditions, the model can be cast as a network flow problem, which means that the number of employees assigned to start at the beginning of any period will naturally be an integer. Section 7.3 outlines a number of extensions to the basic model that account for part-time employees, overtime workers, and cross-trained employees. Section 7.4 extends the basic model even further to account for breaks in the employee schedules and for services that must be staffed over an entire 24-hour period. These problems can no longer be formulated as network flow problems, though standard integer programming techniques work well on such problems. The first few sections of the chapter assumed that we knew a priori how many employees were needed during each period. In section 7.5 this assumption was relaxed using a model that minimizes the accumulated number of customer-hours in the system subject to a constraint on the total number of employees scheduled during the planning period. By modifying the number of scheduled employees, the model can be used to trace out the tradeoff between customer service, as measured by the number of customer-hours in the system, and the cost of providing the service, as captured by the number of employees. The model of section 7.5 assumed that the queueing system was in steadystate at all times. In fact, this is unlikely to be the case if the number of employees on duty changes over time and if the arrival rate of customers changes over time. Section 7.6 introduced a time-dependent queueing analyzer (which was also discussed in Chapter 3). The employee schedule found using the model of section 7.5 can be used as an input to this time-dependent queueing analyzer to obtain a more accurate assessment of the total number of customer-hours of time in the system and to identify when the peak delays are likely to occur. The starting times of employees can then be modified to improve the level of customer service. As a general rule, it is a good idea to have the peak service capacity occur at a point in time that is roughly one mean service time later than the peak in the arrivals. Finally, section 7.7 discussed some of the complexities associated with assigning individual employees to shifts or to particular starting times. The section discussed the problem of assigning nurses to shifts to highlight some of the difficulties inherent in this problem. Three forms of nurse assignments were discussed: cyclic scheduling, preference scheduling, and self-scheduling.
409
PROBLEMS
7.9
PROBLEMS
1. Why can the links from nodes 9,10,...,15 to node 16 be omitted if all unit costs on the upper links are equal to 1 in Figure 7.7? 2. Show that if e¡ > c¡ + d¡ in problem (7.4)-(7.11), then the optimal solution has Zj = 0. To show this, suppose that it is not true and then find a solution with a smaller total cost that must also be feasible. 3. Find an example of a 24-hour scheduling problem in which the optimal linear programming solution is not an all-integer solution. Hint: Think about a problem in which employees work 16-hour shifts and all period requirements (rk) are identical. 4. For the model outlined in section 7.5, qualitatively explain why the results shown in Table 7.5 should uniformly degrade as we progress from allowing nurses to start at the beginning of each hour, to every 2 hours, to every 4 hours, and then to every 8 hours. 5. For the model outlined in section 7.5, qualitatively explain why the results shown in Table 7.5 for the case of nurses starting every sixth hour are significantly worse than those for the case in which nurses can start every eighth hour. 6. Before setting this up, read the entire problem and think about how you want to model it in Excel. Consider the problem of scheduling employees at a local restaurant that is open 16 hours each day. The required number of employees in each one-hour period is given below. Employees work an 8-hour shift (with no breaks).
Beginning Time
500 600 700 800 900 1000 1100 1200 1300 1400 1500 1600 1700 1800 1900
Ending Time
600 700 800 900 1000 1100 1200 1300 1400 1500 1600 1700 1800 1900 2000
Number Γ·
4 3 5 7 8 9 10 8 9 6 7 5 4 4 5
410
SHORT-TERM WORKFORCE SCHEDULING
a) Find a solution that minimizes the number of employees needed at the restaurant. How many employees start in each period? How many total employees are needed? b) Now suppose that you can have some employees work a 3-hour (parttime) shift, but you have to pay them for half a day's worth of work. Find a solution that minimizes the total labor cost. How does this compare to the solution you found in part (a)? How many part-time employees do you hire? How many full-time employees do you hire? (To make life easier here, assume that a full-time employee gets $100 per day and that a part-time employee makes $50 per day.) c) Now, in addition to dealing with the possibility of part-time employees, you need to give each full-time employee a one-hour break. The full-time employees will get a break during their fifth hour (e.g., they will work 4 hours be off for 1 hour and then work another 3 hours). How does this change the way you set up the problem in part (b)? i. Solve the problem without allowing part-time employees. How many employees do you use? What is the cost of the solution, making the same assumptions about employee costs as were made in part (b) above? ii. Solve the problem allowing part-time employees. How many employees do you use of each type? What is the cost of the solution, making the same assumptions about employee costs as were made in part (b) above? 7. Now suppose that you have two different types of jobs (e.g., cooks and customer service representatives). You are given the hourly requirements for each class of job. For example, we might have rk sk
Number of cooking staff needed during period k Number of customer service staff needed during period k
for each period k in the set T of periods. In addition, we have three types of employees: cooking staff, customer service staff, and cross-trained staff who can work in either position. Define the following additional notation: a¡ b¡ c¡
unit cost of a cooking staff employee who begins work in period j unit cost of a customer service staff employee who begins work in period j unit cost of a cross-trained employee who begins work in period j
Because cross-trained employees are more valuable in some sense, we would expect and c¡ > b¡. Finally, as before, we will need to know something about the periods that an employee works given that (s)he begins work in period j . Define
411
PROBLEMS
δβ
1 if an employee who begins work in period j is available for assignment (e.g., not on a break) during period k.
Finally, we define the following decision variables: Xj Y¡ Zj Uk
number of cooking staff employees who begin work in period j number of customer service employees who begin work in period j number of cross-trained employees who begin work in period j number of cross-trained employees working as cooking staff in period k (Note that this definition differs from the definition of the other decision variables. It is not in terms of the number who start in period j , but rather in terms of their actual work assignment during period k.)
a) Formulate the problem of minimizing the total number of employees subject to a requirement that each period's staffing requirements (for cooks and for customer service employees) is met. b) Rewrite the objective function so that it minimizes the total labor cost. c) Without solving either problem, would you expect the solution to part (a) or (b) to employ more cross-trained employees? Why? Briefly justify your answer. d) For the following problem data, find the optimal number of each type of employee to hire beginning at each period if (i) your objective is to minimize the number of employees or (ii) your objective is to minimize the total cost of all employees. Beginning Time
500 600 700 800 900 1000 1100 1200 1300 1400 1500 1600 1700 1800 1900 2000
Ending Time
600 700 800 900 1000 1100 1200 1300 1400 1500 1600 1700 1800 1900 2000 2100
Required Number of Cooks
3 2 3 4 5 5 5 4 4 4 3 3 2 2 3 2
Required I of CS
3 3 4 4 5 6 7 11 10 9 6 7 6 5 4 4
412
SHORT-TERM WORKFORCE SCHEDULING
Assume that each employee works an 8-hour shift with no breaks. Also assume that each cook is paid $120 for an 8-hour shift, a customer service employee is paid $144 per shift, and a cross-trained employee is paid $156 per shift. e) Resolve part (d) if you are not allowed to use any cross-trained employees. How does the number of employees of each type needed change? How does the cost change? Consider the problem of staffing an emergency room at a hospital with nurses using the model outlined in section 7.5. The hourly arrival rates of patients are shown in the table below. Arrivals occur according to a Poisson process and the service times are exponentially distributed with a mean of 45 minutes. Nurses work an 8-hour shift with no overtime and no breaks during the shift. Start
End
Arrivals
Start
End
Arrivals
Start
End
Arrivals
0 1 2 3 4 5 6 7
1 2 3 4 5 6 7 8
10 8.06 6.25 4.7 3.5 2.76 2.5 2.76
8 9 10 11 12 13 14 15
9 10 11 12 13 14 15 16
3.5 4.7 6.25 8.06 10 11.94 13.75 15.3
16 17 18 19 20 21 22 23
17 18 19 20 21 22 23 24
16.5 17.24 17.5 17.24 16.5 15.3 13.75 11.94
a) Find the minimum number of nurses needed to serve all patients. b) If you had an infinite number of nurses, what is the minimum possible total patient-hours in the system. Note that the arrival pattern is essentially a sinusoidal pattern with a mean of 10 patients per hour, though the hourly rate varies. c) If the cost of a nurse is $800 per shift and an hour of patient time in the system is valued at $150, plot the patient cost, nursing cost and total system cost as a function of the number of nurses employed, for 25 through 35 nurses. d) What is the optimal number of nurses to employ if the objective is to minimize the total cost? 9. Repeat problem 8, but this time allow nurses to start only every fourth hour (e.g., at time 0, 4,..., 20). For part (c), solve the problem for 30 through 40 nurses. How does the optimal number of nurses in this case compare with the optimal number in problem 8? How does the total cost compare in the two cases? 10. Use the time-dependent queueing analyzer to study the same situation analyzed in problem 8. Set up the problem as follows:
REFERENCES
413
• Mean demand per hour = 10 • Demand amplitude (peak-mean) = 7.5 • Cycles/day = 1 • Demand shift (minutes) = 720 Set the other parameters of the problem to either their default values or to the corresponding values used in problem 8 as appropriate. a) Use the starting times found in the optimal solution to problem 8. These can be set using the Start Times tab of the Set Number of Servers pane that can be reached by clicking on the Set Times button on the main pane of the program. What is the total cost in this case? Note that the total cost is obtained only after clicking on the Compute Steady State Probs. and Compute Time Dep Probs. buttons. b) Move all of the starting times forward by 15 minutes. What is the new total cost in this case? How does it compare to the total cost found in part (a)? c) Move all of the starting times another 15 minutes forward. What is the new total cost in this case? How does it compare to the total costs found in parts (a) and (b)? d) Finally, move all of the starting times forward another 15 minutes. Again, what is the new total cost in this case and how does it compare to the total costs in parts (a), (b), and (c)? e) What is the best shift in starting times from among the cases considered in parts (a) through (d)? f) Using the starting times corresponding to the best shift in starting times, plot the state probabilities for time 560 for both the steady-state probability distribution and the time-dependent probability distribution. How do the two distributions compare? Which distribution has the smaller mean? Which distribution has the longer right-hand side tail?
REFERENCES Bailyn, L., R. Collins, and Y. Song, 2007, "Self-scheduling for hospital nurses: an attempt and its difficulties," Journal of Nursing Management, 15, 72-77. Bard, J. F., and H. W. Purnomo, 2005a, "Hospital-wide reactive scheduling of nurses with preference considerations," HE Transactions, 37, 7, 589-608. Bard, J. F, and H. W. Purnomo, 2005b, "Preference scheduling for nurses using column generation," European Journal of Operational Research, 164, 2, 510-534. Bard, J. F., and H. W. Purnomo, 2007, "Cyclic preference scheduling of nurses using a Lagrangian-based heuristic," Journal of Scheduling, 10,1,5-23. Burke, E. K., P. De Causmaecker, S. Petrovic, and G. Vanden Berghe, 2002, "A multi criteria metaheuristic approach to Nurse rostering," Proceedings of Congress on Evolutionary Computation, CEC2002, Honolulu, IEEE Press, 1197-1202.
414
SHORT-TERM WORKFORCE SCHEDULING
Burke, E. K., P. De Causmaecker, G. Vanden Berghe, and H. Van Landeghem, 2004, "The state of the art of nurse rostering," Journal of Scheduling, 7,6,441-99. Cheang, B., H. Li, A. Lim, and B. Rodrigues, 2003, "Nurse rostering problems—A bibliographic survey," European Journal of Operational Research, 151, 447-460. De Grano, M. L., D. J. Medeiros, D. J., and D. Eitel, 2009, "Accommodating individual preferences in nurse scheduling via auctions and optimization," Health Care Management Science, 12, 3, 228-242. Fitzpatrick, J. M., A. E. While, A. E., and J. D. Roberts, 1999, "Shift work and its impact upon nurse performance: current knowledge and research issues," Journal of Advanced Nursing, 29,1,18-27. Gold, D. R., S. Rogacz, N. Bock, T. D. Tosteson, T. M. Baum, F. E. Speizer, F. E., and C. A. Czeisler, 1992, "Rotating shift work, sleep, and accidents related to sleepiness in hospital nurses," American Journal of Public Health, 32, 7,1011-1015. Kane, R. L., T. Shamliyan, C. Mueller, S. Duval, S., and T. J. Wilt,T. J., 2007, "Nurse staffing and quality of patient care," Evidence Report/Technology Assessment, Number 151, Minnesota Evidence-based Practice Center, Minneapolis, Minnesota. Knutsson, A., 2003, "Health disorders of shift workers," Occupational Medicine, 53, 103-108. Purnomo, H. W., and J. F. Bard, 2007, "Cyclic preference scheduling for nurses using branch and price." Naval Research Logistics, 54, 2, 200-220. Rogers, A. E., W. T. Hwang, L. D. Scott, L. H. Aiken, and D. F. Dinges, 2004, "The working hours of hospital staff nurses and patient safety," Health Affairs, 23, 4,202-212. Schernhammer, E. S., F. Laden, F. E. Speizer, W. C. Willett, D. J. Hunter, I. Kawachi, I., C. S. Fuchs, and G. A. Colditz, 2003, "Night-shift work and risk of colorectal cancer in the nurses' health study," Journal of the National Cancer Institute, 95,11, 825-828. Schernhammer, E. S., F Laden, F. E. Speizer, W. C. Willett, D. J. Hunter, I. Kawachi, and G. A. Colditz, 2001, "Rotating night shifts and risk of breast cancer in women participating in the nurses' health study," Journal of the National Cancer Institute, 93, 20, 1563-1568. Seago, J. A., 2008, "Nurse staffing, models of care delivery, and interventions," U.S. Department of Health and Human Services, http://archive.ahrq.gov/clinic/ptsafety/ chap39.htm, accessed June 23, 2010. Seago, J. A., A. Williamson, and C. Atwood, 2006, "Longitudinal analyses of nurse staffing and patient outcomes: More about failure to rescue," JONA The Journal of Nursing Administration, 36,1,13-21. Stanton, M. W., and M. Rutherford, 2004, "Hospital nurse staffing and quality of care," Agency for Healthcare Research and Quality, Research in Action Issue 14, A H R Q Pub. No. 04-0029, Rockville, MD. Tekin, E., W. J. Hopp, and M. P. Van Oyen, 2009, "Pooling strategies for call center agent cross-training," HE Transactions, 41, 6, 546-561. Thompson, J. M., and D. Parr, 2007, "Solving the multi-objective nurse scheduling problem with a weighted cost function," Annals of Operations Research, 155,1, 279-288. Wright, P. D., K. M. Bretthauer, and M. Côté, 2006, "Reexamining the nurse scheduling problem: staffing ratios and nursing shortages," Decision Sciences, 37,1, 39-70.
8 LONG-TERM WORKFORCE PLANNING
Bob Sullivan, the new Director of Project Development, was ecstatic about the new contract his firm had just landed. He all but ran into his boss's office with the news. "Diane! Great news! I just found out that we won the consulting job in Spain! I never thought we would get the contract. Wow! $30 million in revenue over the next 18 months. Isn't that great!" To his dismay, his boss, Diane Hawthorn, did not jump out of her skin at the news. Diane had been Vice President of Strategic Consulting for five years and she had been down this road before. She smiled demurely, but even Bob realized that she was not as thrilled at the news as he was. "Diane. Are you okay? This is great news! What's wrong?" "Bob. It is good news, I think. I am just a bit worried about how we will staff the project. We are already stretched pretty thin in Europe and this project will need another 50 people in the next six months and even more than that over the remainder of the project. Where are we going to get the staff? "
Service Science, by Mark S. Daskin Copyright © 2010 by John Wiley & Sons, Inc
415
416
8.1
LONG-TERM WORKFORCE PLANNING
WHY IS LONG-TERM WORKFORCE PLANNING AN ISSUE?
Unfortunately, the scenario outlined above plays out at all too many firms. Longterm workforce management is often more of an art than a science. For example, in many university departments, there is often a tension between different groups within the department. In a civil engineering department, when it comes time to hire a new faculty member, the structures group may vote against anyone in environmental engineering simply because hiring a new environmental engineer means that the department will not be hiring a new colleague for them in the structures area. The geotechnical, transportation planning, and mechanics groups within the department are also likely to oppose hiring anyone in an area other than their own. Without strong leadership and a long-term plan for the department's evolution, such internecine fighting often leads to gridlock and institutional paralysis. Even when there is a long-term plan, there is frequently a tension between hiring in a particular field, such as optimization theory, and finding the best person within a broader field, such as operations research more generally. Professional sports teams are faced with the same problem when they draft college athletes. Should a football team that needs a wide receiver draft the top wide receiver in the pool or would the team be better off drafting the best football player at any position? These questions are both important and extremely difficult to address in one chapter or even one textbook. Many human resources consulting firms are devoted to assisting clients in these areas. Many of these questions—such as how to achieve a consensus within a department about which area should be permitted to hire the next faculty member—are not particularly amenable to quantitative modeling. Leaders with strong interpersonal skills will often trump even the most sophisticated model for such problems. Nevertheless, good models can provide such leaders with valuable insights into the tradeoffs inherent in any decisions that they make. Good models can identify the costs—at least in terms of projected teaching deficits—of hiring in one area versus another. A good model can highlight the tradeoff between training too many versus too few staff to assume mid-level management positions. The development of such models is the focus of much of this chapter.
8.1.1
Treating Personnel as an Inventory of Skills
While personnel management dictates that each person is an individual with his or her unique skills and capabilities, in the aggregate we can view a group of individuals as an inventory of skills that can be deployed by the organization's management. An industrial engineering department may be composed of 20 unique people, but a department chair may sometimes need to think of the department as being composed of three people with deep skills in statistics, four experts in operations research including optimization and stochastic modeling, five people with an interest in the application of statistics and operations research
WHY IS LONG-TERM WORKFORCE PLANNING AN ISSUE?
417
techniques to problems in production and distribution, three people with interests in organizational issues, and five specialists in human factors and ergonomics. Such an aggregation of the faculty may be appropriate for marketing purposes, for communicating to the deans and other department chairs what the faculty do, and for planning course offerings. On the other hand, when a physician approaches the department to ask if anyone can help improve the scheduling in her office, the department chair will have to think again of the 20 faculty members as individuals with unique strengths, capabilities, existing time commitments, and interests in participating in such a project. Similarly, in a consulting firm, each person brings his or her own unique skills to the table. At a higher level, however, a new project may call for 36 personmonths of Java programming over the next six months. A more aggregate perspective on the capabilities of the firm's employees is needed to determine whether or not 36 person-months of Java-programmer time are available in that time frame or if the firm will need to contract with outside contractors for some of the work. In short, for strategic and long-term workforce planning, it is often convenient to think of a group of people as an inventory of skills. This is the perspective we will adopt in much of this chapter.
8.1.2
Need to Be Able to Estimate Profitability of a Project
Returning to the chapter's opening vignette, the Director of Project Development, Bob Sullivan, was ecstatic about the new $30 million project. His boss, Diane Hawthorn, adopted a broader perspective and worried about whether the firm would be able to make a profit on the project. If too much of the work had to be outsourced, the firm might actually lose money on the new large project. Thus, effective long-term workforce management is clearly also tied to the profitability of any individual project and, ultimately, to the profitability of the firm.
8.1.3
Workforce Management Linked to Project Scheduling
While Diane, in the example above, may be justified in her concern about how she will staff the project in the next six months, she may be able to staff the project more easily if she moves some tasks earlier or later or delays the starting date of the project by a month or two. In short, the available workforce might dictate, in part, the scheduling of a project. In turn, the needs of a company's projects will impact decisions about long-term workforce management. For example, suppose the new $30 million project calls for eight statisticians in months 9 through 15 of the engagement. If the firm does not anticipate having eight statisticians available at that time, based on the already-committed activities of its statistical team, the firm might elect to hire additional statisticians between the start of the project and month 9. An alternative would be to hire an outside consulting firm—perhaps a group of starving graduate students under the leadership of an entrepreneurial faculty member—to perform the analysis for them. If statistical analysis is viewed
418
LONG-TERM WORKFORCE PLANNING
as a core competency of the consulting firm and as one of its primary selling points to its clients, outsourcing this activity may not be desirable.
8.1.4
Personnel Development as Part of Workforce Management
While it may be difficult to give someone sufficient training to allow them to become an expert statistician in nine months, it may well be possible to give a Pascal programmer sufficient training to be able to contribute to the development of C++ code in that time frame. Thus, an important alternative to hiring outside consultants may be to develop the requisite talent in-house through personnel training. Of course, the training time will take away from their availability as Pascal programmers on other projects. Similarly, if a firm is likely to be short-staffed in terms of trained project managers, it has three options: the firm can hire additional project managers, it can contract with a project management company to execute the project management tasks that are needed, or it can train one or more of its current employees in project management so that the firm will have the required talent in-house. Finally, many of the decisions about hiring, releasing current employees, contracting with outside firms for assistance, and training employees must be made in the face of significant uncertainty about the number and type of future contracts or commitments that a firm will have. Decisions must be made before the future unfolds. Thus, just as in the case of the newsvendor problem discussed in Chapter 5, there will be costs associated with having too few employees with each level of skill and of having too many employees with specific skills. In this chapter, we begin to address some of these issues. As before, we will begin with a simple static model. We will then progressively relax many of the assumptions in the simple model to capture an increasingly rich set of problems. Many of these models were originally proposed by Jessop (2008). Throughout much of the remainder of the chapter, we will consider the problems faced by a consulting firm that needs to staff projects.
8.2
BASIC MODEL
We will begin with a very simple, almost naive, static and deterministic model. We consider a manager who has a set of projects that have to be staffed. Each project requires certain manpower that is specified by the number of personmonths of labor required on the project in each of a number of different skill categories. For example, one project might require 20 person-months of Java programming, 4 person-months of project management and 2 person-months of technical writing. Another project might need 40 person-months of HTML coding, 24 person-months of statistical analysis, 16 person-months of C++ coding, 6 person-months of project management, and 4 person-months of technical writing. The manager has at his or her disposal the employees of the firm and each employee has a single skill. Thus, there may be 25 HTML programmers, 20
419
BASIC MODEL
Java programmers, 10 project managers, and so on. The firm's employees are hired on a long-term basis and so they will be paid whether or not they are assigned to a project. Therefore, the incremental cost of using one of the firm's own employees is essentially zero. In the event that the firm does not have sufficient personnel resources within the firm, the manager can contract for additional resources at a cost that depends on the skill that is being contracted for. For example, one person-month of a project manager might be more expensive than one person-month of a technical writer. The problem faced by the manager is to determine how to staff the projects to minimize the total cost. To analyze this problem, we introduce the following notation: Inputs / J Sj r¡¡ Cj
set of projects set of skills the supply or number of person-months of skill j s J that are available within the firm the demand or the number of required person-months of skill j G J that are needed on project i e I the cost per person-month of an outside contractor with skill j G J
Decision variables Xtj the n u m b e r of person-months of internal labor allocated to project i e / with skill j s J Y¡¡ the n u m b e r of person-months of external contractor labor allocated to project i e / with skill j G J With this notation, the problem of minimizing t h e cost of staffing t h e projects can be formulated as follows: Min
7 c. ? ι,, ;e/
s.t.
(ογ\
f'e/
Xq + YyZr,, X„+Y v*r„
Vi e I, j eJ VielJeJ
(8.2)
VjeJ
(8.3)
Xtj>0
Vi e I, j eJ
(8.4)
Yv>0
Vi e I, j eJ
(8.5)
The objective function (8.1) minimizes the total cost of external or contractor labor. Remember that the incremental cost of using the firm's internal staff is zero because these employees are "permanent" employees and they will not be paid any more or any less if they are assigned to a project or not. Constraint (8.2) requires every project to be staffed with enough people with each required skill. The staffing can come from internal employees (the X¡¡ variables) or from
420
LONG-TERM WORKFORCE PLANNING
contractor labor (the Y¡¡ variables). Constraint (8.3) states that the total number of internal employees used, when summed over all projects, must be less than the available supply. Constraints (8.4) and (8.5) are standard non-negativity constraints. We can actually calculate the value of the objective function (8.1) without solving the optimization problem. It should be clear that the optimal solution will always prefer to use internal employees before using external contractors. The quantity ^ rv¡ represents the total number of person-months required with skill ¡6/
j e / . The quantity s¡ represents the total number of person-months of internal labor available with skill / e J. Therefore, the number of person-months of external labor that we must contract for with skill / e J is given by either 0 (if 2,/jj < s-) or ^rij ~sj (if Xlj- > sj)· Alternatively, we can say that the number iel
iel
iel
of person-months of external labor that we must contract for with skill ;' e / is given by max 0 , ^ / ^ . - 5 . . Once we know the number of person-months of external labor that we need with each skill, the optimal objective function value becomes ^ c¡ I max 0, ^ r¡¡ - s¡ ¡el
I
V
iel
y
Table 8.1 illustrates this computation with a simple example. The firm has five projects, one in each of five states: California (CA), Illinois (IL), Michigan (MI), New York (NY), and Texas (TX). The projects require different numbers of person-months of five different skills: Java programming, HTML coding, statistical analysis, management, and technical editing. If we add up the total number of person-months of any skill over all five projects, we obtain the total number of person-months of that skill that are required to staff the projects. For the data shown in the table, we need 65 person-months of Java coding, 89 person-months TABLE 8.1. Example inputs for simple workforce planning model Person-Months Required Project
Java
HTML
Statistician
Manager
Editor
CA IL MI NY TX Total Available Needed Cost/Person-Month Total Cost
15 10 0 20 20 65 60 5 $7000 $133,400
20 0 30 15 24 89 90 0 $6500
25 30 30 0 40 125 118 7 $7200
6 8 8 6 6 34 36 0 $10,000
6 6 10 8 12 42 30 12 $4000
421
GROUPING OF SKILLS
TABLE 8.2. One optimal solution to the simple problem of Table 8.1 Own Employees Project
Java
HTML
Statistician
Manager
Editor
CA IL MI NY TX
10 10 0 20 20
20 0 30 15 24
18 30 30 0 40
6 8 8 6 6
0 0 10 8 12
Manager
Editor
0 0 0 0 0 0
6 6 0 0 0 12
Contractors Project CA IL MI NY TX Total External Used
Java 5 0 0 0 0 5
HTML 0 0 0 0 0 0
Statistician 7 0 0 0 0 7
of HTML coding, and so on. Table 8.1 also indicates the number of available person-months of time within the firm, the s¡ values. There are 60 person-months of Java coder time available, 90 person-months of time for HTML coders, and so on. This means that we will be short 5 person-months of Java coding time, 0 person-months of HTML time and so on. Finally, the table provides the unit cost of hiring someone with each skill on the outside (temporary) market for a month. Using this information and the number of person-months needed in each category, we find that the objective function value will be $133,400 no matter how we assign personnel to projects. Table 8.2 gives one of many alternate optima for this problem. Note that the number of external employees needed with each skill shown in Table 8.2 is identical to that computed (without any optimization) in Table 8.1.
See Simple employee planning model.xls in the online appendix.
8.3
GROUPING OF SKILLS
The model of section 8.2 is exceptionally simple. The following are among the many problems with the model: • The model ignores time. Thus, it implicitly assumes that all projects occur over the same time frame. For example, the time frame for the data shown
422
LONG-TERM WORKFORCE PLANNING
in Table 8.1 might be six months. The model implicitly assumes that the person-months of time that are needed on each project are spread uniformly over the time period. Thus, the California, New York, and Texas projects each require one manager in each month of the project, if the time horizon of the data is six months. The Illinois and Michigan projects, however, require f of a manager each month. We explore ways of relaxing this assumption in section 8.4. • The model assumes that all employees are located in the same area and there are no differential costs associated with assigning employees from different regions to different projects. • The model assumes that each employee has only a single skill. In fact, employees are likely to come with a package of skills. Some, for example, might be trained in statistics and simulation. Others might be experts in project management and technical writing. Still others might be skilled in optimization and statistics. We relax this assumption below. In this section, we will assume that employees are endowed with a group or package or set of skills. For example, an industrial engineer might possess skills in statistics, optimization, and simulation. An electrical engineer might possess skills in statistics and signal processing. Thus, if we need someone skilled in statistics on a project, we can assign either an industrial engineer or an electrical engineer to the project. To model this extension of the basic problem, we will define the following additional notation: Inputs and sets K set of skill packages ajk 1 if skill package k e K includes skill j e J; 0 if not sk number of person-months of individuals with skill package k e K Decision variables Xijk number of employee months of individuals with skill package k e K assigned to work on project / e / using skill j e J With this notation, the problem can be formulated as follows: Min Σ < ν Σ ^ s.t.
Σ « Α
+
(8.6) ^ Η
Vie/,;e7
(8.7)
ΣΣΑ***
V e
Xijk > 0
VieI,JGj,keK
(8.9)
Υν>0
Vi eljej
(8.10)
j e / jtJ
* *
(8.8)
GROUPING OF SKILLS
423
The objective function (8.6) is identical to the objective function of the simple model of section 8.2. The objective minimizes the cost of any external contractors needed to meet the requirements. Constraint (8.7) is analogous to constraint (8.2). It states that the skill requirements for each project must be satisfied. The first term of (8.7) represents the total number of the firm's employees assigned to work on project / e I using skill / e J. These can be chosen from among employees with any skill package, provided that package includes skill / e J. Constraint (8.8) is analogous to constraint (8.3). It states that the total number of employees with skill set k e K cannot exceed the total number of such employees available. (Note that in section 8.2 we used the notation s¡ to denote the total number of employees with skill j e J, whereas in this section we are using the notation sk to denote the total number of employees with skill set k e K.) Finally, constraints (8.9) and (8.10) are standard non-negativity constraints.
424
LONG-TERM WORKFORCE PLANNING
GROUPING OF SKILLS
425
426
LONG-TERM WORKFORCE PLANNING
See Employee Planning with skill sets.xls in the online appendix.
The problem can also be structured as a network flow model. Figure 8.4 shows the network structure for the simple problem outlined above. The block arrows represent links that are not explicitly shown. In addition to the standard Source and Sink nodes, there is a node for each type of employee: Programmer, Senior Staff, Junior Staff, Analyst, and Contractor. There are five nodes for each project representing the five skills needed for each project. The skill set/skill mapping embedded in the ajk coefficients defined above determines which employee type node is connected to each project/skill node. Note that the Contractor is connected to every project/skill node. These links are shown with heavier links in Figure 8.4. Links also connect the project/skill nodes (e.g., CA
Figure 8.4. Network flow structure for example problem with skill sets
427
PLANNING OVER TIME
Java) to the Sink. A final link connects the Sink to the Source to allow the flow into every node to equal the flow out of every node. Problem 1 asks you to specify the lower bound, unit cost, and upper bound on each of the links shown in the figure.
8.4
PLANNING OVER TIME
One of the biggest problems with the simple model of section 8.2 is that it ignores the temporal requirements of the projects. It simply uses an aggregate measure of the number of person-months of each skill that are required for each project. In reality, each project is likely to require people with different skills at different times of the year. Just as we found in section 8.3 that having enough employees in the aggregate may not be adequate—we need employees with the right skills— so too we are likely to find that having enough employees overall may not be sufficient. We need to have the right employees at the right times. The formulation given in (8.1)-(8.5) can readily be extended to this case by simply appending a time subscript, t, to all of the inputs and outputs. We let T be the set of all time periods. Thus, for example, Xijt is the number of our own employees with skill j e J assigned to project i e / a t time t e T. The resulting model is:
Min Σ Σ ^ , Σ ^ íeT jeJ
*·'·
(8.11)
iel
Χψ+Υψϊ^, VielJeJjeT
(8.12)
5
Σ^- /<
VjeJ,teT
(8Λ3)
Χψ > 0
VieI,jeJ,teT
(8.14)
i'e/
Υφ > 0
VieI,jeJ,teT
(8.15)
The interpretation of (8.11)—(8.15) should be straightforward and is left as an exercise to the reader. See problem 2. Just as the objective function value for the model in section 8.2 could be found without actually solving the optimization problem, so too can the value of (8.11) be found with simple arithmetic. The total number of required personhours with skill je J at time t e T is given by ^/},-,. If this exceeds the number /e/
of available person-months with skill/ e J at time t e T, given by s¡„ then we need to hire outside contractors to make up the difference at a unit cost of c¡, per person-month. Thus, the optimal objective function value is given by Σ Σ £ 7 Μ Ι Γ 1 3 Χ ^ Σ ' ί ν - ' 5 / ' Γ' w h i c n i s a direct extension of the formula found ieT jcJ
I
in section 8.2.
V
iel
Jl
428
LONG-TERM WORKFORCE PLANNING
To illustrate this model, suppose the monthly breakdown of skill requirements for each of the five projects is as shown in Table 8.3. Note that the total number of person-months of each of the five skills is identical to the aggregate values used in Table 8.1 and Table 8.2. Table 8.4 and Figure 8.5 show (a) the total requirements in person-months for each of the five skills for each month, (b) the available number of person-months of internal labor in each skill area by month, and (c) the required number of person-months of contractor time needed in each skill area and in each month. Figure 8.6 isolates the analysis of the requirements for statisticians. Note that there are 125 person-months of statistician time needed across the five projects and six months. We have 117 person-months of statistician time available to us. The analysis of section 8.2 suggested that we needed 8 person-months of contractor time for statisticians. In fact, when we look month by month, we find that we TABLE 8.3. Sample data for a problem over time Person-Months Required February
Person-Months ¡Required January Project Java HTML Stat Mgr. Editor
Project Java HTML Stat. Mgr. Editor
CA IL MI NY TX Total
CA IL MI NY TX Total
1 1 0 2 2 6
1 0 2 1 1 5
10 0 8 0 5 23
1 2 2 1 1 7
0 0 0 0 0 0
3 3 0 4 5 15
5 0 4 1 2 12
8 8 8 0 5 29
1 2 2 1 1 7
0 0 0 0 0 0
Person-Months Retquired April
Person-Months Required March Project Java HTML Stat. Mgr. Editor
Project Java HTML Stat. Mgr. Editor
CA IL MI NY TX Total
CA IL MI NY TX Total
4 3 0 5 4 16
6 0 4 6 3 19
7 10 8 0 10 35
1 1 1 1 1 5
1 1 2 2 2 8
Person-Months Required May
4 2 0 4 3 13
3 0 10 4 7 24
0 10 6 0 7 23
1 1 1 1 1 5
1 1 2 2 2 8
Person-Months Required June
Project Java HTML Stat. Mgr. Editor
Project Java HTML Stat. Mgr. Editor
CA IL MI NY TX Total
CA IL MI NY TX Total
2 1 0 3 3 9
3 0 6 2 6 17
0 2 0 0 7 9
1 1 1 1 1 5
2 2 3 2 4 13
1 0 0 2 3 6
2 0 4 1 5 12
0 0 0 0 6 6
1 1 1 1 1 5
2 2 3 2 4 13
(c) Contractor Needs by M o n t h Figure 8.5. Requirements, availability, and contractor needs by skill and month
429
430
LONG-TERM WORKFORCE PLANNING
TABLE 8.4. Requirements, availability, and contractor needs Availability by Month and by Skill
Total Person-Months by Month Month January February March April May June Needed
Java HTML Stat. Mgr. Editor 6 15 16 13 9 6 65
5 12 19 24 17 12 89
23 29 35 23 9 6 125
7 7 5 5 5 5 34
0 0 8 8 13 13 42
Month January February March April May June Avail.
Java HTML Stat. Mgr. Editor 5 11 11 11 11 11 60
10 16 16 16 16 16 90
22 22 20 20 17 17 118
6 6 6 6 6 6 36
5 5 5 5 5 5 30
Contractor Person-Months Month January February March April May June Contractors Required
Java HTML Stat. Mgr. Editor 1 4 5 2 0 0 12
0 0 3 8 1 0 12
1 7 15 3 0 0 26
1 1 0 0 0 0 2
0 0 3 3 8 8 22
actually need 26 person-months of contracted statistician time. The surfeit of statisticians at the end of the six month period cannot be used to make up the significant deficit in the earlier months of the project, as shown in Figure 8.6. This point is even more dramatic when we consider the situation for HTML programmers, as shown in Figure 8.7. The analysis of section 8.2 showed that we needed 89 person-months of HTML programmer time and that we had 90 available person-months. Therefore, the analysis of section 8.2 suggested we did not need to hire any HTML programmers. However, in March, April, and May we need more HTML programmers than we have and these needs cannot be accommodated by the surplus of HTML programmers in January, February, and June. Therefore, we actually need to contract for 12 person-months of HTML programmer time. Finally, Figure 8.8 shows the analysis of managerial requirements. The firm needs 34 person-months of managerial time across the five projects and six months and 36 person-months are available. Again, however, due to the mismatch in timing, we need to contract for 2 person-months of managerial expertise. A careful look at the individual projects reveals the reason for this need. Because of the complexity of the Illinois and Michigan projects, they each require 2 person-months of managerial time in January and February, the startup months for the projects. Because we have only 6 person-months of managerial time avail-
PLANNING OVER TIME
431
Figure 8.6. Analysis of statistician requirements
Figure 8.7. Analysis of HTML programmer requirements
able in each of these months, we need to contract for additional managerial expertise. In fact, many firms are loath to contract for managerial expertise. If we could start one of the projects—perhaps the Illinois project—one month early in December and the other project—the Michigan project—one month later in February, we could smooth out the need for managerial expertise and could avoid the need to contract for additional help in this vital area. This leads to the topic of the next section: integration of project scheduling and long-term workforce planning.
432
LONG-TERM WORKFORCE PLANNING
Figure 8.8. Analysis of manager requirements See Simple employee planning model with time periods.xls in the online appendix.
8.5
LINKING TO PROJECT SCHEDULING
In this section, we explore the impact of linking project scheduling and personnel management. In particular, as the discussion surrounding Figure 8.8 suggested, changes in when a project starts, or a task within a project begins, can significantly impact the need for additional employees, either within the firm or hired as outside contractors. Of course, most companies cannot change the starting dates of projects at will; instead, the starting date is often subject to negotiation with the client. As such, the firm may have to pay a penalty of some sort—either a direct monetary penalty or a loss of goodwill—if they negotiate a starting date that differs from the date preferred by the client. In principle, each project will have a number of subtasks, each of which might be moved earlier or later at a cost. For each task within each project, we would have a list of the skills that are needed for that task in each time period. Thus, for example, we might know that during the initial data collection phase of a consulting project, we might need 3 statisticians, 1 project manager, and 5 data entry technicians in the first of 3 months of data collection; 3 statisticians, 1 project manager, and 8 data entry technicians in the second month; and 5 statisticians, 1 manager, and 10 data entry technicians in the third month of the data collection task. Employees would have different skills. Thus, a senior industrial engineer might be skilled at statistics and at project management, while an entrylevel computer scientist might be capable of only data entry tasks. A model at this level of detail can certainly be formulated and solved.
LINKING TO PROJECT SCHEDULING
433
To keep the model simple, however, and to gain insight from its solution, we will formulate, analyze, and solve a simpler model in which only projects, and not tasks within projects, can be moved earlier or later than the desired starting time. In addition, we will revert to the simpler model form of sections 8.2 and 8.4 in which there is a unique, one-to-one mapping between groups of people and skills. In other words, we will assume that a single group of employees possess a particular required skill and that skill is the only skill possessed by the group of employees. In this way, we will again be able to speak of skills and employee groups interchangeably. Clearly, the model outlined below can be extended to incorporate skill groups. As before, projects can be staffed by either internal employees or by external contractors. Internal employees, in this case, must be hired and paid a salary for the entire planning period, while external contractors can be hired on a monthto-month basis as needed. The key is, however, that the external contractors are paid a premium relative to the firm's own employees. This is common. For example, in nursing units, a hospital's own employees are typically paid less than are outside contract, or temporary, nurses. Thus, the model will analyze the tradeoff between hiring less-flexible but less-expensive permanent employees versus using more-flexible but more-costly contractors to staff projects. In addition, the model will allow us to explore the tradeoff between scheduling projects as requested by the clients versus shifting projects to better accommodate staffing capabilities. To model this problem, we utilize the following new notation: Inputs and sets rijt number of person-months of skill j e J that project i e / requires in month t e T oí the project Pi desired starting m o n t h for project / ε / h¡ annual salary of an employee with skill j e J c¡ cost p e r person-month of an external employee with skill j e J (Note that we will assume that c¡ > h¡IYl since otherwise it is cost-effective to outsource all work.) e¡ cost per m o n t h of moving project / e / o n e m o n t h early / cost p e r m o n t h of moving project i e / o n e m o n t h late Note that we are being a bit casual with the time indices. rijt refers t o the n u m b e r of person-months of skill j e J that are required t e T months into project / e /. Thus, r 3 5 ! would give the n u m b e r of person m o n t h s of skill 5 that are required for project 3 in the first m o n t h of the project. If the project starts in March, then the 1 refers to March. O n the other hand, p¡ refers t o the desired starting m o n t h for project / e /. Thus, p3 = 4 would m e a n that project 3 should ideally b e scheduled t o start in April if the absolute time is measured beginning in January.
434
LONG-TERM WORKFORCE PLANNING
In addition, we define the following decision variables: Decision variables Xj number of full time employees hired with skill ;' e J Yj, number of external contractors hired with skill je J in month t e T Z¡, 1 if project i e / i s scheduled to start in month teT Ej number of months early that project / e / starts relative to its desired starting time of p¡ L¡ number of months late that project i e I starts relative to its desired starting time of p¡ With this notation, we can formulate the problem as follows:
Min Σ Λ ^ + Σ ^ Χ ^ + ΣβΛ + Σ / Λ
(8.16)
s.t.
Ι , ^ , ^ Σ ^ Λ
V/E/,ίΕΓ
(8.17)
Σϊ,
=1
Vie/
(8.18)
+ £,. -L,=Pl
Vie/
(8.19)
V/ e J
(8.20)
Υί,Ζθ
VjeJ,teT
(8.21)
Z,.( > 0 and integer
Viel,
(8.22)
Et, L, > 0 and integer
V/ e /
leT
ΣίΖ.< teT
Xj >0 and
integer
teT
(8.23)
The objective function (8.16) minimizes the sum of the firm's own employee costs, the costs of outside contractors, the penalty costs for projects that start early and the penalty costs for projects that start late. Constraint (8.17) is a bit messy. The left-hand side of the constraint is simply the total number of personmonths of skill j e J that are available to the firm in month t e T. This is composed of two terms: the number of its own employees with skill j e J, X¡, and the number of outside contractors hired in month teT with skill ;' e J, Y¡,. The righthand side of the constraint gives the number of person-months of skill j e J that are required in month te T.To understand this term, note first that τ is nothing more than an index that is used in the summation. Therefore, ri;(r_r+1) is interpreted as follows. First, let us fix the project and skill indices, i and /, respectively. Now, for some specific month t e T, if the project started at time τ, the subscript ί - T+ 1 gives the number of months that we are into the project. For example, if t = 5 and τ = 2, meaning that the project started in February and we are now in May, the subscript t—τ+Ι would equal 4, meaning that in May we are in the fourth month of the project. We need to multiply this by the decision variable Zin which will be equal to 1 if project i e I starts at time τ e T and 0 if not. When we now add this up over all starting times prior to / and over all projects, we
435
LINKING TO PROJECT SCHEDULING
obtain the total number of person-months of skill/ e J that are required in month t e T. Constraint (8.18) states that for each project, we must pick exactly one starting month. Constraint (8.19) defines the early and late variables for each project in terms of the time the project starts and the desired starting month. The first term, ^ ί Ζ , , gives the number of the month in which project i e / actually starts. If this corresponds to the desired time,/?,, then the remaining terms on the left hand side will be equal to 0. (The justification for this is left as an exercise to the reader. See problem 3.) If, on the other hand, ^ίΖ,-, < p¡ we have a situation in which project i e / starts early. In this case, we will have E¡ = p¡ -^_tZit
> 0. In other words, the project will be p¡ -^tZu
A similar interpretation applies to the case in which ^tZu
months early.
> p¡. In that case the
teT
project will be ^_tZit - p¡ months late and we will have L¡ = ^tZit teT
- p¡ > O.The
teT
remaining constraints, (8.20)-(8.23) are standard non-negativity and integrality constraints. This model is still rather complicated, despite the assumptions we have made. For each project, we need to specify a complete list of the number of personmonths of work in each skill area to be done in each month. While this would clearly be needed for a real problem, to gain insight into the nature of the solution, we make one additional simplifying assumption for the example below. Specifically, we will assume that all projects are identical in terms of the skill profiles, or list of skills needed in each month of the now generic project. With this assumption, we can modify the inputs and decision variables as follows. Inputs r¡, p, e /
number of person-months of skill j e J that requires in month t e T of the project number of projects with a desired starting time cost per month of moving a project one month cost per month of moving a project one month
the generic project of month t e T early late
Decision variables Xj number of full time employees hired with skill j e J Yj, number of external contractors hired with skill j e J in month t e T Z, number of projects started in month t e T E, number of extra projects started in month teT over and above the number requested (These can be thought of as projects started early.) L, difference between the number of projects with requested start times in month teT and the actual number started, provided this difference is positive (This is the number of projects that are started late.)
436
LONG-TERM WORKFORCE PLANNING
With this notation, the simplified problem can be formulated as follows:
ΣΜΟ+Σ^Σ^Σ^ +/Σ** jeJ
j&J
rs7"
(8.24)
teT
V; e J, t e T
(8.25)
τ—1
ΣΖ,=ΣΡ, tsT
leT
(8.26)
z E L E L l- ,+ ,=P1- l-i+ ,^
VieT
(8.27)
Xj > 0 and integer
\fjeJ
(8.28)
^,>0
VjeJ,teT
(8.29)
Z,, Et, Lt>0 and integer
VieT
(8.30)
Again, the objective function (8.24) minimizes the sum of the firm's permanent employee costs, the costs of external contractors, the penalty costs for projects started early, and the penalty costs for projects started late. Constraint (8.25) is analogous to constraint (8.17). It requires that the firm have available to it the required number of person-months of each skill in each month of the planning horizon. Constraint (8.26) replaces constraint (8.18) and ensures that the number of projects scheduled is equal to the number of projects that are requested. Constraint (8.27) replaces constraint (8.19). Constraint (8.27) can be thought of as a flow balance constraint in terms of the number of projects in month t e T. Z, is the number of projects scheduled to start in month t e T and p, is the number that have been requested to start in that month. In its simplest form, constraint (8.27) says that these two quantities should be equal. But, projects might be early or late. Figure 8.9 helps explain constraint (8.27). Vertically, we have the number of projects starting in January and the number that need to start in January. In the absence of the other four links, the flow in equals flow out condition for this node would state that the number started must equal the number requested to start in January. However, in January, we can delay a project. This creates a flow into the January node from the February node because a delayed project increases the number that have to be scheduled at a later date. Similarly, in January, we can start one or more projects early. This would create a surplus flow going from the January node into the February node and the excess can be thought of as projects that start early and thereby reduce the need for projects to start in subsequent months. So much for the flows incident only on January or the flows between the January and February nodes. Just as we could start projects early in January, so too can we start projects early in the preceding month, December. A project that starts early in December creates a flow into the January node and reduces the number of projects that have to start in January. Finally, if we delay a project in December, it creates an additional need for a project to be scheduled in January. This is reflected by a flow from January to December, or an additional flow out of January.
437
LINKING TO PROJECT SCHEDULING
Start (Jan) Early (Jan)
Early (Dec)
(December)
(
January )
Late (Dec)
(February)
Late (Jan)
Need (Jan) Figure 8.9. Flow conservation of projects—constraint (8.27)
Another way to think about constraint (8.27) is to consider the flows in and the flows out of a node. Going out of a node, we have those projects that are supposed to start in that month, those that are starting early relative to future months, and those that are delayed from preceding months. Going into a node are flows that represent the projects started in that month, those that started early in the preceding month and those that are delayed to the subsequent month. Constraints (8.28)-(8.30) are standard non-negativity and integrality constraints.
438
LONG-TERM WORKFORCE PLANNING
LINKING TO PROJECT SCHEDULING
439
440
441
442
LONG-TERM WORKFORCE PLANNING
Figure 8.16 shows sample results for the model of (8.24)-(8.30). To generate these results, the objective function, (8.24), was modified so that the first two terms were the new objective function, representing the minimization of employee and contractor costs, and the second two terms became a constraint representing the maximum that could be spent on project rescheduling costs. In other words, the revised objective function and new constraint are:
Min ΣΗίΧί+Σ€ίΣΥβ
(8.31)
s.t.
(8.32)
e £ , £ , + / £ L ,
teT
Figure 8.16. Sample tradeoff results for a joint project scheduling/workforce management problem
LINKING TO PROJECT SCHEDULING
443
In (8.32), q is the maximum allowable rescheduling cost. If q is set to a very large value, the objective simply minimizes the employee (plus contractor) costs. This solution is the leftmost solution in Figure 8.16. If q = 0, then we do not allow any project rescheduling. This solution is shown as the rightmost solution in Figure 8.16. A light line connects these two solutions in the figure to highlight the solutions that fall below the line or that are better than a linear combination of these two extreme solutions. As q decreases from the maximum value given by the leftmost solution, additional solutions can be found. (Because penalties for early and late projects are 1000 and 2000 respectively, the total project rescheduling cost will be a multiple of 1000 and so q can be modified in increments of 1000.) The solutions shown as small diamonds in Figure 8.16 represent the entire set of non-dominated solutions for this problem. Of these 19 solutions, only 6 (shown as larger squares) could be found using the weighting method. It is also worth noting that a few of the non-dominated solutions fall above (or to the right) of the line connecting the two extreme solutions. Figure 8.17 shows the breakdown in total labor cost between employee and contractor costs as a function of the total rescheduling cost. In general, as less and less rescheduling is permitted, we are forced to rely on contractor labor to a greater extent and the total labor cost increases. In this example, in part because there are 12 identical projects to be scheduled, when the rescheduling cost is unlimited (at the far right-hand side of the figure), there is almost no need to utilize outside contractors. The analysis so far has assumed that we know how many projects we will have in the future and when they will be requested. In fact, this is almost never
Figure 8.17. Breakdown of labor cost vs. rescheduling cost
444
LONG-TERM WORKFORCE PLANNING
going to be the case. The future is inherently uncertain and unpredictable. As such, it is important to be able to plan now for multiple alternative futures. Because we do not know how many projects we will be asked to execute or when they will be requested, we ignore the project rescheduling costs. Instead, we ask the following question. If we plan for pp¡an„ed projects, and size our own workforce to best handle this many projects, but paaua¡ projects are actually requested, what is the best way to staff the projects? Clearly, if pactuai is significantly less thanppianned, we are likely to be able to staff all projects using our own employees only and without relying on any external contractor labor. Conversely, if pactuai is significantly greater than pptanned, we will almost certainly have to rely heavily on external contractors. To account for future uncertainty, we can modify the model of (8.24)-(8.30) as follows:
un
L^i+LCiL·**
X.
Xj+Yjt>±rj(t_T+X)ZT 2-t^t
=
(8.33) VjeJ,teT
(8.34) (8.35)
Pactuai planned
Vye/
(8.36)
Xj > 0 and integer
V/e/
(8.37)
^>0
V; e / , t ε T
(8.38)
Zt > 0 and integer
VieT
(8.39)
\r
The objective function, (8.33), is identical to (8.31) and simply minimizes the total labor cost, the sum of the employee and contractor costs. Constraints (8.34) are identical to (8.25) and state that the number of person-hours of labor available in each month for each skill must be greater than or equal to the number needed. Constraint (8.35) states that we must schedule exactly paauai projects, where paauai is an input. Constraints (8.37)-(8.39) are standard integrality and non-negativity constraints. Constraint (8.36) requires somewhat more explanation, despite its apparent simplicity. To use the model, we initially omit constraint (8.36) and solve the model for the optimal labor composition for a given number of planned projects, Ppianmd- The output of this will be a specific number of our own employees with each skill, xpjianned^ which will be an input to the next set of model runs. We then reintroduce constraint (8.36) and fix the number of our own employees at this level, xf'""u:d. We solve the remaining model (which now minimizes the contractor cost needed to satisfy the staffing requirements) for all other values of the number of projects, by varying paauai appropriately in constraint (8.35). To illustrate the use of this model, suppose we believe that there will be somewhere between 9 and 15 projects, but we can only estimate the probability of each number of projects. Figure 8.18 shows a probability mass function for the
LINKING TO PROJECT SCHEDULING
445
Figure 8.18. Probability mass function for the number of projects
number of possible projects. The expected number is 12, but there might be as few as 9 or as many as 15. We now fix the number of projects at 9, for example and solve model (8.33)-(8.35), (8.37)-(8.39), excluding constraint (8.36). This will yield the optimal number of our own employees to hire with each skill ;' e / . These values are shown in Table 8.5. We now re-introduce constraint (8.36) and fix the number of our own employees in each of the eight skill categories at the values shown in Table 8.5. We solve the model for 10,11,... ,15 projects, to obtain the optimal total labor cost if we plan for 9 projects, but some other number of projects actually occur. Table 8.6 shows the results of this complete analysis. When we plan for 9 projects, and 9 projects actually occur, the total cost is $8,080,300, which is shown as 8080 thousand dollars. On the other hand, if 10 projects materialize and we had planned for only 9, the total cost increases to $9,086,650 (shown as 9087 thousand dollars). Note that for any row—any fixed number of actual projects— the best we can do is to plan for that number of projects. These values are shaded to emphasize that they are the best values that can be attained for any given number of actual projects. How many projects should we plan for? One objective might be to minimize the expected cost over all possible outcomes. In the next to last row of the table, we compute the expected cost for each number of planned projects. Thus, 11,537 is equal to 8080 times 0.05 plus 9087 times 0.1 and so on through 15,178 times 0.05. The minimum expected cost corresponds to planning for either 12 or 13 projects. (In this example, the costs associated with planning for 12 projects are the same as the costs of planning for 13 projects, no matter how many projects
LONG-TERM WORKFORCE PLANNING
TABLE 8.5. Optimal number of our own employees to hire when we plan For 9 projects
Employee Position
Hire
Program Manager Project Director Project Administrator Statistician Industrial Engineer Senior Programmer Programmer Web Administrator
1 3 5 37 26 5 17 6
TABLE 8.6. Results of uncertainty analysis in the joint project scheduling/workforce management problem
Planned Actual
Prob
9
10
11
12
13
14
15
actually occur. This happens because we hire the same number of employees with each skill whether we plan for 12 or 13 projects.) Figure 8.19 plots the expected cost versus the number of projects for which we plan. Problems 7 and 8 introduce another measure that can be used in determining the number of projects for which we should plan. This measure is known as the regret, a measure that reflects how badly we will feel if we plan for X projects but Y projects actually occur. In other words, it measures how much more we would spend as a result of having planned for the wrong number of projects. 8.6 LINKING TO PERSONNEL TRAINING AND PLANNING IN GENERAL The models discussed above do not allow us to vary our own workforce in response to changing conditions. In reality, firms hire new employees and release
LINKING TO PERSONNEL TRAINING AND PLANNING IN GENERAL
447
Figure 8.19. Expected cost vs. number of planned projects
(or fire) employees who are no longer needed (or who are not performing adequately). In this section, we formulate a model that accounts for hiring and firing of employees. For each employee hired or fired there is a fixed cost that must be paid. Thus, there is a disincentive to hire people who are not needed and there is also a disincentive to fire or release people who may be needed in the near future. In addition, for every employee on the payroll, there is an ongoing monthly salary cost that has to be paid whether the employee is assigned to tasks or not. The model will also account for the natural attrition of employees as some people will leave the firm or retire from the firm of their own accord. If we do not have enough employees with the needed skills in a particular month, we will be forced to contract for those skills, presumably at a higher marginal cost than we would incur had we been able to use our own employees. As in section 8.3, we will distinguish between employees with skill sets and the particular skills that are needed over time. The objective will be to minimize the total hiring, firing, salary, and contractor costs. To formulate this model, we will utilize the following notation. Inputs and sets / set of skills K set of employee skill sets T set of time periods over which we want to plan r¡, number of person-months of skill j e J needed in time period t e T ajk 1 if skill j e J is included in skill set k e AT; 0 if not
448
LONG-TERM WORKFORCE PLANNING
yk
hk, fkt sk ,
Cjt
attrition rate of employees with skill set k e K (In other words, this is the fraction of employees with skill set k e K w h o will leave at the end of each month.) per person cost of hiring an employee with skill set k e K in time period t e T per person cost of firing or releasing an employee with skill set & e K in time period t e T per person-month salary of an employee with skill set k e K in time period t e T
per person-month cost of an external contractor with skill ;' e / in time period t e T
Decision variables Hkl number of people with skill set k e K hired at the beginning of time period t e T F ¡a number of people with skill set k e K fired or released at the beginning of time period / e T Xkt number of employees with skill set k e K available during time period t e T Zjk, number of employees with skill set k e K being used with skill y e / during time period t e T Yjt number of outside contractors with skill y e / used during time period t e T To emphasize the distinction between inputs and decision variables, all input constants are lowercase letters in this model. Uppercase letters refer to either sets (e.g., / , K, T) or decision variables. Thus, hk, is an input that gives the fixed per person cost of hiring a new employee with skill set k e K in time period t e T. On the other hand, Hk, is a decision variable that represents the number of employees with skill set k e K that we choose to hire at the beginning of time period t e T. With this notation, the model can be formulated as follows:
Min X X hktHk, +ΣΣ^Λ,+ΣΣ sx.
Σαϋ<Ζβ,+γ,-,>>-μ
h,** +ΣΣ cPYi> (8 40) Vye/,íer
(841)
Xkl=(l-Yk)Xk^+Hkl-Fk,
VkeK,teT
(8.42)
£ * * ,f
VkeK,teT
(8.43)
\/ksK,t&T
(8.44)
VeJ,keK,teT
(8.45)
VjeJ,teT
(8.46)
keK
jeJ
.x» >o Z /*, >o V >o Hkl Λ,
449
SIMPLE MODEL OF TRAINING
The objective function, (8.40), minimizes the sum of the fixed hiring and firing costs, the ongoing salary costs, and the external contractor costs. Constraint (8.41) ensures that the firm has enough manpower available with the requisite skills in each period. This manpower can be composed of the firm's own employees assigned to work using particular skills, ^ajkZjkt, kaK
or outside contractors, Yjt.
Constraint (8.42) is a flow balance constraint stating that the number of employees available with a particular skill set at a particular time is equal to (a) the number of employees with that skill set in the previous time period who did not leave the firm, plus (b) the number hired at the beginning of that time period with that skill set, minus (c) the number of employees with that skill set who are fired at the beginning of that time period. We interpret Xkf) to be the initial endowment of employees with skill set k e K. Constraint (8.43) ensures that the total number of employees assigned to all skills from within a skill set at a particular time cannot exceed the number of employees available to the firm at that time with that skill set. Constraints (8.44)-(8.46) are standard non-negativity constraints. It is worth noting that we do not require that the hiring, firing, or employment variables be integer. In fact, problem 9 asks you to discuss why these variables cannot be forced to be integer-valued in this model. If the model suggests that we hire a fractional number of employees, what good is it? The primary reason that the model suggests a fractional number of employees is that the number of employees who remain with the firm, (1 - yk)Xkf-\, may be fractional even if Xk,,-\—the number of employees in the firm in the previous month with some particular skill—is integer-valued. This occurs because the retention fraction, yk, is a long-run average and does not represent what will or will not happen in any particular month. In reality, the number of people leaving the firm with any particular skill set at any time will, of course, be an integer, leaving an integer number of remaining employees. Thus, the results of the model should be interpreted as guidelines and not an absolute prescription for action. This is true of all models, but is particularly relevant in this case.
8.7
SIMPLE MODEL OF TRAINING
Many service industries experience seasonal demands over the course of a year. Seasonality in the retail industry was discussed in section 5.4 in the context of inventory management. Other service industries also experience seasonality. For example, in the United States, there is a clear seasonal pattern in the demand for accounting services with a peak in early April just before personal state and federal taxes are due on April 15. Many accountants work 12- or 16-hour days, six (or more) days a week from about March 1 until mid-April. Resort hotels in warm climates experience a surge in demand during the cold winter months while other locales experience peak periods at other times of the year. In this section, we introduce a simple model that can be used to determine how many employees to train in each month to ensure that there are enough
450
LONG-TERM WORKFORCE PLANNING
employees available each month, accounting for the seasonality of the demand for employees, the lead time in training employees and anticipated departures from the firm, or the monthly turnover rate. In many contexts, especially in relatively routine jobs such as retail sales positions and customer service representatives, there is a fairly high monthly turnover rate that needs to be accounted for in such models. Specifically, we assume that for each month t in a planning period T we know how many employees we need to have available, h,. In addition, we know the monthly attrition rate, ß, meaning that if we have n employees available at the beginning of a month, then at the end of that month, nß of those employees will leave the firm, leaving n(l - ß) available at the beginning of the next month, if no employees are trained. Once an employee enters the training program, he or she is not qualified to work for δ months. In other words, if we decide to train employees at the beginning of month f, the employee cannot be counted as being available until the beginning of month t + δ. We will assume that there is no turnover during the training period. Each employee is paid c dollars per month and each trainee is paid b dollars per month while in the training program. The objective is to minimize the cost subject to having enough employees available each month. In addition to this basic information, we need to know how many employees we have now as well as how many are in the training pipeline. We will let t = 1 be the beginning of the first time period and we assume we have ti\ employees at the beginning of this period. This includes any newly trained employees who will be starting their regular (non-training) employment this month. These employees started their training in month 1 - δ. In other words, in month 1 - δ, we decided to train Xus employees. Similarly, in month 2 - δ we decided to train X2-s employees and they will be available to join the regular workforce at the beginning of month 2. Finally, at the beginning of month 0, one month before the problem begins, we decided to train X0 employees who will join the regular workforce at the beginning of month δ. The problem is to determine how many employees to train in the coming months to minimize the total employee cost while ensuring that we have enough employees available each month.
SIMPLE MODEL OF TRAINING
451
452
LONG-TERM WORKFORCE PLANNING
See Employee training example.xls in the online appendix.
8.8
SUMMARY
Long-term workforce planning is critical to the success of any enterprise, but is particularly important for firms or agencies engaged in services because their entire "product" is based on customer service provided by employees. After a brief introduction to the key issues surrounding long-term workforce management, this chapter introduced a series of models. The basic model of section 8.2 minimized the cost of external contractors to satisfy demands for different skills. The model was sufficiently simple that we could compute the optimal objective function value, and the number of external contractor hours needed for each skill, without using formal optimization techniques. The simple model of section 8.2 assumed that each employee had only a single skill and that the problem was static. Section 8.3 introduced a model in which a group of employees are all endowed with the same set of skills. For example, industrial engineers might be capable of working on statistical problems, simulation modeling and optimization. Students with a bachelor's degree in management might be able to collect data, do simple analyses of the data, and prepare reports and presentations. The problem addressed in this section was that of determining how many employees of each group to hire, as well as how many contractor hours for each skill to utilize, so that the total labor costs are minimized and all project needs are satisfied. This model cannot be solved by inspection, but is amenable to network analysis techniques. Section 8.4 introduced planning over time as an extension of the basic model of section 8.2. Again, this problem could be solved by inspection. The model highlighted the fact that a firm or agency does not only need to have adequate staffing in the aggregate, but it also needs to have adequate capabilities at each point in time. For example, a firm might have four statisticians on its staff capable of working 1000 person-days over the course of a year. Suppose there is a need for six statisticians during three months of the year and only two statisticians the
SUMMARY
453
remaining nine months of the year. On average, there is a need for only three statisticians over the course of the year, but the temporal needs for statistical analyses dictate that (a) some projects will have to be delayed, or perhaps started early, or (b) outside statistical expertise will be needed. Section 8.5 integrated project scheduling and workforce management. The key decisions in the model of this section were (a) whether a project should be delayed or started early, (b) the number of employees to hire (permanently) with each skill level, and (c) how many outside contractors to employ. Components (b) and (c) contribute to the total labor costs, while component (a) represents the rescheduling cost. As expected, there is a tradeoff between the two costs. If we minimize the total labor cost, we may need to reschedule many projects to balance the workload over the course of the year. On the other hand, if we cannot reschedule any projects, the total labor cost will be higher and we are likely to rely more on outside contractors to satisfy the peak demands for different skills. Section 8.6 introduced a simple model that allows a firm to hire and release employees at different points of time at a cost. Thus, the model allows for the temporal evolution of a firm or agency's workforce in response to changing needs. Outside contractors are again used to fill in any gaps between a firm or agency's own workforce capabilities and the needs of the firm or agency. Section 8.7 introduced a simple model in which the objective is again to minimize the total labor cost. In this section, all needs must be met by a firm or agency's own employees. Employees can be hired and trained in advance of the need to employ them. Also, there is a natural attrition rate that creates a continuous need to hire new people. There are numerous extensions of the models introduced in this chapter. For example, the models outlined in this chapter all assume that the need for employees arises at the same place. For large international firms, this is almost certainly not the case. It may actually be cheaper to hire local contractors with a particular expertise than it is to move employees around the world in response to evolving project needs. Any of the models outlined above can be extended to include a spatial component. Key decisions would include (a) how many employees to hire in each category and at each location, (b) how many of our own employees should be relocated to other sites over time, and (c) how much we should rely on local contractor help to meet project needs. The models of sections 8.3 and 8.5 can be integrated to recognize that employees do not simply have a single skill; rather, they are endowed with a package of skills. While this is a fairly straightforward extension, it would entail adding yet another subscript to many of the decision variables. The models of sections 8.6 and 8.7 can also be integrated so that employee training periods are recognized in the model of section 8.6. Training and promotion planning can also be incorporated into the models of this chapter, thereby creating a richer set of decisions that better reflect real-world workforce management problems. Finally, the model of section 8.7 can be extended to incorporate minimum and maximum training class sizes.
454
8.9
LONG-TERM WORKFORCE PLANNING
PROBLEMS
1. For the network shown in Figure 8.4, complete the following table identifying the lower bound, unit cost, and upper bound for each of the links listed in the table. From
To
Source Source Source Source Source Programmer Programmer Sr. Mgr. Sr. Mgr. Sr. Mgr. Jr. Mgr. Jr. Mgr. Analyst Analyst CA HTML CA Java CA Stat CA Mgmt CA Edit Sink
Programmer Sr. Mgr. Jr. Mgr. Analyst Contractor CA HTML CA Java CA Stat CA Mgmt CA Edit CA Mgmt CA Edit CA Stat CA Edit Sink Sink Sink Sink Sink Source
Lower Bound
Unit Cost
Upper Bound
2. Give the meaning in words of the objective function and constraints in formulation (8.11)-(8.15). 3. Assuming that the early and late penalties are positive, explain why the second and third terms of constraint (8.19) will be equal to 0 if ^ / Z I ( = p¡ ksT for some project / e /. 4. Again, assuming that the early and late penalties are positive, explain why at most one of E, and L, can be positive in constraint (8.19). 5. Suppose in the example of section 8.5 that no projects could be shifted in time. a) What would Figure 8.13 be under this assumption? b) How many program-manager-hours would be needed each January under this assumption? c) How many program-manager-hours would be needed each June under this assumption? d) How many project-director-hours would be needed each September under this assumption?
PROBLEMS
455
6. Explain why constraint (8.26) is not needed in the presence of constraints (8.27). 7. As an alternative to minimizing the expected cost in section 8.5, we could minimize the maximum regret. The regret associated with planning for X projects when Y projects occur is given by the difference between (a) cost associated with Y projects when we plan for X and (b) the best cost we could have realized had we planned for Y projects. For example, suppose we plan for 10 projects (X = 10) but 13 projects occur. The regret is given by the cost of 13 projects when we planned for 10 (12,661,225) minus the best cost when 13 projects occur (11,561,675) or 1,099,550. a) Using the cost values shown in Table 8.6, find the regret associated with every pair of planned and actual projects.
8. 9.
10.
11.
b) If the objective is to minimize the maximum regret, how many projects should we plan for? Show that minimizing the expected regret is equivalent to minimizing the expected cost. For model (8.40)-(8.46) discuss why we cannot force the hiring (Hkl), firing (Fkl), and employment (Xkl) variables to be integer-valued. Give a simple example of a case in which it would be impossible for these variables to take on integer values. For model (8.40)-(8.46), assuming that hk, > 0 (the cost of hiring an employee with skill set k e K at time t e T is strictly positive) and fkl > 0, discuss why we cannot have both Hk, > 0 and Fkt > 0 for any specific skill set k ε Κ at a particular time t e T. What would a violation of this condition mean in practical terms? How can you show that having both Hk, > 0 and Fkt > 0 is sub-optimal? Consider again the problem outlined in section 8.7. The number of employees needed each month is given below. Now, however, there is a fixed cost per class that is offered. In addition, there is a capacity for each class, or a maximum number of trainees per class. Multiple classes can be offered in a month, but each class incurs the fixed cost. The fixed cost per class is (initially) $15,000. The capacity of each class is (initially) 1000. At the beginning of January, there are 100 employees available. The training period is again three months. You must decide how many employees to start in training at the beginning of October (of the previous year) through September of this year. a) Formulate the problem of minimizing the total cost which now consists of the fixed costs of offering classes, the trainee salaries and the employee salaries, subject to the requirement that there be enough employees available each month. What are the decision variables? Which variables must be integer-valued? b) Solve the problem in Excel. Note that you should get the same total cost as that shown in Figure 8.20 except that the cost here should include an extra $150,000 for the 10 classes that are offered, at $15,000 per class.
456
LONG-TERM WORKFORCE PLANNING
Month
Needed
January February March April May June July August September October November December
120 130 130 140 155 170 170 150 130 130 125 120
c) Now solve the problem with a cost per class of $25,000. How many classes are offered now? What is the total cost and how does it compare to the value you found in part (b)? In particular, is the cost $100,000 more (10 classes times an extra $10,000 per class)? d) Now suppose again that the cost per class is $15,000, but that the capacity of a class is 20 students. (Perhaps there are only 20 computer consoles in the room used for the training.) What is the total cost? Are there any months in which more than one class is offered? If so, which months? Are there any months when no class is offered? How does this cost compare with that found in part (b)? 12. Consider the problem outlined in section 8.5 in which we linked project scheduling and workforce management. Consider the following inputs for a firm in which each project takes one year and requires five different employee types, as shown below. Planning at the firm occurs on a two-month basis. The firm anticipates one project request in each of the first two planning periods, three in each of the middle two periods and two in each of the last two periods as shown below. Outside contractors can be hired for any position at an hourly cost that is 1.5 times the hourly rate shown below. In addition, there is a $2500 penalty per project that is moved early and a $5000 penalty for each project started late. Planning is to be conducted using the wrap-around method as the firm anticipates this schedule of demand for the foreseeable future. a) Set up the problem of minimizing the total labor cost (employee plus contractor costs) subject to a constraint on the total cost of shifted projects and any other relevant constraints. b) If the cost of shifting projects is not constrained, find the optimal solution. What is the total shifting cost? How are the 12 projects scheduled? c) Use the constraint method to find the tradeoff between the total labor cost and the cost of rescheduling projects.
457
PROBLEMS
Requirements by Period (Person-Hours)
Employee Position
Hourly Rate
Annual Salary
Program Manager Project Administrator Statistician Industrial Engineer Programmer
80
160,000
240
120
120
120
120
240
25
50,000
640
320
320
320
320
640
35 45
70,000 90,000
480 360
960 2,160
1,920 2,160
1,920 1,000
1920 1,000
480 500
30
60,000
320
1,280
1,280
1,920
1,920
640
Seasonal Demand Schedule
Season Client requests
Jan-Feb Mar-Apr May-Jun Jul-Aug Sep-Oct Nov-Dec
Jan-Feb Mar-Apr May-Jun Jul-Aug Sep-Oct Nov-Dec 1
1
3
3
2
2
d) Which of the solutions found in part (c) above can be found using the weighting method? e) Create a plot like that shown in Figure 8.17 showing the breakdown of labor costs between employee costs and contractor costs for the solutions found in part (c). 13. Consider again the project scheduling and workforce management problem outlined in problem 12. In this problem, we will ignore the requested start time and we will analyze the impact of uncertainty in the number of projects the firm is asked to execute. a) Set up a model reflecting objective function (8.33) and constraints (8.34)(8.39) in Excel. b) Eliminate constraint (8.36) since we do not actually know the values of xPlanneä at this point. Suppose the firm is faced with nine projects. In other words, letpaclua/ = 9. Solve for the optimal total cost. Record this cost. Also, now set the values of xjl'"""!d to the number of employees hired by the firm in each of the five skill categories. c) Reintroduce constraint (8.36). Let paaua¡ vary from 10 to 15. For each value, record the total cost. Repeat steps (b) and (c) with pac,uai in step (b) changing from 10 through 15 and then, for each value, varying paauai from 9 through 15 in step (c). For each case, record the optimal cost. d) Create a three-dimensional graph showing the actual and planned number of projects on the X and Y axes and the total cost on the Z axis. e) Suppose the probability mass function for the number of projects is given by the table below. Find the expected cost of planning for each number of projects.
458
LONG-TERM WORKFORCE PLANNING
Projects Probability
9 0.02
10 0.05
11 0.1
12 0.2
13 0.35
14 0.15
15 0.13
f) If we want to minimize the expected cost, how many projects should we plan for? g) The regret if we plan for 11 projects and only 10 materialize is the difference between the cost incurred when we plan for 11 projects and 10 materialize and the optimal cost when we plan for exactly 10 projects. In other words, it is a measure of the extent to which we might say, after the fact, "If only I had known that there would only be 10 projects, I would have done these things differently and I would have saved $R." $R is the regret. In this case, if we plan for 11 projects and only 10 materialize, the regret should be $306,500. Compute the regret for every pair of the number of projects for which we plan and the number that materialize. If the objective is to minimize the maximum regret, how many projects should we plan for? How does this differ (if at all) from the result found in part (g)? h) Using the probability mass function shown in part (f), compute the expected regret for each number of projects for which we might plan. How many projects should we plan for if we want to minimize the expected regret? This should be exactly the same as the number you found in part (f). REFERENCES Jessop, B., 2008, "Applying optimization techniques to long-term workforce planning," Undergraduate Honors Research Project, Winter, Mark S. Daskin, Advisor, Department of Industrial Engineering and Management Sciences, Northwestern University, Evanston, IL.
9 PRIORITY SERVICES, CALL CENTER DESIGN, AND CUSTOMER SCHEDULING
"Excuse me! How much longer am I going to have to wait with my son to see a doctor in this crazy emergency room? We have been here for nearly an hour! His throat is very sore and he is nearly in tears. Can't someone see him?" Elizabeth Conner was clearly exasperated and frustrated with the seemingly endless wait for a physician to examine her son. "I am very sorry, Mrs. Conner. I know you care a lot about your son and so do we. Unfortunately, as you probably saw, we had two critically ill patients wheeled in here in the last 30 minutes. All our physicians and nurses are trying desperately to stabilize these two patients. We will get to your son Johnathan as soon as we can, " Amy, the triage nurse, replied. "Can't you do anything for him?" "There really is nothing we can do until a doctor is available. We will call you as soon as someone can see him, Mrs. Conner, " Amy responded firmly.
9.1
EXAMPLES
Queueing problems abound in the service sector. While Chapter 3 provided a basic introduction to queueing models, in this chapter we look at a number of Service Science, by Mark S. Daskin Copyright © 2010 by John Wiley & Sons, Inc
459
460
PRIORITY SERVICES, CALL CENTER DESIGN, A N D CUSTOMER SCHEDULING
applications of queueing theory. Two of these cases require more careful and more in-depth analysis than is possible with the simple models of Chapter 3. Therefore, this chapter introduces concepts of priority queueing and of very large-scale queueing problems. Mrs. Conner and her son encountered priority queueing in the story above. Unfortunately for them, they were the low priority customers. The chapter also discusses customer scheduling issues. To begin, let us remember how the check-in lines for an airline differ from the check-out lines at a grocery store. Is one system inherently more efficient than the other? First, in reality, both systems are fairly complex. In both cases, there are likely to be self-service kiosks that allow customers either to check-in for a flight on their own or to scan their own groceries and to check-out of the grocery store on their own. In addition, both systems will have people to help with the automated process. In most cases, these people hover over four to six kiosks helping customers with the system as needed. Second, both systems will have another set of lines at which customers can be assisted by an airline customer service agent or a grocery cashier. These systems are often segregated into two categories. In the case of airline check-in systems, there are often separate lines for domestic and international passengers. In grocery stores, there are generally separate lines reserved for customers with a small number of items (e.g., 15 or fewer items) while the remaining lines are open to all patrons. It is in the lines served by airline customer service agents or grocery cashiers that the key differences between the two systems are most evident. Most airline check-in facilities have adopted a single line system. Customers needing the assistance of an airline agent in checking in for their flight (e.g., those who want to make changes in their reservations or, at some airlines, those needing to check baggage) form a single line. When they get to the front of the line, they proceed to the first available customer service agent. At most, if not all, grocery stores, however, customers first choose a line and then wait for that particular cashier to be available. Customers must try to guess which line is the shortest line. When one customer enters a line before a second, but the second begins service first, customers perceive a lack of fairness. Larson (1987) terms such occurrences "slips and skips." Slips and skips in the line for service are eliminated by the use of a single line as shown in part (a) of Figure 9.1 as opposed to the multiple line configurations shown in parts (b) and (c) of the figure. Figure 9.2 shows the waiting time in the queue before service for a 24-server system. The mean service time is 1 unit (e.g., 1 minutes) and the utilization ratio—the per server arrival rate divided by the service rate—goes from 0.8 to almost 1. Service times are exponentially distributed and arrivals follow a Poisson distribution. As expected, the waiting time increases as the arrival rate increases. It is important to note, however, that for any utilization level, the waiting time is worse when we have more separate lines for service than when we have fewer (more consolidated) lines. The performance is worst when each server has his or her own line (the 24 lines case). Figure 9.3 shows the ratio of the waiting time with 24, 6, and 3 separate lines to the waiting time with only a single line. The ratio decreases as
461
EXAMPLES
■m (a) Airline System
(b) Grocery System
D
(c) Grocery System with Idle Server
D
Server Customer
(d) Key
Figure 9.1. Schematic of different queueing systems
Figure 9.2. Time in a 24-server queue as a function of the utilization ratio and the number of lines
the utilization ratio increases. While this suggests that the relative performance improves with the utilization level, we need to recall that Figure 9.2 shows that the absolute performance gets much worse as the utilization ratio approaches 1. The key lessons from Figures 9.2 and 9.3 are that performance degrades significantly as the utilization ratio approaches 1, or as the system gets more
462
PRIORITY SERVICES, CALL CENTER DESIGN, A N D CUSTOMER SCHEDULING
Figure 9.3. Relative time in a 24-server queue as a function of the utilization ratio and the number of lines
congested, but that the degree of degradation increases if the system is designed to have separate lines feeding subsets of the servers as opposed to a single line feeding all servers. Thus, not only does the configuration of part (a) of Figure 9.1 eliminate the skip and slip possibility of a customer beginning service before another who arrived earlier, this configuration also results in a smaller average waiting time, when compared to the waiting time of the configuration shown in part (b) of the figure. As a second queueing example, consider the problem of a large parking facility. At some facilities, including one of the large municipal parking garages in Ann Arbor, Michigan, a large sign indicates how many spaces are available. Most garages, however, do not provide this information. As the designer of a garage, one might want to know how many spaces to build so that the probability of the garage being full is less than some specified value. There are a number of ways of addressing this question. If the arrivals are constant over the course of the day—actually an unlikely scenario—then we can apply the steady-state queueing results of Chapter 3. If the arrivals follow a Poisson distribution, the probability that the system is full is given by P(full)=
t
( W
,
(9.1)
7=0
where λ is the arrival rate, l/μ is the mean service time and s is the number of servers. In the case of parking, l/μ is the average time cars spend in the garage and 5 is the number of spaces. Equation (9.1) gives the probability that an incoming customer will not be able to find a place. The problem with this equation is
EXAMPLES
TA B L E 9.1. Maximum number of servers that allow equation (9.1) to be computed in Excel
λ/μ
Max s
2 5 10 25 50 100 125 150
1022 440 308 220 181 154 147 141
that it often cannot be readily computed in Excel since the term (λ/μ)5 grows very rapidly and quickly exceeds the maximum allowable number in Excel. Table 9.1 gives the maximum number of servers that still allow the denominator of (9.1) to be computed in Excel. Note that the range of traffic intensity shown in the table, λΐμ, is actually quite small. For example, at a parking garage in an urban area, the arrival rate might easily be one car per minute or 60 per hour. The average time spent in the garage might be 2.5 hours. This results in a traffic intensity of 150. At that intensity, the maximum number of spaces for which equation (9.1) can be computed is less than the expected number of vehicles in the garage. To circumvent this problem, assuming the desired probability of the system being full is small (as it should be), the distribution of the number of customers in the system is approximately Poisson. We can then approximate the distribution of the number in the system by the normal distribution with a mean of λ/μ and a variance of λΐμ. Therefore, the approximate number of servers (or garage spaces) needed to ensure that the probability of not being able to find a space is less than or equal to a is given by \λ/μ + ζ,_α ■ yfX/μ] = Ceiling ( N o r m i n v ( l - α , λΙμ,^λ[μ),
l).
(9.2)
Table 9.2 compares the estimates obtained from equations (9.1) and (9.2) for a = 0.05 and a - 0.01 for and for a range of traffic intensity values, XIμ. Note that the two estimates tend to be very close to each other and that the approximation in equation (9.2) tends to underestimate the value from the M/G/s queue given by equation (9.1). (The values shown in the table for equation (9.1) were not computed using Excel; rather, they were computed using a stand-alone software program using very high precision arithmetic that allows numbers as large as 104932, carrying 19 or 20 significant digits, as opposed to Excel's limit of approximately 10310.) With these examples as background, the remainder of this chapter deals with two important extensions of the material in Chapter 3. First, in many queueing environments, some customers are given priority over others. For example, in an
464
PRIORITY SERVICES, CALL CENTER DESIGN, AND CUSTOMER SCHEDULING
TABLE 9.2. Comparison of equations (9.1) and (9.2) a = 0.01
a = 0.05 Traffic Intensity
Normal Approx [Equation (9.2)]
Exact [Equation (9.1)]
Normal Approx [Equation (9.2)]
Exact [Equation (9.1)]
25 50 100 250 500 750 1000
34 62 117 277 537 796 1053
35 64 119 279 540 799 1056
37 67 124 287 553 814 1074
39 68 125 289 555 817 1077
emergency room, a patient who arrives in active cardiac arrest will surely be treated before a teenager who fell off her bike and whose arm may be broken. In short, the hospital emergency room uses a (preemptive) priority queue discipline. Many companies now allow customers to pay for premier service. Such customers are given priority at call centers over non-premier customers. Section 9.2 addresses priority queueing problems. Second, many service systems, particularly call service centers, operate with very large numbers of servers and exceptionally large utilization ratios. The customer service representatives are almost always busy. At the same time, the level of service is remarkably high with customers rarely waiting excessive amounts of time. How do such systems manage high utilization ratios and excellent customer service? This is the topic of section 9.3. Section 9.4 discusses scheduling of services with an emphasis on issues related to physician scheduling and scheduling of surgical procedures in an operating room. 9.2
PRIORITY QUEUEING FOR EMERGENCY AND OTHER SERVICES
In Animal Farm, George Orwell wrote that "All animals are equal, but some are more equal than others" (Orwell, 1945). This is true of queueing systems as well: All customers are equal, but some are more equal than others. For example, all passengers on a plane from Chicago to New York are equal in the sense that they all leave Chicago and all arrive in New York. But, some of the passengers are "more equal" in the sense that they are granted priority seating either because they are in first class or business class or because they are "Premier Exec" passengers at the airline or because they are traveling with small children or need additional time in boarding. At hospital emergency rooms, patients in critical condition will be given priority over patients who are less critically ill. Some software companies allow customers to pay for premium service. Such customers are given priority at help lines the firm maintains.
PRIORITY QUEUEING FOR EMERGENCY AND OTHER SERVICES
465
Priority Queueing
Preemptive Queueing
Preemptive Resume
NonPreemptive Queueing
Preemptive Repeat
Figure 9.4. Priority queueing service disciplines
Hospital emergency rooms and call centers may both provide priority service to some patients or customers, but the nature of the priority queue discipline differs in the two cases. Figure 9.4 illustrates the different service disciplines. In a small emergency room, if a critically ill patient arrives, the service to other patients is often interrupted or, in the terminology of queueing theory, it is preempted. The class of preemptive queueing is further subdivided into two subcategories. In some instances, the service to the lower priority customers resumes at the same point at which it left off. This is the class of preemptive resume queueing. In this case, the distribution of the conditional remaining service time after the service resumes will differ from the service time distribution before any service was delivered. For example, if the distribution of the service time is uniformly distributed between 0 and 120 minutes and a customer has already been in service for 40 minutes when his service is pre-empted, the distribution of the remaining service time once service resumes is uniformly distributed between 0 and 80 minutes once service recommences. If, however, the service time distribution is exponentially distributed, then the distribution of the remaining time is still exponentially distributed, with the same parameter and the same mean as the original service time distribution. In other words, if the service time distribution is exponentially distributed with a mean of 30 minutes and a customer has been served for 20 minutes when her service is pre-empted, the distribution of the remaining service time once service recommences is still exponential with a mean of 30 minutes. In other cases, the service must begin anew once the server returns to a preempted customer. This is the preemptive-repeat queueing. In this case, the remaining service time distribution is simply the original service time distribution. All service delivered prior to the preemption is, essentially, lost. Note that if the service time distribution is exponential, the preemptive-resume and preemptive-repeat queue disciplines are identical since the conditional remaining
466
PRIORITY SERVICES, CALL CENTER DESIGN, AND CUSTOMER SCHEDULING
service time in the preemptive-resume case is identical to the original service time distribution, which results in the preemptive-repeat case. At a call center, if a priority customer phones for service and all customer service agents are busy with lower priority customers, the service to those customers is generally not preempted. Rather, the high priority customer must wait until a server becomes available. This is the class of non-preemptive queueing. Our primary focus will be on non-preemptive queueing, as this is the domain for which there are the most results. In all cases, we will consider problems with r different classes of customers. Class 1 customers have the highest priority, then class 2 customers, and so on. Class r customers have the lowest priority.
9.2.1 Single Server, Poisson Arrivals in Each Class, Exponential Service in Each Class with Non-Preemptive Priorities We will begin, as before, with a simple case in which there is a single server serving r classes of customers with a non-preemptive service discipline. Arrivals of customers in each class in a given amount of time occur according to a Poisson process. Specifically, for any class ;', arrivals occur according to a Poisson process with rate X¡. For each class, the service times are exponentially distributed with a mean time for a classy customer of 1/μ;; alternatively, the parameter of the exponential distribution for class j customers is μ,. We denote the class j utilization ratio by p¡ = Α/μ, and the cumulative utilization ratio for classes 1 through / as of = Σ,Ρ*· Recall that we have only a single server and so the number of servers does not affect the class utilization ratios. In this case, we can show that the expected waiting time in the queue prior to service for a class j customer is given by Wj = expected waiting time in the queue for priority / customers ΣΡ*/Α**
(9-3)
(i-'v-.Xl-ff,)' where we define σ0 = 0. The average number of class j customers waiting in the queue is given by Li = average number of class j customers waiting for service !
W-
(9.4)
The average time in the system for a class ; customer is given by W' = average time in the system for a class j customer
J_ W> + ±.
<9-5>
467
PRIORITY QUEUEING FOR EMERGENCY AND OTHER SERVICES
TABLE 9.3. Sample priority queueing results: Single server, Poisson arrivals, exponential service People/Hour Class 1 2 3 4
Arrival Service rate rate 10 15 20 25
75 80 65 70
Mean Wait Mean number in in Number time in Rho/mu Sigma queue in queue system system
Rho 0.133 0.188 0.308 0.357 Numerator
0.002 0.002 0.005 0.005 0.014
0.133 0.321 0.629 0.986 Avg Wait
0.016 0.024 0.055 2.622 0.960
0.161 0.356 1.106 65.542
0.029 0.036 0.071 2.636
0.294 0.543 1.414 65.899
And the average number of class / customers in the system is given by Ώ = k,W¡.
(9.6)
The demand-weighted average time in the system and in the queue waiting for service are given by W:
1W V/'=i
1 r
/ J / V;=i
\
)
and W_
(
r
Σ«
V;=i
λ
!(
r
\
Σ*, )
J 1 W=i
(9.7)
respectively. Table 9.3 displays typical results for this system as well as the key computations. There are four customer classes. The second and third columns give the arrival and service rates for each class. The class utilization ratios are computed in the column labeled Rho. Column 5 is used to compute the numerator of (9.3), which is shown as the sum of the terms in this column, at the bottom of the column. The cumulative utilization ratios, o~, are shown in the next column. Note that they increase, and for the fourth class, the value of σ4 is very close to 1 in this example. The next column, labeled "Wait in queue," uses (9.3) to compute the average waiting time in the queue for each of the four classes of customers. The average waiting time for class 4 is very large—over 2 hours in this case. The values in the last three columns are computed using (9.4), (9.5), and (9.6), respectively. The demand-weighted average waiting time in the queue—given by (9.7)— is also shown at the bottom of the table. Equation (9.3) warrants further examination. Suppose the arrival rate of customer class 2 increases from 15 to 16. First, the numerator will increase from
468
PRIORITY SERVICES, CALL CENTER DESIGN, A N D CUSTOMER SCHEDULING
Figure 9.5. Base case waiting times by class
0.013957 to 0.014114, a 1.12% increase. All waiting times in the queue will increase by at least this amount. The denominator of the waiting time for class 1 customers—in fact any class with a higher priority than that of the class of customers whose arrival rate has changed—does not depend on the arrival or service rates of the class 2 customers. Thus, the class 1 customers experience a 1.12% increase in their average waiting time before service when the class 2 arrival rate increases from 15 to 16 per hour. For classes 2 through 4, the denominator of the average waiting time does depend on the arrival and service rates of the class 2 customers through the σ2, σ3, and o~4 terms. The average waiting time for these customer classes increases by 3.02 percent, 6.6 percent, and 719 percent, respectively. Yes, the new waiting time for class 4 customers has increased by a factor greater than 8 just as a result of the small increase in the arrival rate of a higher priority class of customers. Figure 9.5 and Figure 9.6 illustrate these concepts further. Figure 9.5 plots the waiting time by customer class, as well as the system-wide average waiting time, for a system in which all customer class arrivals are identical and the mean service time is 1 unit. In other words, when the system-wide utilization ratio is 0.6, each of the four customer classes exhibits a class-specific arrival rate of 0.15. While all waiting times increase as the system becomes more congested, the impact on the lower priority customers (those with higher class numbers) is most noticeable. When the system-wide utilization ratio is 0.8, the top priority customers wait only 1 time unit on average, while the lowest priority customers wait 10 time units. Figure 9.6 depicts the impact of increasing the arrival rate of class 3 or class 4 customers on the waiting time of class 4 customers. In each case, the nominal arrival rate was multiplied by 1.5. In other words, when the system-wide utilization ratio is 0.6 for the case in which the arrival rate of class 3 customers was increased, the class-specific arrival rates are 2/15, 2/15, 3/15, and 2/15 for classes 1 through 4, respectively. When the class 4 arrival rate is increased and
469
PRIORITY QUEUEING FOR EMERGENCY AND OTHER SERVICES
Figure 9.6. Impact of increased arrival rates for class 3 and class 4 customers on class 4 waiting time
the system-wide utilization ratio is 0.6, the class-specific arrival rates are 2/15, 2/15, 2/15, and 3/15 respectively. While increasing either arrival rate degrades performance [since the numerator of (9.3) increases], increasing the class 3 arrival rate has a greater impact on the class 4 waiting time than does increasing the class 4 arrival rate. Again, the reason for this is that increases in the class 3 arrival rate reduce both terms—(1 - σ3) and (1 - σ4)—of the denominator of (9.3) for the class 4 waiting time, while increases in the class 4 arrival rate affect only the (1 - σ4) term in the denominator of (9.3). Note that if all service rates are equal (i.e., μ = μχ-μ2 = ... = μΓ), then Wq = ]|Γ X¡W¿ / Σ ^7 = Σ ^jWJ y=i
/
;=i
y=i
/
λ, the weighted average time in the queue over
all customer classes is equal to WM/M/1 = — - — , where λ = V λ,: , μ = μχ = μ2
Λί(ΐ-Ρ)
ΐί
= ... = μη and ρ = λΐμ. However, if μ, * μ, for any two classes i, j , then W * WqM/M/1. This raises the question of who should be served first if we want to minimize the demand-weighted average waiting time: customers in a class with small expected service times or customers in a class with large expected service times. It turns out that the best rule to use is to order the classes in non-decreasing order of the mean service times. In other words, we want μ! > μ2 > ... > μ„ so that the highest priority class should be composed of those customers with the smallest expected service time and the lowest priority customers should be those with the largest expected service time. Table 9.4 and Table 9.5 illustrate this concept. Table 9.4 gives the arrival rates, mean service times, and service rates for three groups of students who want to see a faculty member: undergraduates, M.S. students and Ph.D. students. While there
470
PRIORITY SERVICES, CALL CENTER DESIGN, A N D CUSTOMER SCHEDULING
TABLE 9.4. Example data for setting the priority classes
Class
Arrival Rate
Service Rate
Mean Time
Undergrad M.S. Ph.D.
6 1.5 0.2
12 6 1
5 10 60
TABLE 9.5. Evaluation of all possible class orderings for the inputs of Table 9.4 Class 1
Class 2
Class 3
Ratel
Rate 2
Rate 3
Average wait
Best?
Undergrad Undergrad M.S. M.S. Ph.D. Ph.D.
M.S. Ph.D. Undergrad Ph.D. Undergrad M.S.
Ph.D. M.S. Ph.D. Undergrad M.S. Undergrad
12 12 6 6 1 1
6 1 12 1 12 6
1 6 1 12 6 12
1.47 4.17 1.84 8.12 4.61 8.16
BEST
are a lot of undergraduates, they usually require relatively little time from the faculty member. Often all they need is a signature on a form or to pick up a graded exam or problem set. MS students often take more time as they may need advice on a computer program they are coding or on a thesis. The program has relatively few Ph.D. students, but each one will take an average of an hour of the faculty member's time. Ph.D. students may need extensive career counseling in their final year. In earlier parts of their careers, they need advice on defining a dissertation topic, executing the research, and writing the doctoral thesis. Which student classes should be given priority in such a system? Each of the six possible orderings of the students is evaluated in Table 9.5. As predicted by the discussion above, it is best to order the students in decreasing order of the service rates (or increasing order of the expected service times). In this case, it is best to give the top priority to the undergraduates with a mean service time of 5 minutes, the second highest priority to the M.S. students with a mean service time of 10 minutes, and lowest priority to the Ph.D. students with a mean service time of 1 hour. This discussion, however, assumes that the value of waiting time is the same for all students. While this may be the case for students, it is clearly not the case in other environments. For example, in an emergency room or a doctor's clinic, patients undergo a triage procedure upon arrival. They are classified into one of three different categories: emergency or life-threatening patients for whom immediate treatment may mean the difference between life and death, urgent patients whose condition is not life-threatening, and less urgent patients. Table 9.6 gives hypothetical data on arrival rates, service rates, mean service times, and the value associated with waiting for each of these three patient categories. Using (9.3) to compute the class-specific waiting time and
471
PRIORITY QUEUEING FOR EMERGENCY AND OTHER SERVICES
TABLE 9.6. Example data for setting the priority classes with values of customer waiting time Class
Arrival Rate
Service Rate
Mean Time
Value
Emergency Urgent Less Urgent
0.1 0.25 0.75
0.666667 2 6
90 30 10
100 10 1
TABLE 9.7. Evaluation of all possible class orderings for the inputs of Table 9.6 Class 1
Class 2
Class 3
Emergency Emergency Less Urgent Less Urgent Urgent Urgent
Less Urgent Urgent Emergency Urgent Less Urgent Emergency
Urgent Less Urgent Urgent Emergency Emergency Less Urgent
Rate x Rate x Rate x Average Average value Value 1 Value 2 Value 3 Wait 66.7 66.7 6.0 6.0 20.0 20.0
6.0 20.0 66.7 20.0 6.0 66.7
20.0 6.0 20.0 66.7 66.7 6.0
0.54 0.63 0.45 0.41 0.46 0.61
5.25 4.92 6.27 7.54 7.35 5.70
Best?
BEST
/( ' \ (9.8) / V>=i U=i ) / to compute the demand-weighted average value of waiting time, we obtain the results shown in Table 9.7. In (9.8), c¡ is the cost per unit time of waiting or the value shown in Table 9.6 for customer class /. In this case, it is best to serve the emergency patients first, then the urgent patients and then, when no one else is in the system, to serve the less urgent patients. Note that the average waiting time (unweighted by the value of waiting) for this priority ordering is the largest of all of the six priority orderings. The very high value associated with waiting time for the emergency cases (and, to a lesser degree, for the urgent cases) makes this ordering the best. A general rule is that customer classes should be ranked in decreasing order of Cj^. Customers with a high value of waiting time should be served before those with a lower value of waiting time (the c¡ part of the formula) and those with a high service rate, or small expected service time, should also be served before those with a longer expected service time. The results of Table 9.7 validate this rule. For the emergency patients, cemergm^emergency = 66.67; for the urgent patients, CurgentHurgem = 20.00; and for the less urgent patients, ck tf^less L ■ = 6.00. 'ess urgentt
Σ*,
9.2.2 Single Server, Poisson Arrivals in Each Class, NonExponential Service in Each Class with Non-Preemptive Priorities One of the key limitations of the model described in section 9.2.1 is that the service times must be exponentially distributed. In many cases, this is a poor
472
PRIORITY SERVICES, CALL CENTER DESIGN, A N D CUSTOMER SCHEDULING
assumption. We can show that the average waiting time in the queue for a class j customer when the service times are not exponentially distributed is given by
(99)
"ï-Fsfcî
_ ' λ-Ε[S]) ' k¡Var(S¡) + E2(Si)1 where WQ = 2_, — — ^ = ¿_, —^ ;=i
2
;=i
2
'
and 5/ is a random variable
representing the service time of a class j customer. Figure 9.7 illustrates the impact of variance reduction on the waiting times in a system with three customer classes, each with an arrival rate of 15 customers per hour. The mean service time for each customer class is 1 minute or a rate of 60 per hour. With an arrival rate of 15 per hour and a service rate of 60 per hour, the system-wide utilization ratio is 0.75. The service times for each class follow an Erlang-k distribution, with the same value of k for each customer class. In other words, the service times are all identically distributed. Recall that the variance of an Erlang-k distribution is proportional to Ilk. Each tick mark on the horizontal axis therefore corresponds to a reduction in the variance of \ or a 50% reduction in the standard deviation of the service times. When the service times are exponentially distributed, the mean waiting time of the top priority customers is 1 minute, the mean time for the class 2 customers is 3 minutes, and the mean time for the lowest priority customers is 6 minutes. As the variance is reduced, the waiting times all decrease, as expected. When the variance is 1/64"1 of its original value (a k-value of 64), the waiting times are close to their asymptotic values of \ the times associated with exponential service times. Recall from Chapter 3 that the average waiting time prior to service in an M/D/l queue is half that of an M/M/l queue.
Figure 9.7. Impact of service time variance on waiting times
PRIORITY QUEUEING FOR EMERGENCY AND OTHER SERVICES
473
9.2.3 Priority Service with Poisson Arrivals, Multiple Servers, and Identically Distributed Exponential Service Times When we consider multiple servers, the mathematics quickly becomes intractable unless we impose additional assumptions and restrictions on the model. In this case, we need to assume that the service time distribution is identical for each class j of customers and that the service times are exponentially distributed with μ = μΊ = μ2 = ... = μΓ. In this case, the expected waiting time in the queue for a class / customer is given by W' =
wn
(l-ahl)(l-a.y
where W0 is the expected time until one of the s servers becomes available following the arrival of a new customer. This is simply the probability that the system is busy multiplied by the mean time until a service completion. In other words, W0 - P(wait)(Mean 1 = P(wait)su
-ιΣ!
time until a service completion GIVEN system is busy)
(λ/μγ \ i
su
Wwéi^ s\
= \Pr
(λ/μΥ
su
J_
s'.
su
J_
,(λ/μΥ
su
si and p0=
p0
μ
s\ ¿ U M
ψ{λ[μΙ+(λ/μΥ s\
5μ
^
s/i-A
as in the case of the M/M/s queue, where λ = λχ + λ^ + ... + λ,. Finally, note that the σ terms include the number of servers. Thus, as before, we have σ0 - 0. For class 1, we have σ, = — ; for class 2, σ2 = χμ σ. =
Ψ
= — < 1. χμ
ίμ
, and so on. Clearly,
474
PRIORITY SERVICES, CALL CENTER DESIGN, AND CUSTOMER SCHEDULING
TABLE 9.8. Impact of increasing the number of servers while holding the utilization ratio fixed Waiting Time Class 1
Class 2
Class 3
Average
1.000 0.429 0.252 0.170 0.123
2.000 0.857 0.505 0.340 0.246
6.000 2.571 1.514 1.019 0.739
3.000 1.286 0.757 0.509 0.369
Table 9.8 shows the impact on the customer waiting times for a system with three customer classes. Each class has an arrival rate of 15s customers per hour and an exponential service rate of 60 customers per hour per server. Thus, the utilization ratio is fixed at 0.75. The waiting time for the lowest priority class is 6 times the waiting time of the top priority class, while the time for the intermediate class is twice that of the top priority class. However, as expected, the waiting times decrease dramatically as the number of servers increases. 9.2.4
Preemptive Queueing
In preemptive queueing, as soon as a higher priority (lower class number) customer arrives, the current service for a lower priority customer is interrupted and the higher priority customer is served. Such a queueing discipline might be appropriate for cases in which a professor is meeting with students but is also waiting for a call from the dean of his or her college about whether or not a major grant was funded. If the call comes through during the student meeting, the faculty member is likely to answer the phone and to speak briefly with the dean. Also, as indicated above, in many medical contexts, preemptive queueing may be the appropriate queue discipline. In a small clinic, if a non-critical patient is being treated (e.g., a young girl with a sore throat) when a critical patient arrives (e.g., an older woman complaining of severe chest pain symptomatic of a cardiac arrest), the physician will almost certainly interrupt the treatment of the low priority non-critical patient to care for the more critical patient. For preemptive queueing situations, we need to distinguish between the preemptive-resume case and the preemptive-repeat case. In the preemptiveresume case, the server resumes service to the lower priority customer upon completion of the service to the high priority customer. Thus the additional service time required for the low priority customer depends on how much of the service was completed prior to the preemption by the higher priority customer. In the preemptive-repeat case, if the service to a low priority customer is preempted, the entire service activity must be repeated. Thus, in this case, the distribution of the additional time required to serve the low priority customer
CALL CENTER DESIGN
475
TABLE 9.9. Comparison of queueing with and without preemption Preempt ion Case
No Preemption Case
Class
Arrival Rate/hr
Service Rate/hr
Rho
Sigma
Hours in System
Minutes in System
Minutes in System
1 2 3
20 15 10
60 60 60
0.333 0.250 0.167
0.33 0.58 0.75
0.025 0.060 0.160
1.500 3.600 9.600
2.125 3.700 8.200
following a service interruption is identical to the distribution of the original service time distribution, also as outlined above. Suppose we have a single server queue with r customer classes, as before. The service time distribution is identical for all customer classes and is exponential with mean l/μ. In this case, we can show that the mean total time that a customer of class j spends in the system is given by
Table 9.9 uses (9.10) to compute the expected total time in the system for each of three customer classes. The first five columns give the class, arrival rate, service rate (common for all classes), rho, and sigma for each class. The next two columns use (9.10) to compute the total time in the system in hours and minutes respectively. The final column uses (9.5) to compute the average queueing time for a system without preemption. Without preemption, the expected time in the system for the highest priority customers (lowest class number customers) will always be more than it will be if preemption is permitted. This is simply because without preemption, a newly arrived top priority customer still has to wait for the current customer to compete his or her service; with preemption, the top priority customer begins service immediately unless another top priority customer is being served. Similarly, the time in the system for the lowest priority customers will be greater in the preemption case than it will be in the non-preemption case, when service times are exponentially distributed or in the preemptive-repeat case. In these cases, the service time (effectively) begins anew when the server returns to the lowest priority customer. Thus, his or her time is greater in the preemptive case since the service may have to be repeated several times until it can be completed. 9.3
CALL CENTER DESIGN
Customer call centers, or call centers for short, have been the subject of considerable analysis. Most large firms maintain call centers as points of contact between
476
PRIORITY SERVICES, CALL CENTER DESIGN, AND CUSTOMER SCHEDULING
the firm and its customers. Companies in the mail-order or online ordering business depend critically on call centers for sales and returns. Other companies, including most software firms, provide after-sales support through call centers. For some services, particularly emergency services, a call center is a client's first point of contact with the system. At such systems, an operator quickly assesses the problem, determines the location of the incident, and dispatches the appropriate response team. A typical call center is composed of a large pool of customer service representatives (CSRs) who deal with incoming and outgoing calls. Incoming callers typically want to place orders, handle returns, deal with billing problems, request emergency assistance, and the like. Outgoing call centers are designed to solicit customers for new business. Many financial firms, such as brokerage houses, have outgoing call centers to try to convert smaller customers to customers with larger portfolios or to offer a greater range of services to selected customers. Some charities, including educational institutions, establish call centers for part of the year to collect and solicit donations. For example, many public radio stations devote a few weeks each year to revenue raising activities, most of which are focused around a call center. In addition to the personnel staffing a call center, the center must maintain computers, telecommunication equipment, and software. The software serves two purposes. First, it routes calls to the appropriate CSR. In many cases, the caller is presented with a menu of requests. "For sales, press 1; for product returns, press 2; for product support, press 3; for all other requests, press 4." Based on the customer responses, the routing software determines how to direct the call to an appropriate CSR. Once the CSR and customer are in contact, additional software supports the CSR in providing service to the customer. For example, in the mail order business, the CSR can use the software to look up the customer's order and determine when the product was shipped, the address to which it was shipped, the credit card to which the fees were charged, and so on. Call centers can be either generic, in the sense that all calls require some low level of service and any CSR can handle any call, or they can be skill-based. Many call centers are skill-based. In some cases, different CSRs handle requests from customers in different languages. In other cases, the skills are problem specific. Some CSRs may be trained in sales, while other are designated for returns and billing problems. Some call centers are organized around specific products. For example, a software vendor may have specific CSRs for operating system problems, word processor problems, spreadsheet problems, database management problems, and presentation software problems. In addition, many call centers have multiple layers of CSRs. In such systems, a customer is initially routed to a level 1 CSR. If, after some time, the level 1 CSR cannot resolve the problem, then the customer is routed to a more highly trained level 2 CSR. The higher level CSRs may also have more authority to issue customer refunds and to authorize product returns. Key issues in the design of multi-layered systems include: (a) How many layers should the call center have? (b) How many CSRs should there be in each layer? and (c) What are the protocols and guidelines for passing
CALL CENTER DESIGN
477
a customer to a higher level CSR? These questions are beyond the scope of the analysis outlined below. Some call centers have reduced their need for human CSRs by installing interactive voice response systems. These systems allow the customer to communicate with the system's software using either the touch pad on their phone or by voice. (My own experience suggests that many of the voice recognition programs are not quite ready for prime time. I often simply respond with "Operator" to be placed in touch with a person when the system fails to recognize my voice responses.) For example, many airlines utilize such systems to allow people to determine when a flight will actually depart or arrive. By entering the flight number or similar data (the destination and the approximate scheduled arrival time), the system can let the caller know when the flight will arrive. Many systems now allow patrons to sign up for either e-mail or phone alerts regarding the status of particular flights, further reducing the need to utilize a call center. These systems reduce the need for CSRs. A key question is whether they actually reduce the payroll of the call center or the overall expense of the center. The software acquisition and maintenance costs have to be weighed against the reduction in payroll costs for CSRs. Clearly, call centers can be very complex systems to analyze. The system we will study, however, is a simplification of a real call center. (In fact, as discussed in Chapter 1, all models are abstractions of real systems. Our hope is that, by studying the abstractions, we can learn valuable lessons about the design and operation of their real-world counterparts.) We will begin by ignoring three key features of a call center. In particular, we will assume that all customers require the same sort of service. Therefore, there will only be one class of servers; we will ignore server specialization. Second, we will assume that there are an infinite number of phone lines; in other words, we assume that a caller never receives a busy signal. Finally, we will assume that customers never hang up once they phone the call center; in other words, they wait for service no matter how long the wait is. We will relax some of these assumptions as we proceed. With these assumptions, if customers arrive according to a Poisson process and service times are exponentially distributed, we have an M/M/s queue whose service characteristics we outlined in Chapter 3. Figure 9.8 illustrates the performance of an M/M/s queue as the number of servers, s, increases, holding the utilization ratio, p = Xlsß, constant at 0.95. Beyond 200 servers, the probability of waiting and the average waiting time become negligible. The probability of waiting more that \ of a service time falls below 0.3. Thus, large systems perform very well even at high utilization levels. Another way to see that large systems perform better than smaller systems is to hold the performance metric fixed and to determine how many servers are needed for a given level of offered load. The offered load is the ratio of the arrival rate to the service rate. In other words, the offered load is R = λ/μ. In essence, this is the minimum number of servers needed for steady state (when we use the smallest integer that is strictly larger than the offered load).
478
PRIORITY SERVICES, CALL CENTER DESIGN, AND CUSTOMER SCHEDULING
(b) Prob(Wait) and P(Wait>0.25 Service Times) Figure 9.8. Performance metrics as the number of servers increases holding the utilization ratio equal to 0.95
If there were no economies of scale in queueing systems, we would expect the number of extra servers needed to provide a given level of service to increase linearly with the offered load. In other words, if we need 15 servers to provide a given level of service for an offered load of 10 (5 extra servers), we would expect to need 150 servers for an offered load of 100 (50 extra servers) and 1500 servers for an offered load of 1000 (500 extra servers) to provide the same level of service. Fortunately, the required number of extra servers increases much more slowly than linearly as shown in Figure 9.9. In this figure, we plot the offered load on
CALL CENTER DESIGN
479
Figure 9.9. Number of extra servers needed to provide a given level of service versus the offered load
the horizontal axis and the number of extra servers needed to ensure that the probability of waiting is less than or equal to 0.05 and 0.01 respectively. The figure also shows a power regression line fitted through each of the two lines as light dashed lines. For the case of a probability of waiting equal to 0.05, the number of extra servers needed beyond the offered load is approximated by 2.01Ä04839 (with an R2 value of 0.9993 for the regression). For the case of a probability of waiting of 0.01, the number of extra servers needed is given by 2.665R0M63 (with an R2 value of 0.9997 for the regression). Since the exponent of the offered load in both cases is very close to 0.5, we are tempted to further approximate the number needed by a square root term. If we do so and let the constant term (the 2.01 and 2.665 terms) be given by the value of the cumulative normal distribution such that the probability of the cumulative normal distribution is either 0.95 or 0.99 respectively, we obtain the results shown in Figure 9.10. Figure 9.11 is similar to Figure 9.9 in that it too shows the relationship between the number of extra servers needed to achieve a given probability of waiting versus the offered load. Both the number of extra servers needed (delta) and the offered load (R) are plotted on logarithmic scales. Plotted in this way, we clearly see the relationship between the two quantities. The offered load ranges between 99 and 9900, while the number of extra servers needed goes from a low of 21 (when the offered load is 99 and the probability of waiting is 0.025) to a high of 311 (when the offered load is 9900 and the probability of waiting is 0.001). Converting the regression lines from logarithmic form to standard form, we find the following relationships:
480
PRIORITY SERVICES, CALL CENTER DESIGN, AND CUSTOMER SCHEDULING
Figure 9.10. Approximating the number of extra servers required by the normal approximation. (See color insert)
Figure 9.11. Extra servers needed vs. offered load for three levels of service. (See color insert)
481
CALL CENTER DESIGN
Figure 9.12. Actual state probabilities and normal approximation for a small queue
Δ α025 = 2.099*· 496 Δ α 0 1 = 2.491/?· 496 AÛMl = 3.260RA95
In all cases, the number of extra servers needed grows approximately as the square root of the offered load. But why can we approximate the actual state probabilities, Pn, which are used to compute the probability of waiting ( P(wait) = 1 - ^ P „ ) by the normal distribution? There are several justifications for the use of this approximation. First, consider the state probabilities shown as squares in Figure 9.12 for the case of an arrival rate of 25 per hour, a service rate of 1 per hour, and 35 servers. The actual state probabilities are almost exactly the same as the probabilities obtained from the normal approximation. The approximation is better for larger offered loads (and correspondingly larger numbers of servers). Second, we know that if there were an infinite number of servers, the state probabilities would follow a Poisson distribution with parameter R. Specifically, the probability of there being n customers in the system is given by R"p~R
p =_ — =κ "
... I
(λ/ιιλ"ρ' /μ> „I
{λ/μ)
It is worth noting that this distribution holds for the
482
PRIORITY SERVICES, CALL CENTER DESIGN, AND CUSTOMER SCHEDULING
TABLE 9.10. Example of approximating the probability of waiting with the normal distribution Number of Servers
Z Value (Continuity Correction)
Utilization Ratio
Normal Approx
Exact
130 135 140 145 150 155 160 165 170 175
0.402 0.850 1.297 1.744 2.191 2.639 3.086 3.533 3.980 4.427
0.962 0.926 0.893 0.862 0.833 0.806 0.781 0.758 0.735 0.714
0.3437 0.1977 0.0973 0.0406 0.0142 0.0042 0.0010 0.0002 0.0000 0.0000
0.5548 0.2808 0.1280 0.0520 0.0186 0.0058 0.0016 0.0004 0.0001 0.0000
MIGI°° queue as well as the MIMloo queue; it does not depend on having exponentially distributed service times. We know that if the mean of the Poisson distribution is greater than 30, then the Poisson distribution can be approximated well by the normal distribution. Recall that the mean of the Poisson distribution above is simply R. Thus, if the offered load is more than 30, we can approximate the number of customers in the system (with unlimited capacity) by the normal distribution. With this approximation, we can estimate the probability of waiting by the probability that there are s or more customers in the system. In other words, we can estimate the probability of waiting by
P{wait) = l-o(^3-\
(9.11)
where Φ(ζ) is the standard cumulative normal distribution evaluated at z. For example, consider a system with A = 500 calls per hour and each call takes an average of 15 minutes, meaning that μ = 4. For this system, we have R = 500/4 = 125. Table 9.10 shows how well the normal approximation works in this case. The z-value for the normal distribution includes the continuity correction. In other words, we use z =
j = — . As the number of servers increases, the difference yJR between the probability of waiting as estimated by the normal distribution and the exact value decreases. This seems to suggest that the normal approximation is good only when the utilization ratio is relatively small. In fact, the normal approximation can be used to estimate the number of servers needed to attain a given level of service. In Table 9.11, we vary the arrival rate from 1800 per hour to 1975 per hour, holding the number of CSRs fixed at 500 with a mean service time of 15 minutes. Again, it appears that as the utilization ratio increases, the normal approximation degrades. However, the final column shows that the system
483
CALL CENTER DESIGN
TABLE 9.11. Number of servers needed to attain a given level of service Arrivals Rate
Servers
Utilization Ratio
Z-Value
Normal Approx
Exact
Servers Needed to Obtain Normal Prob (Wait)
1800 1825 1850 1875 1900 1925 1950 1975
500 500 500 500 500 500 500 500
0.9000 0.9125 0.9250 0.9375 0.9500 0.9625 0.9750 0.9875
2.3335 2.0248 1.7205 1.4203 1.1241 0.8319 0.5435 0.2588
0.0098 0.0214 0.0427 0.0778 0.1305 0.2027 0.2934 0.3979
0.0122 0.0266 0.0536 0.1006 0.1770 0.2936 0.4621 0.6940
502 502 503 503 504 505 507 509
TABLE 9.12. The Halfin-Whitt approximation Arrivals Rate
Servers
Utilization Ratio
Normal Approx
Exact
Beta
Halfin-Whitt Aprrox
1800 1825 1850 1875 1900 1925 1950 1975
500 500 500 500 500 500 500 500
0.9000 0.9125 0.9250 0.9375 0.9500 0.9625 0.9750 0.9875
0.0098 0.0214 0.0427 0.0778 0.1305 0.2027 0.2934 0.3979
0.0122 0.0266 0.0536 0.1006 0.1770 0.2936 0.4621 0.6940
2.3570 2.0482 1.7437 1.4434 1.1471 0.8547 0.5661 0.2813
0.0105 0.0238 0.0496 0.0953 0.1708 0.2873 0.4566 0.6906
typically needs only a few more CSRs (or servers) to attain the level of service predicted by the normal approximation. For example, with a utilization ratio of 0.95, the normal approximation estimates a probability of waiting of 0.1305, while the true M/M/500 results show that the value is 0.177. To reduce the probability of waiting to 0.1305, however, we need to add only four CSRs. Thus, the system performance is very sensitive to the number of servers in this regime. For high utilization levels, we can improve on the normal approximation by using an approximation developed by Halfin and Whitt (1981). The probability of waiting in an M/M/s queue (with a large number of servers) is approximated by P{wait) = \l +
βΦ(β) Φ(β)
(9.12)
v — R v — XIu where β — /— = —,—— . Table 9.12 shows the results of this approximation (as well as the value of β) for the examples shown in Table 9.11. The Halfin-Whitt
484
PRIORITY SERVICES, CALL CENTER DESIGN, A N D CUSTOMER SCHEDULING
μ
2μ
3μ
{s~l)M
sß
sß + θ
sß + ΙΘ
sß + W
sß + ΑΘ
Figure 9.13. State transition diagram for an M/M/s queue with reneging or abandonment
approximation does much better than does the simple normal approximation, particularly for large utilization ratios. Most of us have had the experience of being placed on hold for a customer service representative for a very long time, or at least what seems like a very long time. Every minute we hear a recorded message saying, "Your call is important to us. All available customer service representatives are busy with other customers. Please stay on the line and your call will be answered by the first available customer service representative." After several minutes of this message interspersed with soft music, we begin to wonder just how important our call really is to the company in question. Most of us will hang up. We may or may not try back later. Thus, in modeling call centers, it is important to account for customers who hang up or who renege on the queue. The easiest way to model reneging in an M/M/s queue is to assume that the mean time until a customer reneges on the queue is exponentially distributed with parameter Θ. In other words, the mean time until a customer reneges is 1/Θ. Figure 9.13 shows the state transition diagram for this queue. For states 0 through s, the state transition diagram is identical to that of an M/M/s queue. Beyond state s, we need to account for the reneging rate, Θ. In state s + 1, there is one person in the queue and he or she will leave the queue via reneging at rate Θ. In state s + k, there are k people in the queue and the rate at which we go to state s + k - 1 via reneging is k0. It is worth noting that we do not require that the arrival rate, A, be less than the maximum rate at which customers complete service, ςμ, in this system as long as the abandonment or reneging rate is strictly positive. This is true because s/i + k6, the rate at which customers leave the system in state s + k, will be greater than the arrival rate, A, for some value of k, the number of customers waiting in the queue. This means that the infinite state system will attain steady state conditions as long as Θ > 0. Solving for the state probabilities analytically in this system is difficult in general. However, when θ = μ, the state probabilities and the state transition diagram are identical to those of an MIMI<*> queue. In particular, for θ = μ, the probability of the system being in state n is Poisson and is given by (λΙιΔηβ~{λΙμ) p -v /μ) As before, if λ/μ is large enough (e.g., over 30), the Poisson n\ distribution can be approximated very well by the normal distribution. This lends further support for the use of the normal approximation or an approximation similar to it.
CALL CENTER DESIGN
485
486
PRIORITY SERVICES, CALL CENTER DESIGN, AND CUSTOMER SCHEDULING
487
CALL CENTER DESIGN
The normal approximation to the probability of waiting and the Halfin-Whitt approximation do not consider reneging or abandonment from the queue. In fact, both models predict that the probability of waiting is 1 if the arrival rate exceeds the maximum rate at which customers are served; that is, if λ > sß. As discussed above, when customers abandon the queue at any positive rate, we can have λ>ςμ because the abandonment rate will ensure that steady-state conditions can be computed. Fortunately, Garnett, Mandelbaum, and Reiman (2002) have developed an approximation of the probability of waiting that accounts for abandonment. They show that the probability of waiting is given (approximately) by P{wait) = \\ + ^--—v
>\ ,
(9.14)
, , . φ(χ) s-R s-λ/μ 0 where n(x) = -— and p= ¡— = r—— , as before. Note that p may be less than 0 if the offered load, λ/μ, exceeds the number of servers, s.
488
PRIORITY SERVICES, CALL CENTER DESIGN, AND CUSTOMER SCHEDULING
CALL CENTER DESIGN
489
At this point, we have three approximations for the probability of waiting: (a) the normal approximation of (9.11), (b) the Halfin-Whitt (HW) approximation of (9.12), and (c) the Garnett, Mandelbaum, Reiman (GMR) approximation of (9.14). There are important differences between these approximations. The first two fail to account for abandonments while the third assumes that the abandonment rate is positive. In addition, the first two approximations apply only when s > XIμ, while the GMR approximation relaxes this assumption as long as the abandonment or reneging rate is strictly positive. Table 9.13 identifies which approximation is closest to the true probability of waiting as computed using the approach outlined in Figure 9.14. The arrival rate was set at 400 per hour and the service rate was 1 per hour. The abandonment rate was set to 0.25,1, 4, and 16, corresponding to the four columns of the table. Recall that θ/μ is the ratio of the abandonment rate to the service rate; alternatively, it is the ratio of the mean service time to the mean reneging time.
490
PRIORITY SERVICES, CALL CENTER DESIGN, AND CUSTOMER SCHEDULING
TABLE 9.13. Best approximation as a function of beta and theta/mu
Theta/Mu Beta
0.25
1
4
14
-2.0 -1.5 -1.0 -0.5
GMR GMR GMR GMR GMR GMR GMR
GMR GMR GMR GMR GMR NGMR NGMR NGMR
GMR GMR GMR GMR GMR GMR GMR GMR GMR
GMR GMR GMR GMR GMR GMR GMR GMR GMR
0.0 0.5 1.0 1.5 2.0
HW HW
HW
The number of servers varied from 360 to 440 in increments of 10. When there were 360 servers, ß = - 2 ; with 400 servers, ß=0; and when there were 440 servers, ß = 2. Finally, the maximum number of customers allowed in the system was 2000, which was always more than enough to ensure that the probability of a customer receiving a busy signal (arriving when the system is full) was negligibly small. When ß < 0, the normal and HW approximations do not apply; they suggest that the probability of waiting is 1. Therefore, for any abandonment rate, the GMR approximation of (9.14) is the best approximation whenever ß < 0. For larger values of ß, the GMR approximation is still often the best approximation. Note, however, that when θ/μ = 1 (or equivalently, when θ = μ), the normal approximation does as well as the GMR approximation. This is not surprising since, when θ = μ, the state probabilities follow a Poisson distribution, which can be approximated very well by the normal distribution for R = λΐμ = 400. Also note that for very large values of β, the HW approximation is better than the GMR and normal approximations. The spreadsheet approach outlined in Figure 9.14 can also be used to evaluate the impact of a limited number of phone lines for waiting callers. All we need to do is to set the maximum number in the system to the total number of phone lines. In this case, there will be a significant number of callers who receive a busy signal. For example, with an arrival rate of 10 per hour, a service rate of one per hour, an abandonment rate of two per hour, 10 servers and 12 total phone lines, the probability of waiting is 0.301 and the probability of finding all 12 lines busy is 0.0978. Thus, about 30 percent of the arriving callers have to wait for a CSR and slightly less than one in 10 arriving callers receives a busy signal. Finally, we can readily simulate such systems in Excel. Figure 9.16 shows the average time in the system and the average waiting time for a system with an arrival rate of eight people per hour, a mean service time of 1 hour, a mean time to abandon the queue of 30 minutes, five servers, and a maximum of 10 customers in the system at any time. Note that the observed average times, shown as solid lines, converge to the theoretical values which are shown as dashed lines. Figure 9.17
CALL CENTER DESIGN
491
Figure 9.16. Example simulation results: Total time and waiting time. (See color insert)
Figure 9.17. Example simulation results: P(abandon), P(busy), P(wait). (See color insert)
492
PRIORITY SERVICES, CALL CENTER DESIGN, AND CUSTOMER SCHEDULING
shows the probability of abandoning the system, the probability of finding the system full and receiving a busy signal, and the probability of waiting for this system. Again, the observed averages converge to the theoretical values, as expected. Halfin and Whitt (1981), Garnett, Mandelbaum, and Reiman (2002), Koole and Mandelbaum (2002), and Whitt (2007) provide additional details on these models. The reader is encouraged to consult these references for additional information. For example, Whitt (2007) shows that the peak number of busy servers in a time-dependent service system operating in a heavy traffic regime occurs after the peak in the arrival rate. This suggests that the peak staffing level should occur at a point in time after the peak arrival rate. See Numerical model with abandonment.xls in the online appendix.
9.4
SCHEDULING IN SERVICES
One of the key ways to improve the delivery of services is to schedule the delivery times of the services. Perhaps nowhere is the benefit of this more apparent than in the delivery of public transport services. In most urban areas, while there may be a schedule for bus arrivals, the actual arrivals vary significantly about the scheduled time. The variability is sufficiently great in many cases, that passengers simply ignore the schedule and treat the arrivals as if they were random. Fixed rail transit systems, however, typically have their own right of way and, as such, are less vulnerable to local traffic conditions. Such systems are able to adhere to the posted schedule very well. Consequently, passengers typically time their arrivals at the train station or trolley stop to coincide with the scheduled arrival time of the train or trolley. My wife often speaks of taking the 8:04 or the 8:14 train to work. She knows that the trains will be at our local station very close to the scheduled time and she can plan her morning accordingly. In this subsection, we outline two health care examples of scheduling. The first deals with scheduling patients to see a single physician. The second deals with scheduling surgical procedures.
9.4.1
Patient Scheduling at a Physician's Office
We begin by considering how a single physician should schedule patients. This problem occurs in many contexts. For example, a recent senior design project at Northwestern University dealt with scheduling surgeons to see patients. While there were roughly half a dozen surgeons who shared office space, each operated autonomously. Each had his or her own nursing staff and his or her own dedicated exam rooms. Schedules for each surgeon were maintained separately. Because of the differing nature of the surgical procedures practiced by the physicians, the average time spent with the patients in pre-surgical consults and post-surgical
SCHEDULING IN SERVICES
493
follow-up exams differed significantly as well. Many internists also work in similar settings. The key objectives in the design of such a system are (1) minimization of the patient waiting times, (2) minimization of the idle time of the physicians, and (3) maximization of the utilization of the exam rooms. Of the three, the second objective—minimizing the physician's idle time—is often of paramount importance to physicians. As is the case for many fee-for-service providers, idle time is time that cannot be billed. The key decisions faced by a physician and his or her staff in the design of such a system include (1) what should the time be between scheduled patient arrivals, (2) how many exam rooms should the physician maintain, and (3) how many patients should the physician schedule for the first appointment time of the day. While it may seem obvious that the physician should only schedule one appointment at the beginning of the day, in fact one commonly used rule calls for multiple appointments to be scheduled at the beginning of each day. In addition to the objectives and the design parameters of the office, we need to characterize the patient behavior and the uncertain elements of the process. First, patients may arrive a bit early or late for a scheduled appointment. In the simulation model whose results are presented below, we assume that patients arrive at a time that is uniformly distributed between ARRIVE,ow minutes before the scheduled time and ARRIVE hi minutes after the scheduled time. Patient waiting times are measured in terms of the time between when a patient enters an exam room and the larger of (a) the patient's scheduled exam time and (b) the patient's actual arrival time. Thus, patients who arrive early experience a negative waiting time if an exam room is available. On the other hand, a patient scheduled for a 2:00 P.M. appointment, who arrives at 2:03 and who is ushered into an exam room at 2:11 is assigned a waiting time of only 8 minutes (rather than 11 minutes). Also, if the same patient arrived at 1:56 for her 2:00 appointment, the waiting time would be 11 minutes if she entered the examination room at 2:11 (rather than 15 minutes). Once in the exam room, a patient must change into an exam gown. This time is also a random variable uniformly distributed between GOWNiow and GOWNhi. The actual examination times are also uniformly distributed between EXAMlm and EXAMhi. Following the examination, the patient must again get dressed. This time is also modeled as being uniformly distributed between DRESStow and DRESShi. Finally, after the departure of the patient, the nursing staff must prepare the room for the next patient. This time is also modeled as a uniform random variable between READYlow and READY\¡. There are several assumptions built into the model outlined below. First, patients are seen in a first-come-first-served manner. In other words, we do not model patients with different priorities. For scheduled appointments, this is not a serious limitation to the model since scheduled patients are rarely emergent. Second, we assume that the patient can immediately notify the physician when he or she has changed into a gown. There is no additional idle time, if the patient is the next to be seen and if the physician is available. Third, we assume that the additional staff is sufficient to clean and prepare the room as soon as a patient
494
PRIORITY SERVICES, CALL CENTER DESIGN, AND CUSTOMER SCHEDULING
leaves. In other words, we do not explicitly model the room as a "customer" waiting to be "served" (meaning cleaned) by one of the nurses following a patient departure. The room never has to "wait" for this service. The first-come-firstserved rule also applies to the assignment of patients to rooms. If the variability of patient arrival times about the scheduled time is large relative to the interval between patient appointments, a patient scheduled for a later appointment may actually arrive before an earlier-scheduled patient. In this case, the model delays the patient with the later-scheduled appointment until the earlier patient arrives before allowing the earlier-arriving patient to enter an exam room. While these assumptions may be a bit unrealistic, for most systems they should not be overly stringent. For reasonable parameter settings, we should still be able to explore the broad implications of alternative system designs and scheduling policies on the key performance metrics. Table 9.14 gives the base case parameters for the simulation. The doctor schedules patients from 8 A.M. until 4 P.M. Patients are scheduled every 20 minutes, resulting in 24 patients per day, since no patient is scheduled at 4 P.M. A total of 4000 patient arrivals are simulated, or between 166 and 167 days of operation at the physician's office. The system starts in the "empty and idle" state at 8 A.M. every morning. Table 9.15 and Figure 9.18 show the results of two realizations of the simulation model. The average waiting time per patient is roughly 13 minutes. Patient delays propagate throughout the day. The last few patients of the day typically wait more than 20 minutes. Also, the average idle time per day for the physician
TABLE 9.14. Base case parameters for patient scheduling example
Begin Day (hr) Schedule Every X Min End Day (hr) Number at First Appt Number per Day Number of Exam Rooms
8 20 16 1 24 2
(a) System Design and Operating Condition Parameters Patient Arrival To Gown Exam Dress Ready Total
Low
High
Avg
Var
StDev
-5 3 10 2 1
5 5 30 4 3
0 4 20 3 2 29
8.33 0.33 33.33 0.33 0.33 42.67
2.89 0.58 5.77 0.58 0.58 6.53
(b) Random Variable Parameters
SCHEDULING IN SERVICES
495
TABLE 9.15. Sample results for base case inputs
Average Minimum Maximum
Wait for Room
Wait for Doc
Total
Doc Idle
Total Doc Idle Min/Day
5.42 -5 73
7.57 0 24
13.00 -5 85
1.13 0 19
27.03
Results correspond to the first example in Figure 9.18.
(b) Realization 2: Average Total Daily Idle Time = 26.39 minutes Figure 9.18. Two sample base case realizations. (See color insert)
is on the order of 25 minutes or more. Five minutes of the physician idle time is attributable to the first patient, since (1) the first patient of the day is never permitted to enter an exam room until the office opens at 8 A.M. and (2) the physician has to wait for the patient to change into an examination gown. Having close to half an hour of idle time might be unacceptable to many physicians. Therefore, many have adopted the Bailey-Welch (Bailey and Welch, 1952) rule that recommends scheduling two patients at the beginning of the day
496
PRIORITY SERVICES, CALL CENTER DESIGN, AND CUSTOMER SCHEDULING
TABLE 9.16. Sample resu Its for Bailey-Welch rule
Average Minimum Maximum
Wait for Room
Wait for Doc
Total
Doc Idle
Total Doc Idle Min/Day
12.51 -5 95
9.83 0 32
22.34 -5 111
0.48 0 17
11.95
Results correspond to the first example in Figure 9.19.
(b) Realization 2: Average Total Daily Idle Time= 13.41 minutes Figure 9.19. Two sample realizations using the Bailey-Welch rule. (See color insert)
and scheduling subsequent patients at a time interval equal to the mean time the physician spends with each patient. Table 9.16 and Figure 9.19 show sample results of applying the Bailey-Welch rule. To model this system, all we need to do is to change the number of patients scheduled at the beginning of the day from one to two. This results in 25 patients per day and exactly 160 simulated days.The Bailey-Welch rule has indeed reduced the physician's idle time by about a factor of 2. The average patient waiting time, however, has increased from
497
SCHEDULING IN SERVICES
TABLE 9.17. Sample results from scheduling patients with 2 minutes of expected slack between patient arrivals
Average Minimum Maximum
Wait for Room
Wait for Doc
Total
Doc Idle
Total Doc Idle Min/Day
-0.29 -5 36
4.63 0 24
4.34 -5 47
2.37 0 22
56.98
Results correspond to the first example in Figure 9.20.
roughly 13 minutes to over 22 minutes. Thus, saving about 15 minutes of a physician's time results in an additional delay of 225 minutes of waiting time spread over 25 patients. Also, patients later in the day now incur a delay of close to 30 minutes as delays continue to propagate throughout the day. In both the base case and the Bailey-Welch examples, delays increased throughout the day. Many of us have experienced this phenomenon at a doctor's office. We have learned that it is best to schedule an appointment early in the day. Table 9.17 and Figure 9.20 show sample results of scheduling patients at 22 minute intervals, as opposed to 20 minute intervals. To make the simulation fair, we allowed patients to be scheduled until 5 P.M. so that 24 patients would again be scheduled each day, as in the base case. Twenty minutes corresponds to the average time a physician spends with a patient, while 22 minutes corresponds to the 60th percentile of the exam times; 40 percent of the patients will require more than the scheduled time. The average idle time has now increased from about 27 minutes to 57 minutes. This is not surprising since we are introducing 2 minutes of expected slack time per patient. While we might expect this to add 48 minutes (2 minutes times 24 patients) of idle time, over 1/3 of this time is used to allow the physician to catch up on delays incurred earlier in the day. The average waiting time per patient has decreased from 13 minutes to less than 5 minutes. In other words, 30 additional minutes of idle time for the physician result in a savings of over 192 minutes of saved patient waiting time spread over 24 patients. In addition, delays tend not to propagate throughout the day. By about the tenth patient, the average delay per patient has stabilized about its maximum value of about 5 or 6 minutes. Some of the delays that would have been propagated to subsequent patients as a result of a long exam time are now absorbed by the built-in slack between patients. Most physicians would not, however, be happy with nearly an hour of idle time waiting for patients. Finally, it is worth asking how many exam rooms a physician should utilize in parallel. Much of the answer to this can be found by comparing the mean time per patient to the mean total time an exam room will be busy serving a patient, including the time it takes a patient to change into and out of his or her clothes
498
PRIORITY SERVICES, CALL CENTER DESIGN, AND CUSTOMER SCHEDULING
(b) Realization 2: Average Total Daily Idle Time = 56.99 (Legend is Common to Figures 9.18 through 9.20) Figure 9.20. Sample simulation realizations from scheduling with 2 minutes of expected slack between patient arrivals. (See color insert)
and the time it takes the staff to prepare the room for the next patient. Let E be the average exam time and T be the average total time. If the physician utilized only one room, he or she would be idle an average of T - E for each patient. To reduce this time, the physician should try to do something useful while one patient is changing and the room is being prepared for the next patient. To do so, the physician should have another patient available to be seen. Therefore, the minimum number of examination rooms that should be utilized to eliminate this idle time, to the extent possible, is given by \ΤΙΕ\ where [x~\ is the smallest integer greater than or equal to x. In the unlikely event that the scheduled time between patient arrivals exceeds T, then only one room is needed.
See Patient Room Doctor Simulation.xls in t h e o n l i n e appendix.
SCHEDULING IN SERVICES
9.4.2
499
Operating Room Scheduling
Section 9.2 showed that priority should be given to customers with large values of time and short expected processing times. This is known as the ομ rule. The objective underlying this rule is to minimize the weighted value of the customers' waiting times. Section 9.4.1 discussed the benefits of using scheduling as opposed to letting customers arrive randomly. Using a schedule can significantly reduce customer waiting times if (a) the customers adhere to the schedule and (b) the service providers are available for the customers at the scheduled times. In the example we analyzed, all patients were characterized by identical probability distributions for their exam times, adherence to the schedule, changing times, and so on. The goals were to find a schedule that minimized the average patient waiting time and the physician's idle time. As expected, no single schedule could optimize both objectives; tradeoffs must be made. In this section, we explore a related, but different, topic. In this case, each patient has his or her own unique service time distribution. Patients are indifferent with respect to the scheduled time, but should (ideally) not be kept waiting. In addition, we would like to avoid idle time for the physicians and staff. Such a situation arises in the scheduling of surgical procedures. By and large, patients are indifferent between different times of the day for their surgery, but they do not want to be told that the surgery will be at 11 in the morning, only to find that the procedure has been delayed until 4:30 in the afternoon. Similarly, the staff do not want to start the day thinking that there are only 6 hours of procedures scheduled so that they should be finished by mid-afternoon, only to find that they are still in the operating room at 7:30 in the evening. Such delays can occur for two reasons: First, there may be a lot of downtime built into the schedule, causing the final surgery of the day to begin at 4 in the afternoon. Alternatively, some of the early procedures may exceed their scheduled times, introducing delays in subsequent procedures. In short, there is a tradeoff between building a lot of slack into the schedule, resulting in a very long planned day, and having too little slack, causing delays to patients later in the day. Again, to analyze this problem, we can build a simulation model. The model simulates 1000 days of surgery in a single surgical suite. Each day, five surgeries are planned and each of the five surgeries has its own average duration. The actual duration of a procedure follows an Erlang-k distribution. Recall that the mean time of an Erlang-k distribution is ί/μ, while the variance is l/(kß2). Thus, the standard deviation of the distribution goes down with V/fc. An Erlang-1 distribution is the exponential distribution for which the mean and standard deviation are identical; an Erlang-4 distribution will have the same mean but the standard deviation will be half that of the exponential or Erlang-1 distribution. The key decision variables are (1) the order in which the surgeries should be scheduled and (2) how much slack time to build into the schedule between surgeries. In particular, the model is designed so that a single "policy" variable
500
PRIORITY SERVICES, CALL CENTER DESIGN, AND CUSTOMER SCHEDULING
TABLE 9.18. Impact of the policy input on scheduled surgical times for a 2-hour procedure Policy Erlang
Average
Std. Dev.
0
0.5
1
1 4 9 16 25
2 2 2 2 2
2.00 1.00 0.67 0.50 0.40
2 2 2 2 2
3.00 2.50 2.33 2.25 2.20
4.00 3.00 2.67 2.50 2.40
specifies the slack between all surgical procedures. The policy variable gives the number of standard deviations of extra time scheduled for each surgery above and beyond the average time. Table 9.18 shows the impact of both the parameter of the Erlang-k distribution and the policy input on the scheduled duration of a procedure with a 2-hour expected time. In all cases, if the policy input is 0, the procedure is scheduled for exactly the average time, 2 hours. If the policy input is 1, then one additional standard deviation is added to the scheduled time. For an Erlang-1 distribution, the standard deviation is 2 hours and so the procedure with a 2-hour average is allotted 4 hours in the schedule. If the duration of the procedure follows an Erlang-16 distribution, the standard deviation is only 30 minutes and so the procedure is allotted 2.5 hours in the schedule. If the policy input is 0.5, then half a standard deviation is added to the mean in determining the allotted scheduled time for the procedure. The first procedure is always scheduled at time 0. The first procedure is assumed to start on time, at time 0. (In fact, one of the major problems that many operating rooms face is that the first surgery of the day is often delayed significantly causing further delays later in the day. For the purposes of this simulation, however, we will ignore this problem.) The earliest time that the second procedure can start is its scheduled time, but it cannot start until the previous procedure has finished. We are including any time needed to clean and sterilize the operating room for a subsequent patient in the time of the previous patient. In other words, the cleaning time is not explicitly modeled in this simulation model, though it could easily be added to the model. The base case entails five surgical procedures, each with a mean duration of 1.5 hours. The procedures differ in the k-value of their Erlang distributions, or equivalently in the standard deviation of the time for the procedure. The k-values are 1, 4, 9,16, and 25, resulting in standard deviations of 90, 45, 30, 22.5, and 18 minutes. Figure 9.21 shows the key results when the procedures are scheduled in order of decreasing standard deviation, so that the procedure with a 90-minute standard deviation is scheduled first and the one with an 18-minute standard deviation is
SCHEDULING IN SERVICES
501
Figure 9.21. Overtime and delay vs. the policy when procedures are scheduled in order of decreasing standard deviation
scheduled last. Two outputs are shown. First, the figure plots the delay, which is the average over all 1000 simulated days of the total delay to all five procedures. As more slack is built into the schedule—that is, as the policy number increases— the delay decreases because it is less and less likely that a procedure will not be able to start at its scheduled time. The second output is the overtime, which is the difference between the time the last procedure of the day finishes and the sum of the expected times of the five procedures, or 7.5 hours. Thus, if the last procedure ends at time 9 in the simulation, the overtime is 1.5 = 9 - 7.5 hours. The overtime increases as more and more slack is built into the schedule, as expected. Clearly, there is a tradeoff between delay to the patients and overtime on the part of the staff. Figure 9.22 plots the overtime and delay as a function of the policy or the amount of slack built into the schedule when procedures are scheduled in increasing order of the standard deviation of the procedure time. While the shape of each curve is similar to its corresponding curve in Figure 9.21, ordering procedures in increasing order of the standard deviation reduces the average delay and the average overtime in all cases, except for the overtime when the policy input was 0, meaning that no slack time was incorporated into the schedule. The difference in overtime here is under 10 minutes, which is very small compared to the differences in excess of 1 hour when the policy is to add one or more standard deviations to the average time. In short, scheduling surgical procedures in increasing order of the standard deviation of the procedure improves schedule adherence, thereby reducing patient delays and staff overtime. Dentón, Viapiano, and Vogl (2007) found similar results in a study of operating room sequencing and scheduling methods. The
502
PRIORITY SERVICES, CALL CENTER DESIGN, A N D CUSTOMER SCHEDULING
Figure 9.22. Overtime and delay vs. the policy when procedures are scheduled in order of increasing standard deviation
reader interested in other related studies of medical scheduling should also consult Burke et al., (2004), Carter and Lapierre (2001), Dentón et al. (2006), Dentón et al. (2010), Green, Savin, and Wang (2006), Ho and Lau (1992), Iser, Dentón, and King (2008), Kaandorp and Koole (2007), and Muthuraman and Lawley (2008), to list only a small portion of the now growing literature in this field. Erdogan and Dentón (2009) and Gupta and Dentón (2008) provide recent reviews of appointment scheduling in health care and surgical scheduling, respectively.
See OR Scheduling example with 5 surgeries.xls in the online appendix.
9.5
SUMMARY
In this chapter, we explored two important extensions to the classical queueing models of Chapter 3. Priority queueing is critical in service systems. Service operators often want to provide priority service to some customers (e.g., first class passengers boarding an aircraft or emergency patients). Section 9.2 examined queues with priorities. Most of the results that we obtained were for the case of non-preemptive queueing, meaning that even when a higher priority
SUMMARY
503
customer arrives, the customer currently being served finishes his or her service. Preemptive queueing means that the arrival of a higher priority customer interrupts the service of a lower priority customer. In that case, we distinguished between two cases: In some cases, the lower priority customer resumes service at the point at which the service was interrupted; in other cases, the service to the lower priority customer must begin anew. The first case is the preemptiveresume case while the second is the preemptive-repeat case. We noted that if the service times are exponentially distributed, the two preemptive cases are identical. In all cases, we found that an increase in the arrival rate of a medium priority customer (e.g., a priority 2 customer) had relatively little impact on the performance of the queue vis-à-vis the higher priority customers (e.g., the priority 1 customers) but did affect the performance of the queue for the customer class whose arrival rate increased. The performance of the queue for lower priority customer classes (e.g., priority 3 and higher customers) was significantly degraded by the increase in the arrival rate of the medium priority customer class. Section 9.3 examined call center design issues and queueing models in which the arrival rate is very close to the maximum rate at which customers depart from the system. We showed that queueing systems exhibit economies of scale in the sense that the number of extra servers needed to ensure a given level of service beyond the number needed for steady state conditions increases slowly with the offered load. In particular, the number of extra servers needed to ensure that the probability of waiting is a given (small) value, grows approximately as the square root of the offered load. This suggests that large systems, such as call centers with large arrival rates, can operate at very high levels of service and still maintain very high utilization levels. In call center design, it is important to account for reneging or abandonment on the part of customers since most customers will eventually hang up if their call is not answered in a reasonable amount of time. When we account for abandonment, we no longer require that the arrival rate be less than the maximum rate at which customers depart from the system following the completion of service since some customers will depart from the system in frustration without being served. Section 9.4 discussed scheduling issues with a particular emphasis on health care problems. In section 9.4.1, we discussed scheduling patients at a single physician's office with the twin goals of minimizing the physician's idle time and minimizing the patient's waiting time. We found that the often-used Bailey-Welch rule is effective at minimizing the physician's idle time, but that it does so at the expense of patient waiting time, when compared to other policies that strike a more equitable balance between the patient's time and that of the physician. In section 9.4.2, we summarized the findings from a simple simulation model of operating room scheduling. We found that scheduling surgical procedures in increasing order of the variance or standard
504
PRIORITY SERVICES, CALL CENTER DESIGN, AND CUSTOMER SCHEDULING
deviation of the procedures is an effective way of reducing the propagation of delays during the day. We have just scratched the surface of applications of queueing theory and simulation to services. Many service systems can be thought of as systems of queues. Patients flow from registration, to an outpatient waiting room, to a changing room, and then to an exam room. At each state they wait for the available people and physical resources. They then wait for a physician. Next, they wait for a changing room again before leaving a clinic for an outpatient procedure. A request for an inter-library loan goes from the librarian at the local library to a central processing site. The request is then validated and the lending library is asked to pull the book. That request waits in a queue until other similar requests are received, perhaps near the end of the day. The request is processed and the central facility is notified that the book is ready for pickup. The next day a vehicle is routed to the lending library to obtain the book, which is returned to the central facility. The next day, the book is delivered to the library of the borrower. The request for the inter-library loan may be subject to delays at any point in the process. Each of these processes can be analyzed and often improved through the use of queueing theory and simulation modeling.
9.6
PROBLEMS
1. Consider a grocery store in which customers arrive at the checkout counters at a rate of 54 per hour. The service times are exponentially distributed with a mean of 3 minutes. There are three checkout lines. Compare the average waiting time in the queue before service for (a) a system in which there is only one line and the person at the front of the line goes to the first available cashier and (b) a system in which the arrival rate for each server is 18, or 1/3 of the system-wide arrival rate. Give the expected waiting time in minutes. Which system is better? 2. This problem is somewhat challenging. Read the entire problem. Even if you cannot develop the spreadsheet simulation, you should be able to use your intuition to approximately plot the graphs requested in parts (e), (f), and (g). Develop an Excel-based simulation of a single elevator. We will model only passengers going from the ground floor (e.g., a lobby floor of a hotel or the lobby of a large office building) to one of the upper floors. In particular, we will assume that once the elevator reaches the top floor of any of the onboard passengers and unloads those passengers, the elevator can return to the ground floor without stopping. This model might approximate the performance of an elevator at a major hotel immediately after a plenary talk (on the lobby floor) ends and hotel guests want to return to their rooms prior to their dinner engagements. The key inputs to the problem should include:
PROBLEMS
505
• The number of floors in the building above the lobby. • The travel time of the elevator between floors (in seconds). Assume that this time per floor is constant no matter how many floors are being traversed. In other words, we will ignore the effects of acceleration and deceleration of the elevator on the travel times between floors. • The time to open and close the doors of the elevator (in seconds) even if no one alights. • The additional time per person when they are boarding the elevator (in seconds). • The additional time per person when they are alighting from the elevator (in seconds). ■ The number of passenger arrivals per minute. • And in later parts of the problem, the capacity of the elevator (in people). a) Begin by setting the first column of a spreadsheet to be the passenger number. Simulate 5000 passenger arrivals. b) The second column should be the arrival time of the passenger. The first passenger will arrive at a time that is exponentially distributed after time 0, since we are assuming Poisson arrivals. The arrival time of this passenger (in seconds) is given by '-LN(RANDQ)/ ARRIVALSperSECOND.' ARRIVALSperSECOND is the arrival rate per minute divided by 60 seconds per minute. The inter-arrival times of all other passengers are computed similarly. c) Assign each arriving passenger a destination floor, which should be uniformly distributed between 1 and the maximum number of floors in the building. To do this, use the RANDBETWEEN function of Excel. d) With this as a start, you will also need to compute the departure time of the elevator for each passenger, the time the elevator arrives back at the ground floor, the waiting time per passenger, the number of passengers on board when the elevator leaves the ground floor, the top floor to which the elevator travels each time it departs from the ground floor, and the number of stops the elevator makes. You may find it useful to keep track of the number of passengers going to each floor as passengers accumulated on the ground floor prior to a departure. Assume that the elevator takes the first person when he or she arrives (so that there is no waiting time for the first person). Assume initially that there is no capacity limit and that the elevator can take as many passengers as are waiting when it gets back to the ground floor. e) Consider a building with 10 floors above the ground level, an arrival rate of six passengers per minute, a floor-to-floor travel time of 2 seconds, 5 seconds required to open and close the doors even if no one gets on or off, 1 second per person to board, and 3 seconds per person to alight.
506
PRIORITY SERVICES, CALL CENTER DESIGN, AND CUSTOMER SCHEDULING
Plot the waiting time for each passenger versus the passenger number for passengers 1 through 2500. What is the average waiting time? f) Now suppose the arrival rate is 12 passengers per minute. Again, plot the waiting time per passenger versus the passenger number. What is the average waiting time now? g) Now, build the elevator capacity into the model. Suppose the capacity is 20 passengers. Repeat part (e). Do this several times to get a qualitative feel for what the graph looks like. Now increase the arrival rate to seven per minute. Again, generate the graph several times to see qualitatively what it looks like. Finally, try arrival rates of 8, 9,10,11, and 12 to see what happens in those cases. At what point does the system seem to become unstable in the sense that subsequent passengers wait longer and longer? h) How does the maximum number of floors impact the results? Discuss this qualitatively. 3. For the elevator problem discussed in problem 2, we can readily compute the standard deviation of the passenger waiting times using the STDEV function in Excel. In general, we would then use this to compute the standard deviation of the mean waiting time as the standard deviation of the individual passenger times divided by the square root of the number of passengers being considered. This could then be used to compute confidence intervals for the true mean waiting time. Is this approach correct in this case? Why or why not? Note that you should be able to answer this even if you did not do problem 2. 4. In developing the ομ rule that states that customer classes should be ordered in decreasing order of the cost per minute of waiting time multiplied by the service rate for that class, we were minimizing (9.8), or equivalently
Σρ*/μ* y=l
¡=l
(ΐ-^-ι)(ΐ-σ,)
§ A/ 4§(i-^Ki-,) = ψ. where ψ = Υ ρ 4 /ßk
c,X
1(1-^,0(1-^)
is a constant, independent of the order in which the
customer classes are served. Show that the εμ rule holds using this formula. The easiest way to do this is to assume that there are two classes, m and m + 1, for which the rule does not hold. In other words, cmßm < cm+1/im+i. Show that by inverting the order of these two classes, the total value of
507
PROBLEMS
the expected waiting time decreases, meaning that the order of the two i i χ classes should be reversed. Recall that at, = ^pk = ]JT —-. Note that while this may be a bit tedious in terms of the algebra, it is simply that: ALGEBRA. Feel free to make substitutions along the way to simplify the algebra. Also note that I - a¡=í — σ;_ι - p¡. 5. This problem requires lots of reading, but is mostly "plug and chug" if you set up a spreadsheet with the key equations. Consider the operation of a small single-physician clinic. Two types of patients arrive: critical, high priority, or level 1 patients, and non-critical, low priority, or level 2 patients. Let A1; λι
arrival rates for type 1 (high priority) and type 2 (low priority) patients respectively the system-wide arrival rate service rates for type 1 (high priority) and type 2 (low priority) patients respectively (For each type of service the service times are exponentially distributed.)
A = λι + λχ /¿i, μ2 , A P=— L L
mean number in the queue (waiting for service) for type 1 (high priority) and type 2 (low priority) patients
We can show that (see Gross and Harris, 1985): =
L
L
A
(A,/A) + ( A 2 / A ) ( ^ / / 4 )
_ ( A 2 / / i l ) p { ( A 1 / A ) + (A 2 /A)(^/M 2 2 ) 1-λ1/μϊ [ 1-λϊ/μϊ-λ2/μ2
«=K +K
(Α 1 /μ 1 )ρ + ( Α 2 Α / ^ ) [ ΐ - ( Α 1 / / ι 1 ) [ ( Α 1 / Α )
ί-λι/μι-λ2/μ2
{
+
(Α 2 /Α)(μ 1 /μ 2 )]1
1-V^i
J
Note that these equations apply to the non-preemptive case in which the arrival of a critical patient does NOT cause the physician to stop treating a non-critical patient who is currently being treated by the doctor. Also, if you set up a spreadsheet to compute these values—as I encourage you to do—you should get the following as an example.
508
PRIORITY SERVICES, CALL CENTER DESIGN, AND CUSTOMER SCHEDULING
rho hat rho high rho low
High priority
10
Low Priority
20
lambda
30
fraction high
0.333333
fraction low
0.666667
High priority Low priority
0.75 0.25 0.666666667
Avg No high in queue
0.3796
Avg No low in queue Total number waiting
9.1111 9.4907
Total number waiting
9.4907
Avg Time in Q(High)
0.0380
Avg Time in Q (Low) Avg Time in Q (High min)
0.4556 2.2778
40
Avg Time in Q (Low min)
27.3333
30
Avg Time in Q(both)
18.9815
a) Use these equations to find the average number waiting for service and the average waiting time for service (using Little's Law and the appropriate value of the arrival rate) for the critical and non-critical patients if the arrival rate of the critical patients is 1 per hour and the arrival rate of the non-critical patients is 2.5 per hour. Also, the mean time to serve a critical patient is 20 minutes and the mean time to serve a non-critical patient is 10 minutes. Give the times in minutes. b) For a critical patient arrival rate of 1 per hour, plot the waiting time before service for each of the two classes of patients as a function of the arrival rate of the non-critical patients, with the arrival rate for these patients going from 0 to 2.9 per hour. c) For parts (c) and (d), you no longer need to deal with the doctor's office example. These two parts are more generic. Suppose the arrival rate of type 1 customers is 15 per hour and the arrival rate of type 2 customers is also 15 per hour. The service rate is 40 per hour for both types of customers. i. Find the average waiting time for each type of customer. ii.
Find the average waiting time overall. Note that this should be given by the expected waiting time for a high priority customer times the fraction of all customers that are high priority PLUS the expected waiting time for a low priority customer times the fraction of all customers that are low priority customers.
iii. Compute the overall utilization ratio —L + — = p and use this and the M/M/l formulae to find the average waiting time in the queue if there were no priorities. iv. How does the answer to (iii) compare to the answer in (ii)? d) Now suppose that the arrival rates are the same as those identified in part (c) but now one class of customers has a service rate of 60 and the other has a service rate of 30 per hour.
509
PROBLEMS
111.
If we want to minimize the expected waiting time for service over all customers, which of the two customer classes should be given priority: the one with a service rate of 60 or the one with a service rate of 30? Under your plan, what are the expected waiting times for each of the two classes of customers? How does the weighted average waiting time compare with the λ λ average time found in part (c.iii)? Note that the value of — + — = p Mi
fh
is the same in both this question and in part (c.iii) in which the service rates were the same for both customer types? What can you conclude about who should generally be served IV. first if we are faced with two waiting customers—one with a long expected service time and one with a short expected service time? For example, who should I see next of two students waiting to see me: an undergraduate advisee who needs a petition form signed (2minute discussion) or my senior Ph.D. student who just found out that a theorem is wrong (1.5 hour discussion and perhaps lots of tears)? 6. The operating room simulation model of section 9.4.2 is quite simplistic. For example, it deals only with a single operating room. Discuss at least two changes to the system that could improve the schedule adherence. 7. Read the paper by Huschka et al. (2007) on outpatient scheduling. a) How does their approach to adding slack to a schedule differ from that outlined in section 9.4.2? b) Modify the spreadsheet to allow the user of the spreadsheet to choose between the two different policies. If you cannot do this within one spreadsheet, create a new spreadsheet that implements the approach suggested by Huschka et al. (2007). c) Using the approach suggested by Huschka et al. (2007), create a graph that is similar to that of Figure 9.22 for the five surgeries (means and k-values) that were used in creating that figure. 8. Consider the five surgical procedures below. Procedure
Average Time
k-value (for Erlang-k)
A B C D E
2 1 1.5 4 0.5
4 9 16 4 1
a) Find the standard deviation and variance of each procedure's time. b) Use the OR scheduling example with 5 surgeries.xls spreadsheet to estimate the total delay and overtime as a function of the policy used.
510
PRIORITY SERVICES, CALL CENTER DESIGN, AND CUSTOMER SCHEDULING
Recall that the policy specifies the number of standard deviations of slack to add to the average time of each procedure to determine the time allocated to the procedure. Order the procedures in ascending order of their standard deviations. For policy values of 0, 0.25, ... , 2 , record the delay and overtime. Plot the delay and overtime as a function of the policy value. c) What policy would you recommend to the head of surgery? Briefly justify your answer. 9. Use the Patient Room Doctor Simulation.xls spreadsheet to simulate a problem with the following inputs for the random variables. Process Patient Arrival Time to Gown Exam Time Time to Dress Time to Ready the Room
Low
High
Average
-5 3 5 3 2
15 5 15 5 6
5 4 10 4 4
Assume that the day begins at 8 A.M. and that patients are scheduled until 4 P.M., or time 16. Unless otherwise specified, schedule only one patient for the initial appointment of the day. a) Use the spreadsheet to plot the delay and idle times when (i) patients are scheduled every 10 minutes and (ii) the physician uses only two exam rooms. The nominal day is the time between the beginning and end of the scheduled period (between 8 A.M. and 4 P.M. in this case). What is the nominal room utilization in this case? b) Repeat part (a) with three exam rooms. How do the results differ qualitatively from those obtained in part (a)? What is the nominal room utilization in this case? c) Repeat part (b) but now schedule patients every 11 minutes. Be sure to modify the end of the day so that the same number of patients are scheduled as were scheduled in parts (a) and (b). What is the nominal room utilization now? d) Repeat part (c) but now schedule patients every 12 minutes. Again be sure that you extend the end of the day so that the same number of patients are scheduled as were scheduled in parts (a) and (b). How do the patient delays and physician idle times compare with those of parts (a), (b), and (c)? What is the nominal room utilization? e) Which plan would you recommend to the physician? Briefly justify your answer. f) Given that it may be hard to schedule patients every 11 or 12 minutes, what can you suggest to the physician who wants to build some slack into his/ her schedule in anticipation of longer-than-normal patient exam times?
PROBLEMS
511
10. Suppose that calls arrive at a small call center that employs 21 CSRs. Arrivals follow a Poisson distribution with a mean of 80 callers per hour. The mean service time is 15 minutes and customers will wait an average of 30 minutes on the line. Service times and abandonment times are both exponentially distributed. Assume that there are effectively an infinite number of lines for callers. a) Use the normal approximation to estimate the probability of waiting. b) Use the Halfin-Whitt approximation to estimate the probability of waiting. c) Use the Garnett-Mandelbaum-Reiman approximation to estimate the probability of waiting. d) Find the true probability of waiting. You can either develop your own spreadsheet or you can use the spreadsheet entitled Numerical model with abandonment.xls in the online appendix . e) What is the mean waiting time in the queue in minutes? f) What is the probability of abandoning the queue? g) Which of the approximations best estimates the true probability of waiting? 11. Repeat problem 10, but now assume that the mean time to abandon the queue is 100 hours, meaning that callers almost never abandon the queue. 12. Repeat problem 10, but now assume that the mean time to abandon the queue is 3 minutes, meaning that customers are quite impatient. 13. For the inputs of problem 12, but now with only 18 CSRs (which may occur if three people are sick one day), find the following quantities: a) the normal approximation of the probability of waiting b) the Halfin-Whitt approximation of the probability of waiting c) the Garnett-Mandelbaum-Reiman approximation of the probability of waiting d) the true probability of waiting e) the average waiting time in minutes f) the probability of abandoning the queue g) the expected number of callers actually served each hour 14. For the inputs of problem 12, but now with only 25 total lines for callers, meaning that at most four callers can be on hold waiting for one of the 21 CSRs, find the following quantities: a) the normal approximation of the probability of waiting b) the Halfin-Whitt approximation of the probability of waiting c) the Garnett-Mandelbaum-Reiman approximation of the probability of waiting d) the true probability of waiting e) the average waiting time in minutes
512
PRIORITY SERVICES, CALL CENTER DESIGN, AND CUSTOMER SCHEDULING
f) the probability of abandoning the queue g) the expected number of callers actually served each hour h) Which approximation best estimates the true probability of waiting? 15. Repeat problem 14, but now with only 18 CSRs (and 25 total lines). REFERENCES Bailey, N. T. J., and J. D. Welch, 1952, "Appointment systems in hospital outpatient department," The Lancet, 259,1105-1108. Burke, E. K., P. De Causmaecker, G. Vanden Berghe, and H. Van Landeghem, 2004, "The State of the Art of Nurse Rostering," Journal of Scheduling, 7, no. 6 (Nov-Dec): 441-499. Carter, M. W., and S. D. Lapierre, 2001, "Scheduling Emergency Room Physicians," Health Care Management Science, 4, 347-360. Dentón, B. T, A. J. Miller, H. J. Balasubramanian, and T. R. Huschka, 2010, "Optimal Allocation of Surgery Blocks to Operating Rooms Under Uncertainty," Operations Research, forthcoming. Dentón, B. T , A. S. Rahman, H. Nelson, and A. C. Bailey, 2006, "Simulation of a Multiple Operating Room Surgical Suite," Proceedings of the 2006 Winter Simulation Conference, L. F. Perrone, F. P. Wieland, J. Liu, B. G. Lawson, D. M. Nicol, and R. M. Fujimoto, eds.), 414-^124. Dentón, B., J. Viapiano, and A. Vogl, 2007, "Optimization of surgery sequencing and scheduling decisions under uncertainty," Health Care Management Science, 10,13-24. Erdogan, S. A., and B. T. Dentón, 2009, "Surgery Planning and Scheduling: A Literature Review," working paper, Edward Fitts Department of Industrial and Systems Engineering, North Carolina State University, Raleigh, NC. Garnett, O , A. Mandelbaum, and M. Reiman, 2002, "Designing a Call Center with Impatient Customers," Manufacturing & Service Operations Management, 4, 3, 208-227. Green, L. V., S. Savin, and B. Wang, 2006, "Managing Patient Service in a Diagnostic Medical Facility," Operations Research, 54,1,11-25. Gross, D., and C. Harris, 1985, Fundamentals of Queueing Theory, Second Edition, John Wiley & Sons, New York. Gupta, D., and B. Dentón, 2008, "Appointment scheduling in health care: Challenges and opportunities," HE Transactions, 40, 800-819. Halfin, S., and W Whitt, 1981, "Heavy-traffic limits for queues with many exponential servers," Operations Research, 29, 3, 567-588. Ho, C. J., and H. S. Lau, 1992, "Minimizing Total-Cost in Scheduling Outpatient Appointments," Management Science, 38,12,1750-1764. Huschka, T. R., B. T. Dentón, S. Gui, and J. W Fowler, 2007, "Bi-criteria evaluation of an outpatient procedure center via simulation," Proceedings of the 2007 Winger Simulation Conference, S. G. Henderson, B. Biller, M.-H. Hsieh, J. Shortle, J. D. Tew, and R. R. Barton (eds.), 1510-1518. Iser, J. H., B. T. Dentón, and R. E. King, 2008, "Heuristics for balancing operating room and post-anesthesia resources under uncertainty," Proceedings of the 2008 Winter Simulation Conference, S. J. Mason, R. R. Hill, L. Mönch, O. Rose, T. Jefferson, and J. W. Fowler (eds.), 1601-1608.
REFERENCES
513
Kaandorp, G. G, and G. Koole,2007,"Optimal outpatient appointment scheduling," Health Care Management Science, 10, 217-229. Koole, G., and A. Mandelbaum, 2002, "Queueing Models of Call Centers: An Introduction," Annals of Operations Research, 113, 41-59. Larson, R. G, 1987, "Perspectives on Queues: Social Justice and the Psychology of Queueing," Operations Research, 35, 6, 895-905. Muthuraman, K., and M. Lawley, 2008, "A stochastic overbooking model for outpatient clinical scheduling with no-shows," HE Transactions, 40, 9, 820-837. Orwell, G., 1945, Animal Farm, (original title: Animal Farm: A Fairy Story), Seeker and Warburg, London. Whitt, W, 2007, "What You Should Know About Queueing Models to Set Staffing Requirements in Service Systems," Naval Research Quarterly, 54, 5, 476-484.
10 VEHICLE ROUTING AND SERVICES
"/ know that you will be delighted with your new freezer, Mrs. Donohue. You can store a month's worth of food in it. Now, all we have to do is to schedule the delivery," manager Carl Johnson said. "Can you drop it off sometime after 6 in the evening? I am a consultant and I have to be at the office from 8 to 5 every day and I usually don't get home until almost 6, " Amy Donohue asked. "I am sorry, but our delivery truck only makes deliveries until 4 in the afternoon. " "What about first thing in the morning. I can get it a few minutes late on Fridays," Mrs. Donohue suggested. "I'm afraid all we can do is schedule a day, and we don't deliver to your neighborhood on Fridays. What about next Wednesday? You can call Tuesday evening to find out which stop you will be. Of course, sometimes being the fourth stop means 10 A.M. and sometimes it might not be until 3 in the afternoon. It all depends on how hard the first few installations and deliveries are," Carl said reluctantly. "I'm afraid you just lost the sale, if that is the best you can do. I can't afford to be home all day just for a 30 minute delivery of a freezer. Thanks, anyway." Service Science, by Mark S. Daskin Copyright © 2010 by John Wiley & Sons, Inc 515
516
VEHICLE ROUTING AND SERVICES
Carl had been down this road before and had lost all too many sales because of the poor delivery service for which he had contracted earlier in the year. Surely there was a better way.
10.1
EXAMPLE ROUTING PROBLEMS
The provision of many services entails routing vehicles that deliver those services. For example, a non-profit agency might be charged with delivering meals to senior citizens. Vehicles depart from a central kitchen and must deliver meals to the agency's clients in a timely manner (Bartholdi et al., 1983). The list of clients may change over time as clients are added to or dropped from the list and as the budget of the agency expands or contracts at different times of the year. The meals are heated at the central kitchen and delivered warm to the clients using insulated containers on the delivery vehicles. The problem is to find a way to allocate clients to the small fleet of vehicles and drivers maintained by the agency and to route each vehicle as efficiently as possible within a 4-hour limit to ensure that the meals stay warm. A library system composed of over 700 libraries including 50 public libraries serving large parts of a two-county region is designed to allow the constituent libraries—and their patrons—to share books. If a patron of a local library wants a book that the library does not have, the library can request the book from any of the other libraries in the system. Similarly, the local library may loan books to other libraries and their patrons. Each day, vehicles leave a central depot with books that were collected from participating libraries within the last few days. These books are delivered to the intended libraries. During the same trip, books to be loaned to other libraries are collected and sent to the central depot for sorting and future delivery. During difficult financial times, library usage increases as people tend to borrow books instead of buying them. At the same time, however, many state legislatures reduce funding for inter-library loan services to help balance the state budget. The agencies tasked with providing this service must be even more efficient and effective than usual during such periods of increased demand and decreased funding. The agency must be sure that (1) the libraries are assigned to the correct vehicles, (2) the vehicles are routed as effectively as possible, and (3) the frequency of visits to each library matches the need but does not result in unnecessary visits and increased costs (Francis, Smilowitz, and Tzur, 2006). A school system owns and operates a small fleet of buses to provide bus service to the students in the system. Each year, as the student population of each school changes, they must determine bus stops and route buses for both the morning pickups and afternoon dropoffs. The routes must be designed so that students are delivered to school before the beginning of classes. Also, students should not be on the bus for excessively long periods of time in either the morning or the afternoon. Students picked up early in a morning route—those
CLASSIFICATION OF ROUTING PROBLEMS
517
who are therefore on the bus for a long period of time in the morning—should generally be dropped off first in the afternoon. Bus stops must be located close to the student homes. Also, younger students generally are not permitted to cross a street to get to the bus stop from their home. Finally, a waste collection firm has successfully bid on a contract for a small municipality to collect trash from homes in the city. The firm must now design routes for its vehicles so that every street is served with the required frequency. This may entail partitioning the city into regions with waste collection in one region on Mondays, in another region on Tuesdays, and so on. Deadheading—a practice in which a vehicle traverses a street without picking up any waste—is necessary to ensure that different parts of the region are connected. The firm clearly wants to partition the city into regions and to route vehicles to minimize the extent of deadheading. Similar problems arise in routing snow plows and postal delivery personnel.
10.2
CLASSIFICATION OF ROUTING PROBLEMS
Vehicle routing problems can be loosely classified into two categories. The first three examples of section 10.1—meal delivery, inter-library loans, and school bus routing—involve deliveries or pickups from specific locations: client homes, libraries, and school bus stops. These are node routing problems. Section 2.7.2.2 outlined heuristic algorithms for solving some of these problems. The fourth class of examples—waste collection, snow plowing, and postal delivery route design— involves routing vehicles to cover or serve links of the network or streets in the city. These are known as arc routing problems. The remainder of this chapter outlines simple vehicle routing models and algorithms. Many of the examples discussed in section 10.1 entail complexities that are beyond the scope of this text. For example, determining the frequency of library visits makes the routing problem exceptionally complex. The reader interested in such advanced problems should consult (Francis, 2006; Francis, Smilowitz and Tzur, 2006, 2007; and Francis and Smilowitz, 2006). Section 10.3 discusses arc routing problems. Section 10.4 outlines the traveling salesman problem, which is the prototypical node routing problem. The traveling salesman problem assumes that all nodes can be served by a single vehicle. Section 10.5 discusses the classical vehicle routing problem in which there are multiple vehicles and multiple routes. Customers must be assigned to a vehicle or route and each of the vehicles must be routed to achieve one of several objectives including minimizing the sum of all route lengths, minimizing the delivery time of the last customer, and minimizing the number of vehicles needed to serve all customers. Each vehicle typically has both a capacity constraint—there cannot be more than 40 students on the bus at any time—and a time constraint—the entire route cannot take more than 45 minutes.
518
10.3
VEHICLE ROUTING AND SERVICES
ARC ROUTING
In arc routing problems, we want to traverse or travel along each street of a road system at least once. Ideally, we will not have to traverse a street multiple times as such additional traversais—deadheading—generally add no value to the system. For example, there is no reason for a waste collection vehicle to traverse a street multiple times in a single day. Similarly, a postman need not walk the same street twice in a given day. There are, of course, some situations in which multiple traversais do add value. For example, in plowing streets, it is often beneficial to plow major thoroughfares multiple times during a single storm to ensure that they are clear, while local streets and alleys might be plowed only once each day (Malandraki and Daskin, 1993). Such cases are beyond the scope of our discussion, however. We will deal only with the classical problem in which each street must be traversed only once. The classical problem is known as the Chinese Postman Problem because it first appeared in a Chinese journal of operations research. In some applications, the direction of travel on the street does not matter. For example, in waste collection, a vehicle typically traverses a street in one direction only, and the waste collection personnel collect trash from houses on both sides of the street at the same time. In other cases, the direction of travel does matter. In snow plowing, we want to plow both sides of the street and so wide streets must be plowed in both directions. Narrow side streets and alleys might only need to be plowed in one direction. From a modeling perspective, we need to distinguish between three cases. If every link in the network is directed, meaning that the link must be traversed from one node to the other and not vice versa, the problem is a directed Chinese Postman Problem. If every link can be traversed in either direction, the problem is known as an undirected Chinese Postman Problem. Both of these problems can be solved relatively easily. If there are some directed links and some undirected links, the problem is known as a mixed Chinese Postman Problem. Such problems are much harder to solve than are their directed or undirected counterparts and are beyond the scope of this text.
10.3.1 Arc Routing on an Undirected Graph We begin with the undirected problem. The problem apparently first arose in the early 18th century. The city of Königsberg was bisected by the Pregel River. Two islands are located along the river within the city. In 1736, there were seven bridges connecting the two sides of the city and the two islands, as shown schematically in Figure 10.1. The citizens of Königsberg wanted to know if there was a route that traversed each bridge exactly once and returned to the original land mass. The problem was posed to a mathematician named Euler. Euler was able to abstract the problem by representing the city as a set of nodes and links, as shown in Figure 10.2. Euler had the insight to realize that if a tour existed that traversed each bridge (edge) exactly once, returning to the
ARC ROUTING
519
Figure 10.1. Schematic of the city of Königsberg
Figure 10.2. Abstraction of the city of Königsberg as a set of nodes and arcs
original land mass, then you would have to be able to go in and out of each node an even number of times. In other words, the degree of each node would have to be even, where the degree is the number of edges that are incident on each node. You can readily verify that the degree of each node in Figure 10.2 is odd: nodes A, C, and B are of degree 3, while the degree of node B is 5. Thus, it is not possible to find a route that traverses each bridge exactly once and returns to the original land mass. If every node is of even degree, then there is an Euler tour that traverses each edge exactly once and that begins and ends at the same node. If an Euler tour does not exist, then some edges or streets must be traversed multiple times. In most applications, we want to minimize the total route length including any additional traversais or deadheading on the links. Minimizing the total route length is equivalent to minimizing the total deadheading distance. To minimize the total deadheading distance in an undirected network, we need to find a way of matching the odd degree nodes that minimizes the total additional length. To illustrate this, consider the network shown in Figure 10.3. The network includes seven nodes and 10 undirected edges. The numbers beside each edge
520
VEHICLE ROUTING AND SERVICES
Figure 10.3. Example undirected network
Figure 10.4. Simple network of Figure 10.3 with odd-degree nodes highlighted
indicate the length of the edge. The first step in finding a Chinese Postman tour for the network is to identify the odd-degree nodes. The four odd-degree nodes—nodes B, C, E, and G—are highlighted in Figure 10.4. We must now find a way of pairing or matching the odd degree nodes. Table 10.1 lists all six possible pairings of the four odd-degree nodes, the links that would be repeated, and the total added distance if the particular nodes were to be paired. We must now find a set of pairings to select so that the total added distance is minimized and each odd-degree node is in one of the selected pairings. For example, we could elect to pair nodes B and C and then to pair nodes E and G. The total added distance would be 25 + 13 or 38. However, the best possible set of pairings is B with E and C with G. This adds a total of 12 + 22 or 34 extra distance units. Figure 10.5 shows the resulting network with the links that correspond to the optimal matching highlighted. In this augmented network, all nodes are even-degree nodes, meaning that we can find an Euler tour on this network. One such tour is to begin at node A and to follow the route A-B-E-G-D-G-FC-D-E-B-D-C-A. The total length of this route is 130 + 34, or 164 units, where
521
ARC ROUTING
TABLE 10.1. Pairs of odd-degree nodes than can be paired from the network of Figure 10.4
Pair Nodes
Repeat Links
Total Distance
B, C B, E B, G C, E C, G E, G
BD, DC BE BD, DG CD, DE CD, DG EG
25 12 23 28 22 13
Figure 10.5. Optimal matching of the odd-degree nodes of Figure 10.4
130 is the total distance of the links in the original network shown in Figure 10.3. In drawing the Euler tour, it is important that we not create isolated subportions of the network. For example, suppose we start at C and follow the path C-F-G-D-C. Now we might go from C-A-B-E-G-D-C. The problem is that we are now at node C and we have used all of the four links incident on node C. We are stuck there, but we have not traversed one of the two links between B and E and we have not traversed links BD and DE. If we end up in this situation, we can create a subtour—B-E-D-B, in this case—and simply substitute this into one of the tours we have already created wherever we see the origin node of the new subtour. In other words, we have a path from C-A-B-E-G-D-C and we substitute the subtour B-E-D-B for node B in this path to obtain, C-AB-E-D-B-E-G-D-C. Our tour for the Chinese Postman Problem is now C-F-G-D-C-A-B-E-D-B-E-G-D-C. In summary, when all links of the network are undirected, we can solve the Chinese Postman Problem by using the following steps:
522
VEHICLE ROUTING AND SERVICES
1) Find the odd-degree nodes of the network. 2) Find an optimal matching of the odd-degree nodes. 3) Add the links that correspond to the optimal matching to the original network. 4) All nodes in the augmented network should now be of even-degree. Draw an Euler tour on the resulting network. Step 2 requires some additional explication. While there are good special purpose algorithms for this problem, we can usually solve the problem by inspection or by using one of the following two simple optimization models. In the first, we explicitly enumerate every possible pairing of nodes, as was done in Table 10.1. We define the following inputs and sets. Inputs and P N cp anp
sets set of possible pairings, indexed by p set of odd-degree nodes in the original network, indexed by m and n cost of pairing p e P 1 if pairing p e P involves node n e N; 0 if not
In addition, we define the following decision variables. Decision variables Xp 1 if pairing p e P is selected; 0 if not With this notation, we can formulate the optimal pairing problem as follows. Min s-t-
^cpXp peP
(10.1)
Σ^ρΧρ^1
V
"e^
(10.2)
*pe{0,l}
VpcP
(10.3)
The objective function (10.1) minimizes the cost of all selected pairings. Constraints (10.2) state that each odd-degree node must be in exactly one of the selected pairings. Finally, constraints (10.3) are integrality constraints. Perhaps the single most significant drawback to formulation (10.1)-(10.3) is that it requires us to enumerate all of the possible pairings. In general, if there are In odd-degree nodes, then there are (2n - 1)! possible pairings. This number becomes explosively large as indicated in Table 10.2. With only two odd-degree nodes, there is only one possible matching. For the problem of Figure 10.4, with four odd-degree nodes, there were six possible pairings. For a problem with 10 odd-degree nodes, there are over ¿ of a million possible pairings. Finally, for a problem with only 20 odd-degree nodes, the number of possible pairings that
523
ARC ROUTING
TABLE 10.2. Number of possible pairings as a function of the number of odd-degree nodes in a network Number of Odd Degree Nodes
Pairings
Number Squared
2 4 6 8 10 12 14 16 18 20
1 6 120 5,040 362,880 39,916,800 6,227,020,800 1,307,674,368,000 355,687,428,096,000 121,645,100,408,832,000
4 16 36 64 100 144 196 256 324 400
must be enumerated exceeds 100 quadrillion or 1017. Clearly, an alternate approach is needed. From Chapter 2, we know how to find the shortest path between any pair of nodes, and we can do so very quickly. In fact, we can show that the amount of time needed to find the shortest paths between all pairs of nodes in a network grows only as the cube of the number of nodes in the network. Using the shortest path distances, we can formulate the problem of finding the optimal matching using the following alternative inputs and sets. Inputs and sets djk shortest path distance between odd-degree nodes j e N and k e N We also define the following new decision variables. Decision variables Yjk 1 if we pair odd-degree node j e N with odd-degree node k e N; 0 if not With this notation, we can find the optimal matching using the following model:
Wn ■■■ '
ΣΣαΛ
(10.4)
^ = 1 V; eN
(10.5)
jsN IceN
Σ kt=M
1 Vit eJV
Y =Y I
jk
I
kj
V / e N;Â:e N
y, ={0,1} \/jeN;keN
(10.6) (10.7) (10.8)
524
VEHICLE ROUTING AND SERVICES
The objective function (10.4) minimizes the total deadheading distance. Actually, it minimizes twice the total deadheading distance since if node j is paired with node k, then constraint (10.7) stipulates that node k must also be paired with node /. Constraints (10.5) and (10.6) state that each odd-degree node must be paired with exactly one other odd-degree node, while constraints (10.7) require that the matrix of pairing decisions be symmetric, as indicated above. Constraints (10.8) are standard binary constraints. For many problems, constraints (10.7) may not be needed, but for problems with many identical distances, these constraints are necessary to avoid problems in which, for example, node A is paired with node C (YAC = 1 ) , node B is paired with node D {YBD = 1), node C is paired with node B (YCB = 1), and node D is paired with node A (YDA = 1). Note that this assignment of variables satisfies constraints (10.5), (10.6), and (10.8), but it does not satisfy constraints (10.7). While formulation (10.1)-(10.3) required (2n - 1)! variables, this formulation requires only (2nf = An2 variables. The last column of Table 10.2 gives this number of variables. For a problem with 20 odd-degree nodes, only 400 variables are needed for this formulation. By eliminating self-pairing variables (e.g., Y¡¡ variables), we can reduce the number of required variables from An2 to An2 - 2n. In the case of 20 odd-degree nodes, this reduces the number of decision variables by 20 to 380. It may not be worth the effort to do so, however, as we can simply set d¡¡ = °° (or some suitably large number) for every node je N to preclude the use of such variables. These two approaches are illustrated in Undirected CPP example.xls in the online appendix.
10.3.2
Directed Graphs
We now turn our attention to the case in which all arcs of the network are directed. This corresponds to a situation in which either all streets are one-way or in which each of the remaining two-way streets must be traversed one or more times in each direction. For directed graphs, many of the concepts outlined in section 10.3.1 carry forward, but in slightly modified form. We are again concerned with the degree of each node, but we must distinguish between the in-degree and the out-degree of each node. The in-degree is the total number of links pointing into the node and the out-degree is the total number of links directed out from the node. Clearly, if an Euler tour is to exist, the in-degree must equal the out-degree of every node. In other words, for every time we enter a node, there must be a unique way of leaving the node and vice versa. Figure 10.6 illustrates a network with 11 nodes and 20 directed links or edges along with the distances of each of the edges. The procedure for finding an Euler tour on such a network is as follows: 1) Find the in-degree and the out-degree of each node. 2) For each node compute the difference between the out-degree and the in-degree.
ARC ROUTING
525
Figure 10.6. Example directed network for the Chinese Postman Problem
3) If all of the differences in step 2 equal zero, go to step 6; an Euler tour exists on the network without adding any additional links. Otherwise, proceed to step 4. 4) Solve a transshipment problem treating the nodes with a positive difference as demand nodes, the nodes with a negative difference as supply nodes, and the link distances as the costs. (The transshipment problem is just like a transportation problem except that nodes that are neither supply nor demand nodes are used only for transshipments.) 5) Replicate each link on the network once for each unit of flow on the link in the optimal solution to the transshipment problem solved in step 4. 6) Draw an Euler tour on the (augmented) network. Table 10.3 shows the out-degree, in-degree, and net difference for each of the 11 nodes in the network of Figure 10.6. Nodes G, I, and J are supply nodes with supplies of 1 unit each; nodes A and D are demand nodes with 1 and 2 units of demand, respectively. Figure 10.7 shows the network after the additional links have been added. You can readily verify that the difference between the in-degree and the out-degree of every node in this figure is 0, meaning that an Euler tour exists on this network. The original link distances totaled 2025 units. The objective function value for the transshipment problem was 1770, meaning that 1770 additional distance units are needed to create an Euler tour on the network. The total distance of the optimal Chinese Postman tour is therefore 3795.
VEHICLE ROUTING AND SERVICES
TABLE 10.3. In-degree and out-degree of each node in Figure 10.6 Node
Out-Degree
In-Degree
Net
A B C D E F G H I J K
2 2 1 3 2 2 1 2 2 1 2
1 2 1 1 2 2 2 2 3 2 2
1 0 0 2 0 0 -1 0 -1 -1 0
Figure 10.7. Augmented network for the directed CPP of Figure 10.6
THE TRAVELING SALESMAN PROBLEM
527
One possible Euler tour is to start with a simple tour that begins and ends at A: A-C-G-I-K-H-E-B-A. We would then insert G-I-J-G and insert G-I-K-J-G to account for the two extra trips through node G (as well as node J). We now would have A-C-G-I-J-G-I-K-J-G-I-K-H-E-B-A. Now we can insert the loop K-H-E-B-A-F-I-K to obtain A-C-G-I-J-G-I-K-J-G-I-K-H-E-B-A-F-I-K-HE-B-A. Next we can insert K-H-I-K to obtain A-C-G-I-J-G-I-K-J-G-I-K-H-I-KH-E-B-A-F-I-K-H-E-B-A. We now insert K-H-E-B-D-H-E-B-D-E-F-B-D-K to obtain A-C-G-I-J-G-I-K-J-G-I-K-H-I-K-H-E-B-A-F-I-K-H-E-B-D-H-E-B-D-EF-B-D-K-H-E-B-A. Note that the easiest way to do this is to start with the graph of Figure 10.7, create a loop beginning at one node, and ending at the same node. Remove all links in the loop. Then identify other loops that can be created and inserted in place of a single node in the emerging tour. As loops are identified and inserted, remove the links from the graph to be sure you do not use them again.
10.4 THE TRAVELING SALESMAN PROBLEM The Chinese Postman Problem and its arc routing extensions are appropriate in many contexts, including cases in which an entire street or link must be served or when all addresses on a street must be served. The former cases include snow plowing and street cleaning while mail delivery is an example of a case in which all addresses on a street must be serviced. Many routing contexts, however, entail serving specific sites. The meal delivery and inter-library loan problems discussed in section 10.1 are examples of such problems. For these problems, node routing techniques should be employed. In this section, we will begin with the simplest example of a node routing problem: the Traveling Salesman Problem (TSP). In the TSP, there is only a single route. There are no capacity or route length constraints. Section 10.5 extends the TSP by relaxing both of these restrictions. Specifically, in the vehicle routing problem (VRP), we allow multiple routes as well as capacity and route length constraints.
10.4.1
TSP—Exact Algorithm
In the TSP, we are asked to find a minimum-length route that begins at some node—it could be any node in the network—and ends at the same node, visiting each node exactly once. We are also given the distances between each pair of nodes. While this problem statement is deceptively simple, the problem is in a class of problems for which there are no known provably optimal algorithms
528
VEHICLE ROUTING AND SERVICES
whose running time is a polynomial function of the size of the problem (Garey and Johnson, 1979). In this section, we will outline one exact approach to the problem. Section 10.4.2 summarizes a few heuristic approaches. 10.4.1.1 Exact Algorithm—Assignment Model. In this approach, we simply determine whether or not the vehicle or salesman goes directly from one node to another. To do so, we use the following notation. Inputs and sets N the set of nodes in the network the distance between nodes j e N and k e N (To avoid self-loops, a djk subtour that starts at one node and simply goes right back to that node, we should set d¡¡ - °° for all j e N.) Decision variables. Xjic 1 if the tour goes directly from node je TV to node k e N; 0 otherwise With this notation, we can begin to formulate the problem as follows:
Min X £ d y * ^ jeN
s-t-
(10.9)
kuN
Σ Xik =l
VJeN
(10.10)
^Xik=l
VkeN
(10Λ1)
jeN
Xjk = {0,1}
VjcN;keN
(10.12)
The objective function (10.9) minimizes the total distance of the tour. Constraints (10.10) ensure that we leave every node exactly once and constraints (10.11) stipulate that we enter every node exactly once. Finally, constraints (10.12) are the standard integrality constraints. If you look carefully at this formulation, you will realize that it is nothing more than an assignment problem formulation, as discussed in Chapter 6. We know that such problems are easy to solve. This suggests that something may be missing from this preliminary formulation, as indeed there is. To understand the difficulty with this formulation, let us use it to solve the TSP on the network shown in Figure 10.8. This is identical to the network of Figure 10.6, except that we have removed the directions from each link. In general, we would like the graph to be a complete graph, meaning that we can go directly from any node to any other node. In this case, and whenever links are missing, we can simply set the distances of non-existent links (e.g., from node A to node G) to infinity.
THE TRAVELING SALESMAN PROBLEM
529
Figure 10.8. Example network for the TSP
Figure 10.12 shows the solution to this problem. The links that are used are shown as wide lines. The total distance associated with this solution is 1005. Clearly, this solution does not satisfy the conditions of a TSP because the solution includes four separate subtours. A person using this solution, for example, could not get from node A to node B. We need to eliminate these subtours. 70.4.1.2 Adding Subtour Elimination Constraints. One way of eliminating the subtours shown in Figure 10.12 is to limit the number of links that connect each of the subtours to one less than the number of nodes in the subtour. The subtour A-F-A, for example, can be eliminated by adding the constraint XAF+XFA<1.
530
VEHICLE ROUTING AND SERVICES
Similarly, the subtour B-D-E-B can be eliminated by adding the constraint XBD
+ %DE + XEB - 2·
If we add these constraints along with the three constraints needed to eliminate the other three subtours, we obtain the solution shown in Figure 10.13. The total length of this solution is 1020. Because there are no subtours, this is an optimal solution to the problem.
THE TRAVELING SALESMAN PROBLEM
531
In general, solving a TSP is not as simple as this. Often, when we add one set of subtour elimination constraints, the new solution simply has other subtours that also must be eliminated. This naturally raises the question of why do we not simply add all of the subtour elimination constraints a priori! These constraints are of the following form:
Figure 10.12. Solution to the assignment model for the TSP of Figure 10.8
Figure 10.13. Solution to the TSP of Figure 10.8 after adding subtour elimination constraints
532
533
THE TRAVELING SALESMAN PROBLEM
ΣΣΧβ jeS keS
^Ι-
1
VSŒN,2<\S\<\N\-1
αο13)
K
'
What this constraint says is that we should focus on a subset, 5, of the nodes. The number of nodes in the subset must be at least two and strictly less than the total number of nodes in the network (2 < 151 < IM - 1). For each such subset of the nodes, we add up the total number of links in the subset, ^ ^ Xjk. This total must be less than or equal to the number of nodes in the subset minus 1,151 - 1. The problem with this is that there are a huge number of such constraints to add. In fact, the number is equal to 2m - IM - 2 since there are a total of 2IA" possible ways of constructing subsets of the set of nodes, counting the empty set and the set of nodes itself. We need to subtract 2 from this to eliminate these two cases. We also subtract the total number of subsets of exactly one node. This number is equal to IM. Unfortunately, the total number of possible subtour elimination constraints gets to be very large. For a problem with 11 nodes, such as the problem shown in Figure 10.8, there are 2035 such constraints. Clearly, you would not want to try to enumerate all of them by hand. For a problem with twice as many nodes, there are 4,194,280 constraints, and for a problem three times as large, there are 8,489,934,557 such constraints! This is why subtour elimination constraints are added only as needed. For the problem at hand, we needed only five subtour elimination constraints, rather than the full set of 2035. Also, in practice, special programs are devised to detect subtours in a solution and to add the appropriate constraints. Finally, it is worth noting that there are other forms of subtour elimination constraints. A full discussion of them is beyond the scope of this text, but the reader should consult the excellent book by Lawler et al. (1985).
10.4.2 TSP Heuristic Algorithms Given the complexity and difficulty associated with solving a traveling salesman problem optimally, it is not surprising that several heuristics have been devised to solve the problem. These heuristics fall into two categories. The first set of heuristics tries to find a feasible solution or a tour that visits each node exactly once and that has a small, if not optimal, total distance. These are known as construction heuristics. Sections 10.4.2.1,10.4.2.2, and 10.4.2.3 discuss such heuristics. The second approach is to take a tour that may have been found through a construction heuristic and attempts to improve the solution. Naturally, these are called improvement heuristics. Section 10.4.2.4 discusses a number of such heuristics. 10.4.2.1 The Myopic or Nearest Neighbor Heuristic. Perhaps the simplest way to construct a Traveling Salesman tour is to begin at any node. Next, visit the closest node that is not yet on the tour. Continue building the tour in this way until all nodes have been visited. At that point, return to the original starting node.
534
VEHICLE ROUTING AND SERVICES
TABLE 10.4. Sample coordinates for a TSP problem Node
A
B
C
D
E
F
G
H
I
J
K
X Y
0 0
10 5
15 12
8 8
22 14
25 21
14 23
10 19
8 12
7 18
4 13
This algorithm is best illustrated on a problem in which every candidate link exists. Such problems arise if we are given the coordinates of the points to be visited and a distance metric between the points. The distance metric might be the straight line or Euclidean distance metric. Table 10.4 gives sample coordinates for a TSP. Table 10.5 gives the inter-nodal Euclidean distances, where we have set the distance from any node to itself equal to 100000.00. If we begin at node A, the next node to be visited is node B at a distance of 11.18. Next comes node D at a distance of 3.61, then node I at a distance of 4, followed by node K at a distance of 4.12. The entire tour is A-B-D-I-K-J-H-GC-E-F-A with a total distance of 96.15 units. Figure 10.15 illustrates the route. This figure illustrates one of the key deficiencies associated with the myopic or greedy algorithm. The approach leads to "painting yourself into a corner" in the sense that when the algorithm is nearly done, there are few nodes left to visit. They may all be quite remote from the most recently visited node. In this example, node A is at the origin and node F, the final node visited before returning to node A, is the furthest node from node A. However, we have no choice but to return to the origin at this point in the algorithm. In this case, one-third of the total distance is incurred in getting from the final node back to the starting node. One way to improve the myopic algorithm is to start the algorithm at each node. When we do this, the best solution is found by beginning at node I. The tour becomes I-D-B-C-E-F-G-H-J-K-A-I with a total distance of 84.96 units. This route is shown in Figure 10.16. While this tour looks better, and does not cross itself, it is still not the best. The optimal route goes from A-D-I-K-J-H-G-F-EC-B-A and has a total length of 79.95 units, as shown in Figure 10.17. 10.4.2.2 A Spacefilling Curve Approach to the TSP. The spacefilling curve approach, developed by Bartholdi and Platzman (1982,1988) and Bartholdi et al. (1983) is best explained graphically. We can begin with a square service area as shown in Figure 10.18. Initially, the spacefilling curve simply goes around the square (Initial curve). Next, we divide the square into four squares, by dividing the X and Y coordinates by two (Four subregions). In each subregion, we draw a curve (Four sub-curves) and then link the individual curves to find a single spacefilling curve (Four linked sub-curves). This process continues as shown in the third set of figures (Sixteen subregions, Sixteen sub-curves, and Sixteen linked sub-curves).
τ-Η
CO ro m o o τ-Η q ■"t q ^ t vd oo' c-i o
τ-Η
^f
τ-Η
τ-Η
o vo
¡*ä
CO
^i^H
^t
T—I
σ\
*
o o o o
T-H
m co σ\ co <—¡
O
o o τ-Η
CN oo o T f CN
q -*' r-^ r-^
Γ-~
X
o
o ^; τ-Η ^ t CN
i/o CN i/"l O VO oo O O O CN VO ^ H i/-i oo 0 0 CO VD Ö Ö τ-Η T - H T - H O
o
"Ί
o o o
O
o
"t
CO oo ·* ·<* CN >n ( N σ\ rJ H -*' l—H
T-H
O O O
O O O O
CO 00 i/S
oo CN o T-H vd -*
o oo O CO vo O 0 0 ve σ\ vo T - H q τ-Η ^D O CN T - H ^t 0 0 τ-Η co i/-i »O Ö r-^ CO oó T-H T-H T-H O O O
o
"* o <υ
o
Π3 1— ■
c
s
o
q
VC co
o
^f
vq uo VO
T-H
^H
T-H
ö >/-) ^ o o
CO U1 O CN O TT VO CN T - H co T - H Γ^ Ö CO CN τ-Η CM
νο σ\ Pi
o
(N 00
Tt
o o
>/->
—
c
CO TT u-> vo ^ f oo O T-H O T-H σ\ ' t νο' 0 0 τ—I vo CN T - H τ-Η τ-Η T H τ-Η 1 CN
o o o
^r
oo CO ^ f uo r^H
^Η
^H i—I
ir¡ ^Η
CN CN ■ * σ\ OÓ CN ^ Η ^ H CN
o
to t/>
00 O
(O
o o
ω
00 CO O CN O Ί
o p (N vö w-i K CN T-H
ö ^ o o o o
^r o q
CN O Tf ^Η ^D l S CN co ^ f ^H
^H
^Η
CN CO in O WÔ oó τ ^
T-H
-C
■4-»
5 E
di JH
τ-Η VO O CO vo O O τ-Η 00 Ö τ-Η
Q
τ-Η
H
o o o o
o k_
Q. OJ JZ ■4—' L_
o
vil
i/l
OJ VJ t= TO
o
υ
CD Τ3 O C kL
οο Τ-Η
pa
Ö
*LU
1 CO
< 1—
τ-Η τ-Η
O
1=
LfS
'-l
^H
VD 0 0 O i-H
^H
v¿
^H ^H
CN ^ H
vo 0 0 m 1/Ί O
o 00
CN ■ * i S CO ^ H
q
T-H
O
CO
>/->
^Η
^H
VD 00
o
■>*■
in O
Ö T-H
O ^f VO
o O lO o o q
s
Ö T-H
T-H T-H
o o o vo Ö oo o o o o
vq
q
T-H
-* σ\ T f ^ Η oo CO CN
T-H
o
o
^ ■ '
^H
oo
■t O CN CO O
r~
co Ö T-H
T-H
T-H
αι
—
o o o o
τ-Η
i/-i
T-H
ΙΛ
T3
τ-Η O CN VO O σ\ 0 0 O
CO O CN ■ *
< u
T3 O
z;
o ö o o o
oo
τ-Η
T—i
σ\
H
τ-Η
T-H
oo uo CO Γ - CN T - H O ^Ο o\ ^ f ^ f CO VO vo
τ-Η τ-Η
CN CO CN ( N
H
T-H
T-H
o <
m u Q ω Pi O K
H I
>—> «
535
536
VEHICLE ROUTING AND SERVICES
Figure 10.15. TSP route using the myopic algorithm beginning at node A
Figure 10.16. TSP route using the myopic algorithm beginning at node I
Figure 10.17. Optimal TSP route for the data in Table 10.4
Figure 10.18. Creating spacefilling curves in a square 537
538
VEHICLE ROUTING AND SERVICES
Figure 10.19. Spacefilling curve approach for the data of Table 10.4
Once the service region is sufficiently covered by the spacefilling curve, we superimpose the coordinates of the nodes to be served on the region (and on the spacefilling curve). Nodes are visited in the order in which they appear on (or near) the curve. Figure 10.19 illustrates this approach for the data of Table 10.4. The nodes have been approximately superimposed on the spacefilling curve. The line connecting the nodes shows the tour as suggested by this method. In this case, the resulting tour is identical to the optimal solution. Bartholdi and Platzman (1982) show that the heuristic tour will generally be about 25 percent longer than the optimal tour (for large numbers of nodes). Bartholdi et al. (1983) applied this approach to a vehicle routing problem for Meals On Wheels in the Atlanta region. The approach could be implemented without a computer, using only two card files. Each of the clients was represented using two identical cards. One file sorted the clients by name and the second by their position on the spacefilling curve. This facilitated the addition and deletion of clients. Vehicles were simply routed to serve clients in the order in which they appeared on the spacefilling curve. The approach resulted in a 13-percent improvement over the manually designed routes that had been used by the agency prior to Bartholdi and Platzman's work. In essence, the approach transforms the two-dimensional problem into a one-dimensional problem. Each node is represented by its position on (or near) the spacefilling curve. Nodes are visited in the order in which they appear on the curve. The self-organizing feature map approach is conceptually very similar to spacefilling curve approach (Angéniol, de La Croix Vaubois, and Le Texier, 1988).
539
THE TRAVELING SALESMAN PROBLEM
10.4.2.3 Christofides' Heuristic. One of the best algorithms (in terms of its worst-case guaranteed performance) is an approach suggested by Christofldes (1976). The algorithm builds on our knowledge of Euler tours and is applicable whenever the triangle inequality holds for the problem at hand. The triangle inequality simply says that for any three nodes, A, B, and C, the distance from A to B plus the distance from B to C is greater than or equal to the direct distance from A to C. Mathematically, this can be stated as "■AB +dBC
>.dAC.
The algorithm can be described as follows. Christofldes' heuristic for the Traveling Salesman Problem 1) Find the minimum spanning tree for the network. 2) Find the odd-degree nodes of the minimum spanning tree. 3) Find an optimal matching of the odd-degree nodes and add the links of the matching to the minimum spanning tree. 4) Draw an Euler tour on the resulting graph. It should be noted that this algorithm may visit some nodes multiple times. If the triangle inequality holds, we can generally remove multiple visits to a node, thereby further reducing the distance of the tour. Step 1 requires further explanation. A spanning tree is a graph that connects every pair of nodes in the network but that has exactly one way of getting between every pair of nodes. The minimum spanning tree of a network is a spanning tree with the shortest possible total distance. A bit of thought will convince you that a spanning tree has exactly \N\ - 1 links or edges where N is the set of nodes. In other words, the number of links in a spanning tree is exactly one less than the number of nodes in the network. There are two well-known algorithms for finding the minimum spanning tree in a network: Prim's algorithm (Prim, 1957) and Kruskal's algorithm (Kruskal, 1956). We will outline both algorithms. Kruskal's algorithm for the minimum spanning tree 1) Find the shortest link in the network and add it to the emerging minimum spanning tree (MST). Place the two nodes associated with this link in a bucket or group of nodes. If the network has only two nodes, stop; otherwise go to step 2. 2) Find the next shortest link in the network. One of four possibilities must be true: a) The two nodes of the link are already in the same bucket. In this case, skip the link and repeat step 2. b) Neither node is in a bucket. In this case, add the link to the emerging MST and create a new bucket for the two nodes of the link.
540
VEHICLE ROUTING AND SERVICES
c) One node is in a bucket and the other is not yet in any bucket. In this case, add the link to the emerging MST and add the node that was not yet in any bucket to the bucket of the other node associated with the link. d) Both nodes are in different buckets. In this case, add the link to the emerging MST and merge the two buckets. 3) If there are \N\ - 1 links in the tree, stop; otherwise, repeat step 2. Figure 10.20 illustrates Kruskal's algorithm for the network of Figure 10.8. In Figure 10.20 the links that have been added to the emerging MST are shown
Figure 10.20. Illustration of Kruskal's MST algorithm for the network of Figure 10.8. (See color insert.)
THE TRAVELING SALESMAN PROBLEM
541
with heavier lines. Initially, the shortest link is link D H at a distance of 70. Nodes D and H and the link between them are colored red and are added to the emerging MST. The next shortest is HK at a distance of 75. Node K is added to the emerging MST as is link HK. Next is link EH, also at a distance of 75. Node E is added to the emerging MST as is link EH. Next, link GI, also with a distance of 75. Link GI and nodes G and I are added to the emerging MST but are colored purple because they are not in the same bucket as the earlier nodes. Next is link DE with a distance of 80. But nodes D and E are already in the same bucket, meaning that they are already connected within the same part of the emerging MST. We skip link DE. The next shortest link is AF at a distance of 85. It too initiates a new bucket, colored green, with link AF and nodes A and F. Next comes link HI, also at a distance of 85. While both H and I are in the emerging MST, they are in different buckets, or different subtrees, of the emerging MST. We include link HI and merge the two buckets, coloring all links and nodes red. The algorithm proceeds until we find the complete MST with a total distance of 855. Prim's algorithm for the minimum spanning tree 1) Begin with any node in the network. Call this node v. Set the emerging MST to v. 2) Among all nodes in the emerging MST, find the shortest link that does not connect to another node in the emerging MST. Add this link to the MST as well as the node of the link that was not in the emerging MST. 3) If there are fewer than \N\ - 1 links in the emerging MST, repeat step 2; otherwise, stop. Figure 10.21 illustrates the steps of Prim's algorithm, beginning at node C. While the final MST is slightly different from that obtained by Kruskal's algorithm—Figure 10.21 includes link JK while Figure 10.20 uses link IJ—both algorithms result in a total distance of 855. The choice between the two algorithms depends largely on the sophistication of the data structures used to store the network. For problems of the size that are likely to be encountered in routing problems, both algorithms are exceptionally fast. Once we have the MST, we need to find the odd degree nodes of the tree and to find an optimal matching of those nodes. Figure 10.22 shows the eight odd-degree nodes as shaded circles as well as the optimal matching of these nodes, shown as dashed lines. The matching adds 440 distance units to the 855 of the MST, resulting in an Euler tour of 1295 units. Three nodes—nodes E, H and I—will be visited twice on the tour. Since this network satisfies the triangle inequality, we can remove some of these multiple visits. Figure 10.23 shows the results of removing these multiple visits. Dashed lines represent the new links that have been added as a result of removing two other links in each case. The
Figure 10.21. Illustration of Prim's MST algorithm for the network of Figure 10.8
Figure 10.22. MST with optimal matching of odd degree (shaded) nodes 542
THE TRAVELING SALESMAN PROBLEM
543
Figure 10.23. Christofides' heuristic result after removing multiple visits to nodes E, H, and I
resulting length is 1130. Recall that the optimal tour, shown in Figure 10.13, is 1020 units long. While Christofides' heuristic cannot guarantee an optimal solution, we can show that if the triangle inequality holds, the length of the tour resulting from Christofides' heuristic, before removing extra visits to nodes that may be visited two or more times on the Euler tour, is no more than 50 percent greater than the length of the optimal tour. While this may not sound like much of a performance guarantee, in fact most heuristic algorithms cannot claim to be this good. For many algorithms, the worst-case performance degrades with the size of the problem. Even when there is a constant worst-case performance guarantee, it is rarely this good. Also, in most cases, the algorithm does much better than this. In the example above, the algorithm was 27 percent off of an optimal solution. Numerous other TSP construction heuristics have been devised, including the nearest insertion heuristic, the farthest insertion heuristic, and convex hull insertion heuristics. For each of these, there are several variants. The goal in all cases is to find a good tour with relatively little work. Once such a tour has been found, it can be subjected to a number of different improvement algorithms designed to further reduce the tour's total distance. 10.4.2.4 2-Opt, 3-Opt, and Or-Opt Improvement Heuristics. Once we have an initial tour, we often would like to improve the tour. This section outlines three such improvement algorithms: the 2-opt heuristic, the 3-opt heuristic, and the Or-opt algorithm. For problems with Euclidean distances or for which the triangle inequality holds, the optimal tour should not cross itself. Figure 10.15 is an example of a tour that crosses itself. Such tours seem to be almost visually offensive since it seems clear that some better route must exist.
544
VEHICLE ROUTING A N D SERVICES
Figure 10.24. Illustration of the 2-opt algorithm
The 2-opt (and 3-opt) algorithms attempt to improve the tour by removing two (or three) links and reconstituting the tour in such a way that the total distance is reduced. Figure 10.24 illustrates the basic idea behind the 2-opt algorithm. The original network is shown as solid lines. The curved lines between A and B and also between C and D are portions of the tour that may contain additional nodes that are not explicitly shown in the figure. There are direct links between nodes A and D and between B and C. These two links cross each other. If we remove these two links and then replace them by links BD and CA the total tour length will clearly be reduced. In doing so, we need to reverse the direction of all of the links on the path from C to D so that they are now directed from D to C, as shown by the dashed curved line. Provided the distance matrix is symmetric or distances are Euclidean, reversing the direction of these links should have no impact on the total tour length. We do need to exercise care in reversing links, however, in some circumstances. For example, if time windows are associated with the pickups or dropoffs on a segment of the route, reversing the direction of that route segment may force some activities to fall outside their allowable time windows. Also, if there are precedence constraints on the nodal activities (e.g., you have to pick up a customer before you can drop her off), reversing the direction of a route segment may result in an infeasible tour. In general, removing two (non-adjacent) links in a tour will create two unlinked paths. There will be only two ways to re-link these paths to create a tour: (a) we can replace the two original links (e.g., links AD and BC in Figure 10.24) or (b) we can use the only other possible re-linking (e.g., links BD and CA). (If the link distances are not symmetric, we also need to consider DB and AC as well as DA and CB, with the appropriate redirection of the links between A and B and between C and D.) The 2-opt algorithm continues trying pairs of link removals until no two links can be removed and the tour re-linked to reduce the total tour distance. For problems with Euclidean distances, we can show that the tour will not cross itself after the use of the 2-opt algorithm.
THE TRAVELING SALESMAN PROBLEM
545
Figure 10.25. Tour of Figure 10.15 after removing links AF and BD
Figure 10.25 shows the impact of removing links AF and BD and then relinking the tour, beginning with the tour shown in Figure 10.15. The length of the tour in Figure 10.15 was 96.15. After this operation, the length has decreased to 93.14. We can then remove links GC and FB and replace them by links GF and CB (reversing the path from C to E to F) to obtain the tour shown in Figure 10.26. Note that this is identical to the optimal tour shown in Figure 10.17. In this case, the 2-opt algorithm has found the optimal tour. The 3-opt algorithm works in a similar manner except that three links are removed. This will create three paths that can be re-linked in eight different ways. Thus, although there are approximately \N\2 possible pairs of links to remove for a 2-opt algorithm and only two ways to re-link the resulting paths, there are approximately \N\3 ways to remove three links from a tour and there are eight ways to re-link the resulting three paths for a 3-opt algorithm. The 3-opt algorithm is computationally far more intensive than is the 2-opt algorithm. This added computational burden, however, comes with the prospect of slightly better tours. Problem 6 asks you to identify the three links whose removal and subsequent re-linking of the tour will result in an optimal tour when performed on the tour of Figure 10.1. Conceptually, we can try 4-opt and 5-opt algorithms and so on. Lin and Kernighan (1973) proposed a variable k-opt algorithm in which the procedure determines the best number of links to remove at each stage of the algorithm. This procedure, however, is exceptionally complex.
546
VEHICLE ROUTING AND SERVICES
Figure 10.26. Tour of Figure 10.25 after removing links GC and FB
(a) Original Route
(b) Path A-B-C Removed
(c) Re-linked Route
Figure 10.27. Illustration of Or-opt algorithm
The Or-opt algorithm proceeds in a somewhat different manner. The basic idea is to remove a path consisting of k consecutive nodes from the tour (along with the k - 1 links connecting them) and to find the best place on the route to re-insert that path in the remaining portion of the route. Figure 10.27 shows an example of the Or-opt algorithm for k = 3 and for a small route [see part (a)]. Three consecutive nodes, A, B, and C, are removed from the route [see part (b)]. We then find the best place to insert this sequence of nodes. In this case, the best place found is between nodes D and F on the route [see part (c)]. The Or-opt algorithm generally begins with k = 3. Each set of k consecutive nodes is removed and we find the best possible place (possibly the original location on the route) to insert the sequence of nodes. If an improved location is found for the sequence of nodes, the replacement is made. The process continues
THE TRAVELING SALESMAN PROBLEM
547
until there is no sequence of k = 3 nodes whose removal and re-insertion elsewhere on the route will reduce the total route length. At this point, we set k = 2 and attempt to remove two consecutive nodes (or equivalently a single link) and re-insert them elsewhere on the route. When we cannot find a sequence of two consecutive nodes whose removal and re-insertion elsewhere on the route will decrease the route length, we set k = 1 and try to re-insert each node at a different location on the route. To illustrate the three improvement algorithms further, we begin with the myopic solution beginning at node I as shown in Figure 10.16. The total distance for this route is 84.96. After the 2-opt algorithm, the total distance can be reduced to 81.55, as shown in Figure 10.28. If we now use the Or-opt algorithm on this route, we obtain the optimal route shown in Figure 10.17. If we apply the Or-opt algorithm to the original route of Figure 10.16, we obtain the route shown in Figure 10.29 with a total distance of 82.69. The 2-opt algorithm applied to this route yields the route shown in Figure 10.28. Applying the Or-opt algorithm to this route results in the optimal tour. This shows that (1) the direct application of the Or-opt algorithm does not guarantee that a route will not cross itself, (2) the order in which algorithms are used can impact the solution, and (3) repeated application of an algorithm after another heuristic has been used can result in further decreases in the total route distance. Finally, if we apply the 3-opt algorithm directly to the route of Figure 10.16, we obtain the optimal tour shown in Figure 10.17.
Figure 10.28. 2-opt heuristic applied to the route of Figure 10.16
548
VEHICLE ROUTING AND SERVICES
Figure 10.29. Or-opt heuristic applied to the route of Figure 10.16
10.5
VEHICLE ROUTING PROBLEMS
In many practical contexts, a single vehicle cannot serve all the demands for one or more of a number of reasons. First, the total quantity, volume, or weight of the goods to be delivered (e.g., the total number of meals to be delivered) may exceed the capacity of a single vehicle. Second, there may not be enough time to serve all customers with a single vehicle. This too occurs in many meal delivery programs because the food must be delivered quickly so that it is still warm when it arrives at the agency's clients. This is also generally the case in school busing problems. If a single vehicle cannot serve all customers, the already-difficult traveling salesman problem becomes even more challenging. Now we must also assign customers to vehicles (or routes) so that the total demand allocated to each vehicle does not exceed the vehicle capacity and the total travel time or travel distance of each route does not exceed the permissible values. Unfortunately, evaluating the travel time or distance associated with a route requires solving the traveling salesman problem for the customers assigned to the route. Therefore, to evaluate a candidate assignment of customers to routes accurately, we need to solve a difficult optimization problem for each route. Clearly, we are not likely to be able to solve such problems optimally. In this section, we outline a number of heuristics for the classical vehicle routing problem, or VRP. In the traditional VRP, we are given the locations and demands, measured in either cubic feet or pounds, of the material to be delivered or picked up. The classical problem deals only with either pickups or deliveries, but not both simul-
549
VEHICLE ROUTING PROBLEMS
taneously. In addition, we are given the location of a central depot from which, or to which, all of the goods must be shipped. We also know the distances or times between the central depot and every customer and between every pair of customers. Finally, we are given the maximum capacity, in weight or volume, for each route as well as the maximum distance or time for each route. The problem is to find a set of routes such that each customer is on exactly one route, the route capacity and duration or distance constraints are obeyed, and the total cost associated with all of the routes is minimized. Just as the TSP was exceptionally hard, so too is the VRP. We therefore outline two simple heuristics that have been devised for the problem.
10.5.1 The Sweep Algorithm The sweep algorithm (Gillett and Miller, 1974) centers the problem around the central depot. The coordinates of the central depot are (0,0) at the origin. The algorithm uses the polar coordinates of each demand point; in other words, the algorithm uses the angle of the point from the central depot and the distance from the central depot. Recall that if we are given the X and Y Cartesian coordinates of a node, (xh y¡), we can find the polar coordinates, (0„ p¡), using the following transformation:
θ,. =arcsin(x7p / ) The sweep algorithm begins by picking any angle from the origin or central depot. It then rotates the angle clockwise, sweeping demand points into the emerging route until a constraint is violated. Typically, the constraint that will be violated will be either the capacity constraint of the vehicle serving the route or the distance or time constraint. The capacity constraint is easy to check since we simply add the demand of the next potential customer to the total demand that is on the vehicle already. If the sum is less than or equal to the capacity of the vehicle, the demand node can be added to the route; otherwise, we stop constructing the emerging route. The distance or time constraints are harder to check because we theoretically need to solve a TSP using the depot, the nodes already on the route, and the new candidate demand node to determine whether or not adding the node will violate the constraint in question. In practice, in forming the routes, we generally just evaluate the route distance or time with the demands served in the order in which they are swept into the route. Sometimes we allow a route to exceed the nominal distance or time by a small amount—10 or 20 percent—in the hopes that subsequent route improvement algorithms will bring the route back to feasibility. When a new node cannot be added to the emerging route because its addition would cause a constraint to be violated, that node initiates a new route and the algorithm proceeds from that node. To illustrate the sweep algorithm, consider the data shown in Table 10.6. The depot is at the origin, as indicated above. There are 20 demand points. Five of
550
VEHICLE ROUTING A N D SERVICES
TABLE 10.6 Sample routing data Node
Demand
Angle
Radius
X-loc
Y-loc
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
33 17 17 17 33 17 17 17 33 17 17 17 33 17 17 17 33 17 17 17
0 7 16 26 37 49 62 76 91 107 124 142 161 181 202 224 247 271 296 322
2000 6000 6000 6000 2000 6000 6000 6000 2000 6000 6000 6000 2000 6000 6000 6000 2000 6000 6000 6000
2000.00 5955.28 5767.57 5392.76 1597.27 3936.35 2816.83 1451.53 -34.90 -1754.23 -3355.16 -4728.06 -1891.04 -5999.09 -5563.10 -4316.04 -781.46 104.71 2630.23 4728.06
0.00 731.22 1653.82 2630.23 1203.63 4528.26 5297.69 5821.77 1999.70 5737.83 4974.23 3693.97 651.14 -104.71 -2247.64 -4167.95 -1841.01 -5999.09 -5392.76 -3693.97
Depot
0
0
0
0.00
0.00
the demand points are located at a distance of 2000 units from the depot and have demands of 33 units each. The remaining 15 demands are located 6000 units from the depot and have demands of 17 units each. (The distance units might be hundredths of a mile, for example.) The angle between the nodes increases as we progress counterclockwise from node 0. Distances between nodes are computed using the Euclidean or straight-line distance formula. Routes of any length are permitted, meaning that the maximum route length (or time) is effectively infinite. The maximum capacity of each route is 120 demand units. If we begin with node 0 and proceed in a counterclockwise manner, the sweep algorithm generates the four routes shown in Figure 10.30 with a total distance of 81,236 units. The depot is shown as a large circle in the center of the figure and each of the 20 demand points is shown as a small square. Demand node 0 is immediately to the right of the depot and the demand nodes are numbered sequentially from there in a counterclockwise direction. The first route includes nodes 0,1, 2, 3, and 4. The sweep algorithm is actually very fast and so we can begin with every node, rotate both clockwise and counterclockwise, and select the best route from among the solutions generated in this manner (where N is the set of demand nodes). Figure 10.31 shows the results of doing this. The best solution is found
VEHICLE ROUTING PROBLEMS
551
Figure 10.30. Sweep algorithm results rotating counterclockwise from node 0
Figure 10.31. Best sweep routes found by rotating counterclockwise from node 9
by starting with node 9 and rotating counterclockwise. The total distance of the four routes is 80,941. A casual glance at the routes of Figure 10.31 (or of Figure 10.30 for that matter) suggests that the routes can readily be improved by using one or more of the improvement algorithms outlined in section 10.4.2.4. For example, the route just south of the depot in Figure 10.31 serves nodes 15,16,17,18, and 19
552
VEHICLE ROUTING AND SERVICES
Figure 10.32. Improved routes beginning with best sweep routes of Figure 10.31
in that order. Node 16 is the large demand node close to the depot. The vehicle goes out to node 15 and then has to come back in to node 16 and then out again to node 17. A better route would go from the depot to node 16, then to node 15, and then on to nodes 17, 18, and 19 to finish the route. Figure 10.32 shows the results of improving the routes shown in Figure 10.31 in this way. The total distance has been reduced by roughly 8.8 percent from 80,941 to 73,821. In addition to the intra-route improvement algorithms outlined in section 10.4.2.4, we can also try moving a node from one route to another, provided the distance, time, and capacity constraints are not violated by the move. We can also consider exchanging two nodes between two different routes, again ensuring that all constraints are satisfied when the nodes are swapped between routes.
10.5.2 The Savings Algorithm One advantage of the sweep algorithm is that it tends to partition the service area into regions, with each region served by a separate vehicle. While this creates nice geographic territories, it also is one of the key shortcomings of the algorithm. In practice, the best routing solutions often exhibit overlapping routes. In fact, in some cases, the optimal route structure has one route embedded within another route. The savings algorithm (Clarke and Wright, 1964) addresses these problems. The savings algorithm begins with each demand node assigned to its own vehicle and route. Routes are then merged based on the amount of distance or time that can be saved by merging the routes. Figure 10.33 illustrates the concept. The depot is shown as node D along with two demand nodes, 1 and 2. In part
553
VEHICLE ROUTING PROBLEMS
(a) Nodes 1 and 2 on Separate Routes
(b) One Merged Route
Figure 10.33. Savings algorithm
(a) of the figure, each node is served on its own route. In part (b), the two nodes have been merged into one route. We have added a link between node 1 and node 2 and have removed links between node 1 and the depot and between the depot and node 2. The savings in the total cost associated with merging demand nodes 1 and 2 into a single route is given by "12
=
C
\D
+
C
D2 ~
C
12'
where S12 denotes the savings and cjk is the cost of going directly from node j to node k. In this case, the savings would be Su = c1D + c 20 - c,2 = 11 + 13 - 4 = 20. The savings algorithm can be described by the following steps. Savings algorithm 1) Compute the savings associated with every pair of demand nodes. 2) Sort the savings in non-ascending (descending) order from the largest to the smallest. 3) Starting at the top of the (remaining) list of savings, merge the two routes associated with the largest (remaining) savings value, provided that: a) The two nodes are not already on the same route. b) Neither node is interior to its route, meaning that both nodes are still directly connected to the depot on their respective routes. c) The total demand associated with the merged route does not violate the capacity constraint. d) The total distance or time associated with the merged route does not violate the route length or time constraint. 4) Repeat step (3) until no additional savings can be achieved. In Figure 10.34, node 2 is interior to its route. It is not directly connected to the depot. Such a situation could arise if we merged the route shown in Figure
554
VEHICLE ROUTING A N D SERVICES
Figure 10.34. An interior node in a route
Figure 10.35. Savings algorithm routes for the example of Table 10.6
10.33(b) with a route from the depot to node 3 and back. One simple way of determining whether or not any additional savings are possible in step 4 is to compute the total demand associated with the two routes with the smallest demand. If the sum of these demands exceeds the vehicle capacity, then no additional route mergers are possible and the algorithm can stop. Figure 10.35 shows the results of using the savings algorithm on the data of Table 10.6. The total distance has been reduced to 69,584 units. Note that three of the routes intersect each other and we no longer have nice wedge-shaped territories. The savings algorithm is very versatile. It can readily be extended in a number of ways. For example, the radial distances, cjD and cDk, can be weighted differently
VEHICLE ROUTING PROBLEMS
555
from the circumferential distance, cjk, to obtain a generalized savings value, SfknemUzed =X{cjD+cDk)-cjk. Also, it should be clear that the savings associated with demand nodes that are very far apart is likely to be small. Therefore, we may compute only the savings associated with demand nodes that are close to each other. One way to do this is to superimpose a grid on the demand nodes. We might then compute only the savings associated with demand nodes in the same grid cell or in neighboring cells. This can significantly reduce the computational burden associated with computing and sorting the savings values, frequently with no degradation of the algorithm's final results. Also, it is easy to include additional conditions in the list of conditions in step 3. For example, in routing school buses, we frequently have separate buses for children who are disabled in one way or another. We might not want an emotionally disturbed 17-year-old on the same bus with a physically handicapped 8-year-old, for example. We could then have a condition that stipulates that two nodes cannot be merged unless the demands (children) associated with the routes are compatible. In short, while the savings algorithm may not be as sophisticated as many newer algorithms it has three key advantages. First, it is easy to understand. Second, it is easy to implement. Third, it is easy to adapt to new conditions and new problem domains.
10.5.3
Randomized Savings Algorithm
The savings algorithm and the sweep algorithm, as described above, are deterministic algorithms. There is nothing random or uncertain about either algorithm. If you apply either algorithm repeatedly, you will always get the same result. This, however, need not be true. The savings, for example, merely give an indication of the value associated with merging two particular nodes. There is no look-ahead capability built into the savings computation and, as such, the procedure may result in solutions that are sub-optimal. Many algorithms, including the sweep and savings algorithms, can be randomized. For example, in step 3 of the savings algorithm, instead of selecting the pair of demand nodes with the largest unprocessed savings value, we might elect to process one of the top P savings values at random. In this way, the algorithm can be randomized. The value of P represents how deeply we want to dig in the savings list for the next pair of nodes to process. If P = 1, we have the standard savings algorithm. As P increases from 1, the algorithm becomes increasingly random. If we use P > 1 with different random number streams, the results will differ each time, and we can select the best solution from among many different runs of the algorithm. Similarly, in the sweep algorithm, instead of always selecting the demand node with the next larger (or smaller) angle, we might select a demand node at random from among the next P nodes in the direction in which we are sweeping. (We would then have to be careful about how to return to nodes that have not been processed yet, but the details of how to do that can be readily determined when the algorithm is implemented.) One version of the randomized savings algorithm is as follows.
556
VEHICLE ROUTING A N D SERVICES
Randomized savings algorithm 1) Compute and sort the savings as in the standard savings algorithm. Set P, the maximum depth or maximum number of savings to consider at any time, and Q, the number of replications of the algorithm at each depth. 2) Apply the classical savings algorithm (with a depth of 1). Let BestKnown be the objective function value and routes associated with this solution. 3) For p = 2 to P (where p is the current depth in the savings list), perform the following steps: a) For q = 1 to Q (where q is an iteration counter), perform the following steps: i) Apply the savings algorithm with the next savings to be processed selected randomly from the top p unprocessed savings in step 3 of the classical savings algorithm above. ii) If the solution just found has a better objective function value than that of BestKnown, replace BestKnown with the objective function value and routes of this solution. 4) Return BestKnown as the best solution. Figure 10.36 shows the results of applying the randomized savings algorithm with a depth of 10 (P = 10) and 10 iterations per depth (Q = 10) to the data of Table 10.6. The total distance is 69,525, slightly less than that shown for the routes in Figure 10.35. While randomized algorithms typically take longer than their deterministic counterparts because they are executed multiple times, they often provide better
Figure 10.36. Results of randomized savings algorithm
557
SUMMARY
solutions. Randomization algorithms.
10.5.4
is a powerful
technique
in enhancing
many
Other Vehicle Routing Algorithms
In this chapter, we have only scratched the surface of the numerous vehicle routing algorithms that have been developed. Other methodologies include: • tabu search algorithms (Glover, 1989, 1990a, 199b; Glover and Laguna, 1997; Taillard et al., 1997; Gendreau, Hertz, and Laporte, 1994; Gendreau, Laporte, and Séguin, 1996; Toth and Vigo, 2003, Fu, Eglese, and Li, 2005) • genetic algorithms (Goldberg, 1989; Baker and Ayechew, 2003) • simulated annealing (Chiang and Russell, 1996) • ant algorithms (Meuleau and Dorigo, 2002; Doerner et al., 2003; Reimann, Doerner, and Hartl, 2004) • variable neighborhood search (Hansen and Mladenovic, 2001) Laporte (2007) provides an excellent summary of the vehicle routing problem. Other somewhat dated summaries include the text edited by Golden and Assad (1988) and the review papers by Laporte (1992a, 1992b).
10.6
SUMMARY
This chapter has provided an overview of vehicle routing problems and algorithms. Routing is essential for the delivery of many services including school busing, street cleaning, snow plowing, postal services, the delivery of large consumer goods such as refrigerators, freezers, stoves, and dishwashers, as well as home repair service providers such as plumbers and electricians. In some cases, service must be provided to an entire link or street, as in the case of snow plowing, street cleaning, and postal services. In other cases, service is provided to discrete locations, as in the case of express mail deliveries, school busing, and home repair services. Section 10.3 introduced algorithms for the Chinese Postman Problem when service is to be delivered to the links or streets of a network. Three cases were identified. If all links are undirected (each street can be traversed in either direction and needs to be traversed only once) or if all links are directed (each street is either one-way or each of the two-way streets must be traversed one or more times in each direction), the problems are easy to solve. We simply augment the network to obtain an Euler tour and then draw the Euler tour on the network. If multiple vehicles are needed, we can (heuristically) divide the Euler tour into segments, each of which is to be served by a different vehicle. If, on the other hand, the network is composed of some directed links and some undirected links, the problem is exceptionally hard. The problem on the mixed network is beyond the scope of this text.
558
VEHICLE ROUTING AND SERVICES
Sections 10.4 and 10.5 dealt with problems in which services were delivered to specific nodes in the network. Section 10.4 discussed the classical Traveling Salesman Problem. A number of construction and improvement heuristics were outlined. In section 10.5, we examined the Vehicle Routing Problem in which multiple vehicles are needed to serve all customer demands. The algorithms outlined in this chapter are really only the building blocks for more sophisticated approaches that are often needed to solve routing problems for real service providers. Many complicating factors have been ignored in this chapter. For example, there are often time windows during which a delivery either must take place or is not permitted to occur. Fast food establishments, for example, do not want deliveries during the peak lunchtime period. A large delivery truck would take up several parking places that could be used by patrons of the restaurant. In addition, the driver often needs the assistance of the restaurant staff in unloading the vehicle. These staff members are better deployed serving customers during the lunch hour rather than unloading a delivery vehicle. Therefore, the lunchtime period is frequently precluded as a possible delivery time for vehicles in this case. The presence of time windows complicates the problem significantly. In fact, the problem of finding a feasible set of routes that satisfy all time windows is itself a difficult problem, let alone finding the best possible set of routes. To circumvent these problems, at least to some extent, the vehicle routing problem with time windows is often formulated with penalties for violations of the time window constraints rather than with hard and fast constraints that cannot be violated. In some cases, nodes must be visited with differing frequencies. For example, some homes may pay for waste removal on two days of the week, while others may elect only one day of pickups. In the inter-library loan problem described in section 10.1, major public libraries may receive deliveries daily, college and university libraries might receive deliveries three times a week, while public schools and other smaller libraries might receive dropoffs only twice each week. If the customer delivery times are known in advance, we are left with a standard vehicle routing problem for each day. On the other hand, the delivery dates might need to be determined jointly with the routing. Customers or libraries receiving service twice each week might need to be assigned to either a Monday/Thursday, Tuesday/Friday, or Monday/Friday schedule. Also, it might be beneficial to upgrade a library receiving deliveries twice each week to deliveries three times a week if there are other nearby libraries on a three-day-per-week schedule. Such problems become exceptionally difficult (Francis, Smilowitz and Tzur, 2006, 2007). In many services, including the inter-library loan problem as well as express package delivery and pickup problems, vehicles must simultaneously pick up customers or demands and deliver other customers or demands. The simultaneous pickup and delivery problem introduces two new features to the vehicle routing problems discussed above. First, precedence constraints may need to be imposed on the routes. If the vehicle is picking up senior citizens at their resi-
SUMMARY
559
dences and dropping them off at various physician offices and clinics, clearly a client pickup must precede the dropoff of that client. Second, not only do we need to be concerned with the capacity of the vehicle as it leaves the depot (in the case of deliveries alone) or arrives back at the depot (in the case of pickups alone), we must now be concerned with the capacity of the vehicle at every stop along the way. Clearly, the number of senior citizens on the bus as it leaves any location cannot exceed the number of seats on the bus. The objective function used throughout this chapter has been the minimization of the total route length. This is an efficiency objective. While many service providers must be concerned with efficiency, they are also concerned with efficacy and equity. Efficacy can be thought of as a measure of the quality of service provided to customers. One way to measure efficacy is to look at the service time of all customers in the system. For example, consider a school bus route that serves stops 1, 2, 3,4, and 5. The number of children dropped off at each stop is equal to the stop number; one child at stop 1, two at stop 2, and so on. The bus takes 5 minutes to travel between the school and either stop 1 or stop 5, and 5 minutes between each pair of stops. If the bus begins with 15 students at the school and goes to stop 1 and then to stop 2 and so on until stop 5, there will be 5 + 2 · 10 + 3 · 15 + 4 - 2 0 + 5 · 25= 275 student-minutes of time on the bus, or an average of 18.3 minutes per student. On the other hand, if the bus proceeded in the opposite direction, visiting stop 5 first, then stop 4 and so on, the total number of student-minutes on the bus would be reduced to 5 · 5 + 4 · 10 + 3 · 15 + 2 · 20 + 25 = 175 or an average of 11.7 minutes per student. In either route, the bus takes a total of 30 minutes to travel from the school back to the school. Thus, the efficiency is the same for both routes, but the second route results in a smaller average time per student on the bus and is better in terms of efficacy. Equity refers to fairness between customers. The efficiency argument would suggest that the bus pick up students in the morning in the reverse order, beginning with stop 1 and ending with stop 5. Again, the total number of studentminutes on the bus would be 11.7. However, the poor student at stop 1 spends a total of 50 minutes on the bus each day while the lucky students at stop 5 spend only 10 minutes on the bus each day. Marsh and Schilling (1994) summarize a large number of equity measures that have been used in facility location analysis, many of which can also be employed in vehicle routing problems. Some routing problems involve multiple depots. For example, in garbage collection problems, there may be multiple waste sites at which household waste can be deposited. In such cases, we not only need to partition the nodes into routes and to sequence the nodes on the routes, but we also must allocate demand nodes or routes to specific facilities or depots. In some cases, the location of the depots must also be determined. Such problems are very complex (Laporte, Nobert, and Taillefer, 1988; Min, Jayaraman, and Srivastava, 1998; Perl and Daskin, 1985; and Wasner and Zäpfel, 2004). Building on the techniques outlined in this chapter and in the References section, you should be able to tailor an algorithm for many extensions of the
560
VEHICLE ROUTING AND SERVICES
classical routing problems outlined above. Virtually every routing problem of any practical interest is a hard problem in the sense that there is no known provably optimal algorithm whose worst-case running time does not grow exponentially with the size of the problem. Heuristic methods are the norm. In developing heuristics, you are limited only by your imagination and your own programming skills.
10.7
PROBLEMS
1. Show that for an undirected network, the number of odd-degree nodes must be an even number. Note that this property is critical if we are to find a matching of the odd-degree nodes. 2. Show that for a directed network the sum of the in-degrees must equal the sum of the out-degrees, summed over all nodes of the network. Show that this also means that the sum over all nodes of the net out-degree minus the in-degree must be 0. 3. Show that the additional distance needed to convert a directed network into an Euler tour is always greater than or equal to the distance needed to convert the same topological network but with all edges treated as undirected edges into an Euler tour. Hint: Think about what must be true about (a) the relationship between nodes in the directed network with an in-degree that is not equal to the out-degree on the one hand and their counterpart nodes in the corresponding directed network and (b) the solution to the transportation problem that must be solved to find the optimal matching in the directed network relative to the set of possible solutions for the optimal matching problem for the undirected CPP. 4. Use the approach outlined in section 10.4.1 to find the optimal traveling salesman tour for the data shown in Table 10.4. 5. Argue that the worst possible result from Christofides' heuristic for the traveling salesman problem is a tour that is 1.5 times the optimal tour length. 6. Which three links can be removed from the tour of Figure 10.15 so that the appropriately re-linked tour will be optimal? 7. Explain why the savings algorithm should not be used to merge routes when one (or both) of the nodes is interior to its route. 8. Consider the following network: a) Find the minimum spanning tree on this network. b) Draw the tree. c) What is the total length of all arcs in the tree?
PROBLEMS
561
9. Using the network shown in problem 8: a) Use Christofides' algorithm to solve the Traveling Salesman Problem. Draw the tour. What is the total length of the tour? b) Use the optimal algorithm outlined in section 10.4.1 with additional subtour elimination constraints as needed to find the optimal tour. Draw the tour. What is the total length of this tour? c) What is the percentage difference between the tour found using Chrisofides' algorithm and the optimal tour? 10. Using the network shown in problem 8, solve the Chinese Postman Problem. a) What are the odd-degree nodes? b) What is the optimal pairing of the odd-degree nodes? c) How much additional distance is added due to the pairing of the odd degree nodes? d) What is the total length of the original network (without the total distance of the optimal pairing of the odd-degree nodes)? e) What percentage of the total length of the original network is the total distance of the optimal pairing of the odd-degree nodes? f) Find an Euler tour on the original network plus the links that are added as a result of the optimal pairing of the odd-degree nodes. List the nodes to be visited in order beginning with node 1. 11. Consider the following network: a) Find the minimum spanning tree on this network.
562
VEHICLE ROUTING A N D SERVICES
b) Draw the tree. c) What is the total length of all arcs in the tree?
12. Using the network shown in problem 11: a) Use Christofides' algorithm to solve the Traveling Salesman Problem. Draw the tour. What is the total length of the tour? b) Use the optimal algorithm outlined in section 10.4.1 with additional subtour elimination constraints as needed to find the optimal tour. Draw the tour. What is the total length of this tour? c) What is the percentage difference between the tour found using Chrisofides' algorithm and the optimal tour? 13. Using the network shown in problem 11, solve the Chinese Postman Problem. a) What are the odd-degree nodes? b) What is the optimal pairing of the odd-degree nodes? c) How much additional distance is added due to the pairing of the odd degree nodes? d) What is the total length of the original network (without the total distance of the optimal pairing of the odd-degree nodes)? e) What percentage of the total length of the original network is the total distance of the optimal pairing of the odd-degree nodes? f) Find an Euler tour on the original network plus the links that are added as a result of the optimal pairing of the odd-degree nodes. List the nodes to be visited in order beginning with node 1. 14. Consider the directed network shown below: a) Find the in-degree and out-degree of every node. b) Find the optimal pairing of the nodes for which the in-degree does not equal the out-degree.
563
PROBLEMS
c) What links are used in the optimal pairing? d) Using the optimal pairing, find an Euler tour on the original network augmented by the links used in the optimal pairing. List the nodes to be visited in order, starting with node 1. e) Of the total distance of the Euler tour, what percentage is represented by the addition of links used in the optimal pairing?
15. Again, consider the network shown in problem 14, except that now let the link between node 6 and node 12 as well as the link between node 4 and node 5 be undirected. Each of these two links must be traversed at least once in an optimal solution to the Chinese Postman Problem. However, we must now determine the direction in which to traverse each of these links. Solve the Chinese Postman Problem under these revised conditions. 16. Consider the data shown below. The depot is at node 0. Each vehicle has a capacity of 350 units. The maximum distance that a vehicle can travel is 50 units. Compute the distances using the Euclidean distance formula. That is, the distance, d¡k between points j and k, with coordinates (x¡, y¡) and (xk, yk), respectively, is djk = ^{Xj - xk f + ( vy ~ykf. a) Use the sweep algorithm to find the best routes, beginning with the node with the smallest angle (node 8) and proceeding counterclockwise. i) How many routes do you use? ii) What is the total route length? iii) List the nodes visited on each route, the demand associated with that route, and the route length. b) Again using the sweep algorithm, begin at the node with the second smallest angle (node 1) and proceed counterclockwise. i)
How many routes do you use?
ii)
What is the total route length?
564
VEHICLE ROUTING AND SERVICES
iiii) List the nodes visited on each route, the demand associated with that route, and the route length. c) Use the savings algorithm to solve the problem. Again: i) How many routes do you use? ii) What is the total route length? iiii) List the nodes visited on each route, the demand associated with that route, and the route length. d) Of the three solutions you have found, which one is the best in terms of minimizing the total distance associated with the routes? Node
X-coordinate
Y-coordinate
Demand
Angle
Radius
0 1 2 3 4 5 6 7 8 9 10
0 5 3 6 -5 -3 -7 3 7 -3 -4
0 7 5 -6 -1 -9 -6 -8 2 4 8
0 65 95 100 85 60 110 100 85 60 75
54.46 59.04 315.00 191.31 251.57 220.60 290.56 15.95 126.87 116.57
8.60 5.83 8.49 5.10 9.49 9.22 8.54 7.28 5.00 8.94
REFERENCES Angéniol, B., G. de La Croix Vaubois, and J.-Y. Le Texier, 1988, "Self-organizing feature maps and the travelling salesman problem," Neural Networks, 1, 289-293. Baker, B. M., and M. A. Ayechew, 2003, "A genetic algorithm for the vehicle routing problem," Computers and Operations Research, 30, 787-800. Bartholdi, J. X, and L. K. Platzman, 1982, "An O(NlogN) planar traveling salesman heuristic based on spacefilling curves," Operations Research Letters, 1, 4,121-125. Bartholdi, J. J., and L. K. Platzman, 1988, "Heuristics based on spacefilling curves for combinatorial problems in Euclidean space," Management Science, 34,3, 291-305. Bartholdi, J. J., L. K. Platzman, R. L. Collins, and W. H. Warden, 1983, "A minimal technology routing system for Meals on Wheels," Interfaces, 3, June, 1-8. Chiang, W.-C, and R. A. Russell, 1996, "Simulated annealing metaheuristics for the vehicle routing problem with time windows," Annals of Operations Research, 63, 3-27. Christofides, N., 1976, "Worst-case analysis of a new heuristic for the traveling salesman problem," Report 388, Graduate School of Industrial Administration, Carnegie Mellon University, Pittsburgh, PA. Clarke, G., and J. W Wright, 1964, "Scheduling of vehicles from a central depot to a number of delivery points," Operations Research, 12, 568-581.
REFERENCES
565
Doerner, K., R. F. Hartl, V. Maniezzo, and M. Reimann, 2003, "An ant system metaheuristic for the capacitated arc routing problem," The Fifth Metaheuristics International Conference, MIC2003, Kyoto, Japan, 1-16 to 6-16. Francis, P. M., 2006, "Period vehicle routing with service choice: Models and algorithms," Ph.D. dissertation, Department of Industrial Engineering and Management Sciences, Northwestern University, Evanston, IL. Francis, P., and K. Smilowitz, 2006, "Modeling techniques for periodic vehicle routing problems," Transportation Research Part B: Methodological, 40, 872-884. Francis, P., K. Smilowitz, and M. Tzur, 2006, "The period vehicle routing problem with service choice," Transportation Science, 40, 4, 439^154. Francis P., K. Smilowitz, and M. Tzur, 2007, "Flexibility and complexity in periodic distribution problems," Naval Research Logistics, 54, 2,136-150. Fu, Z., R. Eglese, and L.Y.O. Li, 2005, "A new tabu search heuristic for the open vehicle routing problem," Journal of the Operational Research Society, 56, 261-21 A. Garey, M. R., and D. S. Johnson, 1979, Computers and intractability: A guide to the theory of' NF'-completeness,W. H. Freeman and Co., New York. Gendreau, M., A. Hertz, and G. Laporte, 1994, "A tabu search heuristic for the vehicle routing problem," Management Science, 40,10,1276-1290. Gendreau, M., G. Laporte, and R. Séguin, 1996, "Tabu search heuristic for the vehicle routing problem with stochastic demands and customers," Operations Research, 44, 3, 469-477. Gillett, B., and L. Miller, 1974, "A heuristic algorithm for the vehicle dispatch problem," Operations Research, 22, 340-349. Glover, F., 1989, "Tabu search—Part I," ORSA Journal on Computing, 1, 3,190-206. Glover, F., 1990a, "Tabu search—Part II," ORSA Journal on Computing, 2,1,4-32. Glover, F., 1990b, "Tabu search: A tutorial," Interfaces, 20, 4, 74-94. Glover, F., and M. Laguna, 1997, Tabu Search, Kluwer Academic Publishers, Boston, MA. Goldberg, D., 1989, Genetic algorithms in search optimization and machine learning, Addison-Wesley, Reading, MA. Golden, B. L., and A. A. Assad, (eds.), 1988, Vehicle routing: Methods and studies, NorthHolland, Amsterdam. Hansen, P., and N. Mladenovic, 2001, "Variable neighborhood search: Principles and applications," European Journal of Operational Research, 130, 449-467. Kruskal, X, 1956, "On the shortest spanning subtree of a graph and the traveling salesman problem," Proceedings of the American Mathematical Society, 17,1, 48-50. Laporte, G, 1992a, "The traveling salesman problem: An overview of exact and approximate algorithms," European Journal of Operational Research, 59, 231-247. Laporte, G., 1992b, "The vehicle routing problem: An overview of exact and approximate algorithms," European Journal of Operational Research, 59, 345-358. Laporte, G., 2007, "What you should know about the vehicle routing problem," Naval Research Logistics, 59, 8, 811-819. Laporte, G., Y. Nobert, and S. Taillefer, 1988, "Solving a family of multi-depot vehicle routing and location-routing problems," Transportation Science, 22, 3, 161-172. Lawler, E. L., J. K. Lenstra, A. H. G. Rinnooy Kan, and D. B. Shmoys, 1985, The traveling salesman problem: A guided tour of combinatorial optimization, John Wiley & Sons, New York. Lin, S., and B. W. Kernighan, 1973, "An effective heuristic algorithm for the traveling salesman problem." Operations Research, 21, 498-516.
566
VEHICLE ROUTING A N D SERVICES
Malandraki, C , and M. S. Daskin, 1993, "The maximum benefit Chinese postman problem and the maximum benefit traveling salesman problem," European Journal of Operations Research, 65, 218-234. Marsh, M. T., and D. A. Schilling, 1994, "Equity measurement in facility location analysis: A review and framework," European Journal of Operational Research, 74,1-17. Meuleau, N., and M. Dorigo, 2002, "Ant colony optimization and stochastic gradient descent," Artificial Life, 8,103-121. Min, H., V. Jayaraman, and R. Srivastava, 1998, "Combined location-routing problems: A synthesis and future research directions," European Journal or Operational Research, 108,1-15. Perl, J., and M. S. Daskin, 1985, "A warehouse location-routing model," Transportation Research, 19B, 381-396. Prim, R. C , 1957, "Shortest connection networks and some generalizations," Bell System Technical Journal, 36,1389-1401. Reimann, M., K. Doerner, and R. F. Hartl, 2004, "D-Ants: Savings based ants divide and conquer the vehicle routing problem," Computers and Operations Research, 31, 563-591. Taillard, E., P. Badeau, M. Gendreau, F Guertin, and J.-Y. Potvin, 1997, "A tabu search heuristic for the vehicle routing problem with soft time windows," Transportation Science, 31, 2,170-186. Toth, P., and D. Vigo, 2003, "The granular tabu search and its application to the vehiclerouting problem," INFORMS Journal on Computing, 15, 4, 333-346. Wasner, M., and G. Zäpfel, 2004, "An integrated multi-depot hub-location vehicle routing model for network planning of parcel service," International Journal of Production Economics, 90, 403^119.
11 WHERE TO FROM HERE?
"Happy New Year! Happy New Year!" Everyone raised their glasses and toasted the incoming year as they watched the fireworks on the wide-screen TV at their rented condominium in Florida. The Nichols family had spent five days down south and was looking forward to another two days of fun and sun before heading back north. "Here's to a great year for all of us," John Nichols said, toasting his wife and two daughters. Amanda, their 22-year-old daughter, seemed a bit distracted amidst the holiday cheer. Her angst did not escape the close gaze of her mother, Diana. "What's wrong, Amanda? You seem less than thrilled. It's been a great vacation and you have lots to look forward to this year. After all, you are graduating in May, " Diana said. "I know, Mom," Amanda replied. "That's just it. I love school and I dread having to leave. I don't have a job yet and I feel there is still so much more to learn. "
Service Science, by Mark S. Daskin Copyright © 2010 by John Wiley & Sons, Inc 567
568
11.1
WHERE TO FROM HERE?
INTRODUCTION
The service industries are growing rapidly throughout the world, but particularly in the developed countries. The focus of this book has been on the use of optimization and queueing theory to analyze service systems and to help the operators and owners of such systems make better decisions. Following a brief introductory chapter, Chapters 2 and 3 provided the methodological background in optimization and queueing modeling for the remainder of the text. Chapter 4 applied optimization modeling to location and districting decisions. Both government and private service providers often require inventory to serve their customers. Inventory management was the focus of Chapter 5. Resource allocation decisions were discussed in Chapter 6. Chapters 7 and 8 addressed short- and long-term workforce management problems, respectively. Chapter 9 examined priority service systems, call center design, and the impacts of customer scheduling in service systems. Chapter 10 addressed vehicle routing problems. As Amanda, mentioned in the vignette at the beginning of this chapter, has learned, even 4 years at the best of universities cannot teach you all you need to know in today's world. So, too, it is with this topic. No single book can possibly cover all that there is to know about the service industries, even when approached from the perspective of modeling for improved decision making. Section 11.2 briefly summarizes three additional methodologies that are useful in the analysis of service systems. Section 11.3 discusses a number of additional problem areas within the service sector to which our modeling approaches can be applied.
11.2
OTHER METHODOLOGIES
Although queueing theory and optimization modeling are powerful techniques in the analysis and design of service systems, a number of other methodologies are also important. This section briefly outlines three such techniques: statistical analysis (section 11.2.1), stochastic optimization (section 11.2.2), and simulation modeling (section 11.2.3).
11.2.1
Statistical Analysis and Forecasting
In much of this book, we have assumed that we know the demand for services. For example, we assumed that we know the number of students who want to take a particular course when we need to assign classrooms to courses. In dealing with inventory decisions, we either treated the consumption rate as being a known constant or a known probabilistic function. We may have assumed that the demand for a service (e.g., the number of emergency room patients to arrive each day) followed a Poisson distribution with a known mean (of eight per day, for example). But where do these estimates come from and how important is it to estimate the demands accurately? Let us first answer the second question. In many cases, it is not critical that the demands be estimated particularly accurately in the sense
OTHER METHODOLOGIES
569
that the key decisions are often not terribly sensitive to the exact magnitude of the demand for services. Location models are notoriously insensitive to small changes in the demands at the nodes. One simple example of this is the onemedian problem on a network with two nodes. The optimal solution is simply to locate the single facility at the node with the larger demand. As long as we know which node is going to generate the larger demand, we do not need to be concerned with the exact magnitude of the demand, provided we care only about the location decision. The objective function value—the demand-weighted total or average distance—will depend critically on the magnitude of the smaller node's demand in this case. Note that for this problem, the location decision is completely independent of the distance between the two nodes. The distance can be 1 mile, 10 miles, 100 miles, or 1000 miles. In each case, we will locate at the node with the larger demand. Again, the objective function value will depend on the distance between the nodes. Inventory decisions are also relatively insensitive to the magnitude of the demand. Recall that the economic order quantity goes up with the square root of the demand. If we overestimate the demand by 10 percent, the order size will be less than 5 percent larger than the optimal value and the total ordering and inventory carrying cost will be about 0.1 percent above the optimal value. In this case, the objective function value is even less sensitive to small changes in the demand than is the key decision. Whenever possible, demand should be estimated based on historical data. While past performance does not guarantee future returns, as portfolio managers often remind us, historical demand is often a good indicator of future demand. Regression analysis and time series analysis are often used to predict future demands based on historical data. Regression attempts to predict the demand based on other underlying factors. For example, the demand for inter-library loans—the dependent variable—might depend on the number of people overall in the service region, the number of public libraries, and the fraction of the population that is employed in the region— three independent variables. As regression models are developed, it is important that there are reliable estimates of current and future values of the independent variables; otherwise, we have simply transformed the prediction problem from one of predicting the value of the dependent variable to one of predicting the value(s) of the independent variables. Most statistical textbooks (Tamhane and Dunlop, 2000; Devore, 2008) cover simple linear regression as well as multi-variate regression. Time series analysis attempts to predict future demands directly from observations of past demand values. In this case, the demand next month will be predicted as a function of the demand this month, an overall trend, and seasonality factors derived from the historical data. Many basic operations management texts (Heizer and Render, 2001; Render, Stair, and Hanna, 2003; Hopp and Spearman, 2008; and Nahmias, 2009) and supply chain management books (Chopra and Meindl, 2004) include sections on time-series forecasting that are also appropriate for the service industries.
570
11.2.2
WHERE TO FROM HERE?
Stochastic Optimization
The optimization problems that we have considered in this text have not explicitly represented uncertainty. Uncertainty, however, is inherent in most service systems. Future demand is not known with certainty; costs may not be known with certainty; resource availability may also be uncertain. For example, in assigning aircraft to gates at an airline terminal, the exact arrival times of the inbound flights might be uncertain, the pushback times of the outbound flights are also likely to be uncertain, and the exact number of passengers boarding each outbound flight might be uncertain when gate assignment decisions must be made. Several techniques have been devised to deal with uncertainty in optimization. Chance constrained optimization typically optimizes a deterministic objective function subject to constraints that must be satisfied with a given probability. For example, if the arrival and pushback times of the aircraft are uncertain, then the total time that an aircraft will occupy a gate is also uncertain. Some flights may arrive to find that the gate to which they are assigned is not yet available. In this case, we may impose a constraint that stipulates that the probability of an inbound flight having to wait more than 5 minutes for an available gate must be less than or equal to 0.05. Similarly, in assigning classes to classrooms in the face of uncertain course enrollments, we may impose a constraint that states that the probability of a course being assigned to a room that is too small to accommodate all students must be no more than 0.1. Stochastic optimization or optimization with recourse deals primarily with multi-stage decision making. For example, we may need to decide now on the number of elementary schools to build to serve a number of new housing developments without knowing for sure how many school-aged children will live in each area. The second stage decision would then assign students to the schools whose sites were determined in the first phase after the uncertainty about the number of students in each region has been resolved. Our objective in the first phase might be to locate schools in such a way that we minimize the expected number of students requiring busing (e.g., living more than 1 mile from their school) over all possible future scenarios of where students might actually live. Sen and Higle (1999) and Birge and Louveaux (1999) are excellent references on stochastic optimization. Robust optimization is useful when the uncertainty regarding one or more parameters entering a model can be characterized by a range within which the parameter(s) must fall. For example, we may not know the exact number of students enrolling in a class, but we might know that it will certainly be at least 30 (since there may be 30 graduating seniors who must take the course this term) and no more than 50 (since there are only 50 students in the program who have taken all of the prerequisite courses). Now, in addition to optimizing any performance measure (e.g., minimizing the number of classes that are not held in the same building as the department that is offering the course) any assignment of
OTHER METHODOLOGIES
571
courses to rooms must be feasible for all possible values of the number of students who want to take a course. Bertsimas and Thiele (2006) provide an excellent overview of robust optimization.
11.2.3
Simulation
Most service systems exhibit stochasticity or randomness. The actual demand for emergency services, even at the same time of day and on the same day of the week, will differ from one week to the next due to random events. The arrival times of patients at a clinic, even when patients are scheduled for particular appointment times, are subject to randomness due to numerous factors, including a lack of synchronicity between the watches and clocks of the patients and the clinic personnel and traffic patterns the patients encounter en route to the clinic. Examination times with the physicians and medical staff at the clinic are also subject to randomness. Some patients require significantly less time than the scheduled time, while others may require dramatically more than the allotted time. There are three approaches available to us in modeling such systems. At one extreme, we find analytic queueing theory, as discussed extensively in sections 3.3, 3.4, and 3.5 of Chapter 3. A key insight from virtually all such models is that the performance measures or metrics are almost all inversely proportional to 1 - p, where p is the arrival rate multiplied by the mean service time divided by the number of servers. Even priority queues, as discussed in section 9.2, behave in this manner. In other words, performance degrades as the utilization ratio increases and performance becomes quite bad as the utilization of the system approaches 100 percent. Such insights are useful. Analytic queueing models, however, must make numerous assumptions about the arrival process, the service time distribution, and the service discipline. Such assumptions are often difficult to justify in the face of real data from actual systems. Analytic queueing models assume that the arrival and service processes do not depend on time. Again, this assumption is unlikely to be supported by observations of actual systems. The peak arrival rate of calls for emergency medical services over the course of a day is typically three to four times that of the nadir of the arrival rate. Similarly, the demand for many retail goods exhibits significant seasonality (as shown in Figure 5.15). Also, the number of servers on duty may vary over the course of time. More cashiers are likely to be on hand at a grocery store between 5 and 6 P.M. when customers are buying food for dinner than between 10 and 11 P.M., when most customers are asleep! To relax the assumption of time-independent conditions, we can numerically integrate the ChapmanKolmogorov equations, as discussed in sections 3.7 and 7.6. Simulation allows us to relax almost all of the vexing assumptions made by analytic queueing theory and by the numerical approaches we have outlined in sections 3.6 and 3.7. Simulation allows us to analyze very complicated arrival and service processes. For example, it is quite easy to simulate problems in which
572
WHERE TO FROM HERE?
customers arrive in batches, as they do at airport check-in systems. A batch in this case is a group of passengers (such as a family) that arrives together. When an aircraft arrives at the terminal, the arriving passengers should be modeled as a batch, particularly when analyzing immigration processing and customs operations. The assumption of Poisson arrivals for such a system would be seriously flawed. Simulation also allows us to model multiple classes of arrivals; for example, passengers arriving with only carry-on luggage as well as passengers arriving with checked luggage, which creates a new "customer"—the baggage—that moves through part of the system separately from the original "customer," the passenger. Complicated service processes can also be replicated, including customers traversing multiple service centers (e.g., check-in, security screening, and boarding). In other cases, service process complications may arise due to priorities (e.g., emergency patients versus non-emergent patients at an emergency room) and the need for different types of servers (e.g., one patient may need only an emergency room physician for minor stitches, while a patient in cardiac arrest may require a cardiologist, a cardiac surgeon, an anesthesiologist, an x-ray technician, and numerous other support staff). While we have explored a few spreadsheetbased simulation models in this text, in general it is far easier to create a simulation model using a specialized language designed for this purpose. Banks (1999) and Banks et al. (2005) provide excellent introductions to simulation modeling while Nelson (1995) is an excellent reference on stochastic modeling in general and its relationship to simulation. Finally, simulation and optimization modeling have recently been merging as the need to analyze and optimize ever-morecomplex problems becomes apparent. Tekin and Sabuncuoglo (2004) provide a review of this rapidly emerging field. 11.3
OTHER APPLICATIONS IN SERVICES
Just as you can extend your knowledge methodologically, the range of applications and problems that can be analyzed within the service sector can also be expanded. Recently, a number of authors have integrated inventory and location decision-making into non-linear models, which, while beyond the scope of this text, can readily be solved using special-purpose algorithms (Daskin, Coullard, and Shen, 2002; Shen, Coullard, and Daskin, 2003; Shen and Daskin, 2005; Ozsen, Coullard, and Daskin, 2008,2009). A key finding of this line of research is that a failure to incorporate inventory effects into location models will result in utilizing too many facilities and having too many stockpiles of inventory due to the economies of scale associated with holding inventory. Recent years have also seen an increased interest in reliability modeling in facility location problems. This line of research recognizes that facilities may fail. Facility "failures" may be the result of utilization (e.g., an ambulance is busy and has therefore temporarily "failed" with respect to new incoming calls for service), weather-related disruptions (e.g., a tornado destroys a number of cell phone towers, reducing coverage to an area), or terrorist attacks. When attacks are
OTHER APPLICATIONS IN SERVICES
573
random or are due to congestion, optimizing the expected performance of the system is often most relevant (Snyder and Daskin, 2005). On the other hand, when an adversary (e.g., an enemy or a terrorist) attacks a network, the attacks are unlikely to be random. It is no coincidence that the September 11, 2001 attacks occurred in New York and Washington, DC and not in New Bedford, Massachusetts and Winnetka, Illinois. In the case of a targeted attack, a multilevel optimization problem must be solved (Bard, 1998; Church, Scaparra, and Middleton, 2004; Scaparra and Church, 2008). At the highest level are the systemdesign decisions that we, as the planners and operators of the system, can make. For example, we can determine how many facilities to have and the level of hardening of those sites. The next level represents the decisions of the enemy who must determine how many and which facilities to attack. The lowest level would then model the operation of the attacked and partially destroyed system. Snyder and Daskin (2006) and Snyder et al. (2006) review models that are appropriate to both random and targeted disruptions. Accounting for disruptions often leads to the use of more facilities than would be called for in the absence of disruptions. The extra facilities can be viewed as a form of insurance policy in the event that some facilities are disrupted or destroyed. Resource allocation problems must often be solved in the face of uncertainty regarding both the demands and the supplies. The stochastic optimization approaches discussed in section 11.2.2 are often appropriate for such cases. For example, a trucking firm may want to schedule customer loads as the load requests are received, often over a period of roughly one month prior to the date of execution of the loads. On November 16, a customer may request that a load be delivered at 8:30 A.M. two weeks later on November 30. The commitment of a delivery time needs to occur on (or around) November 16 before all other requested deliveries for November 30 have been received. A properly structured stochastic optimization model can anticipate future load requests for that date based on historical data and can suggest a good delivery time in response to the 8:30 A.M. requested time. The model may suggest, for example, that it would be better to delay the delivery, if possible, until 9:15 A.M. to avoid highway congestion and to smooth the utilization of the carrier's fleet of vehicles, accounting for the anticipated future demands on that date. While section 7.3 examined scheduling with cross-trained employees, the model was exceptionally simplistic. Hopp and van Oyen (2004) provide a framework for evaluating the strategic and tactical benefits of employing agile or cross-trained employees. Tekin, Hopp, and van Oyen (2009) examined the impact of pooling or cross-training CSRs in a call center handling multiple customer types. Their results suggest that pooling or cross training employees may be beneficial when the mean service times of the different customer types are similar. However, when the mean times differ significantly, pooling or crosstraining may actually degrade performance. In analyzing complex service systems like call centers with multiple customer service requirements, multiple customer priorities, and various CSR capabilities, simulation is often needed in the final design of a system.
574
WHERE TO FROM HERE?
Chapter 10 on vehicle routing only scratched the surface of what is possible in analyzing routing problems for service systems. As indicated in section 10.6, many service systems must deal with efficacy (how well the customers are served) and equity (how disparate are the individual customer service levels) in addition to the traditional measures of efficiency (how much does the service delivery cost). Multi-objective routing is an active area of ongoing research for many students, faculty, and practitioners. Finally, pricing can be used to mediate supply and demand in some contexts. One hotel in Manhattan, for example, charged approximately $180 to $200 per night for a room in late August when we dropped our daughter off at college. Two months later, on parents weekend, the same room rented for somewhere between $400 and $500 per night, over twice as much. Demand was much greater at that point in time and the higher prices allowed the hotel to increase its profits and to dampen the demand of those parents (including our daughter's parents!) who were not willing to pay those rates. The hotel charged only $160 per night for the same room in January when demand for hotel rooms in Manhattan was significantly lower. Similarly, red eye flights from the West Coast to the East Coast leaving at midnight and arriving early in the morning are typically priced far below flights leaving at other times of the day in an attempt to shift demand from peak periods to the off-peak red eye flights. Saturday night theater tickets typically cost more than do the same seats for a Sunday matinee performance. When coupled with well-developed demand models that incorporate price as an independent variable, appropriately structured models can be developed to guide the pricing of services. It is worth noting, that some services—such as the demand for emergency medical services—are likely to be completely independent of price. When a friend or relative is in cardiac arrest, few people will elect to shop around for the best price for ambulance services. Auctions can sometimes be used to price services. Combinatorial auctions— in which the service recipient requests bids on service bundles from service providers—have been used successfully to price transportation services (Ledyard et al., 2002; Sheffi, 2004). The underlying model can be thought of as a problem of minimizing the total expenditure of the service recipient subject to constraints that stipulate that each lane of traffic be assigned to the appropriate number of carriers and that the carrier capacity constraints are obeyed. Additional constraints may guarantee that each qualified bidder receives a minimum amount of service. By bidding on multiple lanes of service as part of a single bid package, carriers can benefit from otherwise empty or deadheading lanes. Shippers benefit as well by reducing their total transportation expenditures below the level that would otherwise occur if they used spot market prices for the transport services. Given the potential for win-win situations, auctions are likely to become an increasingly important part of the service provision landscape. The explosive growth of eBay in the auctioning of physical goods is a testimony to the value of auctions in today's economy.
REFERENCES
11.4
575
SUMMARY
Services are expanding rapidly throughout the world. The classes of decisions discussed in this text—location decisions, inventory management, resource allocation, workforce management, prioritization of customers, and vehicle routing— are commonly faced by many service providers. Careful design and operation of service systems can enhance productivity and customer service levels. The modeling methodologies outlined in this text— optimization and queueing theory—should take you a long way toward developing useful models of service systems. Additional techniques—including forecasting, stochastic optimization, and simulation—may well be needed for complex problems, especially those characterized by a myriad of operating rules, conditions, and by uncertainty.
REFERENCES Banks, J., 1999, "Introduction to simulation," Proceedings of the 1999 Winter Simulation Conference, P. A. Farrington, H. B. Nembhard, D. T. Sturrock, and G. W. Evans (eds.), 7-13. Banks, J., J. S. Carson, B. L. Nelson, and D. Nicol, 2005, Discrete Event System Simulation, 4th ed., Prentice Hall, Inc., Upper Saddle River, NJ. Bard, J. F., 1998, Practical Bilevel Optimization: Algorithms and Applications. Kluwer Academic Publishers, Dordrecht, The Netherlands. Bertsimas D., and A. Thiele, 2006, "Robust and data-driven optimization: Modern decisionmaking under uncertainty," in Tutorials on Operations Research, M Johnson, B. Norman, and N Secomandi (eds.), Ch. 4, 95-122, INFORMS, Hanover, MD. Birge, J. R., and F. Louveaux, 1999, Introduction to Stochastic Programming, Springer Series in Operations Research, New York. Chopra, S., and P. Meindl, 2004, Supply Chain Management: Strategy, Planning, and Operations, 2nd ed., Prentice Hall, Upper Saddle River, NJ. Church, R. L., M. P. Scaparra, and R. S. Middleton, 2004,"Identifying critical infrastructure: The median and covering facility interdiction problems," Annals of the Association of American Geographers, 94, 3, 491-502. Daskin, M. S., C. Coullard, and Z.-J. M. Shen, 2002, "An inventory-location model: Formulation, solution algorithm and computational results," Annals of Operations Research, 110, 83-106. Devore, J. L., 2008, Probability and Statistics for Engineering and the Sciences, 7th ed., Thomson, Australia. Heizer, J., and B. Render, 2001, Principles of Operations Management, Prentice Hall, Upper Saddle River, NJ. Hopp, W. J., and M. L. Spearman, 2008, Factory Physics, 3rd ed., Irwin/McGraw Hill, Boston MA.
576
WHERE TO FROM HERE?
Hopp, W. J., and M. P. van Oyen, 2004, "Agile workforce evaluation: A framework for cross-training and coordination," HE Transactions, 36, 919-940. Ledyard, J. O., M. Olson, D. Porter, J. A. Swanson, and D. P. Torma, 2002, "The first use of a combined-value auction for transportation services," Interfaces, 32, 5, 4-12. Nahmias, S., 2009, Production and Operations Analysis, 6th ed., Irwin/McGraw Hill, Boston, MA. Nelson, B. L., 1995, Stochastic Modeling: Analysis and Simulation, McGraw-Hill, Inc., New York. Ozsen, L., C. Coullard, and M. S. Daskin, 2008, "Capacitated facility location model with risk pooling," Naval Research Logistics, 55, 4, 295-312. Ozsen, L., C. Coullard, and M. S. Daskin, 2009, "Facility location modeling and inventory management with multi-sourcing," Transportation Science, 43, 4, 455^472. Render, B., R. M. Stair, Jr., and M. E. Hanna, 2003, Quantitative Analysis for Management, 8th ed., Prentice Hall, Upper Saddle River, NJ. Scaparra, M. P., and R. L. Church, 2008, "A bilevel mixed-integer program for critical infrastructure protection planning," Computers and Operations Research, 35, 1905-1923. Sen, S., and J. L. Higle, 1999, "An introductory tutorial on stochastic linear programming models," Interfaces, 29, 2, 33-61. Sheffi, Y., 2004, "Combinatorial auctions in the procurement of transportation services," Interfaces, 34, 4, 245-252. Shen, Z.-J. M., C. Coullard, and M. S. Daskin, 2003, "A joint location-inventory model," Transportation Science, 37,1, 40-55. Shen, Z-J. M., and M. S. Daskin, 2005, "Tradeoffs between customer service and cost in an integrated supply chain design framework," Manufacturing and Service Operations Management, 7, 3,188-207. Snyder, L. V., and M. S. Daskin, 2005,"Reliability models for facility location:The expected failure case," Transportation Science, 39, 3, 400-416. Snyder, L.V., and M. S. Daskin, 2006, "Models for reliable supply chain network design," invited paper, chapter in Reliability and Vulnerability in Critical Infrastructure: A Quantitative Geographic Perspective, A. Murray and T. H. Grubesic (eds.), Advances in Spatial Science Series, Springer. Snyder, L.V., M. P. Scaparra, M. S. Daskin, and R. L. Church, 2006, "Planning for disruptions in supply chain networks," Tutorials on Operations Research, M. Johnson, B. Norman, and N Secomandi (eds.), Ch. 9, 234-257, INFORMS, Hanover, MD. Tamhane, A. C , and D. D. Dunlop, 2000, Statistics and Data Analysis: From Elementary to Intermediate, Prentice Hall, Upper Saddle River, NJ. Tekin, E., W. J. Hopp, and M. P. Van Oyen, 2009, "Pooling strategies for call center agent cross-training," HE Transactions, 41, 6, 546-561. Tekin, E., and I. Sabuncuoglu, 2004, "Simulation optimization: A comprehensive review on theory and applications," HE Transactions, 36,1067-1081.
INDEX
Note: Page numbers in italics refer to figures, those in bold to tables. abandonment, in call centers, 484-489, 484, 485,488,503 absolute P-center problems, 218 aggregation, and analytic location models, 193,193 analysis, as element of optimization, 34 analytic location models, 189,189-193, 190-192 and aggregation, 193,193 and uniform distribution, 189,192-193, 193 analytics, use in decision making, 22 analyzing model, in modeling process, 20 arc routing problems, 517,518 on directed graph, 524-527,525,526, 526, 557 on undirected graph, 518-524, 519,520, 521, 521,523,557 arcs, in network optimization problems, 60, 62-63,63,64 arrival process, 120 assigning specific employees to shifts, 406-408 assignment problems. See resource allocation problems assumptions, identifying, in modeling process, 18-19, 22 auctions, and service pricing, 574
average distance models, 200, 201, 226-228,229,230,230,230-231,232, 233,233 average service time, 114,115,115-118, 117 average waiting time, 114,114,115,115, 117,117,118 backorders, and economic order quantity model, 292-294,292,294 Bailey-Welch rule, 345, 496, 496, 496-497, 503 big-M constraints, 105 binary variables, 69-72 binding constraints, in linear programming, 4 3 ^ 4 branch and bound, 72-74, 73, 74 breaks, and short-term scheduling, 390-392,391 call centers, xxvii, xxviii, 475-479, 478-481,481^84, 482,483,490, 497,492,503 abandonment, 484-489,484,485, 488, 503 Garnett, Mandelbaum, Reiman approximation of probability of waiting, 487,488,489,490,490
Service Science, by Mark S. Daskin Copyright © 2010 by John Wiley & Sons, Inc
577
578
call centers (cont'd) generic vs. skill-based, 476 Halfin-Whitt approximation of probability of waiting, 483, 483^184, 489,490,490 incoming vs. outgoing, 476 and interactive voice response systems, 477^178 limited number of phone lines, impact on waiting callers, 490, 491, 492 multi-layered, 476—477 normal approximation of probability of waiting, 479, 481,482,482^183, 483, 489, 490,490 offered load, 477-479,479, 480,481, 503 outgoing vs. incoming, 476 skill-based vs. generic, 476 canonical form, in linear programming, 46-47 center-median tradeoff, and multiobjective problems, 240-241,242, 243-244,243,244,245 chance constrained optimization, 570 Chapman-Kolmogorov equations, 126 Chinese postman problem directed, 524-527,525,526,526, 557 undirected, 518-524,519,520, 521, 521, 523,557 Christofides' heuristic, 539-541,540,542, 543,543 coefficient of variation of exponential distribution, 153 column generation, 211 column reduction rules, in set covering models, 207-208 compactness, in districting problems, 261 competition model, in franchise location, 268-270,270 complementary slackness conditions, in linear programming, 49, 50 constraint method, and multi-objective problems, 92, 93, 94, 94-99, 95-98, 100 constraints, 33 aggregation/disaggregation of, 105-106, 228 big-M, 105 binding, 43^44
INDEX
decision variables in, 102 effect on objective function of adding to optimization problem, 46 excess of, and infeasibility in linear programming, 52 forcing/linkage, 227-228 identifying, in modeling process, 18 indices in, 104 in network optimization problems, 63 non-negativity, 44 sensitivity to small changes, in integer programming problems, 69 on service providers, 10 construction algorithms, 75-76, 76,78, 533 Christofides' heuristic, 539-541,540, 542,543,543 myopic (nearest neighbor) heuristic, 533-534,534,535,536 spacefilling curve approach, 534,537, 538,538 contiguity, in districting problems, 246 continuous location models, 194-196,195 convexity, in districting problems, 246 cost minimization objective of private service agencies, 10 cost of providing service vs. improved service, use of Excel in solving, 397, 397-398,398-400,400-401 covering models, 200-201,200, 203 absolute P-center problems, 218 links, location on, 198-199, 217-218, 218 maximal covering models, 200,201,203, 214-215,216,217, 217,218-219, 219 maximum expected covering location model, 220-222,223, 224,225,226 nodes, location on, 198-199,217-218, 218 p-center models, 200, 201,203,217-219, 233-234,234,235 set covering models, 200,200-201, 203-205,204,205,206,207-214,212, 213,214,220 set partitioning problems, 210-211 vertex P-center problems, 218, 233-234, 234,235 covering-median tradeoff, and multiobjective problems, 236-238,239,240, 240,240
INDEX
crossover, and genetic algorithms, 79 cross-trained employees, and short-term scheduling, 388-390,388, 573 customer scheduling, xxvii, xxviii cycle service level, and inventory, 312, 313 cyclic schedules, 407 data collection, in modeling process, 18, 21-22 decision variables, 32 in constraints, 102 definitions of, 101-102 indices in, 101-102 linking, 102-104,103 in network optimization problems, 60 in objective functions, 102 demand balancing with resources, 111 balancing with supply, 12 variation in, 5 developing models, 19 directed Chinese postman problem, 524-527,525,526,526,557 discrete location models, 199-202,200 average distance models, 200,201, 226-228,229, 230,230,230-231,232, 233,233 covering models, 200-201,200,203-205, 204,205,206, 207-215,212,213,214, 216, 217-222,217, 219,223,224,225, 226, 233-234, 234,235 p-dispersion models, 200,201-202 districting problems, 244-250,247,249, 253-254,253,254-256,256-261, 259 compactness, 261 contiguity, 246 convexity, 246 Excel, use in solving, 250-252,251,252 partition problem, 246 dominated solutions, in multi-objective problems, 81-83,81,82 dual problem, in linear programming, 47-51 dual variables, 48, 58, 59 economic order quantity model, 287-291, 288,290,291, 324 and backorders, 292-294,292,294
579
and Goal Seek, 301 and limited space/value of goods in inventory, 300-302,300-303 and multiple items, 295-298, 295, 296, 297,298 and positive travel time, 292 and production vs. order delivery, 294, 294-295 employment in service industry, 8, 9, 9,10 EOQ model. See economic order quantity model Erlang-k distribution, 121, 614 Erlang's Loss Formula, 152 Euler tour, 518-519,524-525,527,557 Excel (Goal Seek), and economic order quantity problems, 301 Excel, IF statements in, 105, 205, 207 Excel, in implementing models, xxviii Excel, use in solving abandonment problems in call centers, 485^189,485, 488 cost of providing service vs. improved service problems, 397,397-398, 398-400,400^101 districting problems, 250-252,251,252 fixed charge models, 231,232 integer problems, 66-67,67, 71,74 limited space/value of goods in inventory problems, 300-302, 300-303 linear programming problems, 54-59,55, 57-59 Markovian queue problems, 158, 158-170,159-165,165-169 maximal covering models, 215,216, 217 maximum expected covering location model, 222,223,224 M/Ekn> queue, 168-170,169 M/M/3 queue, 160-166,161-165, 165-166 M/M/s queue, 158-161,159-161 multi-objective problems, 88,89-91, 90-99,93, 94, 95-98,100, 238,239, 240, 241,242, 243 network optimization problems, 61, 62 p-median models, 228,229 project scheduling problems, 437-439, 438, 440,441, 442 queueing problems, 152-153,155, 158-170,158,159-165,165-169,463
580
Excel, use in solving (cont'd) reorder point in inventory problems, 314-316,315,316 scheduling problems, 382-383,382,383, 384,393-394,393,394, 423-426, 423-425 set covering models, 205,206,207 suborder approach for multiple items in economic order quantity model, 297-298,297,298 training problems, 450-452,451 transshipment problems, 526-527 traveling salesman problems, 529-532, 530-532 exercising model, in modeling process, 19-20 exponential distributions, 125,153 fathoming nodes, 73, 75 FCFS (first-come-first-served) queue discipline, 134,135,147 feasible region in integer programming problems, 66, 66,68 in linear programming, 42, 43, 43, 44, 45, 46 feedback link in modeling process, 21 fill rate, 312, 313-314 finite planning horizon model, 304-310, 305,306,307, 308,309 firing/hiring of employees, and long-term scheduling, 446-449 first-come-first-served queue discipline, 134,135,147 fixed charge models, 200,201,230-231, 232,233,233 flows (minimum/maximum), and network optimization problems, 60, 63-65 fluid approximation approach, and queueing models, 120 franchise location problems, 262 competition model, 268-270,270 p-dispersion model, 262-263 profit maximization model, 263-266, 264,265-267,267, 268,268 Garnett, Mandelbaum, Reiman approximation of probability of waiting, 487-490, 490
INDEX
generic vs. skill-based call centers, 476 genetic algorithms, 78-80, 79 crossover, 79 infeasibility in, 79-80 and multi-objective optimization, 101 mutation, 79 selection, 79 Goal Seek (Excel), use in economic order quantity problems, 301 Halfin-Whitt approximation of probability of waiting, 483,483^184, 489,490, 490 heuristics, 74-80, 76-79 hierarchical objective set covering model, 220 hiring/firing of employees, and long-term scheduling, 446-449 hypothesis testing, 23 IF statements, in Excel, 105,205,207 improvement algorithms, 75,77-78, 77, 78, 533 Or-opt algorithm, 546-547,546,548 3-opt heuristic, 544,545,547 2-opt heuristic, 544-545,544-547, 547 incoming vs. outgoing call centers, 476 in-degree, in directed graph, 524 indices in constraints, 104 in decision variables, 101-102 in inputs, 101-102 infeasibility in genetic algorithms, 79-80 and inputs, 52 in linear programming, 52 in resource allocation problems, 350-357,357,352,354,356,357,357, 372 infinite planning horizon model, 308-310, 309 infinite server (M/M/<*>) model, 148-150, 149 inputs, 31-32 definitions of, 101-102 indices in, 101-102 and infeasibility, 52 in linear programming, 55,55 in queueing theory, 120-121
INDEX
integer programming problems, 35, 37, 65-69,68 branch and bound, 72-74, 73, 74 Excel, use in solving, 66-67, 67,71,74 fathoming nodes, 73, 75 feasible region, 66, 66, 68 heuristics, 74-80, 76-79 integer variables, 69-72 rounding, 65-66, 69 sensitivity to small changes to constraints, 69 solving, 72-80, 73, 74 interactive voice response systems, and call centers, 477 Internet, and services, 5-6 inventory cycle service level, 312,313 economic order quantity model, 287-303,288,290-292,294,295,296, 297,29,3,300-30?, 324 fill rate, 312, 313-314 and location modeling, 572 naive approach for dealing with multiple items, 295,295,296 newsvendor problem, 316-323, 317,321, 323,324, 325 reorder point, use of Excel in solving for, 314-316,315,316 and services, xxvi-xxvii, 2, 4,12,15, 285-287, 324 single joint order approach for dealing with multiple items, 295-297, 296 of skills, treating personnel as, 416-417 suborder approach for dealing with multiple items, 297-298 time-varying demand, 304-310,305,306, 307,308,309, 324-325 uncertain demand/lead times, 310-316, 311,312,315,316,325 Kruskal's algorithm, 539-541, 540 leaf nodes, in tree networks, 198 least squares regression, 37-40,38-40, 39 limited space/value of goods in inventory problems, use of Excel in solving, 300-302,300-303
581
linear programming, 34—37,35, 41, 104-105 binding constraints, 43^44 canonical form, 46^17 complementary slackness conditions, 49, 50 dual problem, 47-51 example problems, 51-54 Excel, use in solving, 54-59,55,57-59 feasible region, 42,43, 43,44, 45, 46 graphical representation, 42-44,42, 43, 45,46 and infeasibility, 52 inputs, 55, 55 integer programming problems, 35, 37, 65-80,66-68, 73, 74, 76-79 network problems, 35,36-37, 60-65,61, 67-65 non-negativity constraints, 44 primal problem, ΛΊ-Α9, 50 standard form, 47, 48 weak duality condition, 49 links, location on covering models, 198-199,217-218,218 Little's Law, 122,124,175 location modeling, xxvi, 12-13,186 analytic location models, 189,189-193, 190-192,193 continuous location models, 194-196, 195 discrete location models, 199-205,200, 204, 205,206,207-235,213,217,219, 225,226,229,230,230,232,233,234, 235 districting problems, 244-261,247,249, 251,252,253,254-256,259 examples of, 186-189,199 franchise location problems, 262-270, 264,265-267,267,268,270 and inventory, 572 multi-objective problems, 202,236-245, 239,240,240,242-245 network location models, 196-199,197, 197,199 reliability modeling, 572-573 undesirable facility location models, 202 use in modeling non-distance factors, 200
582
INDEX
long-term scheduling, xxvii, 12,14-15, 377-379,378,379,416 basic model for, 418-422,420,421 grouping of skills, 421^127, 423-426 and hiring/firing of employees, 446-449 inventory of skills, treating personnel as, 416-417 and personnel development/training, 418, 449-452, 451 and planning, 427-428, 428, 429-432, 430-432 project profitability, estimating, 417 and project scheduling, 417-418, Λ32-Λ4Π, 437, 438, 440-445, 446, 447, 453
M/M/s queue, 141-148,141,143,144, 145-147,148,158-161,159-161 M/M/s queue with no waiting, 150-153, 150,152 modeling process, 17-22,17 analyzing model, 20 assumptions, identifying, 18-19,22 constraints, identifying, 18 data collection, 18, 21-22 developing model, 19 exercising model, 19-20 feedback link in, 21 objectives, identifying, 18 outcomes, monitoring, 21 problem, identifying, 17-18,21 recommendations, adopting/
Markovian queues, 121-122,124-127 Chapman-Kolmogorov equations, 126 Excel, use in solving problems, 158, 158-170,159-165,165-169 M/Ek/3 queue, 168-170, 769 M/M/1 model, 130-137,131,132,133, 134,136 M/M/1 queue with restricted queue length, 137-140,137,138,139 M/M/3 queue, 160-166,161-165, 165-167 M/M/°° model, 148-150,149 M/M/s queue, 141-148,141,143,144, 145-147,148,158-161,159-161 M/M/s queue with no waiting, 150-153, 150,152 steady-state balance equations, 127-130, 129,130 maximal covering models, 200,201, 203, 214-219,216, 217,217,219 maximum expected covering location model, 220-226,223,225,226 M/EJ3 queue, use of Excel in solving, 167-170,169 MGE See moment generating function minimum spanning trees. See spanning trees M/M/1 model, 130-137,131,132,133,134, 136 M/M/1 queue with restricted queue length, 137-140,137,138,139 M/M/3 queue, 160-167,161-165,165-169 M/M/oo model, 148-150, 749
implementing, 20-21 recommendations, converting outputs into, 20 solving model, 19-20 stakeholders/groups, identifying, 18 modeling, reliability, 572-573 modeling, use of spreadsheets, 19 models, 16-22. See also modeling process; modeling, reliability; modeling, use of spreadsheets moment generating function, 134-137, 145-146 MSTs (minimum spanning trees). See spanning trees multi-objective problems, xxvi, 34, 80,202, 236 and center-median tradeoff, 240-241, 242-245,243-244 constraint method, 92, 93-98, 94-99, 700 and covering-median tradeoff, 236-238, 239,240, 240,240 Excel, use in solving, 88,89-91, 90-100, 93-98,100,238,239,240, 241,242,243 dominated solutions, 81-83,81,82 and genetic algorithms, 101 non-dominated solutions, 81-82, 81, 82 non-supported solutions, 92, 97 shortest path problem, example of, 83-84,83,84 supported solutions, 92, 97 weighting method, 84-92, 85,85, 86, 87, 87,89-91, 97-98
INDEX
multiple objectives optimization, 34,35 mutation, and genetic algorithms, 79 myopic heuristic, 533-534,534,535,536 naïve approach for dealing with multiple items in inventory, 295, 295, 296 nearest neighbor algorithm, 75-76, 76, 533-534, 534,535,536 network form of simple short-term scheduling model, 384-385,385 network location models, 196-199, 797, 197,199 network optimization problems, 35,36-37, 60-65,61-63,65 arcs, 60,62-63,63,64 constraints, 63 decision variables, 60 example of problem, 52-54 flows (minimum/maximum), 60, 63-65 node-arc incidence matrix, 60, 61, 61 nodes, 60-63,63 objective, 60 unit cost, 60, 63-65 networks, tree, 196-199,197,197,199 newsvendor problem, 15-16, 316-325, 317, 527,323,324 node routing problems, 517,527. See also traveling salesman problem node-arc incidence matrix, and network optimization problems, 60,61,61 nodes fathoming, 73,75 leaf, in tree networks, 198 location on covering models, 198-199, 217-218,218 and network optimization problems, 60, 61-63,63 non-dominated solutions, in multiobjective problems, 81-82,81,82 non-linear optimization models, 34-36,35, 104-105 non-Markovian queues, 153-155 non-negativity constraints, in linear programming, 44 non-preemptive queues, 466^172,467, 468,469,470,471, 472, 502-503 non-supported solutions, in multiobjective problems, 92, 97
583
normal approximation of probability of waiting, 479, 481-^83, 482, 483, 489, 490,490 NP-hard problems, 207 objective function, 30, 33-35 and adding constraint in optimization problem, 46 decision variables in, 102 subscripts in, 102 objective(s) identifying, in modeling process, 18 and network optimization problems, 60 multiple, of service providers, 11 multiple vs. single, and optimization, 34,55 of public vs. private service providers, 10-11 single vs. multiple, and optimization, 34,55 offered load, 477^179, 479,480,481, 503 optimization, 19,20,23,30-31 chance constrained, 570 effect on objective function of adding constraint to optimization problem, 46 elements of, 31-34 integer programming problems, 35, 37, 65-80,66-68, 73, 74, 76-79 least squares regression, 37^t0,38-40, 39 linear programming, 34-37,35, 41^14, 42, 43, 45,46-80,55,57-59, 61, 67-65, 65-68, 73, 74, 76-79 multiple objectives vs. single objective, 34,55 network problems, 35, 36-37,60-65, 67-65,65 non-linear, 34-36,35,104-105 with recourse, 570 robust, 570-571 single objective vs. multiple objectives, 34,55 stochastic, 570 uncertainty in, 570-571 order delivery vs. production, and economic order quantity model, 294, 294-295
584
Or-opt algorithm, 546-547, 546, 548 outcomes, monitoring, in modeling process, 21 out-degree, in directed graph, 524 outgoing vs. incoming call centers, 476 outputs converting into recommendations, in modeling process, 20 of queueing models, 122 overtime, and short-term scheduling, 386-388,387,387 partition problem, 246 part-time employees, and short-term scheduling, 385-386,386,387 p-center models, 200,201,203, 217-219, 233-234,234,235 p-dispersion models, 200, 201-202, 262-263 performance metrics, for queueing models, 122-124,123 personnel development/training, 418, 449-152, 451 phone lines, number of, and impact on waiting callers, 490,491,492 p-median models, 200,201,226-228,229, 230, 230,230 positive travel time, and economic order quantity model, 292 preemptive queueing, 465-466, 474—475, 475, 503 repeat, 465^166,474-475, 503 resume, 465-166,474, 503 preference scheduling, 407 price, shadow, 48, 58, 59 pricing of services, 574 primal problem, in linear programming, 47-49, 50 Prim's algorithm, 541,542 priority queueing systems, xxviii, 178, 464-466,465,475, 502 priority service with Poisson arrivals, multiple servers, and identically distributed exponential service times, 473-474, 474 single server, Poisson arrivals in each class, exponential service in each class with non-preemptive priorities, 466-471, 467,468,469, 470,471
INDEX
single server, Poisson arrivals in each class, non-exponential service in each class with non-preemptive priorities, 471^172, 472 private service agencies, 10-11 probabilistic queueing theory, 120 problem(s) identification of, in modeling process, 17-18, 21 rules for formulating, 101-106 production vs. order delivery, and economic order quantity model, 294, 294-295 profit maximization model, in franchise location, 263-266,264,265-267,267, 268,268 profit maximization objective of private service agencies, 10 projects profitability, estimating, 417 scheduling, 417-418,432-139,437,438, 440-443,442^146,445, 446, 447,453 public service agencies, 10-11 queue, 112 queueing models, 19,20,23,111-112, 119-120,156-157,175-178, 459^64, 461,462, 463, 464, 571. See also call centers; scheduling Excel, use in solving, 152-153,155, 158-170,158,159-165,165-169,463 fluid approximation approach, 120 inputs, 120-121 Little's Law, 124,175 Markovian queues, 121-122,124-153, 129-132,133-135,136,137,140,141, 143,144,145-147,148-150,152 non-Markovian queues, 153-155 non-preemptive queues, 466-472,467, 468, 469, 470, 471, 472, 502-503 outputs, 122 performance metrics, 122-124,123 preemptive queues, 465^-66,474-475, 475, 503 principles of queueing, 117-118 priority queueing systems, xxviii, 178, 464-475, 465, 467,468,469,470, 471, 472, 474, 475, 502 probabilistic queueing theory, 120
INDEX
service time, average, 114-118,115, 117 service time, distributions of, 113,113 service time, variability in, 113-115, 113-118,117 time-dependent queues, xxvi, 170-176, 773,775 waiting time, average, 114, 774,115, 775, 117,777,77« randomization, 23 randomized savings algorithm, 555-557, 556 randomized sweep algorithm, 555 recommendations, in modeling process adopting/implementing, 20-21 converting outputs into, 20 recourse, optimization with, 570 regression analysis, 23, 569 regret, 446 reliability modeling, 572-573 reneging, in call centers. See abandonment, in call centers reorder point in inventory problems, 314-316,375,576 repeat queueing, preemptive, 465^466, 474-475,503 resource allocation problems, xxviii, 12, 13-14 examples, 342,343,344-346,358-360, 358,360,361,362, 363-372,366,366, 368,372 formulating, 346-350,348,349 infeasible solutions, 350-357,357,352, 354,356,357,357, 372 and uncertainty, 573 resources, balancing with demand, 111 resume queueing, preemptive, 465^166, 474,503 robust optimization, 570-571 rounding, 65-66, 69 routing. See vehicle routing row reduction rules, in set covering models, 208-210 savings algorithm, 552-555,553,554 scheduling, xxviii, 12,14—15, 31 assigning specific employees to shifts, 406^108 customer, xxviii
585
cyclic, 407 Excel, use in solving, 382-383,382-384, 393-394,393,394,423-426,423-425 long-term, xxviii, 12,14-15, 377-379, 378,379,416-Α4Ί, 420,421,423-426, 428,429,430,431,432,437,438, 440-445,446,447,451 preference, 407 self-scheduling, 407 in services, 492-503, 494-497, 495, 496, 498,500,501,502 short-term, xxviii, 12,14,377-408,378, 379, 381,382-387, 387,388,391-394, 399, 400, 401, 402, 403,403,405,573 selection, and genetic algorithms, 79 self-scheduling, 407 service discipline, 120 service, efficacy of, 559 service, equity of, 559 service facilities, number of, xxvi, 13 service maximization of public service agencies, 11 service process, 120 service providers constraints on, 10 multiple objectives of, 11 objectives of public vs. private, 10-11 service sector employment in, 8, 9, 9,10 growth in, xxv, 6-8, 7, 8 service time average, 774,115,115-118,117 distributions of, 113, 773 variability in, 113-117,113-118 services attributes of, 2, 4-5 evolution of, 5-6 examples of, 1-2,3 and Internet, 5-6 and inventory, xxvi-xxviii, 2, 4,12,15, 285-287, 324 as percentage of economy, 6-8, 7-70, 9 pricing of, 574 scheduling in, 492-503, 494-497, 495, 496,498,500,507,502 set covering models, 200, 200-201, 203-204,204, 205 column reduction rules, 207-208 Excel, use in solving, 205, 206, 207
586
set covering models (cont'd) hierarchical objective set covering model, 220 limitations of, 211-214,272, 213, 214 row reduction rules, 208-210 set partitioning problems, 210-211 sets, definitions of, 101 shadow price, 48, 58, 59 shortest path problems, 36, 52-54, 83-84, 83,84,306-307,306,307 short-term scheduling, xxvii, 12,14, 377-380,378,379 assigning specific employees to shifts, 406-408 and breaks, 390-392,391 cost of providing service vs. improved service, 394^103,397-400,401,402, 403, 403 cross-trained employees, 388-390, 388, 573 naive approach, 380, 381 network form of simple model, 384-385, 385 overtime, 386-388,387,387 part-time employees, 385-386,386, 387 simple model of, 380-385,381,382-385 time-dependent queueing analyzer, 404, 405, 406,408 24-hour scheduling, 392-394,392-394 simulations, 19-20,119-120,167,176, 571-572 single joint order approach for dealing with multiple items in inventory, 295-297,296 single objective optimization, 34,35 SITATION software, 244, 271 skill-based vs. generic call centers, 476 skills grouping of, 421-427, 423-426 inventory of, treating personnel as, 416-417 slack variable, 47 solving model, in modeling process, 19-20 spacefilling curve approach to traveling salesman problem, 534,537,538, 538 spanning trees, 539-541, 540,542 Kruskal's algorithm for minimum spanning tree, 539-541,540
INDEX
Prim's algorithm for minimum spanning tree, 541,542 spreadsheets, use in modeling, 19 stakeholders, role in modeling process, 18, 20-21,22 standard form, in linear programming, 47, 48 statistical analysis/forecasting, 568-569 steady-state balance equations, 127-130, 729,130 steady-state condition, 132 stochastic optimization, 570 suborder approach for dealing with multiple items in inventory, 297-298, 297,298 subscripts, in objective functions, 102 subtour elimination constraints, in traveling salesman problem, 529-533, 532 "super crunchers," 22-23 supply, 5,12 supported solutions, in multi-objective problems, 92, 97 sweep algorithm, 549-552, 550,557, 552 3-opt heuristic, 544, 545, 547 time series analysis, 569 time, "wrap around" approach to modeling, 392-393,392 time-dependent queues, xxvi, 171-175, 775,775 time-dependent queueing analyzer, 172-175, 775, 775, 404, 405, 406, 408 time-varying demand, 304, 324-325 finite planning horizon model, 304—310, 305,306,307, 308,309 infinite planning horizon model, 308-310,309 training/development of personnel, 418, 449-452,457 transshipment problems, 526-527 traveling salesman problem, 75-78, 76-78, 517,527-528 exact algorithm—assignment model, 528-529,529-532 Excel, use in solving, 529-531, 530-532
INDEX
heuristic algorithms, 533-548, 534, 535, 536-538, 540,542-548 subtour elimination constraints, 529-531,532,533 tree networks, 196-199, 797,197,199 triangular distribution, of service time, 113,113 TSR See traveling salesman problem 24-hour scheduling, 392-394, 392, 393, 394 2-opt algorithms, 77-78, 77, 78, 544-547, 544-547 uncertainty in demand/lead times, 310-316,311,312, 315,316,325 in optimization, 570-571 in resource allocation problems, 573 undesirable facility location models, 202 undirected Chinese postman problem, 518-524,519-521,521, 523,557 uniform distribution and analytic location models, 189, 192-193,193 of service time, 113,113 unit cost, and network optimization problems, 60, 63-65 utilization ratio, 131,132,132,144,166, 167-168 variables, 69-72 in constraints, 102 dual, 48, 58, 59 integer, 69-72 slack, 47 variance in service time, impact on waiting times, 472 vehicle routing, xxviii, 12,16, 516-517, 557-560 arc routing problems, 517, 518-527, 519, 520,521, 527,523,525,526,526, 557
587
efficacy of service, 559 equity of service, 559 Euler tour, 518-519, 524-525, 527, 557 node routing problems, 517,527 transshipment problem, 525, 526-527 traveling salesman problem, 517, 527-558,529-532,534,535,536-538, 540,542-548 vehicle routing problem (multiple vehicles/routes), 517,548-557,550, 551-554,556 vehicle routing problem (multiple vehicles/routes), 517,548-549,557 randomized savings algorithm, 555-557, 556 randomized sweep algorithm, 555 savings algorithm, 552-555, 553, 554 sweep algorithm, 549-552,550,557, 552 vertex P-center problems, 218,233-234, 234,235 voice response systems, and call centers, 477 VRP. See vehicle routing problem waiting time average, 114, 774,115, 775,117, 777, 118 variance in service time, impact on, 472 weak duality condition, in linear programming, 49 Weber problem, 194-196, 795 weighting method, and multi-objective problems, 84-92, 85-87,85, 87, 89-91, 97-98 Weiszfeld procedure, 194-195 workforce scheduling. See scheduling "wrap around" approach to modeling time, 392-393,392