OPERATIONS RESEARCH METHODS: RELATED PRODUCTION, DISTRIBUTION, AND INVENTORY MANAGEMENT APPLICATIONS B. D. CRAVEN University of Melbourne S. M. N. ISLAM Victoria University March 2005 ii PREFACE Business managements make daily decisions on many issues, such as how much and where to produce, for which market, what prices to set, and how much stock to keep. Mathematical models can help to make the best decisions, among the possible alternatives. The objective of this book is to present a survey of selected Operations Research methods, and some of their applications to managerial decision making, concerning production, inventory, distribution, and integrated supply chain modelling. Also included are listing of some computer programs to compute operations research models.1 Operations Research (O.R.) has been termed The Science of Better. A problem in the real world is modelled, usually in mathematical terms, then mathematical techniques, together with data analysis and computational algorithms, are applied, in order to find ways to do the job better. The word Operations derives from the many successful applications of O.R. to military operations in the 1940s. But, since then, most O.R. applications have been to peaceful activities, especially to business management, of which planning industrial production, and scheduling airlines, and other transportation, have been prominent. The name Management Science denotes the same discipline, with some emphasis on business management. Practitioners of Operations Management will find many of these techniques relevant. The areas of Logistics, Supply Chain Management, Decision Sciences, and Manufacturing Management deal with similar applications.2 This book is concerned with O.R. methods. The commencing chapter (numbered chapter 0 - computers count up from zero) gives a general discussion of model building, various examples of their applications, and some discussion of the limitations of some models. It is suggested that an O.R. practitioner should understand the models and the techniques, and, while using computers and computer packages extensively, should not depend on them to decide a model (possibly inappropriate) to use. Chapter 1 discusses linear programming . As well as the mathematics, section 1.16 on cost data discusses when such models are appropriate, and what sort of data must be sought. Chapter 2 discusses dynamic programming, and several of its many applications, to capital budgetting and to a rental problem. The effect of random elements is also considered. Chapter 3 discusses the critical path method. Chapter 4 discusses planning over time. This includes discussion of interest rates and present value, effect of inflation, risk-averse utility, decision trees and planning over time, and forecasting. A concise introduction to the use of spreadsheets for such planning and calculations is given in chapter 9. Chapter 5 discusses inventory, presenting various versions of 1 Some programs written in FORTRAN AND GAMS are included. 2 See Ragsdale (2001), and Gass and Harris (2001), for various such applications. iii economic order quantity, with applications including seasonal demand, discounting, and the issues that arise when inventory and production must be managed together, as especially in supply chain management. Chapter 6 outlines the topic of networks, which often arise in planning models. Chapter 7 discusses various methods for nonlinear optimization , and lists some of their applications. Although many models are described by linear equations, nonlinear models are also often needed. Chapter 8 discusses simulation techniques, with applications to queue, inventory and storage models, and also to networks models. Often simulation can obtain results, when no exact formulas are possible. The discussion of simulation methods, both those based on events and those planned on a time scale, should enable a user to understand what a computer package for simulation should be doing, and perhaps write his own simulation program. In chapter 9, a number of related computer programs are listed. For these various methods and applications, the basic methods and primary applications are presented, together with some reviews of recent developments. In comparison with some other books on the methods of Operations Research, the present book gives a concise account of the methods and applications. A moderate mathematical background is assumed (some calculus and matrix algebra). A reader is assumed to want to understand the methods, and the modelling assumptions made, rather than leave it all to a computer package. Some aspects that may be innovative include the following: • A detailed discussion (in chapter 0) of O.R. modelling, including the difficulties involved, and various areas of application to real problems. • A discussion (section 1.16) of cost data, replacing the common (inadequate) assumption that everything is linear. • Various topics (in chapter 4) concerning planning over time, i including discussion of riak-averse utility, and stability analysis. • Some critical discussion (sections 5.11 and 5.12) of supply chain models. • Some critical discussion (sections 7.19 and 7.20) of multiobjective optimization, and of optimization when the usual convexity assumptions fail. This book presents phases and aspects of applied operations research studies with the emphasis on business, logistics, and operation management applications. This book includes many examples of applications of operations research methods in those areas. It can be used as a text or a reference for a course on operations management and logistics/supply chain management at the Masters or Doctoral level and a text for undergraduate students in operations research. It will also be of importance to corporate executives, academics, practitioners, and business consultants. iv TABLE OF CONTENTS Chapter 0 Introduction to Operations Research and Applications 0.1 Mathematical models for management 0.2 Some reference books 0.3 Initial example 0.4 Check-list, when setting up an Operations Research model 0.5 Some other examples of Operations Research models in business 0.6 Importance of model building, and limitations of computers 0.7 Why the name? 0.8 The usefulness of spreadsheets 0.9 Presentation of conclusions and recommendations 6 11 12 12 12 Chapter 1 Linear Programming 1.1 Introduction - management models 1.2 Standard form for a linear program 1.3 Idea of simplex method 1.4 Simplex tableaus 1.5 Information from tableau 1.6 Two-phase method 1.7 Unsigned variables 1.8 Revised simplex method 1.9 Dual linear program 1.10 Dual properties 1.11 Sensitivity 1.12 Dual simplex method 1.13 Jumps in shadow costs 1.14 Integer linear programming 1.15 Transportation problem 1.16 Cost data (piecewise linear cost function) 1.17 Some exercises on linear programming 1.18 Computer input/output for linear programming 1.19 A note on interior-point methods Appendix: Some theory of linear programming 14 16 16 17 18 19 20 20 22 23 25 25 26 27 29 33 36 40 43 44 Chapter 2 Dynamic Programming 2.1 Introduction 2.2 A routing problem 2.3 Why does this work? 2.4 Forward analysis 2.5 An investment (or capital budgetting) problem 2.6 A model for inventory and production 2.7 A rental problem 2.8 Stochastic inventory 2.9 Some exercises and examples 46 46 47 48 48 49 51 52 53 v 1 2 3 3 Chapter 3 Critical Path Method 3.1 Introduction 3.2 Example of CPM 3.3 Method of calculation 3.4 Example of computer output 3.5 Alternative presentation 3.6 Random variation in time durations 3.7 Exercises 55 55 56 57 58 59 59 Chapter 4 Planning over Time, Uncertainty and Forecasting 4.1 Present value 4.2 Annual cost and rate of return 4.3 Allowing for inflation? 4.4 Different interest rates 4.5 Decision trees 4.6 Risk-averse utility 4.7 Decision tree examples and exercises 4.8 Stability over time 4.9 Indifference curves 4.10 Forecasting and exponential smoothing 61 62 62 63 64 68 69 70 71 72 Chapter 5 Inventory Management 5.1 What is inventory? 5.2 Economic order quantity 5.3 Inventory model for constant sales rates 5.4 Inventory model for variable demand 5.5 Sequencing a number of products 5.6 What stock to carry of a critical component? 5.7 Managing inventory and production together 5.8 Seasonal demand 5.9 Discounted and floor prices 5.10 The newsboy problem 5.11 Supply chain management 5.12 Examples of supply chain models 5.13 Some exercises 74 74 75 76 77 78 78 80 80 81 81 83 85 Chapter 6 Network Planning 6.1 Why networks? 6.2 Idea of out-of-kilter algorithm 6.3 Idea of a shortest-path algorithm 6.4 Idea of Ford-Fulkerson transportation method 6.5 Branch and bound 6.6 Remarks on mixed-integer linear programming 6.7 Job-shop scheduling 6.8 Examples 86 87 88 88 89 92 92 94 Chapter 7 Nonlinear Optimization Methods 7.1 Introduction 95 vi 7.2 7.3 7.4 7.5 7.6 7.7 7.8 7.9 7.10 7.11 7.12 7.13 7.14 7.15 7.16 7.17 7.18 7.19 7.20 Separable programming Convergence and convergence rate Lagrange multipliers Sensitivity Computing an iterative algorithm Descent methods Fletcher-Reeves algorithm Davidon-Fletcher-Powell (DFP) algorithm Example Linesearch Descent methods and stability Constrained minimization Sequential unconstrained minimization technique (SUMT) Projected gr5dient Quadratic programming by Wolfe's method Further comments on constrained mimimization Multiobjective optimization Invexity Some applications of nonlinear programming 95 96 97 99 99 100 101 101 102 103 105 106 107 107 108 109 112 113 114 Chapter 8 Simulation 8.1 Idea of simulation 8.2 Queue and storage models 8.3 Examples of simulation 8.4 Getting pseudorandom numbers 8.5 Some simulation models 8.6 Some other methods and models 115 115 118 120 122 122 Chapter 9 Some Computer Programs 9.1 Remarks on computer programs for O. R. problems 9.2 Using spreadsheets 9.3 Using Excel Solver 9.4 An example of a GAMS package for capital budgetting 125 126 129 131 9.5 9.6 9.7 9.8 9.9 9.10 Introduction to the FORTRAN programming language A linear programming package lpZSq Documentation for the linear programming package lpZSq A FORTRAN program for critical path A program for one application of dynamic programming FORTRAN programs to illustrate methods for unconstrained optimization Bibliography 133 138 144 147 151 153 160 vii Chapter 0 INTRODUCTION TO OPERATIONS RESEARCH AND APPLICATIONS 0.1 Mathematical models for management A business firm must make decisions on many issues relating to production, distribution, consumers, shareholders, information processing, employees, society, pricing etc..These decisions typically concern production and inventory planning, sales forecasting, capital budgeting, investment planning, materials requirement planning, locational decisions, personnel management and planning, pricing, distribution, management and planning, integrated supply chain or logistics management and planning, as they affect the several parts of the firm. These questions are sometimes considered under the heading of Operations Management. Business decision making requires the choice of the best decision among alternatives, or at any rate a decision that gives a substantial improvement. The objectives may be revenue maximisation, cost minimisation, satisfactory performance regarding social responsibility, shareholder value maximisation, etc., or sometimes the survival of the firm in adverse circumstances. The decisions are constrained by requirements such as budget and resource constraints. Methods of Operations Research (O.R.) are well adapted to such decision making in business. Applications of OR to business management have been discussed in different disciplines such as Management Science, Operations Management, Logistics Management, Supply Chain Management, and Decision Sciences. In Operations Research, we set up and use mathematical models, usually related to questions of planning in business, industry, or management. Any model of a real-life situation must simplify it greatly, by picking out those factors we think important for our purpose, and neglecting the rest. Otherwise, we can't calculate, or predict. (Newton approximated the sun and earth by masses concentrated at points. This approximation succeeded). We must consider whether we have we made a right selection. What check or validation is possible? To put our model in mathematical terms makes us formulate our ideas precisely - what exactly are we assuming? - and so we are less likely to make hidden assumptions without knowing it. Moreover, once we have a model in mathematical terms, we can manipulate it effectively using concise mathematical language. Also calculations, using a computer, are more readily set up. The model results provide useful information for making business decisions. The factors we recognize, as affecting the situation, consist of (i) external factors ("exogenous factors"), which we regard as inputs to the system, and whose effects we shall study, (ii) factors the model 1 tries to explain ("output", "dependent", or "endogenous" factors), and (iii) factors we shall neglect. For example, if we are hired by a firm to determine the level of production that will maximize profits, then profit becomes an "output" for the system, and market factors become the "inputs". But, for an economist who wants to explain production levels, profit could be an internal variable (internal to the system being studied, neither an input nor an output). We should be clear what is the aim of our investigation. It often falls to the O.R. investigator to clarify the objective. This involves much discussion with the propounder of the problem, to find out "where the shoe is really pinching". For example, it could be irrelevant to optimize a production schedule, if the real problem is labor relations. We can fall on our face by neglecting some essential factors. A century ago, some mathematicians proved that aeroplanes were impossible; they had neglected the essential "boundary layer", where viscosity of the air plays an essential role. Likewise, in a business model, it is possible to omit an essential factor - for example there may be an upper bound on certain resources, which must not be forgotten. This course has to present examples from books; however, in a real-world situation, always go and see for yourself (the factory floor, or the airport, or whatever) if you possibly can - it is usually different from what was supposed. 0.2 Some reference books (a few out of the many published.) The codes <DG> etc. are here for cross-referencing. Note that a book such as <DG>, which includes discussion of building suitable models, is of more value to an O.R. practitioner than a book that mainly presents the computational algorithms. In practice, the calculations are done on computers; however, one needs some understanding of the algorithms, otherwise one never knows whether the computer is producing sense or nonsense. <DG> H.C. Daellenbach, J.A. George, D.C.. McNickle, 1984 (1st. ed.) or 1978 (2nd. ed.). Introduction to Operations Research (Allyn & Bacon). <a good balance between model building and the mathematics> <HW> R. Hesse and E. Woolsey, 1980. Applied Management Science (a quick and dirty approach), (Science Research Associates). <good for practical " real-world" details of application> <B+> K.H. Bradshaw and others, 1982. An Operations Research Casebook (Longman Cheshire). <the source of many miniproject topics for an O. R. course> J.C. Ecker and M. Kupferschmid, 1988.Introduction to Operations Research (Wiley). <MD> M.J.C. Martin and R.A. Denison, 1971. Case Exercises in Operations Research ,(Wiley-Interscience) 2 <a good source of many project topics> E.A. Bender, 1970. An introduction to mathematical modelling (Wiley/Interscience). H.A. Taha, 1982. Operations Research (Macmillan). <better on calculation examples than model building> B. Srinavasan and C.L. Sandblom, 1989, Quantitative Analysis for Business Decisions (McGraw-Hill). <includes some useful examples of decision trees> <SDK> M. Syslo, N. Deo, J. Kowalik,1983. Discrete Optimization Algorithms with Pascal Programs, (Prentice-Hall). <See especially chapter 3: Optimization on Networks> <WS> R.E.D.Woolsey and H. Swanson, 1969, 1975.Operations Research for Immediate Application A Quick and Dirty Manual, (Harper & Row). <see especially chapters 6 and 7> <MW> S. Makridakis and S. C. Wheelwright, 1989. Forecasting Methods for Management (Wiley). This list is not meant to exclude other, and more recent, textbooks. Reference may be made to Thompson and Thore (1992), Ragsdale (2001), and Vollman et al. (2005), listed in the bibliography, for more examples of O. R. models in management. But it is not recommended to use a text that is mainly a manual for a particular computer package (see section 0.6). 0.3 Initial example Think of a factory, whose running cost (which is to be minimized) is a function of various production variables (how much do we make of which product on which machine for which market?), subject to constraints (limits on material resources, labor, time available, market requirements). This may (but need not always) reduce to a linear programming model). Note that we must, later, be specific as to what we mean by cost. The following check-list (in 0.4) applies specifically to linear programming models, but also gives general guidance in setting up other kinds of O.R. models. 0.4 Check-list, when setting up an Operations Research model The stages of an applied operations research study have been listed as follows (following Taha, 1992): a. defining the research or the policy problem b. developing the operations research model for the relevant system c. implementing/solving the model numerically by some suitable algorithms and computer programs d. undertaking validation tests of the model and its results e. analysing the implications of the model results for actions or decisions related to the issues under the study. 3 A more detailed check-list is as follows: (1). Find out what the problem really is! It won't come to you packages in mathematical terms. Ask simple, relevant questions. Go and see for yourself. "Obvious" assumptions can be wrong. (2) What are the variables of the problem? What, in fact, can you vary? If you seek to optimize, what is the objective function? Or are there several ? Check that the variables relate to the decisions that must be made. Would they give us enough information to act on? Many variables cannot be negative. What alternatives are possible? (3) List the constraints. They often include: input constraints (restrictions or requirements on raw materials), capacity constraints (e.g. available machine time, pipeline capacity, storage available, rate at which a product can be made), materials balance ("what goes in must come out", e.g. old inventory + production - part used to make new product = new inventory + deliveries to customers), output constraints (requirements, or limits, on sales, production, or rate of return). Check that units of measurement are consistent, or make them so. (A factory once measured its storage tank capacities in cubic feet, but its flow rates - inconsistently - in gallons per minute. For mathematical modelling, the flow rates were converted to cubic feet per hour - to avoid hopeless confusion. Today, SI units (metres, kilograms,. etc.) would be preferred). (4) What data are needed? You may need all your tact to get it! Exact figures may be unobtainable, or make little sense; maybe get upper and lower estimates instead. Are the cost figures you get relevant ? If you are planning production schedules, then likely costs of raw materials and energy enter; wages may or may not, depending on the time scale of planning. (5) Check out a simplified example! So, find any blunders in your model, or your computer program, before you risk your reputation. And get quickly a "ballpark estimate" to please the boss ! (Don't be frightened of a rough "back of envelope" calculation for this limited purpose - if you can do it quickly !) Do the results make practical sense? Are the computations, perhaps, only telling you what everyone in tbe industry has known for twenty years ? (6) Compute the full model. Often it is better to start from present operating conditions, and try to improve them, rather than start from scratch. What can be recommended for action (expressed in practical 4 terms, not mathematical symbols) ? Note the importance of writing a report, intelligible to management. Don't expect managers to cope with a schedule of how much to make of which product, if it is expressed as: x⁄ = 17.5 x‹ = 29.7 and so on ! Instead, tell the, in their language ! Something like: Daily production schedule Dinguses 17.5 tonnes Whatsits 29.7 tonnes and so on. (7) Model Validation and Verification. In Gass and Harris (2001, p. 865), model validation is defined as the process of determining how well the outputs of a mathematical model of real-world problem conform to reality. Model validation is often synonymously used with other terms such as model verification and model testing. Model validation is one of the important steps of an O.R. study. In an applied O.R. study, the reliability of the O.R. model and its results need to be tested. For this purpose, the usual model validation criteria can be adopted. According to Hazell and Norton (1986, p. 269) model validation and its purposes are as follows “"Validation of model is a process that leads to (1) a numerical report of the models fidelity to the historical data, (2) improvements of the model as a consequence of imperfect validation, (3) a qualitative judgment on how reliable the model is for its stated purposes, and (4) a conclusion (preferably explicit) for the kinds of uses it should not be used for" Several criteria can be used to test the validation of a model (see Gass and Harris, 2001; Labys, 1982; Taha, 1992; Hazell and Norton, 1986) at three levels of validation tests: descriptive, analytical and experimental. Three different types of validation criteria are applied to these three levels of validation tests (although 2 types of validations are suggested in Gass and Harris (2001) which are face validity and predictive validity) (see Kresge 1980 for further details): (i) Descriptive validation criteria: The attainment of the objectives of the model. The appropriateness of the model structure and the plausibility of results. (ii) Analytical validation criteria: The plausibility and characteristics of models and their results. The robustness of the results. (iii) Experimental validation criteria: Methodological tests of model documentation. Cost and efficiency in model, storage, transfer and extension. Tests for accuracy and efficiency of implementation as well as cost of and efficiency in the software transfer, storage and extension. 5 The above is a detailed set of model validation criteria for O.R. models. In a real life O.R. study often some simple validation tests are used (Hazell and Norton, 1986): plausibility of results, and comparisons of model results with actual or historical results, and other model results. Also, it is important to compare the model predictions with an independent set of observations. Those may be observations from a different time period, from the period whose data were used to estimate the parameters of the model. (8) What happens if something changes? Murphy's law makes sure it does ! How sensitive are your conclusions to small changes in the data ? (The jargon phrases are "post-optimality analysis" for linear programming, or (more generally) "sensitivity analysis".) If your recommendation is very sensitive to a particular item of data, or a particular assumption, find this out before it finds you out! If you calculate a linear programming model, it is seldom good enough to just present an optimum schedule! Consider also what happens if some likely things change. For example, a sales target for some product may have been set; but would it be profitable to increase it by a few percent, even though the distribution costs would then also increase ? Also, there may (quite often) be several other schedules, alternative to the calculated optimum schedule, which are nearly as good; and sometimes these alternatives should be presented to a management. They may want to take additional factors into account such as qualitative factors, that could not be included in the mathematical model. (9) Try to persuade the management to put your recommendations into effect. This can be the hardest part ! If they do, observe carefully what happens. Get some feedback of information. Should your model then be altered ? 0.5 Some other examples of Operations Research models in business There will be many such in later chapters. Chapter 1 discusses various linear programming examples. For the present, consider without going into details - the following additional examples of Operations Research models in business, including supply chain questions. (a ) A management must choose between several plans for future action. For example, do they start at once to produce their new product line ? Or do they conduct a market survey first ? That gives them, hopefully, better information, but runs the risk of letting a competitor 6 get in first. The various possibilities may be shown on a diagram called a decision tree. In this diagram, a branch divides into two or more branches whenever the management must take some decision (go ahead, or not? how much to make?), or whether the external world decides it for them (the new product sells like hot cakes, or only a few people want to buy it?) Based on this diagram, some evaluation of alternative courses of action can be made. Of course, one is estimating uncertain things (how likely is it that the sales will go up by 50% for the new product?), and such estimates have to be rough. But one is better off analysing even rough information in a systematic and quantitative way, than just relying on intuition - or optimism - to put the picture together. (See Chapter 4) (b) Planning industrial operations over months or years, as well as comparing alternatives as in a, needs to be done systematically. A dollar now is worth more than a dollar at some future date. (Even without inflation, money can still earn interest.) So one has to discount future payments or receipts, to an extent depending on the time interval, to allow for this. One may thus calculate a present value of operations that will happen gradually over time. A variant of this is to calculate a (percentage) rate of return - a measuring stick for how profitable or productive the planned operations will be (see Chapter 4). Such calculations are often, and usefully, done using a spreadsheet program on a desktop computer, so that all the relevant figures are handily displayed, say with years as columns and various kinds of payments or receipts as rows. This makes it easy to vary some parameter, such as some interest rate, and see what will happen. Such a presentation also allows another important aspect, called cash flow, to be checked. A business must have enough money coming in, from somewhere, to meet its essential obligations in each year. (A firm may go bankrupt now, for lack of cash flow this year, even though its prospects for future years appear bright.) (c) Network models are often useful. This may describe some actual network, of pipelines for oil or water, or an electrical or telephone network, or a network of routes for road transport, whose performance (and bottlenecks !) must be analysed. However, scheduling problems can often be described by networks. If a number of tasks have to be done in a suitable order (you can't put the roof on the building until you have built some walls !), then a network can describe the scheduling. Thus, each line (or "pipe", or arc) of the network could represent a task, and each dot (or "junction", or node) of the network represents a time of completion. One may then calculate how soon the whole project could be completed, and which are the "bottlenecks" (see Chapters 3 and 6). 7 (d) Inventory means things kept in store - whether raw materials, or products partly made ("in-process inventory"), or completed products. If the firm has no inventory of raw materials, then an interruption to supply will stop production - and starting and stopping is expensive (even, sometimes, disastrous !). If there is no inventory of finished products, then the customers can't get the products when they need them (and then do they buy them from another firm ?), or the firm's production is further disrupted by starting and stopping to match varying demand for the products. But carrying inventory costs money; not only do storage facilities, and wages of people to run them, cost money, but (often, most importantly) the cost of the materials held in stock has to be borrowed from the bank, and costs bank charges. How should these conflicting requirements be balanced ? Guesswork usually gets it wrong ! (Many firms have spent far too much in connection with inventory, keeping far too much, or far too little.) However, mathematical models are available, and these things can be calculated (see Chapter 5). (e) Rail trucks, carrying raw materials for a factory, come to a goods yard to be unloaded. Their rate of arrival is somewhat variable; and the rate at which they can be handled is also somewhat variable. The usual result is that some queue builds up of trucks, waiting to be unloaded. That costs money - and the situation is even worse, if the materials are perishable ! Similar queues arise in many other situations, including (for example): Passengers, and baggage, arriving at airline counters; Telephone calls coming into a telephone exchange; Waiting to use specialized machines in a factory. Mathematical models are available for various kinds of queues, if something is known (or can be measured) about variabilities, as well as average rates. It is these quantities that make the differences, not whether the queue is of people or rail trucks or telephone calls. The mathematics is very close to that for inventories (see Section 8.1). (f) Many scheduling problems, including some questions of inventory management, scheduling production and employment, budgetting for capital expenditure between several projects, have the common (and awkward) feature that the number of possibilities is very great, far too many to make a list of them to compare. Suppose that the scheduling can be put on a time scale (weeks or months, say), or at any rate put in order (number off the alternative investment projects 1,2,3,...). Suppose also that the "cost" (maybe actual cost, or some other quantity such as waste product, to be minimized), adds up over the different "times". Then a technique called dynamic programming can 8 often be used, to avoid listing an impossible number of possibilities. Under the "adds up" assumption, one may calculate from each "time" to the next, instead of listing all possible schedules. Roughly stated, the production (or whatever) for "today" depends on past history, only to the extent that it is summed up in the production (or whatever) for "yesterday" (see Chapter 3). (g ) The property just stated (not needing to look further back than "yesterday") may be thought of as a "short memory" property. (Technically, it is called the Markovian property). This property happens, quite often, with stochastic systems - those including some random elements - in particular with many queues, and inventory systems where (as usual) there is some variability in demand for the products. Of course, it does not always happen; but, when it does, it usually makes some calculations possible. (h) The order of scheduling tasks in a workshop - say, when various jobs must be scheduled on successive machines - often leads to job shop scheduling problems, involving integers (in which order should a list of jobs be done), rather than continuous variables. For some of these practical problems, there are good techniques; for some others, there are only rough approximations (see Chapter 6). (i) Suppose the yield (ratio of useful output to raw material input) for some industrial process must be maximized, subject to some constraints (it is no use blowing up the factory, or making the reaction vessel freeze solid !). Usually, the functions here are nonlinear, so that linear programming does not apply. Sometimes, such a problem can be reformulated, using different variables, to allow linear programming to be used as an approximation. But, quite often, there is too much nonlinearity in the problem to allow this simplification. There are a diversity of methods for calculating such nonlinear problems. Questions of sensitivity to changes in the data are also important (see Chapter 7). (j) Optimization is not only about maximizing profit or minimizing cost, but can, and often should, consider environmental variables as well. For example, a model may include a constraint which sets an upper bound to air or water pollution. Or an environmental variable may be assigned a cost, and included in the cost function that is to be minimized. (k) A model for optimal waste management was given by Sahoo, Kim, Kim, Kraas, and Popov (2005). If only vehicle travel time is minimized, the model is a mixed integer linear program (MILP). Thus (see Chapter 1 and Section 6.6), the model is described by linear equations, but 9 some of them may only take integer values. A more complicated version of the model also seeks to minimize the number of vehicles, and balance the workload. Of course, there must be some compromise between these different objectives. While there are various computer programs for MILP, they may not be suitable for this specialized problem. The authors use several heuristic (approximate) methods, including a clustering algorithm to generate the initial routes, related to the travelling salesman problem, and also a simulated annealing method (see Section 8.4) to improve the result. (l) Various models for supply chain have been given recently. One, by de Kok, Janssen, van Donemalen, van Wachem, Clerkx and Peeters (2005) is cited in section 5.12. The variability of demand increases as one moves back through the stages of the production process. The authors propose a model, with linear equations describing inventory. However, their main concern is to reduce time lags in the planning process. Another supply chain model, by Troyer, Smith, Marshall, Yaniv, Tayur, Barkman, Kaya and Liu (2005), seeks to improve the proportion of deliveries that are on time, over a network of factories and dealers, while reducing inventories. Here, inventories must be held at various places in the network, with appropriate levels of safety stock (see chapter 5 for what this means for a single inventory). But the demands must be propagated down the network (see Section 5.11.) (m) Metty, Harlan, Samelson, Moore, Schnweur, Raskina, Schneur, Kanner, Potts and Robbins (2005) gave a model for a supplier negotiation process in the telecommunications industry. This led again to a MILP model. Hicks, Madrid, Milligan, Pruneau, Kanaley, Dumas, Lacroix, Desrisoers and Soumis (2005) gave a MILP model for scheduling the use of aircraft which are shared between several firms. This model contained many zero-one variables (taking value 1 when the aircraft is used for a particular journey, and 0 otherwise). The (heavy) computational requirement was reduced by partitioning the MILP into smaller subprograms, having only a few variables in common. So the problem was handled by optimizing the subprograms, then improving the values of the common variables, then repeating the process. Kuchta, Newman and Topal (2005) gave a MILP model for scheduling production at an iron mine, to meet demands from the mills that process it. Here, zero-one variables occur, taking value 1 if a particular block is mined at a particular time, and otherwise zero. LeBlanc, Hill, Greenwell and Czesnat (2005) developed a distribution model, involving different warehouses and shipping distances, to minimize the total shipping, holding and handling costs, using a linear programming model. 10 0.6 Importance of model building, and limitations of computers Any course on Operations Research must detail various standard models, and methods to analyse and calculate with them. But one must not impose a standard model on a real-world situation, if it does not fit. It may well happen that no standard model is of any relevance, to a particular real situation. One must learn, and be prepared, to set up a model, to fit the real situation. To practice this, one should also undertake project work on specific problems. Most Operations Research investigations involve serious computation, and many computer packages are available, e.g. for linear programming. But it is important not to allow an available package to determine the model to be used. The computer output may be very misleading if you do not know what model, or assumptions, are built into the package, or if you do not know, even in outline, what computational method is being used. Indeed, if a very rough, quick, pencil-and-paper calculation can be done, it may provide a useful check (are we out by a factor of ten?), as well as giving some answer to an impatient boss or client. One instance of misuse of a computer package was cited by Greenberg (1987). A factory had a two-year supply of unsaleable red widgets in its warehouse, and more being made, because the computer-based production and inventory control system said they should be made. The system was not documented, to they did not understand it. Eventually, it was found that an order for blue widgets had been received, but it was entered by mistake as a large order for red widgets. This caused a special production order to replenish the stock of red widgets, and a spurious forecast demand for red widgets, so even more were called for. The mistaken order was corrected, but the system did not recover from the mistake. One source of projects (of moderate size) is An Operations Research Casebook, by K. H. Bradshaw, D. N. Foster, B. R. Smith, and G. A. Vignaux (Longman Cheshire, Melbourne, 1982). Many actual applications of operations research may be found in journals, especially Journal of the Operational Research Society and Interfaces. However those in Interfaces are often large models, involving large sets of data and heavy computation. A student is advised to start on some smaller models, found in the older literature. A few examples are the following: K. Kolesar, 1975, Determining the relation between fire engine travel times and travel distances in New York city, Operations Research 23 (4), 614. W. T. Ziemba, C. Parkan and R. B rooks-Hill, 1974. Calculation of investment portfolio with risk-free borrowing and lending, Management Science 21, 209-222. R. Juseret, Long term optimization of electrical system generation by convex programming, 1978. Mathematical Programming Study 9, 186-195. A. Prékopa and T. Szántai, Flood control reservoir system design using stochastic programming, 1978. Mathematical Programming Study 9, 138-151. B. D. Craven, Mathematical Programming and Control Theory, 1978. Chapman & Hall, 11 London. S. K. Singh, A function for size distribution of incomes, 1976. Econometrica 44, 963970. R. P. O'Neill, M. Williard, B. Wilkins and R. Pike, 1979. A mathematical programming model for allocation of natural gas, Operations Research 27, 857. 0.7 Why the name ? Operations Research takes its name from the application of scientific methods to the planning of military operations, by Britain and U.S.A., during the 1939-1945 war. However, the ideas and methods have long since been applied to the arts of peace. Other names, such as Management Science and Industrial Engineering, describe very similar disciplines. 0.8 The usefulness of spreadsheets A spreadsheet program is often useful for data input (e.g. to a linear programming package, see section 1.18 for an example), or for data output for presentation, from the computation of an O. R. model. The basic principles of a spreadsheet are quite simple (see section 9.2), and the complications (especially graphical presentations) can be learned later, as and when required. However, the computational features of spreadsheet programs have serious limitations, and often more specialized computer programs are preferable (e.g. programs for linear programming or nonlinear optimization.) Moreover, a model that is easy to set up on a spreadsheet may be an inadequate model. Nothing substitutes for the pencil-and-paper modelling, before going near the computer. 0.9 Presentation of conclusions and recommendations It is the responsibility of an Operations Research consultant (whatever label he/she wears) to present the results intelligibly to the client, without assuming the client is already familiar with the technicalities. (It is always the job of a mathematician to explain himself/herself to the client, rather than the other way about.) Usually, both a written report and an oral presentation are required. The following notes relate to a written report, what it should contain, and how it should be arranged, so as to be acceptable to a business management. The layout of a report should be something like the following: SUMMARY (or OVERVIEW (on a single page; no math symbols!) Introduction and objectives Summary of findings and conclusions Summary of recommendations (perhaps cross-referenced to main report) 12 MAIN REPORT (maximum nine pages) Problem definition Method (but relegate math. technicalities to an appendix) Assumptions made (list assumptions - so that your work is checkable) Analysis of data Findings and conclusions (some graphical, or spreadsheet, presentation may be useful) Recommendations (some specific things to do) APPENDICES (as the problem requires; put here such things as extensive tables of data, computer output, mathematical formulation, e.g. of a linear programming model.) The stated limitation on the size of the Summary (one page, for the big boss), and the Main Report (maximum 9 pages), are important. Do not expect managers to read masses of material! Don't expect them to read mathematical symbols, when these are not essential! For example, do not present the results of a linear programming optimization as x1 = 123.45 , x2 = 17.4 , etc. . Instead present some table of recommended quantities, with names that the management will be familiar with, for example: PRODUCTION SCHEDULE 123.5 tons of Wotsernames, 17.4 tons of Gizmos, etc (putting in whatever the names of the products really are). Do not present spurious precision in the conclusions - consider how accurate the data are! Also, a spreadsheet presentation is often persuasive. The names given for headings are not set in concrete; vary them to suit the topic. There must be (usually in an appendix) enough relevant mathematical detail to enable the calculations to be checked, or repeated with some changes. For example, for a linear programming model, there must be a list of variables, and the problem description in some form - a data matrix, maybe on a spreadsheet, can be better than pages of equations. Note carefully that the data for a real-world problem is often inadequate (then, often, you must make assumptions, and state clearly what you have assumed), and may contain items that are irrelevant, or misleading (you must use some judgement !) A report must be typed, using any available word processor. You don't have to use a computer program to do diagrams; graphs can be pasted in the report. However, spreadsheet programs, such as Excel, have some useful graphics capability. And the added neatness of graphs done with a computer program is a selling point, as well as a requirement by journal editors. 13 Chapter 1 LINEAR PROGRAMMING 1.1 Introduction : management models To introduce linear programming, consider the following two models. Model A Allocation of production to machines Six products can be made on each of two machines.The following tables show, for each combination of product and machine, the production rate (expressed as hours per ton) and the cost ($ per ton); also the demand in tons for each product. Also shown are the variables, x⁄, x¤, ..., chosen to denote the amount (tons) of each product to be made on each machine. The hours available are 780 hours on machine 1, and 3077 hours on machine 2. A schedule is required, by which the requirements can be met at minimum total cost. Production rate Product Product Product Product Product Product 1 2 3 4 5 6 Cost Demand ($/ton) (tons) Mach.1 Mach.2 Mach.1 .228 .119 36.0 .228 .119 42.4 .231 .132 34.5 .231 .132 41.0 .182 .112 22.1 .182 .112 28.5 Variables (hours/ton) Mach.2 44.2 36.2 38.4 30.2 21.4 13.4 2929 9420 1655 8978 2989 2977 x⁄ x¤ x‹ x› xfi xfl x‡ x° x· x⁄‚ x⁄⁄ x⁄¤ There is a constraint for each product (x⁄ + x‡ = 2929 for the first product), and a constraint for each machine (.228x⁄+.228x¤+.231x‹+.231x›+.182xfi+.182xflˆ780 for machine 1); and all the variables xj are nonnegative. The constraints need to be laid out tidily in rows and columns (thus as a matrix) - or there will be confusion, especially when entering data into a computer program. The use of dots for zeros is unconventional, but helps the eye considerably. The objective function to be minimized is 36.0x⁄ + 42.4x¤ + ... + 13.4x⁄¤ . 14 x⁄ x¤ 1 1 2 . 3 . 4 . 5 . 6 . 7 8 x‹ . 1 . . . . x› . . 1 . . . xfi . . . 1 . . xfl . . . . 1 . x‡ . . . . . 1 .228 .228 .231 .231 .182 .182 . . . . . . x° 1 . . . . . x· x⁄‚ x⁄⁄ x⁄¤ . . . . . 1 . . . . . 1 . . . . . 1 . . . . . 1 . . . . . 1 =2929 =9420 =1655 =8978 =2989 =2977 . . . . . . ˆ 780 .119 .119.132 .132 .112 .112 ˆ3077 Model B The Novelty Company makes Thingos, Dinguses and Whatsits. Each Thingo takes 1.5 hours to make, and requires 4.5 kg of raw material I and 950 g of raw material II. Each Dingus takes 4.6 hours to make, and requires 2.0 kg of raw material I and 100 g of raw material II. Each Whatsit takes 2.1 hours to make, and requires 11.0 kg of raw material I and 240 g of raw material II. The net profit (= sale price minus costs) for each Thingo is $220, for each Dingus is $150, for each Whatsit is $270. The Company has available 25 hours, 130 kg of raw material I, and 26 kg of raw material II. What is the maximum profit they can make, and how do they do it ? Suppose they make x⁄ Thingos, x¤ Dinguses, and x‹ Thingos. Then x⁄ ˜ 0, x¤ ˜ 0 and x‹ ˜ 0, since negative amounts have no meaning here. The restrictions on time, raw material I, and raw material II, require the following constraints to be satisfied: 1.5x⁄ + 4.6x¤ + 2.1x‹ ˆ 25, 4.5x⁄ + 2.0x¤ + 11.0x‹ ˆ 130, 950x⁄ +100x¤ +240x‹ ˆ26000. Subject to these constraints, the objective function 220x⁄ + 150x¤ + 270x‹ is to be maximized. So there is a linear programming problem: Maximize 220x⁄ + 150x¤ + 270x‹ subject to x⁄ ˜ 0, x¤ ˜ 0, x‹ ˜ 0, 1.5x⁄ + 4.6x¤ + 2.1x‹ ˆ 25 , .45x⁄ + .20x¤ + 1.10x‹ ˆ 13.0 , .95x⁄ +.10x¤ + .24x‹ ˆ 26.0 . Observe that, in a linear program, the objective function and the constraint functions are linear, and the veariables are nonnegative . The constraints may be equalities, ˆ inequalities, or ˜ inequalities. [Note also , in Model B, that the second and third constraints have been scaled (multiplying by 0.1 and 0.001 respectively), so as to make the largest coefficient in each constraint not too far from 1 is absolute value; this helps the accuracy of computation.] Linear programming applies to many other situations; other examples are given in later sections. 15 1.2 Standard form for a linear program The inequalities are converted to equalities by putting in extra variables. Thus, in Model B, the inequality1.5x⁄ + 4.6x¤ + 2.1x‹ ˆ 25 becomes 1.5x⁄ + 4.6x¤ + 2.1x‹ + x› = 25, where x› is a nonnegative slack variable . Thus Model B becomes: Minimize 220x⁄ + 150x¤ + 270x‹ + 0x› + 0xfi + 0xfl subject to x⁄, x¤, x‹, x›, xfi, xfl ˜ 0, 1.5x⁄ + 4.6x¤ + 2.1x‹ + x› = 25.0 , .45x⁄+ .20x¤ + 1.10x‹ + xfi = 13.0 , .95x⁄ + .10x¤ + .24x‹ + xfl = 26.0 . Note that each constraint now has a variable with coefficient 1, that occurs nowhere else (thus, x› in the first constraint). Thus there is an initial feasible solution (feasible means satisfying the constraints) x› = 25.0, x› = 13.0, xfl = 26.0, all other xj = 0. (Notice that there are here just as many nonzero xj (three) as there are constraints.) If the coefficients in these constraInts are laid out as a matrix, thus x⁄ 1.5 .45 .95 x¤ 4.6 .20 .10 x‹ 2.1 1.10 .24 x› 1 . . xfi . 1 . xfl . . 1 25 13 26 then this matrix contains a unit matrix (here, columns 4,5,6). This is necessary in order to start the simplex method - see Section 1.3). If a model has a ˜ constraint, for example 3x⁄ + 4x¤ ˜ 12, then a negative slack variable is introduced, to convert to an equality, thus 3x⁄ + 4x¤ - xnegslack = 12. But this is not enough, since a term with coefficient +1 is needed, to provide the unit matrix. So an artificial variable is added; thus, 3x⁄ + 4x¤ - xnegslack + xartificial=12. But xartificial is not part of the original problem; so a penalty cost term +Mxartificial must be added to the objective function (to be minimized). Here, M is a large enough positive number, so that minimizing the objective function will get rid of the artificial variable. Consider now an equality constraint, say 3x⁄ + 4x¤ = 12. This still needs an artificial variable (though not a slack variable), thus 3x⁄+4x¤ + xartificial= 12, with +Mxartificial in the objective function. This account standardizes on Minimization problems. Maximization (as in many textbooks) is equally good. Note that MAX 2x⁄ - 3x¤ + 5x‹ is equivalent to MIN -2x⁄ + 2x¤ -+ 5x‹ .Thus, the profit coefficients -2, 2, -5 are the negatives of the cost coefficients 2, -3, 5 ; and the z j-cj (see Section 1.4) have opposite sign; and -Mxartificial is added to the objective being maximized. [Also some books have a different definition of standard form.] 1.3 Idea of simplex method The simplex method is the most widely used algorithm for computing linear programs. (See also Section 1.19.) 16 Consider the linear program: C: Minimize 3x⁄ + 4x¤ subject to x⁄˜0, x¤˜0, 2x⁄ + x¤ ˆ 7, x⁄ + x¤ ˜ 5. Putting this into standard form gives the (initial) tableau : 3 x⁄ 2 1 7 Cost coeffts zj -cj 4 x¤ 1 1 6 0 x‹ . -1 -10 0 x› 1 . 0 10 xfi . 1 0 Requirement 7 5 50 Multiplier -.5 -3.5 Note that the cost coefficients (c⁄=3, c¤=4, etc.) are not part of the tableau; but we need to refer to them. Multiplier and zj-cj are explained below. Here, x› is a slack variable, x‹ is a negative slack, and xfi is an artificial variable; M is taken here as 10, for simplicity. (Usually a much larger number is required, like 10000, to be large enough, compared to all the other costs in the problem). Columns 4 and 5 give the required unit matrix. The constraints solve immediately to give x›=7-2x⁄-2x¤-0x‹ and xfi=5-x⁄-x¤+x‹. (The variables x› and xfi form the initial basis. Initially x›=7 and xfi=5, so the objective function f = 0(7)+10(5)=50. ) Now the objective function equals f = 3x⁄+4x¤+0x‹+0x›+10xfi = 3x⁄+4x¤+0x‹+10(5-x⁄-x¤+x‹) = 50 - [ 10(1) -3]x⁄ - [10(1) - 4]x¤ - [10(-1)-0]x‹ = 50 - 7x⁄ - 6x¤ + 10x‹. [The numbers 7, 6, -10 are zj -cj in the tableau.] Initially x⁄=x¤=x‹=0 (nonbasic variables). Consider increasing one of them from zero. The fastest rate of decrease of f is obtained by increasing x⁄ from zero. How far can x⁄ increase ? From x›=7-2x⁄ ˜0and xfi=5-x⁄˜0, there follows x⁄ˆ3.5 and x⁄ˆ5, hence x⁄ is taken as 3.5. The new basis variables are x⁄ (replacing x›) and xfi. [The order of the basis variables matters.] [Here, the pivot is the element in column 1 (new basis variable) and row 1 (the first constraint here tells which variable leaves the basis. Row 1 is here the pivot row.] It is now required to solve for x⁄ and xfi. Add 0.5 (equation 1) to equation 2; add -3,5(equation 1) to the zj-cj row); divide the pivot row (here, row 1) by the 2 (the pivot element). This gives x⁄ +.5x¤ +.5x› = 3.5 and .5x¤-x‹-.5x›+xfi=1.5. Solving for the new basis variables, x⁄=3.5-.5x¤-.5x› and xfi=1.5-.5x¤+x‹+.5x›. Therefore f = 3x⁄+4x¤+10xfi =25.5 -[ 3(.5)+10(.5)-4]x¤ -[3(0)+10(-1)-0]x‹ - [3(.5)+10(-.5)-0]x› =25.5 - 2.5x¤ +10x‹ + 3.5x› ; so x¤ enters the basis. Then x⁄=3.5-.5x¤˜0 and xfi=1.5-.5x¤˜0, require that x¤ˆ3.5/.5=7.0 and x¤ˆ1.5/.5=3; so take x¤=3; the pivot is the second element in column 2. And so on. 1.4 Simplex tableaus The above calculations are done systematically, using arrays of numbers, called tableaus. The step from each tableau to the next is 17 called an iteration. 3 x⁄ Tabl.1 2 1 zj -cj 7 Cost coeffts Tabl.2 1 . 0 Tabl.3 1 . 0 4 x¤ 1 1 6 0 x‹ . -1 -10 0 x› 1 . 0 .5 .5 2.5 . -1 -10 .5 -.5 -3.5 . 1 0 1 -2 -5 1 -1 -1 10 xfi . 1 0 Requirement 5 50 . 1 0 3.5 1.5 25.5 -1 2 -5 2 3 18 . Multiplier 7 -.5 -3.5 -1 -5 In tableau 1, the basis columns are 4 and 5; the cost coefficients are [c› cfi] = [0 10]. Calculate z⁄-c⁄ =[0 10] ã2õ-3=7; z¤-c¤=[0 10] ã1õ-4=6; and so on; note basic zj-cj=0. Ã1Õ The largest positive zj-cj is z⁄-c⁄=7; so x⁄ enters the basis. Choose the smallest nonnegative ratio among 7/2 and 5/1 [look at requirements column and pivot column; ignore negative ratios, if present, since they don't stop the variable going positive]. The first ratio is the smallest, so the first basis variable (x›) is replaced by x⁄. The pivot is shown in bold. For rows other than the pivot row, the multiplier = - (element in pivot column)/(pivot element). [Thus the multiplier for second row is -(1)/(2). ] To update the tableau, for rows other than the pivot row: new element = old element +(row multiplier)(element in same column and pivot row) Thus, for row 2 and column 1, 1 ü 1 + (-.5)(1) = .6. The zj-cj row is updated like any other row. Finally, the pivot row is divided by the pivot.Thus tableau 2 is obtained. The largest positive zj-cj is z¤-c¤=2.5; so x¤ enters the basis. The second basis element (xfi) leaves the basis (consider ratios 3.5/.5 and 1.5/.5). In the third tableau, all zj-cj are ˆ 0; so an optimum has been reached. (The numbers zj-cj are called reduced costs.) 1.5 Information from tableau The optimal solution is x⁄ = 2, x¤ = 3, other xj = 0. Observe that the unit matrix in the initial tableau consists of columns 4 and 5 (in that order). The optimal inverse basis matrix then consists of columns 4 and 5 in the optimal tableau. From z›-c›=-1 and zfi-cfi=-5, with c›=0 and cfi=10, obtain z›=-1 and zfi=5. In the optimal tableau, columns 1 and 2 form the unit matrix; columns 1 and 2 in the initial tableau from 18 the optimal basis. Check that: ã 1 -1õã2 1õ =ã1 0õ and [3 4]ã -1õ = [-1 5] Ã-1 2ÕÃ1 1Õ Ã0 1Õ Ã-1 2Õ i.b.m. b.m. Here, [3 4] is the vector of cost coefficients for the optimal basic variables; and the shadow costs are [z›, zfi] = [-1 5] (see below). What happens if some requirement is perturbed a little? If the second requirement 5 is changed to 5+h, then (using the inverse basis matrix) ãx⁄ õ = ã1 -1õã7 õ =ã2- h õ ˜ ã0õ provided hˆ2 Ãx¤ Õ Ã-1 2ÕÃ5+hÕ Ã3+2hÕ Ã0Õ h˜-1.5 So the basic variables x⁄, x¤ stay basic when h varies between -1.5 and 2, although the values change. Within that range, the optimal objective function equals 3(2-h)+4(3+2h)=18+5h. The number 18 is already given in the optimal tableau; and 5 is the second shadow cost. 1.6 Two-phase method So far, a numerical value was given for M. If, instead, M is left as a symbol, then the zj-cj for the initial tableau for example C (in 1.3) are M-3, M-4, -M, 0,0, and the initial objective is 5M (instead of 50), with multiplier -(M-3)/2. The second tableau obtains 0, (M-5)/2,-M, -(M3)/2,0; objective =(3M+21)/2, and multiplier = -(M-5). The third tableau has zj-cj as 0, 0, -5, -1, -M+5, and objective 18. This is the big M method, sometimes used for hand calculation. An alternative, often used in computer programs for LP, is the two-phase method. In phase I, M is taken as the unit of cost, and other numbers considered negligible, so that the cost coefficients become 0, 0, 0, 0, 1, and the initial objective value is 5. Phase I Cost coeffts 0 0 0 0 1 x⁄ x¤ x‹ x› xfi Requirement Multiplier Tabl.1 2 1 . 1 . 7 1 1 -1 . 1 5 -.5 zj -cj 1 1 -1 0 0 5 -.5 Tabl.2 1 . 0 .5 .5 .5 . -1 -1 .5 -.5 - .5 Tabl.3 1 . z j - cj 0 New zj - cj 0 . 1 0 0 1 -2 0 -5 1 -1 0 -1 . 1 0 3.5 1.5 1.5 -1 2 -1 5 2 3 0 -1 -1 At the end of phase I, the zj-cj are all zero, except artificial columns. They must be recalculated, using the original costs, for example 19 z‹-c‹= [3 4] ã 1 õ -0 = -5 (using costs 3, 4 for basic x⁄,x¤ Ã-2 Õ and zero now instead of M ) Here, by coincidence and unusually, all the (new) zj-cj happen to be ˆ 0, so the optimum has been reached. But usually some (new) zj-cj is > 0, so a phase II must follow, consisting of one or more simplex iterations. If the objective function in example C (in 1.3) is changed to x⁄ - x¤, then the tableaus become x⁄ x¤ x‹ x› xfi Requirement 2 1 . 1 . 7 1 1 -1 . 1 5 1 1 -1 . . 5 1 1 0 -2 . 1 0 . 1 -1 0 1 1 . 0 . -1 1 -1 X 2 5 0 -5 öRecalculated After the end of Phase I, the zj - cj row and objective value are recalculated as shown above, for example z⁄-c⁄ = [c‹ c¤] [1] - c⁄ = [0 -1 [1] -1 = -3 . [2] [2] [Here X is no longer relevant, since the artificial column will ot be put back into the basis. For comparison, X would be -M-1 for the big M method.] An iteration of Phase II gives: 1 2 -3 . 1 . 1 . . 1 1 -1 -1 . X 2 7 -7 which happens to be optimal, with x⁄=0, x¤=7, and (slack) x‹=2. (Again, X is not relevant here - although its matrix column is part if the inverse basis natrix.) 1.7 Unsigned variables A variable (z say) that is not required to be nonnegative can occur in a linear program - usually representing the change (up or down) of a variable from its usual level. To make the simplex method work, z must be written as z = z⁄ - z¤ with z⁄˜0 and z¤˜0. But z⁄ and z¤ must not both occur in a basis (3 = 3-0 and -3 = 0-3 okay, not 3 = 4-1). 1.8 Revised simplex method Usually (see model A for an example) the matrix of coefficients in a linear program is sparse, meaning that there is a high proportion of zeros. It then becomes computationally useful to not work with the whole simplex tableau, but only with part of it - the inverse basis matrix, with an extra row and column. The revised simplex method thus saves both data storage and computing time (multiplying uselessly by zero). But it is then necessary to record separately which variables are 20 in the basis; the whole simplex tableau is no longer available to show it. Req Matrix Col Mult Req 50 | 0 10 | 7 | -3.5 7 | 1 . |2 | 5 | . 1 |1 | -.5 Basis x›,xfi zj - cj =7,6,-10,0,0 ; col 1 Matrix Col Mult 25.5 | -3.5 10 | 2.5 | -5 3.5 | 0.5 . | .5 |-1 1.5 | -.5 1 | .5 | Basis x⁄,xfi zj - cj =0,2.5,-10,-3.5,0 ; col 2 Req 18 2 3 Matrix . | -1 5| | 1 -1| | -1 2| Basis x⁄,x¤ zj - cj =0,0,-5,-1,[-5] ;optimal. In this calculation, M is taken as 10. The initial objective value, 50, is obtained as in the simplex method; it is convenient here to put the requirements column at the left. The matrix tabulated is the inverse basis matrix , so starts with a unit matrix. The top row starts with the cost coefficients for the initial basis columns. The revised simplex (unlike the simplex) regularly refers back to the original data matrix: x⁄ x¤ x‹ x› xfi Requirement 2 1 . 1 . 7 1 1 -1 . 1 5 The cost coefficients are 3,4,0,0,10. To obtain the zj-cj for the first revised-simplex tableau, use the top row with the columns of the data matrix. Thus z⁄-c⁄ = [0 10] ã2 õ - 3 = 7; others are Ã1 Õ similar.This shows that column 1 should enter the basis. To reconstruct column 1 of the simplex, use the inverse basis matrixwith column 1 of the data matrix : ã1 0 õã2õ = ã2õ Ã0 1ÕÃ1Õ Ã1Õ This column is marked Cols in the above revised-simplex tableau; the 7 at the top is z⁄-c⁄. The pivot is chosen, in this column, as for the simplex; and the update (of the whole matrix) is done, just as for the simplex (except that it is a smaller matrix). [For example, 0-(3.5)(1)=-3.5] In the second revised-simplex tableau, z¤-c¤=[-3.5 10]ã1õ-4= 2.5; others are similar. Thus x¤ enters the basis. Ã1Õ Column 2 of the simplex is reconstructed as ã.5 0õ ã1õ=ã.5õ;note that the column is got from the data matrix Ã-.5 1Õ Ã1Õ Ã.5Õ Considering the ratios 3.5/.5 and 1.5/.5, the first basis variable (x›) leaves the basis, being replaced by x¤. In the update (for example) the matrix element 0.5 ü 0.5+(-1)(-.5)=1. The third tableau is optimal, since all zj-cj are ˆ 0; zfi-cfi (for the artificial column) is put in [ ], to remind that an artificial column is not considered for putting back in the basis. Computer programs for linear programming use the revised simplex (or some development of it that saves space by storing, not the inverse matrix itself, but other information from which it can be constructed, or some other form that is more numerically stable for large LPs), not the simplex, to save both storage space and time. (Only integer 21 programming needs the full simplex tableau). Normally, one uses decimals, rather than vulgar fractions otherwise denominators soon get unmanageably large. Note that the change from simplex to revised simplex, and the change from big M to two-phase, are separate things; the revised simplex example here used big M (with M=10 for convenient presentation), but could have used two-phase instead. Observe also that the calculations work down columns rather than across rows. For this reason, some computer programs for linear programming (e.g. Craven's program - see Section 1.19, and the Minos package) enter the matrix data going down columns (thus not across rows, like equations), and enter only nonzero matrix elements (and which row they are in). Alternatively, some programs accept the data in spreadsheet format (see section 4.10); here also, only nonzero data need be entered. 1.9 Dual linear program Consider the following linear programs: Primal program in matrix language MIN 3x⁄+4x¤+Mxfi subject to MIN cTx = [3 4 0 0 M] x 2x⁄+x¤+x› = 7, (where x = [x⁄, x¤, x‹, x›, xfi]T ) x⁄+x¤-x‹+xfi=5, ü subject to x ˜ 0, x⁄,x¤,x‹,x›.xfi ˜0 Ax = b, [Optimum x⁄=2, x¤=3] where A = ã2 1 . 1 .õ, b=ã7õ . ï Ã1 1 -1 . 1Õ Ã5Õ ï (rearrange the pieces) Dual program ö MAX bTw subject to ATw ˆ cT, MAX 7w⁄ + 5w¤ subject to 2w⁄+w¤ˆ3, w⁄+w¤ˆ4, thus MAX [7 5]ãw⁄õ subject to 0w⁄ -1w¤ˆ 0 [so w¤˜0] à w¤Õ 1w⁄+0w¤ ˆ M, [so w¤ˆM] [w⁄ w¤]ã2 1 . 1 .õ ˆ [3 4 0 0 M] ï [Optimum w⁄=-1,w¤=5 Ã1 1 -1 . 1Õ set z⁄=-w⁄, z¤=w¤ Note that the dual does not MAX -7z⁄+5z¤ subject to include a constraint w ˜ 0. -2z⁄+z¤ˆ3, -z⁄+z¤ˆ4, z⁄˜0, z¤˜0. Thus, a dual problem can sometimes be usefully rearranged. Note that, if M is very large, a constraint w¤ ˆ M has no effect. 1.10 Dual properties I Weak duality If x is feasible for the primal, and w is feasible for the dual, then cTx ˜ bTw. Proof cTx - bTw = cTx - wTb = cTx - wTAb = (cT-wTA)x ˜ 0 since each vector has components ˜ 0. Remark The range of values that the primal objective takes lies entirely above the range of values that the dual objective takes (assuming x and w feasible). Suppose that the primal is minimized as x=x*, and the dual is maximized at w=w*; then cTx* ˜ bTw*. 22 II Zero Duality Gap (ZDG) cTx* = bTw* ; and w* is the vector of shadow costs for the primal. Proof In the optimal simplex tableau, denote by Q the inverse basis matrix, u the vector of basic variables, q the vector of cost coefficients for them. Then u = Qb; the matrix in the optimal tableau is QA; the vector of the zj-cj is cTQA-cT, which is ˆ 0 by the optimality condition. So the vector qTQ of shadow costs is feasible for the dual. Since (qTQ)b = qTu = cTx*, and no w feasible for the dual can (by I) have wTb>cTx*, it follows that w*=qTb is optimal for the dual, and cTx* = bTw*. III Karush-Kuhn-Tucker conditions (see chapter 7). Necessary conditions for x* to minimize the primal are that, for Lagrange multipliers r* ˜ 0 and w*, there hold cT=w*TA + r* and r*Tx* = 0. Proof In the optimal tableau, xj>0 only for basic xj, and then r*j=cj-zj =0. So r*j = cj-zj = 0; so r*Tx = 0. 1.11 Sensitivity It is usually not enough to calculate an optimum to a linear program; it is also necessary to consider how sensitive the optimum is to small changes of the data. (Requirements are not all "set in concrete"; and there can be last-minute changes to data.) •a In 1.5, a small change to one requirement is considered; over a sufficiently small right hand side range (in the example, if the second requirement lies between 5-1.5 and 5+2), then optimal objective = original value+(shadow cost)(change in requirement); and the same basic variables stay optimal. (If more than one requirement changes, the shadow costs still apply, but the RHS ranges are reduced.) •b Consider a change to a cost coefficient. (a) Change c‹ away from 0. Since x‹ is not in the optimal basis, the z j are unchanged. So all the zj-cj remain ˆ 0 (still optimal), provided that z‹-c‹ stays ˆ0. From c‹=0 and z‹-c‹=-5 follows z‹=-5, so now z‹-c‹=5-c‹ˆ0 provided c‹˜-5. (b) Change c⁄ away from 3. Since x⁄ is basic, the zj are changed; it is necessary to check all nonbasic zj-cj (except artificials). Thus, z‹-c‹= [c⁄ 4] ã 1 õ-0=c⁄-8ˆ0 provided c⁄ˆ8. (Hereã 1õ is column 3 of Ã-2Õ Ã-2Õ the optimal tableau in 1.4.) Similarly z›-c›=c⁄-4ˆ0 provided c⁄ˆ4. So the tableau is still optimal when c⁄ˆ4. (If c⁄ increases above 4, a further simplex iteration is needed.) (c) Suppose that both c⁄ and c‹ are both functions of some parameter r. For a simple example, suppose c⁄=3+r and c¤=4-2r. Then z‹-c‹ = [3+r 4-2r]ã 1õ-0 = 5-4r ˆ 0 provided r˜5/4; z›-c› = ... . Ã-2Õ Such a situation may arise in a profit-maximizing problem, with profit 23 coefficients p⁄ = 30-20 (thus, revenue - variable cost) and p¤ = 85-45 (representing products manufactured) in the objective being maximized. Suppose that a unit of the first product requires 0.1 kg of a certain ingredient, and a unit of the second product requires 0.2 kg, where this ingredient costs $q per kg (currently q = $50, but may vary). Then p⁄ = 30 - [.1q+15] and p¤ = 85 - [.2q + 35]. •c Consider the example of 1.4, with requirements changed to 7 and 3.5. (The latter is on a boundary of its RHS range.). The optimal tableau now becomes: Tabl.3 1 . 0 . 1 0 1 -2 -5 1 -1 -1 -1 2 -5 3.5 0 25.5 (Note one basic xj is zero.) But there is also another optimal tableau (got using dual simplex, see 1.12) : Tabl.3 1 (new) . 0 1 -1 0 -1 2 -3 . 1 0 1 -2 -7 3.5 0 25.5 The shadow costs are different: -1 and 5 for the first tableau, 0 and 3 for the second. But also the RHS ranges are different, when the second requirement (b¤) varies: from 3.5 to 5.0 for the first tableau, from 0 to 3.5 for the second. If the optimal objective value is considered as a function of b¤, then this function is piecewise linear (thus, made up of a finite number of linear pieces), and the slope changes when b¤=3.5 . •d Consider adding a new column to the problem . Suppose the example of 1.3 is modified to: Minimize 3x⁄+4x¤ (+10xfi)-7xfl subject to all xj˜0, and 2x⁄+x¤+x› +xfl = 7, x⁄+x¤-x‹+xfi -xfl = 5. (Including slacks x3, x4 and artificial x5). What would zfl-cfl be for tableau 3 in 1.4 (which was optimal without xfl) ? This is calculated using the shadow costs, as zfl-cfl= [-1 5]ã 1õ-(-7) =+1, so no longer optimal. Then the new Ã-1Õ column 6 must be calculated, applying the inverse basis matrix,to the new column, as ã1 -1õ ã 1õ = ã 2õ . A simplex iteration would then follow. Ã-1 2Õ Ã-1Õ Ã-3Õ •e Consider a change in (one or more) matrix coefficients. The constraints Ax=b, x˜0 may be written as Bu + Kv = b, where B = matrix of basic columns, K = matrix of nonbasic columns, u = vector of basic 24 variables, v = vector of nonbasic variables. So the optimum (u*,v*) satisfies Bu*=b, u*˜0, v*=0. Now perturb B to B+E; this will change u to u+z, say, satisfying (B + E)(u + z) = b. If the elements of the matrix E are "small enough", so that z is "small", and the product Ez can be neglected, then Eu + Bz Ú 0; so z Ú -B-1Eu. In the example of 1.4, suppose the coefficient of x⁄ in the first constraint changes from 2 to 2.1 Then B = ã2 1õ Ã1 1Õ ; E = ã0.1 0õ; à 0 0Õ z Ú ã1 -1õã.1 0õã2õ . Ã-1 2Õ Ã 0 0ÕÃ3Õ 1.12 Dual simplex method In the simplex, requirements must be ˜0; feasibility is kept at all times, but the optimality conditions are not satisfied until the last tableau. In the dual simplex, which in fact solves the dual problem, but using a tableau suitable for the primal, requirements may be negative; the optimality conditions are satisfied always; but feasibility is not fulfilled until the last tableau. Consider the example: D: MIN x⁄+3x¤ subject to x⁄,x¤˜0, x⁄+4x¤˜8, x⁄+2x¤˜6,2x⁄+x¤˜6. Instead of introducing artificial variables then using the simplex method, the dual simplex may be used, writing the constraints in the form -x⁄ -4x¤ + xslack = -8 (similarly for the others). This gives the first two tableaus as follows: -1 -4 1 . . | -8 ö .25 1 -.25 . . | 2 ü -1 -2 . 1 . | -6 -.5 . -.5 1 . | -2 -2 -1 -1 -3 . 0 . 0 1 0 | -6 | 0 -1.75 . -.25 . -.25 . 1 | -4 ö -.75 0 0 | 6 In the first tableau, x‹,x›,xfi form an infeasible basis. The zj-cj are calculated as for the simplex; they are all ˆ0 (optimality conditions satisfied), so this basis is dual feasible. Choose now the row with most negative requirement as the pivot row (shown ö). Look at the pivot row and the z j-cj row, considering the ratios -1/-1 , -3/-4, 0/1 . The smallest positive ratio picks out column 2 to enter the basis; the pivot (-4) is shown bold in the tableau. [In a maximizing problem, choose instead the negative ratio nearest zero. ] An ordinary simplex iteration, with this pivot, gives the second tableau shown. Consider now the parametric programming question from 1.11•c, where the second requirement (h say) is the parameter, and the optimum is required, as this parameter varies. The tableau obtained is: 25 Tabl.3 1 . 0 . 1 0 1 -2 -5 1 -1 -1 -1 2 -5 | 7-h | (optimal | -7+2h ö |3.5ˆhˆ7) | 21-3h (Note that -7+2h=0 when h=3.5). If h decreases below 3.5, then x¤ becomes negative. Therefore a dual simplex iteration is done, with the second row as the pivot row. This leads to the tableau: 1 1 -1 . 1 | h (optimal . -1 2 1 -2 | 7-2h 0ˆhˆ3.5) 0 0 -3 0 -7 | 3h (Note that h˜0 and 7-2h˜0 provided that 0ˆhˆ3.5). optimization could be continued, for h˜7 or for hˆ0. simplex is also used in integer linear programming. This parametric The dual 1.13 Jumps in shadow costs Consider the following initial and optimal tableaus for a linear program. (This example is modified from an example in <DG>, page 125, by scaling the rows, so that the largest coefficients in each row are comparable in size. Such scaling is recommended for computational accuracy.) Costs -24 -20 0 0 0 0 100 12 20 24 0 0 .5 1 1.5 1 1 1 1.2 144 1 . . -.8 -60 . 1 . 0 . . 1 . 0 . . . . . . . -1 1 -100 0 . . . -1 -6 -.5 . -.5 . 1.5 1 . 1 0 -14 6 2 9.6 12 -408 . . . 1 0 1 . . 1,5 -.5 -2.4 . 0 0 . 0 . . -1 -100 . Suppose that the first requirement is perturbed from 12 to 12+h. When h=-6, the basic xj are no longer all ˜ 0; multiplying the optimal inverse basis matrix by the column vector (12+h, 20, 24, 0) gives (x¤, x›, xfl, x⁄0 = (-3, 5, 24, 18). The dual simplex can be used here; two iterations proceed from the tableau on the left to the optimal tableau on the right, (If the simplex is run again, starting with first requirement = 6, the same optimum is obtained, but with the rows in a different order). 26 . . . 1 0 1 1.5 . -.5 . -.5 1 -.5 . -2.4 . 1.6 . -1 . 1 0 -6 0 -14 . . . . 1 -1 . . 0 -3 . -2 -3 5 . -1 -2 24 ü . 3.2 2.4 . 18 1 2 2 -372 0 -28 -48 . 1 . . 6 1 . . . 8 . 1 -1 14.4 . . . . 12 0 0 0 0 -288 Now consider what happens when the first requirement is changed to 19. The dual simplex gives an optimum, x2=12, x4=0, x3=3, x1=8; with shadow costs (got from columns 3,4,5,7 ) 0, 0, -18, -2.5. But now, for comparison, let us solve this problem (with requirements 19,20,24,0) using the simplex. This gives x2=12, x3=3,x6=0,x1=8, and shadow costs 0, -12, -8, 0, thus a different optimum, though with the same optimal total cost of -432. Why the difference? Observe that each optimum has some basic xj at zero. Using the inverse basis matrix in each case, a calculation with the optimal inverse basis matrix, and using here a RHS parameter p, gives: x2 . . 1/2 -5/8 19 12+p/2 0 x4 = . 1 -5/6 5/24 20 = 0-5p/8 ! 0 if -24"p"0 x3 1 . -2/3 5/12 24+p 3-2p/3 0 x1 . . 1/3 5/12 0 8+p/3 0 x2 1 -2 1 . 19 3+p 0 x3 = . 3 -2 . 20 = 12-2p ! 0 if 0 " p "6 x6 . -4.8 4 -1 24+p 0+4p x1 . -2 2 . 0 8+2p Thus p=0 is a boundary between the first case (where optimal cost = -432-18p, -24ˆpˆ0), and the second case (optimal cost = -432-8p, 0ˆp<6). Here -18 and -8 are the respective shadow costs. As usual with parametric linear programming, the optimal total cost is a piecewise linear function of a RHS parameter p. 1.14 Integer linear programming Often some, or all, variables in a linear program must be restricted to be integers (e.g. rolls of paper, or lengths of steel, to be cut; number of people in a work schedule. There are also zero-one linear programming problems, where some variables must be 0 or 1 only, describing things that are either on or off (present or absent). Except for transportation problems (see 1.15) the usual linear programming algorithm does not generally give integer solutions, and rounding a non-integer solution can give a very poor approximation to an optimum integer solution, when small integers are involved. (If all the numbers are large, one would certainly round to integers, and expect to get a usable answer.) The following is an example of Gomory's cutting-plane algorithm for integer linear programming. Unfortunately it, and also the rival branch-and-bound algorithm (see section 6.5) are much slower that the usual (revised) simplex method, 27 and are restricted in practice to integer problems of modest size. Consider the following example: Maximize x⁄ + x¤ subject to x⁄, x¤ nonnegative integers, and to 2x⁄ + x¤ ˆ 6, 4x⁄ + 5x¤ ˆ 20. The initial and final tableaus for the usual simplex method are then: 2 4 -1 1 5 -1 1 . . 1 . . 6 20 1 . . . 5/6 1 -2/3 . 1/6 -1/6 1/3 1/6 5/3 8/3 13/3 Since this problem is maximizing, the zj-cj in the optimal simplex tableau are ˜ 0. Consider one of the equations involving a noninteger variable, say the second equation. (Usually the equation having the largest fractional part on the right hand side is chosen; but here, there is a choice between 2/3 and 2/3.) The equation may be rewritten as: 0.x⁄ + 0.x¤ + (1/3)x‹ + (1/3)x› = (2/3) + [2 - x¤ + x‹]. Here, the left side coefficients are fractions, thus 0 ˆ coefficient < 1; this has been arranged by shifting integer multiples (like 1.x‹) to the right hand side. An optimum integer solution must satisfy (1/3)x‹ + (1/3)x› ˜ 0, hence the right hand side of the rewritten equation is ˜ 0, hence the integer [2 - x¤ + x‹] ˜ 0, hence (1/3)x‹ + (1/3)x› ˜ (2/3). The problem is modified by adding this additional constraint; it may be simplified (multiplying by the denominator 3) to x‹ + x› ˜ 2. This additional constraint is called a cutting plane, because it cuts off a part of the feasible region of the original linear program. The previous optimum now no longer satisfies all the constraints. A new optimum may be found, using the dual simplex method. For this, the cutting plane is rewritten as -x‹ - x› + xfi = -2, in which xfi ˜ 0 is a new slack variable. The dual simplex tableau, and the result of an iteration on it, are shown as follows; the pivot element chosen is shown in bold. 1 0 5/6 -1/6 . 5/3 1 . 1 . -1/6 2 . 1 -2/3 1/3 . 8/3 ü . 1 -1 . 1/3 2 . . -1 -1 1 -2 . . 1 1 -1 2 . . 1/6 1/6 . 13/3 . . 0 . 1/6 4 There is here a choice of pivots; if row 3, column 2 is chosen instead, a different optimum : (x⁄,x¤,x‹,x›) = (0,4,2,0) , is obtained, in place of (2,2,0,4). The integer-optimum objective function has the same value, 4, for each optimum. (When a problem involves small integers, it often happens that there are more than one optimum point.) This example is unusually fortunate, in that a single cutting plane leads at once to an integer optimum. More typically, a number of iterations are required, each introducing a cutting plane - so the tableau grows more rows and columns. Note also that, for integer programming (though not usually for ordinary linear programming), calculations in 28 exact vulgar fractions may be required (as done here). To see what is happening geometrically, note that x‹ + x› ˜ 2 Ä (6=2x⁄-x¤) + (20-4x⁄-2x¤) ˜ 2 Ä x⁄ + x¤ ˆ 4. The original (non-integer) optimum (x⁄,x¤) = (5/3. 8/3) does not satisfy this constraint; the new optimum (2,2) satisfies it. With the present example, if constraint 1 had been chosen, instead of constraint 2, to generate a cutting plane, then it happens that two cutting planes would have been needed, to find an optimum. [ A (less recommended) alternative to using the dual simplex here is to solve the linear program (a) Minimize (1/6)x1 + (1/6)x2 + Mx6 subject to the original constraints, and also x3 + x4 -x5 + x6 = 2. (Here x5 is a slack variable, x6 is an artificial variable, and 1/6, 1/6 come from the previous zj-cj row, changing sign because we are switching from a maximum to a minimum problem.) The calculated numbers are the same as for the dual simplex, but there is more calculation. ] 1.15 Transportation problem As an example, suppose that 3, 8 and 2 buses are required at three destinations A, B, and C respectively. They must come from garages P, Q, R, which can supply respectively 2, 6 and 5 buses. Note that the numbers match: 2+6+5 = 3+8+2. The number of garages need not equal the number of destinations; it just happens to in this example. The buses are to be scheduled so as to minimize the total of the delivery times. The delivery times, for each combination of garage and destination, are given (in units of 10 minutes) in the following table: From P Q R To A 4 10 6 B 3 5 8 C 7 9 7 Suppose that xij buses are sent from source i (thus from P, Q, or R) to destination j ( thus to A, B, or C). All the xij must be nonnegative, and in fact integers, and must satisfy the constraints: x⁄⁄ + x⁄¤ + x⁄‹ = 2, x⁄⁄ + x¤⁄ + x‹⁄ = 3, x¤⁄ + x¤¤ + x¤‹ = 6, x⁄¤ + x¤¤ + x⁄‹ = 8, x‹⁄ + x‹¤ + x‹‹ = 5, x⁄‹ + x¤‹ + x‹‹ = 2. The "cost" f = 4x⁄⁄ + 3x⁄¤ + 7x⁄‹ + 10x¤⁄ + 5x¤¤ + 9x¤‹ + 6x‹⁄ + 8x‹¤ + 7x‹‹ is to be minimized, subject to these constraints. This problem is a linear program, except for the requirement that all xij are integers; however, it will turn out, for a linear program of this special form, that if the data are all integers, then the resulting xij will all be integers. The problem could be solved by the simplex method, but the tableau would be needlessly large, and would consist mostly of zeros. More efficient computational methods are therefore required. Dantzig's stepping stone method (an adaptation of the simplex method) 29 is described here;. The alternative labelling method of Ford and Fulkerson is much more efficient on a computer (see Chapter 6). If there are m sources and n destinations, then there are m+n constraints (3+3=6) in the example above). However, these equations are linearly dependent; in the example, the left set sum to ÛiÛjxij = 13, and so also do the right set. So one constraint is superfluous; there should be m+n+1 equations. The xij will be set out in a table with m rows and n columns. The supplies are put at the left, and the demands at the top. Table of A P 4 Q 10 R 6 "costs" B 3 5 8 Initial C 7 9 7 allocation 3 2+´ . 6+´ . 5+´ 3 6 8 2+´ 6-´ . 3 2+3´ . 0 2´ 2+´ 7 2 0 For the present, ignore the ´ terms. The minimum cost method for obtaining an initial feasible solution begins as follows.The cheapest cell in the first row is in column 2. Put as much as possible in the cell at row 1, column 2, thus MIN(2,8)=2. Thus the first supply is reduced to 0, and the second demand to 8-2=6. Since there is no more room in row 1, look for the cheapest remaining cell in column 2; this is row2, column 2, and put as much as possible in that cell, thus: MIN(remaining supply in row 2, remaining demand in column 2) = MIN(2,6) = 6. But now row 2 and column 2 are filled up, and it is not clear where to go next. This difficulty arises because the supplies for rows 1 and 2 sum to 6, the demand for column 2. To overcome it, perturb the supply for each row by adding ´ to it, where ´ is considered as positive and very small. To keep the total demand equal to the total supply, a total of 3´ (3 being the number of rows) must be added to the demands somewhere. As shown, the 3´ is added to just one of the demands. Then 2+´=MIN(2+´,8) goes in row 1, column 2, leaving 8-(2+´)=6-´ demand in column 2. Then 6-´=MIN(6+´,6-´) goes in row 2, column 2, so that a supply of 2´ remains in row 2. This goes in the cheapest available cell in row 2, namely column 3, leaving 2+´ demand in column 3. That goes in the only available cell, namely row 3, column 2, leaving a demand of 3 remaining in row 3. That goes in the only available cell at row 1, column 1. So all demands and supplies are accounted for, so a feasible solution is obtained. Note that there are just 5 stepping stones ("occupied cells", to which some xij has been allocated, corresponding to basic variables in the simplex method), and that 5 = number of rows + number of columns - 1. Is it optimal ? Suppose that an amount t is added to the cell in row 1, column 1. To keep the row and column totals correct, -t must be added 30 to row 1, column 2, +t to row 2, column 2, -t to row 2, column 3, +t to row 3, column 3, and -t to row 3, column 1. This path is following (some or all of the) stepping stones previously obtained. The change in total "cost" is Î = c⁄⁄t-c⁄¤t+c¤¤t-c¤‹t+c‹‹t-c‹⁄t = 4t-3t+5t-9t+7t-6t=-2t, so the total "cost" would be reduced by increasing t from 0. The largest possible t is chosen, subject to 2+´-t˜0´, 2´-t˜0, ´3-t˜0, hence t=2´. Table of A P 4 Q 10 R 6 "costs" cij B C 3 7 5 9 8 7 Adding t to one unoccupied cell ? 3 8 2+3´ ui 2+´ t 2+´-t . 0 6+´ . 6-´+t 2´-t 2 5+´ 3-t . 2+´+t 0 vj 6 3 7 cij-ui-vj -2 . 0 2 . . . 5 . But is row 1, column 1 the best cell to choose? To find this, dual variables (sometimes called"fictitious costs") are calculated ; since each row and each column of the table represents a constraint, there are dual variables ui for the rows and vj for the columns. They must satisfy ui + vj = cij for each occupied square. They are calculated by stepping stones; let u⁄=0; u⁄+v¤=c¤¤ gives v¤=3; u¤+v¤=c¤¤ gives u¤=2; u¤+v‹=c¤‹ gives v‹=7; u‹+v‹=c‹‹ gives u‹=0; u‹+v⁄=c‹⁄ gives v⁄=6. Then Î = [c⁄⁄-(u⁄+v¤)+(u¤+v¤)-(u¤+v‹)+(u‹+v‹)-(u‹+v⁄)]t =[c⁄⁄ - u⁄ - v⁄]t= -2t <0. For an unoccupied cell in row i and column j, cij - ui - vj would be calculated. In this example, row 1 and column 1 gives the only negative value, so this cell is the only choice. If cij - ui - vj ˜ 0 for all unoccupied cells, then a minimum has been reached. (Note that the arbitrary choice of u⁄=0 can be made, because one constraint is dependent on the others.) How large can the change t be ? Since no xij can be negative, t must satisfy all of 2+´-t ˜0, 2´-t˜0, 3-t˜0. Hence, giving t the largest possible value, t=2´. The new table is shown below left; note that row 2, column 3 has now 2´-t=0, and becomes "unoccupied". The total "cost" has decreased from 68+23´ to 68+19´, this decrease equalling the product of t=2´ by -[c⁄⁄-u⁄-v⁄]=2. The new ui and vj are also shown; the consequent cij-ui-vj for the three unoccupied squares are 2,4,3, all >0, so an optimum has been reached - shown below at right (now dropping the ´s.) With different data, more iterations may be needed; and values of t larger than "´ terms" may be found. cij-ui-vj Optimal table 3 8 2+3´ ui 2+´ 2´ 2-´ . 0 . . 2 0 2 . 6+´ . 6+´ . 2 4 . 2 . 6 . 5+´ 3-2´ .2+3´ 2 . 3 . 3 . 2 vj 4 3 5 31 Integer solutions ? The supplies and demands were given as integers; all the calculations added and subtracted, but never divided; so an integer optimum schedule was obtained. This happens with transportation problems, though not with general linear programs. Unbalanced demands ? In the above example, suppose now that the third source can supply 7 buses instead of 5; then total supplies =15, total demands =13, no longer balanced. To make the method work, balance must be restored by introducing an additional column (D) for a dummy destination, having zero "costs" (because those buses do not, in fact. go anywhere), and a demand of 2 (the extra supply available). The previous optimum can be used, as shown, to give an initial allocation. Table of "costs" cij , and an initial allocation, for unbalanced A B C D 3 8 2+3´ P 4 3 7 0 2+´ 2´ 2-´ . Q 10 5 9 0 6+´ . 6+2´ . R 6 8 7 0 5+´ 3-2´ . 2+3´ problem 2 . . 2 Connection with linear programming A transportation problem can be written as a linear program: MIN cTx subject to x˜0, Ax=b, where x is a vector of the elements xij. For the above example, bT=[2 6 5 3 8 2], and the matrix A has the "structured" form: 1 . . 1 . . 1 . . . 1 . 1 . . . . 1 . 1 . 1 . . . 1 . . 1 . . 1 . . . 1 . . 1 1 . . . . 1 . 1 . . . 1 . . 1 The dual variables are v⁄,v¤,v‹,u⁄,u¤,u‹. The vector wTA-cT in the duality theory for linear programming has as elements the quantities ui+vj-cij for the transportation problem. Thus, in fact, the u and vj are shadow costs. However, one would not use the ordinary simplex method for a transportation problem, because it would be very wasteful in time and numbers stored. A special case of production allocation Consider the allocation of production for m products and n machines. Such a linear programming model could be: MIN Ûi,j cijxij subject to all xij ˜ 0, Ûj xij = di (i=1,2,...,m), Ûi rijxij ˆ hj (j=1,2,...,n), in which a quantity xij (tons or kg or whatever) of product i is to be made on machine j, and total production cost is to be minimized, subject to satisfying demands di for product i (i=1,2,...,m), and staying within the available time of hj hours on machine j (j=1,2,...,n), where the rate of production for product i on machine j is expressed by rij tons (or kg, etc.) 32 per hour. In general, this problem required the simplex method. However, if rij = åi!j holds, for all i and j, then the problem can be scaled into transportation form. The constraints can be rewritten as: Ûj (åixij) = (åidi) (i=1,2,...,m); Ûi (åixij) ˆ dj/!j (j=1,2,...,n). Thus a transportation problem is obtained, in the new variables åixij. The ˆ constraints are dealt with by introducing an additional "slack row" in the transportation table, with zero costs attached. Note that transportation problems are commonly computed using a faster network method by Ford and Fulkerson (see Section 6.4) 1.16 Cost data (piecewise linear cost function) Every textbook of linear programming includes examples where cost figures like "cost of processing material X is $20 per ton". This assumes that (i) the cost is known, and (ii) is exactly proportional to the quantity (tons) of the material. Life, whether or not meant to be easy, is rarely so simple! Let us look first at (ii). The following idealized diagram gives the picture. (Here only one product is considered, in order to get a plane diagram, whereas there are usually many products to be considered.) In the diagram, A shows the initial cost (you have to have a factory and a machine before you can make anything); AB is a linear part of the cost curve (suitable for applying LP - note that this line does not pass through the origin); BC is a steeper part of the curve (extra production, at overtime rates, or using more expensive raw material); the step CD shows the cost of a new and better machine; DE represents normal production (cheaper with the new machine), and EF overtime production. A linear programming model can only apply to a straight-line part of a cost curve, not to the whole curve. A cost coefficient for the LP model is then the slope of the linear part of the cost curve. Note also that, when the same machine is changed over from making one product to making another, there is always a setup cost incurred, in addition to a cost proportional to the amount made of the new product. Oftern, the setup cost includes a substantial contribution from production time lost, in getting the machine properly adjusted to the new product. Now, what do we mean by cost ? There are practical difficulties in 33 getting told (maybe no one knows, or the man who knows sees the O.R. type as a threat, and won't say). But, beyond these, there is the question of what kind of cost. Accountants classify cost components in several ways; as direct costs (directly related to the goods being made) versus indirect costs (not directly related), or as fixed costs (not varying with level of production) and variable costs (varying with level of production, often taken as proportional to it). Some examples are as follows. Direct costs Indirect costs Wages of production workers Purchase of food for factory canteen Cost of testing output Rates, heating, etc., for the factory Purchase of special tools Wages of cleaners Fixed costs Rental of factory building Manager's salary Variable costs Cost of raw materials Cost of electric power to run production machines Wages of production workers (?) Note that wages of production workers are not always a variable cost over a short time scale (the wages may well be fixed by a union contract, so that they will be paid, even if there is not much work to do); but wages become a variable cost over a longer time scale (over which the number of men employed must move up or down with the general level of production.) Some examples of cost components are shown in the following diagrams. The abscissa is always level of production or output; the ordinates are not always on the same scale. For an optimization model (such as LP) , some kind of variable costs are required. However, we must consider what actually varies, if the changes considered in the model are made. (For example, if we reallocated production between different machines, would this change the wages of the production workers, or would they be paid the same anyway? If it would not change them, then they would not enter the cost coefficients of the LP model.) However, after optimizing the LP model, we would have to also calculate the remaining fixed costs, for the alternative plans considered; they could turn out to dominate. (For example, is it useful to buy very low variable costs - low slope in the cost curves - by incurring enormous capital costs, of installations, machines, etc. ?) The term marginal cost is also used for the slope of a linear part of a cost curve. 34 Cost curves Remember that accountants use cost data for quite different purposes - including what to charge for the product, a means of stopping anyone pinching the cash, and for tax purposes, all essential. Often, the absorption costing method is used. The system is divided into cost centres (e.g. departments, or machines). To each cost centre is assigned the direct costs applicable, and also a proportion of overheads (= indirect manufacturing costs); the proportioning may be according to hours of labor, or e.g. machine time. But these proportions are likely to change if we replan the production, e.g. using a LP model; we don't want to include the overheads in the costs for the LP. Sometimes variable costing is used, in which fixed costs (which do not depend on level of production) are separated out. The following simple example shows the differences. (This does not look like "mathematics" ! But an O.R. person must be able to get needed data from accountants' records.) Data Direct material $18000 Number of units made 10000 Direct labor $12000 Number of units sold 6000 Overheads:variable $15000 Sale price per unit $12 Overheads: fixed $15000 Absorption method Total manufacturing cost $60000. Manufacturing cost per unit $6. Cost of goods sold (6000 x $6) $72000 Inventories at cost (4000 x $6) $24000 Sales revenue (6000 x $12) $72000 Contribution to profit (=72000-36000). $36000 Variable costing method Variable costs $45000. So unit cost is $4.50. Cost of goods sold (6000 x $4.50) $27000 Inventories at cost(4000 x $4.50) $18000 Fixed costs $15000 Contribution to profit (=72000-27000-15000) $30000. 35 1.17 Some exercises on linear programming Formulate each model as a linear programming problem, with a function to be maximized or minimized, subject to some constraints (equations or inequalities).Then convert the problem into standard form by introducing slack variables and artificial variables as required. (Of course, inequalities like xj ˜ 0 are unchanged.) LP1 A firm can make four different products. each requiring different amounts of the inputs, which are labor (measured in man-weeks), energy (KWh), and material (tons). The data are tabulated as follows: Product Unit profit Production level INPUTS Labor (man-weeks) Energy (KWh) Material (tons) I 4 x1 II 5 x2 1 7 3 1 5 5 III 9 x3 1 3 10 IV 11 (in some suitable unit) x4 units per week TOTAL AVAILABILITIES 1 ˆ 15 2 ˆ120 15 ˆ100. The firm wants the maximum profit it can get. Formulate as a LP problem. What happens to the formulation if there are also minimum quantities of certain of the products which have to be supplied? (Remark: This product-mix problem is nearly formulated already. It is included to stress that variables need to be listed, with units of measurement specified (otherwise one will get lost with a real-world problem). LP2 Two products are produces successively on two machines. The manufacturing times in hours per unit of each product are tabulated below for the two machines. Time per unit (hours) Machine Product 1 Product 2 Product 3 Product 4 1 2 3 4 2 2 3 2 1 2 The total cost of producing 1 unit of each product is based directly on the machine times. Assume that the cost per hour for machines 1 and 2 is $10 and $15 respectively. The total hours budgeted for all the products on machines 1 and 2 are 500 and 380. The sales price per unit for products 1,2,3 and 4 are $65, $70, $55, $45. LP3 For model A in Section 1.1, use a computer program (e.g. lpZ7ap) to compute an optimum. (Note that the data are needed in a tidy input form, as in the second table in 1.1, before entering data into the program.) Then tabulate the optimum obtained in the style: 36 machine 1 machine 2 shadow cost product 1 . 2929 100.31 product 2 product 3 product 4 product 5 product 6 shadow cost Some such tabulation is essential, in order that a non-mathematician may make sense of the output ! What then happens if the requirement for product 1 is increased, say by 2% ? Use a computer program to find out; and see if the change relates to shadow costs. (If it doesn't, then why not ?). LP4 Multi-period scheduling A firm makes both thingos and whatsits. They want to plan for a year ahead, to meet the following sales targets for the four quarter quarter 1 2 !!!! 3 4 thingos 4000 1800 4500 3000 whatsits 2000 2500 1500 2400 They keep inventory of each product (thus, they make some in advance of the demand). In quarter t, they make at thingos and bt whatsits; and ht labor hours are available; ht must not vary by more than 10% (up or down) from each quarter to the next. At the end of quarter t, after making the deliveries for that quarter, they have an inventory of pt thingos and qt whatsits. Each thingo requires 2 working hours to make; each whatsit requires 3 working hours to make. The initial conditions (where they start) are given as h‚ = 5000 hours, and given values of p‚ and q‚ (initial inventoroes). If the variables are listed by quarters, thus a⁄, b⁄, p⁄, q⁄, h⁄, then a¤, b¤, p¤, p¤, q¤, h¤, then ..., then the matrix of coefficients has a "block structure" : quarter quarter quarter quarter 1 2 3 4 ’ ’ 0 0 0 ’ ’ 0 0 0 ’ ’ 0 0 0 ’ where ’ is a submatrix of coefficients (not all zero), and 0 is a zero submatrix. Write down those constraints which affect the second quarter; and thus verify the stated block structure. Note here that initial inventory + production - demand = final inventory (for each product and each quarter); and that ht is linked by inequalities to ht-1. (Such "block structures" are typical for linear programming models for multi-period scheduling.) LP5 The following example was given by Trustrum (1971). Solve it both by the simplex method, and by the revised simplex method, and write 37 down the dual problem. Minimize x1 + 6x2 + 2x3 -x4 + x5 -3x6 subject to all xj˜ 0, and x1 + 2x2 + x3 + 5x6 = 3, -3x2 + 2x3 + x4 + x6 = 1, 5x2 + 3x3 + x5 -2x6 = 2. (Remark: Is it necessary in this example to introduce more variables in order to have an initial basis ? This example is cited to show this feature.) LP6 Solve the following transportation problem. (Note that there may, very likely, be more than one optimum. And epsilons may be essential!) An efficiency expert (?) has rated four candidates Ci for four jobs Jj as follows. Find the optimal assignment of candidates to jobs (so as to maximize the sum of the ratings). J1 6 7 6 1 C1 C2 C3 C4 J2 9 1 8 3 J3 5 2 2 9 J4 6 4 5 3 LP7 Three products are processed through three different operations. Time per unit (minutes) Operation capacity Product 1 Product 2 Product 3 Operation (minutes per day) 1 1 2 1 430 2 3 0 2 460 3 1 4 0 420 Net profit/unit($) 3 2 5 Let x1, x2, x3 units of products 1,2,3 be produced each day. The LP model to maximize profit is: MAX 3x1+2x2+5x3 s.t. xj˜0, x1+2x2+x3ˆ430, 3x1+2x3ˆ460, x1+4x2ˆ420. (This assumes profit proportional to amount made - not always true !). The optimal tableau is 100 230 20 1350 -.25 1.5 2 4 1 . . . . 1 . . .5 0 -2 1 -.25 .5 1 2 . . 1 . (i) Suppose the second "requirement" of 460 minutes per day is decreased, by some accident to the machine. How far can we decrease it without upsetting the optimal schedule, and what does that cost us? (ii) Suppose a fourth product is scheduled, through the same operations, with net profit $9 per unit, and times 3,2,4 minutes, through the same operations. How much of the new product should we make? What would the net total profit become? 38 LP8 A firm can make four products. The data for daily production scheduling are: product 1 2 3 4 availability floor area (m™) 10 30 80 40 900 m™ labor (persons) 2 1 1 3 80 persons variable cost ($/unit) 20 30 45 58 sales revenue ($/unit) 30 50 85 90 The optimal tableau (using 10 m™ and $10 as units) to maximize profit is: 10 20 74 | | | 1 . . -1 -4 1 3 0.2 1.6 . 1 . -0.6 0.4 0.68 +0.8 -0.2 0.16 (i) A raw material used in making products 1 and 3 is variable in price. At present it costs $100 per ton (included in the above variable costs). Product 1 uses 0.1 ton, and product 3 uses 0.2 tons. Suppose the cost of this raw material changes to $p per ton. How far can p vary, without changing the optimal schedule ? (Hint: Compare 1.11c. The first profit coefficient is 30 - (0.1–100 + 10) when p = 100; it changes to 30 - (0.1p+10), so gives 2.0 - 0.01p in $10 units.) (ii) The firm can increase its effective floor space to 1000 m™ by installing some new equipment, that would cost $50 per day. Should they ? If so, what would be the new production schedule ? LP9 A furniture maker wants to maximize his weekly profit. His data are as follows: Product number : Available Machine hours Wood (square metres) Profit($) per item made 1 2 3 4 1 4 20 3 2 20 4 6 50 3 8 40 1000 hours 2500 sq. m A linear program (in scaled variables) to maximize profit is MAX 2x1+2x2+5x3+4x4 s.t. all xj˜0, x1+3x2+4x3+3x4ˆ10, 4x1+2x2+6x3+8x4ˆ25. The optimal tableau is x1=4.0 x3=1.5 15.5 | | | 1 . . -1 1 1 . 1 . 1.4 .4 .8 -.6 .4 .8 .4 -.1 .3 (i) What happens to the optimum schedule, and to the optimum profit, as the unit profit for product 3 (at present 5) varies from 0 to Ç ? (ii) A major customer insists that 100 units of product 2 be delivered in as particular week. For that week, what are the optimum schedule and profit? (iii) A shipping delay reduces the wood supply to 2000 sq. m. What is the 39 optimal production schedule and profit under that restriction? However, another source can supply up to 1000 sq. m at $6 per sq. m instead of the normal price of $4 per sq. m). How much (if any) should he buy at that increased price? (iv) He is considering another product, which uses 4 hours of machine time, and only 2 sq. m of wood. It would give a profit of $36 per item. Should he make any? LP10 Solve the integer programming problem: MAX 4x1 + 6x2 + 2x3 subject to 4x1 - 4x2 ˆ 5, -x1 + 6x2 ˆ 5, -x1 + x2 + x3 ˆ5, where x1, x2 , x3 are nonnegative integers . The optimal simplex tableau is 1 . . .3 .2 . . 1 . .05 .2 . . . 1 .25 . 1 . . . 2 2 2 | 2.5 | 1.25 | 6.25 | 30 LP11 In the example of 1.5, the basic variables x⁄ and x¤ remained basic when the second requirement was varied between 5.0-1.5 and 5.0+2.0. Outside this range, some x jruns negative. Use the dual simplex method to calculate the optimum value of this linear program as a function of the second requirement, as it varies from 3.5 down to 0.0. Also, what happens if the second requirement is increased above 7.0 ? 1.18 Computer input/output for a linear program Consider the (trivial) linear program: Minimize -3.4x⁄ -5.6x¤ +6.0x‹ subject to x⁄˜0, x¤˜0. x‹˜0, and 2.0x⁄ + 3.1x¤ ˆ 3.0, -4,5x⁄ + 6.0x¤ + 4.0x‹ ˆ 4.0 . For Craven's LP program (lpZ - see chapter 9), the output file is as follows. Note that the nonzero matrix elements are given sequence numbers 0,1,2,..., to enable changes to data. Only the basic optimal variables xj are listed, since the nonbasic variables are zero. The optimal dual variables, and the objective function value, are listed. The optimal inverse basis matrix is given, with an extra "zero row" for optimal dual variables, and an extra "zero column" for optimal xj variables; thus the inverse basis matrix is: ã.2312 -.1195õ Ã.1734 .0721Õ (to 4 decimal, places). The zj-cj (reduced costs) are not tabulated; however this program shows them on the screen as : 0.0000, 0.0000, -2.1017, -1.7572, -0.0254. Sample output file SeqNo Row Col Entry 0 -1 1 2.000000 1 2 1 -4.500000 2 -1 2 3.100000 3 2 2 6.000000 4 -2 3 4.000000 5 -1 4 1.000000 6 -2 5 1.000000 7 0 0 .000000 40 C( 1 )= -3.4 C( 2 )= -5.6 C( 3 )= 2 C( 4 )= 0 C( 5 )= 0 B( 1 )= 3 -1 B( 2 )= 4 -1 Optimum X 1 = .215799614643 X 2 = .828516377651 Dual 1 = -1.75722543353 Dual 2 = -.0254335260086 Objective = -5.37341040462 W( 0 0 ) -5.3734 W( 1 0 ) .2158 W( 2 0 ) .8285 W( 0 1 ) -1.7572 W( 1 1 ) .2312 W( 2 1 ) .1734 W( 0 2 ) -.0254 W( 1 2 ) -.1195 W( 2 2 ) .0771 With this program, the matrix can also be saved for future use, in the format: 2,5,3,5,7 0 ,-1 , 1 , 2 1 , 2 , 1 ,-4.5 2 ,-1 , 2 , 3.1 3,2,2,6 4 ,-2 , 3 , 4 (The first line records the number of different kinds of data, for setting up arrays.) The following page shows the format for data input. This can be done either by keyboard entry (nonzero matrix elements only), or by spreadsheet input. 41 42 1.19 A note on interior-point methods Consider a linear program, in standard form, with m constraints and n variables; typically, n is considerably larger than m. The simplex method moves from vertex to vertex, thus along the boundary of the feasible region, which is a polyhedron in n-dimensional space. The number of vertices is large, but usually only a few need to be visited. While an example exists where all the vertices are visited, the number of iterations of the simplex method, for typical industrial planning models, typically averages about 2m, though there is much variation about this average. Would it be quicker to take a more direct path through the interior of the feasible region? There are more recent interior-path methods which do this, and they are often found useful for large linear programs, which in any case require heavy computation on big computers. Usually they are implemented as central-path methods. The basic idea is discussed below. However, their efficiency depends on the details of how the computation is arranged. When the dimension n of the space is large, most of the( n-dimensional) volume is close to the boundary. Consider, for example, a hypercube (the ndimensional analog of a cube), defined by: C = {x = (x1, x2, ..., xn) : 0 ˆ xj ˆ 1, j=1,2,...,n}, and another hypercube inside it: Cå = {x = (x1, x2, ..., xn) : å/2 ˆ xj ˆ 1 - å/2, j=1,2,...,n}, where å is small positive. The n-dimensional volume of the part of C not in Cå is 1 - (1-å)n , which approaches 1 as n becomes large. Thus, in large dimension, keeping close to the boundary may in fact be passing through a large part of the volume. Consider now a linear program, in standard form: MIN cTx subject to Ax = b, x ˜ 0, where A is a matrix with m rows and n columns. If the KKT conditions for a minimum are added, this gives: Ax = b, x ˜ 0, ATy + z = c, z ˜ 0, xi zi = 0 (i=1,2,...,n). (PD) (This is called a primal-dual formulation, sin c e y and z are the variables of the dual linear program, and the added constraints are those of the dual program.) The system (PD) is linear except for the nonlinear constraints xi zi = 0., and these divide the computation into separate branches, depending on which subsets of the xi are nonzero. Consider then a modification of (PD): Ax = b, x > 0, ATy + z = c, z > 0, xi zi = µ (i=1,2,...,n), (PDµ) in which µ is a positive parameter. The system (PDµ) can be solved quickly by Newton's method (see Section 7.3), giving a solution (x*(µ),y*(µ)). The central path is the graph of x*(µ) against µ. Of course, x*(µ) is only computes for a chosen set of values of µ = µ0 > µ1 > µ2 > ... tending to 0. Efficient computation requires a balance between the steps in µ (say, how tg choose µj+1/µj) and the precision of computing each x*(µj). Newton's method, to find a zero of a vector function F(w), generates a sequence w0, w1, w2, ... F(wj=1) Ú F(wj) + G(wj) (wj+1 - wj) = 0 to determine the step wj+1 - wj . Here G(wj) is the gradient of F at wj . 43 44 45