scieee AI-readable full text Open interactive document viewer

OPERATIONS RESEARCH IN BUSINESS ADMINISTRATION AND MANAGEMENT

Maroto Álvarez, Mª Concepción,Alcaraz Soria, Javier,Ginestar Peiro, Concepción de María,Segura Maroto, Marina

Abstract

Operations Research, Management Science or Business Analytics is a technology that helps improve business decision making. This book is focused on linear, integer, nonlinear and multiobjective programming, as well as multiple criteria decision making and metaheuristics (genetic algorithms). Excel Solver, LINGO, Expert Choice and D-Sight are the software used to solve decision making problems.

Full text

ISBN 978-84-9048-242-1 0214P04 EDITORIAL UNIVERSITAT POLITÈCNICA DE VALÈNCIA Operations Research in business administration and management Concepción Maroto Álvarez Javier Álcaraz Soria Concepción Ginestar Peiro Marina Segura Maroto The publication of this book has been approved by the Department of Applied Statistics and Operations Research and Quality of the Universitat Politècnica de València (Spain) Academic book collection To cite this publication please use the following reference: MAROTO ÁLVAREZ, C., [et al] (2014) Operations research in business administration and management. Valencia: Universitat Politècnica de València First edition, 2014 Authors: Concepción Maroto Álvarez Javier Álcaraz Soria Concepción Ginestar Peiro Marina Segura Maroto Cover design by Carmen Lloret Of this edition: edUPV / www.lalibreria.upv.es / Ref.: 6176_02_01_01 ISBN: 978-84-9048-242-1 (print version) ISBN: 978-84-9048-241-4 (electronic version) DOI: https://doi.org/10.4995/REA.2022.617602 http://tiny.cc/edUPV_rea Operations research in business administration and management/ edUPV The reuse and redistribution of the contents is allowed as long as the authorship is acknowledged and the complete bibliographic information is cited. No commercial use or generation of derivative works allowed To our students: never lose the hope to do things better. Acknowledgments We acknowledge the support of the Faculty of Business Administration and Management of the Universitat Politècnica de Valencia in preparing this book for Operations Research teaching. We also thank Stephen and Dogan for their infinite patience with the English proofreading. 5     CONTENTS    CHAPTER 1. THE NATURE AND METHODOLOGY OF OPERATIONS RESEARCH ............................................... 11 1.1. THE ORIGIN AND EVOLUTION OF OPERATIONS RESEARCH ........................................................................ 13 1.2. THE NATURE OF OPERATIONS RESEARCH............................... 14  1.3. APPLICATIONS ............................................................................................. 17 1.4. METHODOLOGY OF OPERATIONS RESEARCH ...................... 20 1.4.1. FORMULATION OF THE PROBLEM ................................................... 20 1.4.2. MODELLING.............................................................................................. 22 1.4.3. IMPLEMENTATION ................................................................................. 27 1.4.4. DATA............................................................................................................ 30  1.5. SUMMARY ...................................................................................................... 31 1.6. SELECTED REFERENCES ....................................................................... 31   CHAPTER 2. FORMULATING AND SOLVING LINEAR PROGRAMMING MODELS: BASIC CONCEPTS ............................................................................... 33 2.1. THE PROBLEM: PRODUCTION IN A POWER PLANT AND POLLUTION CONTROL ......................................................... 35 2.2. THE MODEL: VARIABLES, OBJECTIVE FUNCTION AND CONSTRAINTS ............................................................................. 36 2.2.1.VARIABLES: DIVISIBILITY AND NONNEGATIVITY HYPOTHESIS ....................................................... 36 2.2.2.OBJECTIVE FUNCTION AND CONSTRAINTS: LINEARITY HYPOTHESIS .................................................................. 37 2.2.3.GENERAL FORMULATION OF A LINEAR PROGRAMMING MODEL: CERTAINTY HYPOTHESIS ................................................ 42 2.3. FEASIBLE REGION AND GRAPHICAL SOLUTION ................ 43  2.4. SLACK VARIABLES ............................................................................. 45  2.5. SENSITIVITY ANALYSIS.................................................................... 45 2.5.1. SENSITIVITY ANALYSIS OF THE OBJECTIVE FUNCTION COEFFICIENTS............................................................ 45 2.5.2.SENSITIVITY ANALYSIS OF THE RIGHT-HAND SIDE OF THE CONSTRAINTS ......................................................................... 47 6 Operations research in business administration and management         2.6. THE EXTENDED PROBLEM: A NEW VARIABLE ....................... 49 2.7. LINEAR PROGRAMMING MODEL SOLVING WITH SPREADSHEET .......................................................................... 50 2.8. LINEAR PROGRAMMING MODEL SOLVING  WITH OPTIMIZATION SOFTWARE .............................................. 53 2.9. MODELLING: SOME EXAMPLES .................................................. 55 2.9.1. COMMON MISTAKES IN MODELLING .......................................... 55 2.9.2. SOME MODELS OF LINEAR PROGRAMMING ........................... 57 2.10. SUMMARY ............................................................................................. 60 2.11. SELECTED REFERENCES ............................................................... 61 2.12. CASE STUDIES ..................................................................................... 61  CHAPTER 3. GENERAL METHODS OF LINEAR PROGRAMMING .................................................................. 69 3.1. BASIC CONCEPTS: CORNER-POINTS AND BASIC SOLUTIONS............................................................................................. 71 3.2. THE SIMPLEX METHOD.................................................................... 75 3.2.1. GENERAL CONCEPTS ..................................................................... 75 3.2.2. THE SIMPLEX METHOD BY SIMULTANEOUS EQUATIONS ....... 75 3.2.3. CRITERIA OF THE SIMPLEX METHOD: ENTERING A BASIC VARIABLE AND A LEAVING BASIC VARIABLE ........... 78 3.2.4. TABLEAU SIMPLEX......................................................................... 81  3.3. INITIAL BASIC FEASIBLE SOLUTION AND ARTIFICIAL VARIABLES. THE TWO-PHASE METHOD ........................... 85 3.4. SIMPLEX ALGORITHM WITH BOUNDED VARIABLES ......... 89 3.4.1. LOWER BOUND TECHNIQUE ........................................................ 89 3.4.2 UPPER BOUND TECHNIQUE.......................................................... 93  3.5. THE REVISED SIMPLEX METHOD, THE INTERIOR-POINT ALGORITHM AND THE OPTIMIZATION SOFTWARE........ 99 3.6. SUMMARY .............................................................................................102  3.7. SELECTED REFERENCES ...............................................................103  3.8. CASE STUDIES .....................................................................................104 7 Contents     CHAPTER 4. DUALITY AND SENSITIVITY ANALYSIS.................. 111  4.1. THE DUAL PROBLEM AND PRIMAL-DUAL RELATIONSHIPS ................................................................................. 113 4.1.1. THE PRIMAL PROBLEM AND THE DUAL PROBLEM .................. 113 4.1.2. PRIMAL-DUAL RELATIONSHIPS.................................................... 114 4.2. DUAL SIMPLEX ALGORITHM ........................................................ 116 4.3. SENSITIVITY ANALYSIS OF THE COEFFICIENTS OF THE OBJECTIVE FUNCTION ......................................................... 119 4.3.1. MODIFICATION OF A CJ CORRESPONDING TO A NONBASIC VARIABLE .......................................................................................... 120 4.3.2. MODIFICATION OF A CJ CORRESPONDING TO A BASIC VARIABLE ......................................................................................... 121 4.3.3. SIMULTANEOUS MODIFICATIONS OF SEVERAL COEFFICIENTS ................................................................................ 121  4.4. SENSITIVITY ANALYSIS OF THE RIGHT-HAND SIDE OF THE CONSTRAINTS ............................................................................. 123 4.5. PARAMETRIC LINEAR PROGRAMMING ................................... 126  4.6. SUMMARY ............................................................................................... 128  4.7. SELECTED REFERENCES ................................................................. 128  4.8. CASE STUDIES ....................................................................................... 129   CHAPTER 5. INTEGER PROGRAMMING ............................................. 137  5.1. INTRODUCTION .................................................................................... 139  5.2. A SIMPLE PROBLEM TO DISTRUST OF ROUNDINGS .......... 140 5.3. SOME APPLICATIONS OF INTEGER PROGRAMMING........... 142 5.3.1. CAPITAL BUDGETING DECISIONS ............................................... 143 5.3.2. SETUP COST PROBLEM .................................................................. 144 5.3.3. SITE SELECTION OF INDUSTRIES AND SERVICES ..................... 146 5.3.4. A DISTRIBUTION PROBLEM WITH NONLINEAR COSTS ............ 147 5.3.5. A PROBLEM OF TRANSPORT ROUTES ......................................... 152 5.3.6. OTHER FORMULATION POSSIBILITIES WITH BINARY VARIABLES ....................................................................................... 154 8 Operations research in business administration and management       5.4. INTEGER PROGRAMMING TECHNIQUES: BRANCH-AND-BOUND ALGORITHMS ........................................ 156 5.4.1. INTRODUCTION ............................................................................... 156 5.4.2. GRAPHICAL SOLUTION .................................................................. 156 5.4.3. SELECTION CRITERIA OF THE NODE .......................................... 163  5.5. BRANCH-AND-BOUND TECHNIQUES AND OPTIMIZATION SOFTWARE............................................................ 166 5.6. SUMMARY................................................................................................ 168 5.7. SELECTED REFERENCES ................................................................. 168 5.8. CASE STUDIES ....................................................................................... 169  CHAPTER 6. MULTIOBJECTIVE PROGRAMMING AND GOAL PROGRAMMING ................................................ 177  6.1. BASIC CONCEPTS: OBJECTIVES, GOALS AND CRITERIA. 179  6.2. MULTIOBJECTIVE PROGRAMMING ........................................... 180 6.2.1. CONSTRAINTS METHOD ................................................................. 184 6.2.2. WEIGHT METHOD ........................................................................... 185 6.2.3. OTHER MULTIOBJECTIVE TECHNIQUES .................................... 186 6.3. GOAL PROGRAMMING...................................................................... 187 6.3.1. GENERAL STRUCTURE OF A GOAL PROGRAMMING MODEL . 187 6.3.2. WEIGHTED GOAL PROGRAMMING .............................................. 189 6.3.3. PREEMPTIVE GOAL PROGRAMMING........................................... 191 6.4. SUMMARY ............................................................................................... 195 6.5. SELECTED REFERENCES ................................................................. 195 6.6. CASE STUDIES ....................................................................................... 196  CHAPTER 7. DISCRETE MULTIPLE CRITERIA DECISION MAKING TECHNIQUES .................................................... 203 7.1. ANALYTIC HIERARCHY METHOD...............................................  205 7.1.1. INTRODUCTION................................................................................ 205 7.1.2. HIERARCHY BUILDING..................................................................... 206 7.1.3. SETTING PRIORITIES........................................................................ 207 Chapter 1. The nature and methodology of operations research 15 intuitions and opinions. If we consider that technology is in charge of designing systems, physical as well as abstract, Operations Research is a technology that designs abstract systems that consist of useful information for the planning, the control and the other necessary activities to manage an organization. According to Keys, Operations Research is a technology that designs abstract systems, by scientific means, to improve the effectiveness of organizations. The implications for teaching and learning Operations Research take into consideration two components. On the one hand, formal means must be used to teach useful working ways, such as quantitative analysis and application of scientific methods. On the other hand, it is necessary to complement this education with the application of the previous skills to real problems. This textbook considers this approach as the most appropriate in areas where Operations Research is taught, which are, Business Administration and Management studies. Robinson (2000) defines Operations Research as the application of the scientific method to improve the effectiveness of operations, decisions and management. Robinson considers that one of the reasons for the discipline to remain invisible or visible but not well understood, is because it has been practiced under different names. Besides Operations Research, other almost synonymous terms have been used such as Management Science, Decision Technology, Decision Support, Policy Science, Systems Analysis (with relative applications to administration and decisions), Management Technology and Management Analytics. Business Analytics is another recent name that integrates descriptive and prescriptive analytic methodologies. An important feature of Operations Research is maintaining a global perspective on the projects, analyzing the particular problems in the context in which they occur. In both the classical and the most modern definitions of Operations Research the system concept is fundamental. Let us see some examples that will illustrate this. Many companies calculate the unit production cost at a machine shop or a production line, taking into account all of the costs of the resources used. The lower the unit production cost the greater the efficiency. This procedure is valid only for production processes that consist of a single phase and where there is no trouble in selling the product. When the company has complex production processes with several products (e.g. tile companies) and each line produces different parts - often in small batches-, which are used as inputs in subsequent phases of the production process, this acts as an incentive for the machines to be producing all the time. If the next production line in the manufacturing process does not require these intermediate stocks immediately, the company will need to store them temporarily, incurring a cost for these intermediate stocks that are not attributed to the line that generated them. Therefore, the production line seems to be efficient, while the company has to deal with excessive costs caused by these intermediate stocks. Operations research in business administration and management 16 As we have seen in the previous example, the operation efficiency of a particular division of a company can impair the overall performance in terms of objectives and goals. The efficiency measures how well resources in a given activity are used. Thus we can speak of technical efficiency, which does not need to be the same as economic efficiency, which maximizes the difference between revenues and costs. However, a company is interested in achieving its objectives, which we can evaluate via its effectiveness. That the several parts of a system operate efficiently does not necessarily mean that the whole system is effective in achieving its objectives. This is not to say that efficiency is contrary to effectiveness. Real efficiency is measured in terms of the overall objectives of the company. Efficiency and effectiveness are complementary concepts. In short, we can say that effectiveness deals with "doing the right thing" and efficiency with "doing things right" (Daellenbach and McNickle, 2012). Here is another example to illustrate the concept of system in Operations Research. In a company with five departments (raw materials procurement, production, marketing, finance and personnel) marketing proposes an increase in the duration of the guarantee of one of its products to better compete. What forms the system? What forms the environment? The marketing department consists of distribution, sales and customer services. The company assumes that extending the guarantee period will increase sales. However, they also increase guarantee costs due to added customer services. Therefore, the system to be studied could be reduced to sales and customer services (System 1), with all other operations of the company, customers and competitors which form the environment. The aim of System 1 is to find out the guarantee period that maximizes the difference between benefits from sales and guarantee costs. System 1 considers product quality as a part of the environment, but product quality will affect both sales and warranty costs. For this reason, System 1 could be expanded to include production (System 2). The objective of this system is to determine the optimal combination of product quality and the guarantee period to maximize profits. However, product quality is also affected by the quality of the raw materials used, which are part of the system 2 environment. Thus System 2 could be expanded further to include the procurement of raw materials and form System 3. System 3 could also be extended to include other company's products, if sales of these products are affected by changes in the guarantee period of the first product, leading to System 4. In Figure 1.1 we can see how each system is included in a larger one. With this example we want to illustrate the fact that the Operations Research always tries to solve the conflicts of interest within the company, so that the best result for the company in terms of its objectives is achieved. This does not mean that the study should always explicitly consider all aspects, but that the objectives sought after have to be consistent with those of the company. Chapter 1. The nature and methodology of operations research 17 Figure 1.1. Example to ilustrate the system concept. Source: Daellenbach et al. 1987. 1.3. APLICATIONS After World War II the British as well as the American army maintained active Operations Research teams. As a result, nowadays there is a large number of people called “military operations researchers” that apply the Operations Research approach to national defense problems. Operations Research is also widely used in other types of organization and in the business world. In fact, almost all large and many medium sized enterprises worldwide have established Operations Research teams. Among the industries that apply Operations Research are those dealing with aviation and missiles, computer science, electric power generation, electronics, food, metallurgy, mining, paper, petroleum, transportation, as well as financial institutions, government agencies and hospitals. The companies which were finalists of the Franz Edelman INFORMS (Institute for Operations Research and the Management Science) prize provide excellent examples of real applications of Operations Research (http://www.informs.org). Among the finalists in 2012 were Hewlett-Packard (HP), Intel and TNT Express. The latter won the award for its "Global Optimization", which uses advanced methods to optimize the transport network of the company. This program solves problems in warehouse location, optimal routes for trucks, fleet management and personnel scheduling. In 2011 Midwest Independent Transmission System Operator (Midwest ISO), a nonprofit organization that manages the electricity market in 13 U.S. states (North Central region) and one in Canada (Manitoba), won the award. It has operational control of more than 1,500 energy production plants and 55,000 miles of power lines. It notifies the plants, every 5 minutes, of the amount of energy required to meet the current demand. It uses a linear programming model to calculate production levels and establish the market price of electricity. The model size is up to 3 million continuous variables and 4 million System 4 Ot her Products System 3 Purchases System 2 Production System 1 Sales and customer services Operations research in business administration and management 18 constraints. The solution to the model provides plant production levels and energy prices (shadow prices or opportunity costs). It also uses an integer programming model to determine when a plant should be producing or not. The individual companies retain physical control of the plants and transmission lines. Midwest ISO manages the real-time power to bid and buy on demand, manages the market and maximizes the benefit of the company which sells the cheapest electricity. In short, using techniques discussed in this book, in this example the price at which electricity is bought and sold is determined and, what is more important, the electricity is available when and where it is needed and provided safely. In 2009 HP and the Marriot hotel chain were notable entries with two Operations Research tools to manage the product portfolio and with a price optimizer respectively. Also in 2009 Zara was among the finalists for applying Operations Research to improve its distribution process. Cocacola Enterprises, the world's largest bottler and distributor of Coke products (Coke, Fanta, Sprite, Minute Maid, etc) was also recognized in 2007 for its application to schedule the daily routes of 10,000 trucks. We will discuss the application of Zara in a little more detail. Zara´s supply chain consists of two main warehouses located in Spain, which regularly receive shipments of finished garments from suppliers and replenish all Zara stores twice a week. The key is to determine the exact number of each size (up to 8 different sizes) and each item (up to 3,000 at a time) to be included in each shipment to each store (there are over 1,500). Until 2005 Zara used a procedure that required a large number of employees to determine shipments to each store. The company developed a decision making process based on Operations Research methods, including methods of forecasting and a very large mixed integer programming model. The implementation of this new process presented many technical difficulties. One of them was to include the uncertainty of estimates and inventory policies of the stores, and the integration of a complex mathematical model with many large databases. They also had to have the software and hardware infrastructure necessary to solve optimization of thousands of problems in a couple of hours each day. Additionally, it presented challenges related to human resources, because the Zara corporate culture highly values intuition and personal judgment in decisionmaking. The development of this new process, supported by Operations Research techniques, was completed in all stores and articles and it has been used since 2007. In general, linear programming and integer programming have been successfully used in solving problems related to the allocation of the means of production, material mixing, distribution, transportation, investment selection and planning of agriculture, among others. A very important application of linear programming in the field of economics is Data Envelopment Analysis (DEA), developed by Charnes, Cooper and Rhodes (1978). DEA is a linear programming based technique that allows us to empirically measure the productive efficiency of decision units such as groups of companies in the same sector, financial institutions, hospitals, educational institutions, etc. and identify the companies that are on the efficient frontier of production. The efficiency is measured by the weighted sum of the outputs on the inputs. The weighting structure is calculated using linear programming. Furthermore, the concepts of linear Chapter 1. The nature and methodology of operations research 19 programming guide and facilitate the analysis and interpretation of the results of the DEA models. At present this is still a very active field of work, both in the application and in the research being conducted. Nonlinear programming is also used in certain problems of resource allocation, selection of efficient portfolios, new product design, production problems, mixtures in chemical processes, etc. Multiobjective programming and goal programming also have many applications such as natural resource management (Weintraub et al., 2007), scheduling of advertising media, land use management, location of utilities and planning of resources in hospitals to name just a few. Other Operations Research techniques such as inventory theory, game theory and simulation have been used in a variety of contexts. Operations Research shares with Artificial Intelligence the objective of providing methods and procedures for solving problems and making decisions. Artificial Intelligence is inferential and has expert knowledge and heuristic methods. Operations Research is mainly based on mathematical algorithms. A careful integration of these two approaches has a bright future ahead for the performance and acceptance of the systems. Decision Support Systems for decision making integrate Operations Research and Artificial Intelligence techniques in information systems that are very useful in the decision making process. This integration can make Operations Research techniques more accessible to decision makers and the models can also use Artificial Intelligence techniques. We should also highlight heuristic search techniques such as genetic algorithms, tabu search and simulated annealing. Operations Research models are common in finance, often grouped under the name of financial engineering. Similarly marketing engineering usually means Operations Research applied to marketing. In this field it is applied to strategic decisions (planning, portfolio, etc.) and at the tactical level (product design, advertising, etc.). They also play an important role in the analysis of electronic markets. Other opportunities will come from electronic trade and investment, from online banking to online insurance. With regard to supply chain management, the digital economy provides opportunities to use Operations Research in resource planning in companies. Given the information that is available online, advanced planning and production scheduling, will improve coordination and cooperation between suppliers and customers. The growth of mobile computing and communication will increase the aid that applications give to decisionmaking in transport trucks. Thus there are companies that optimize loading and truck routes using web applications to obtain data and distribute solutions. The Internet also facilitates the expansion of supply management towards integrating product design, sales and customers. Finally, we must emphasize the strengths of Operations Research in the digital economy era: it exploits the vast amount of data available, which is of ever increasing complexity due to its analytical nature and uncertainty, modeling increases our understanding of business processes and virtual experiments can be made without risk to business and thus provides decision making technology for the automation of Operations research in business administration and management 20 recurring decisions in real time, such as for web applications. In short, the Operations Research of the future is Operations Research in real time. Customers often ask when their order will be delivered. Providers base their response on their inventory and the scheduled production in progress. However, they should now be able to respond after performing a scheduling algorithm including the potential order. To achieve the required performance in real time sometimes we need to resort to heuristic algorithms such as those discussed in the last chapter of the book. 1.4. METHODOLOGY OF OPERATIONS RESEARCH Daellenbach and McNickle (2012) clearly establish three major phases in the methodology of Operational Research which are: problem formulation, modelling and implementation, which in turn break down into the sub-phases indicated in Figure 1.2. Figure 1.2. Methodology of Operation Research. Source: Daellenbach and McNickle (2012) 1.4.1. FORMULATION OF THE PROBLEM In the first place, we should make a synthesis of the situation, for example through graphics or charts which will help us during the problem definition phase, after which we should identify the structure, the transformation processes, the components and the Formulation of the problem Modelling Implementation Sinthesize the problem situation Follow up the solution use Identify the problem Build a mathematical model Describe the relevant system Find the preferred solution Validation of the solution Plan the implementation Sensitivity analysis Control the solution Implement the solution Project proposal Project report Revising the solution Chapter 1. The nature and methodology of operations research 21 inputs and outputs of the relevant system. For a problem to exist there must be an individual or group of individuals, called decision-makers, who are not satisfied with the current situation or who have unsatisfied necessities, such as reaching some goals or objectives. They also know when the goals or objectives have been satisfactorily reached and they have control over the aspects of the situation that affect the extent to which the goals or objectives are achieved. The four elements of a problem are: x The decision-maker/s. x The decision-maker´s objectives. x The measurement of efficiency in order to be able to assess the extent to which objectives are achieved. x The action alternatives or decision variables to reach the objectives. The second step of the formulation of the problem is its identification and consists of defining these four elements. The third step consists of defining the relevant system for the problem that we have identified in the previous step, including its environment. The decision-maker has an esential role in the problem formulation phase. In practice, the determination of these four components might not be so easy to obtain by simply asking the decision-maker. Sometimes the decision-maker only has a vague intuition that things could go better. We should explore and clarify the situation through several people involved in the situation. Sometimes, it may happen that the person who makes the decisions does not have access to the information needed to make an effective decision and the one that has the information does not have enough authority to make decisions. In these cases, the first thing to do is to change the structure of the organization, re-assigning the roles in the decision making. In most real applications, problem formulation is not achieved in these three steps, rather the initial formulation is detailed with successive reformulations, as the problem is better understood. In fact, it continues until the project concludes. However, it is in this phase where the success or failure of many projects occur. Once we know the problem and the relevant system well enough, we can decide whether Operations Research may provide a solution to the problem. Therefore we should ask ourselves the following questions: Can the problem be expressed in quantitative terms? Are the required data available or can they be obtained at a reasonable cost?  Does the cost of the analysis justify the possible benefits that will be obtained from WKHimplementation of the results? To what extent can the decision-maker expectations EHfulfilled? If we answer these questions affirmatively, then the formulation phase concludes with a proposal that will be the document which the decision-maker will use to decide to continue with the project or not. Therefore, the proposal is a key element. We should not promise more than we know that we can obtain with the available resources. Since Operations Research has much in common with the scientific research, it should be guided by the ethics of the scientific method. Operations research in business administration and management 22 The following anecdote from Ackoff illustrates both the difficulty of formulating the problem in real cases, and the fact that we can not always solve an unsatisfactory situation by making models. It is as important to know what models are useful and when we can improve decision making, as it is to know how to recognize when they are not the right tool. The administration of a large office building received complaints for years about excessive staff time spent waiting for the elevators in the main lobby. Several teams of Operations Research analyzed this problem of excessive waiting time. Different solutions were proposed: to use some elevators for lower floors and others for higher floors only. However, it was concluded that a significant reduction would be possible only by installing new elevators with a high associated cost. A member of the last team to study the problem asked why staff complained and after appropiate inquiries it turned out to be because of boredom. The Operations Research team then proposed installing mirrors. Some workers used them to make a final check of themselves or to check out other staff without being too obvious. When this solution was implemented the complaints disappeared (Ackoff, 1987). Nowadays, screens with information of interest to the staff can achieve the same effect as the mirrors did then. Operations Research, in many cases, does not intend to find the optimal solution, but to find some degree of improvement over the previous situation. One of the founding fathers of the discipline colloquially explained it as follows: "Operations Research is the art of providing bad solutions to problems that otherwise would have worse solutions." 1.4.2. MODELLING This phase distinguishes Operations Research from other methods of solving problems. According to Daellenbach and McNickle (2012), Operations Research is often seen as a number of techniques and mathematical tools, which do not favour the discipline at all to the detriment of its potential. The modelling phase begins by expressing the system related to the problem in quantitative terms. A mathematical model expresses in quantitative terms the relationships between especially important components of the system that have been defined in the formulation phase. These relationships can sometimes be represented in a spreadsheet and for some others it is necessary to formulate the relationships in terms of mathematical expressions, such as equations, inequalities or functions. The term model is used in a broad sense, since it can take the form of a chart as well as of mathematical expressions. We call the action alternatives or controllable aspects of the problem decision variables. The term action alternatives is used when the number is discrete and usually small. The measurement of the behaviour or effectiveness is the aspect that measures the extent to which the objectives of the company are reached. If this measure of effectiveness can be expressed as a function of the variables, we call it the objective function. Our goal is to find the values of the decision variables that maximize or minimize the objective function. The parameters or coefficients represent the uncontrollable aspects of the problem. And the constraints are the mathematical expressions that limit the range of values of the decision variables. From the early 50’s, a number of mathematical models have been developed with their own resolution procedure, such as linear programming Chapter 1. The nature and methodology of operations research 23 and its numerous extensions, network models such as the critical path, etc. They are what we call general purpose models. Any problem that satisfies the hypotheses of a general model can be approached and solved in this way. For those problems that do not adapt to any specific technique of Operations Research, a model should be developed for the specific purposes, with a unique structure for that particular problem. Likewise, a solution procedure has to be created for that specific case. Lastly, when all of the inputs and relationships are known, the problem is deterministic, while if some inputs or results are subjected to uncertainty, like the probabilistic influences, the model is known as probabilistic or stochastic. A mathematical model, to be useful, should enable better decisions when you use it than when you don't and should also be: x Simple: Simple models are easier for the decision-maker to understand. It will be easier if the decision-maker follows the logic of a spreadsheet than a set of equations. However, when designing complex models it is unavoidable that approximations appropriate to the real situation be made. x Complete: The model should include all of the significant aspects of the problem that affect the measurement of its effectiveness. It may be necessary to design two models, one with certain aspects to compare and to decide their relevance and another one without them. x Easy: It should be possible to obtain responses from the model, such as the optimum solution, with a reasonable computational effort. Moreover, it should be easy to prepare, update and change the parameters and obtain new answers quickly. x Adaptive: Usually, reasonable changes in the structure of the problem do not invalidate the model. If the changes invalidate the model, it may be possible to adapt the model with slight modifications. An adaptive model is known as a robust model. In practice, we may find these properties useful in a model, however, users may only appreciate some of them. Thus, the decision-maker and the user of the model might be more interested in the desirable properties of the modelling process than in those of the model itself. The credibility and trust of the user are related more to the process and the interaction with the modeller than with the model itself. In this sense, it is important to keep in mind the following aspects: The model should be appropriate for the situation under study: The model produces outstanding results with the smallest possible cost and in the time required by the decision-maker. A “good” Operations Research model does not necessarily have to show the details or to resemble the physical system that it attempts to optimize. In addition, a good model should allow us to measure the progress reached toward the decision-maker’s objectives. The model has to produce information that is relevant and appropriate to the decision-making process. If the model complies with these last two properties and we can demonstrate them to both the decision-maker and the user, then it is more likely that Operations research in business administration and management 24 they will find the model useful. Lastly, some of the properties of good models are in conflict. A simple model cannot take into consideration all of the relevant aspects. A robust model cannot be simple. A model that includes all of the significant aspects may not be easy to manipulate. The person (or team) that builds the model should balance these aspects and adopt a commitment, which should take into consideration the funding and the time available for the analysis. It should also take into consideration the possible benefits. Thus, the use of simple and quick strategies that provide 50% of the benefits can be economically more advantageous than using a sophisticated and expensive model that achieves 90% of the potential benefits. The cost of development of the mathematical model, data collection, calculation of the best solution, model implementation and maintenance, increases more than proportionally with the sophistication of the model, while the benefits increase less than proportionally. Although the process of mathematical modelling can be considered as a scientific process, there are certain aspects that are closer to an art than to a science. It is considered an art because it is necessary to develop simple models that are good approaches to real life. There is little advice that can be given in this respect, except that the ability and necessary skills can be acquired with practice. Experts recommend starting with simple models that become richer evolving towards elaborated models by the incorporation of additional aspects of the problem. Another tip is to work with numeric examples, as well as graphics and charts. The construction of models in the practice of business administration and management is valuable at least for the following reasons (Eppen et al, 1997): 1. The models require that the objectives be explicity defined. 2. The models require the identification and recording of the types of decisions that influence these objectives. 3. The models require the identification and recording of the interactions between all these decisions and of their respective advantages and disadvantages. 4. The models require thinking about the variables to include and to define them in quantitative terms. 5. The models require us to consider what data are relevant for the quantification of these variables and to determine the interactions between them. 6. The models require the recognition of the relevant restrictions on the values that variables can take. 7. The models can communicate ideas and expertise, facilitating teamwork. After the construction of the model, we manipulate the quantitative model to explore the system’s behaviour in response to the changes in the inputs, that is, we explore the solution space. The objective is to find the preferred solution in terms of the decisionmaker’s objectives. If the latter is interested in a main objective the optimal solution has Chapter 1. The nature and methodology of operations research 31 In summary, the identification of the data sources, data collection and evaluation are activities that may happen parallel to any of the eleven steps of the methodology described, even in the last step of the revision of the solution. In some cases data may not be available in the required form or may even not exist. In these cases, actions should be aimed at the collection of data in the required form. Lastly, we would also like to emphasize the importance of the analyst’s skills regarding personal relationships and their ability to obtain information from interviews. Open interviews are recommended to perform, showing curiosity and interest in what others know, rather than giving the image of an expert who knows everything. 1.5. SUMMARY This chapter approaches the basic nature and methodology of Operations Research in order to understand and assess the role of Operations Research in the education and training of Graduates in Business Administration and Management. Operations Research is a technology whose purpose is the production of information about systems to improve the efficiency of companies and other organizations. The construction and the solving techniques of mathematical models are only a part of a real Operations Research project. The Problem formulation and solution implementation phases are also key, so we should not lose sight of the role played by the model and the solution within the methodology of Operational Research. The aim of the remaining chapters is to facilitate learning of the formulation and solving linear programming models, integer, nonlinear and multiple criteria using Microsoft Excel Solver and LINGO and other professional software (Expert Choice and D-Sight). We will focus on the key concepts and the necessary techniques for the correct interpretation of the results of the models, in order to improve decision-making and ultimately the effectiveness of companies. We recommend that the student read this introductory chapter again at the end of the course, when they will better understand some of the issues discussed. 1.6. SELECTED REFERENCES 1. Ackoff, R.L. (1987): The Art of Problem Solving: accompanied by Ackoff's Fables. John Wiley & Sons. 2. Assad, A.A., Wasil, E.A. and G.L. Lilien (1992): Excellence in Management Science Practice. A readings book. Prentice-Hall International. 3. Daellenbach, H.G.; George, J.A. and D.C. McNickle, (1987): Introducción a las técnicas de Investigación de Operaciones. CECSA. Operations research in business administration and management 32 4. Daellenbach, H., McNickle, D. and S. Dye (2012): Management Science. Decisionmaking through systems thinking. 2nd Revised Edition. Palgrave Macmillan. 5. Eppen, G.D.; Gould, F.J.; Schmidt, C.P.; Moore, J.H. and L.R. Weatherford (1997): Introductory Management Science: Decision Modeling with Spreadsheets. 5th edition. Pearson. 6. Hillier, F.S and Hillier, M.S. (2011): Introduction to Management Science. A Modelling and Case Studies. Approach with Spreadsheets. Fourth Edition. McGraw- Hill. 7. Hillier, F.S. and Lieberman G.J. (2010): Introduction to Operations Research. Ninth Edition. McGraw-Hill. 8. Keys, P. (Ed) (1995): Understanding the process of Operational Research. Wiley. 9. Kirby, M.W. (2000): “Operations Research Trajectories: The Anglo-American Experience from the 1940’s to the 1990’s”, Operations Research 48, 661-670. 10. Robinson, R. (2000): “A Business Executive´s Guide to Modern OR”, OR/MS Today 27/3, 22-27. 11. Weintraub, A.; Romero, C.; Bjorndal, T. and R. Epstein (2007) (Editors): Handbook of Operations Research in Natural Resources. Springer. 12.Winston, W. L. and S.C. Albright (2012): Practical Management Science. Fourth Edition. South-Western. USA. CHAPTER 2 FORMULATING AND SOL VING LINEAR PROGRAMMING MODELS: BASIC CONCEPTS 2.1. THE PROBLEM: PRODUCTION IN A POWER PLANT AND POLLUTION CONTROL ............................................................................. 35 2.2. THE MODEL: VARIABLES, THE OBJECTIVE FUNCTION AND CONSTRAINTS ............................................................................................... 36 2.2.1. VARIABLES: DIVISIBILITY AND NONNEGATIVITY HYPOTHESIS ..... 36 2.2.2. OBJECTIVE FUNCTION AND CONSTRAINTS: LINEARITY HYPOTHESIS ............................................................................................. 37 2.2.3. GENERAL FORMULATION OF A LINEAR PROGRAMMING MODEL: CERTAINTY HYPOTHESIS ....................................................... 42 2.3. FEASIBLE REGION AND GRAPHICAL SOLUTION ....................... 43 2.4. SLACK VARIABLES .................................................................................... 45 2.5. SENSITIVITY ANALYSIS ........................................................................... 45 2.5.1. SENSITIVITY ANALYSIS OF THE OBJECTIVE FUNCTION COEFFICIENTS........................................................................................ 45 2.5.2. SENSITIVITY ANALYSIS OF THE RIGHT-HAND SIDE OF THE CONSTRAINTS 2.6. THE EXTENDED PROBLEM: A NEW VARIABLE ........................... 49 2.7. LINEAR PROGRAMMING MODEL SOLVING WITH A SPREADSHEET ………………………………………………………. 50 2.8. LINEAR PROGRAMMING MODEL SOLVING WITH OPTIMIZATION SOFTWAR 53 2.9. MODELLING: SOME EXAMPLES …………………..........……………… .. 55 2.9.1. COMMON MISTAKES IN MODELLING…………………...……….……….. 55 2.9.2. SOME MODELS OF LINEAR PROGRAMMING………………………...… 57 2.10. SUMMARY .................................................................................................... 60 E …………………..……………… Operations research in business administration and management 34 2.11. SELECTED REFERENCES ...................................................................... 61 2.12. CASE STUDIES ............................................................................................ 61 Chapter 2. Formulating and solving linear programming models: basic concepts 35 Linear Programming is the most important technique used in Operations Research and is considered to be as one of the most significant scientific advances of the 20th century. It is a standard tool for solving optimization problems that has had an extraordinary impact since 1950 and currently saves millions of dollars for many companies and businesses. Some of the most common applications include problems such as allocating production resources, material blending, distribution, transportation, food planning and radiation therapy design. In linear programming real problems are represented by mathematical models subject to a number of conditions, such as the linear nature of the functions. Similar to what happens with other Operations Research techniques, model construction is an essential stage and it is mainly the fruit of experience and the correct application of some basic principles. We begin this chapter by formulating a problem and then a linear programming model in order to solve it step by step. In this way all the assumptions of linear programming models will be explained. We will also see that the meaning of programming in this context is rather different from the term "programming", as used in computer science to refer to software implementation. Further, we will solve graphically one problem to help the intuitive understanding of the main basic concepts, such as feasible solution, feasible region and optimal solution. The concept of slack variables and the effects of changing the parameters of the model through sensitivity analysis are also presented. Next, we will solve the problem as we would in practice, using spreadsheets or optimization software and we will interpret the results. The chapter includes other problems that will facilitate learning the modelling and subsequent resolution and interpretation of the solution to improve decision-making in business. Finally, selected references on this topic are given as a guide to provide students with extra reading material. The chapter includes case studies; some of which will be used in laboratory sessions and solved by the students with the help of the teacher, and other case studies will serve as self-assessment exercises. 2.1.THEPROBLEM:PRODUCTIONINAPOWERPLANTAND POLLUTION CONTROL The management of a coal-fueled thermal power plant is analyzing the operational configuration of the plant to adapt to new environmental pollution control regulations. The maximum emission rates of the thermal power plant are x Maximum emission of sulphur oxide: 3000 parts per million (PPM) x Maximum emission of particles (smoke): 12 kilograms/hour (kg/h) The coal is transported to the plant by train and is unloaded into containers close to the plant. A conveyor belt takes it to the pulverizer, in which it is handled and fed directly to the combustion chamber at the correct speed. The heat generated in the combustion Operations research in business administration and management 36 chamber is used to produce steam, which, in turn, serves to drive the turbines. Two types of coal are used: type A, a hard, clean-burning coal with low sulphur content (rather expensive); and type B, a cheap, relatively mild coal with high sulphur content that causes smoke, as shown in Table 2.1. The thermal value in terms of the steam generated is greater for coal type A than for type B, which are 24000 and 20000 lb per ton respectively. Table 2.1. Emission of polluting agents Coal Sulphur oxide in fuel gases Particles (kg emission/ton) A 1800 PPM 0.5 Kg/ton B 3800 PPM 1.0 Kg/ton As coal type A is hard, the pulverizer can only handle 16 tons of coal A per hour; however, it can handle up to 24 tons of coal B per hour. The loading system of the conveyor belt has a capacity of 20 tons per hour independent of the type of coal. One of the many questions the plant's management has given is the emission limits of the polluting agents and the types of coal available, what is the maximum possible amount of electricity that can be generate in the power plant? The answer will allow managers to determine the safety range in order to cover peak power demands. 2.2.THEMODEL:VARIABLES,OBJECTIVEFUNCTIONAND CONSTRAINTS 2.2.1. VARIABLES: DIVISIBILITY AND NONNEGATIVITY HYPOTHESIS In the short term, the installations of the power plant are fixed. The only aspect of the problem that can be changed and used to modify the production of the power plant is the amount of each type of coal to burn. Therefore, the decision variables of the problem are x Amount of coal A used per hour, referred to as X1 (ton/h) x Amount of coal B used per hour, referred to as X2 (ton/h) Linear programming often refers to the controllable aspects of decision-making problems as activities. Therefore, X1 and X2 represent the burning activity levels of coal A and coal B, respectively. LINEAR PROGRAMMING HYPOTHESIS 1: DIVISIBILITY All variables can take any real value Chapter 2. Formulating and solving linear programming models: basic concepts 37 Many activities of the real world vary in a continuous way, i.e., they are divisible infinitely. For example, the amount of coal burnt per hour can be adjusted within certain limits. However, there are real activities that can only take integer values, for example, the number of truck trips necessary to move a certain load from one place to another or the number of computers required by a company. When the real activity is not divisible in a finite way, but the normal level of the activity is a high number, then divisibility conditions can be used as a convenient approach. This means that the value of the solution is ten or higher. Fractional values are rounded up to the closest integer value. However, if the normal level of the activity is less than 10, integer programming will be necessary. LINEAR PROGRAMMING HYPOTHESIS 2: NONNEGATIVITY CONDITIONS All variables are nonnegative This hypothesis reflects the nature of most real activities, since negative activity levels hardly ever occur in economic or engineering contexts. However, this consideration does not involve a loss of generalization. Any number (positive, zero or negative) can be expressed as the algebraic difference between two nonnegative numbers. If an activity can occur in both positive and negative levels (for example, buying or selling bonds), two variables are introduced for this activity, X+ for nonnegative levels, and X- for nonpositive levels. Their difference X = X+- X- represents the real level of the activity. With this method, both X+ and X- are subject to be nonnegative. Optimization software allows users to define directly these variables as free variables with a variation range between negative and positive infinity. 2.2.2. OBJECTIVE FUNCTION AND CONSTRAINTS: LINEARITY HYPOTHESIS The objective of the plant's management is to maximize power generation in the plant. Since electric power is generated from steam there is a direct relationship between steam and electric power generation, maximizing steam generation is equivalent to maximizing electric power generation. Therefore, the management objective can be restated as "finding the combination of fuels that maximizes steam generation ". How much steam is produced for any given amount of coal used? A simple and systematic way of determining this is shown in Table 2.2. Let us express the amount of steam generated in thousands of pounds. Therefore, coal A produces 24 steam units and coal B 20 steam units per ton of coal. Thus, the amount of steam generated per hour is (1) 24 X 1 + 20 X 2 = Z Operations research in business administration and management 38 Table 2.2. Building the objective function Coal Stream (lb/ton) Coal used (ton/hour) Stream generated (lb/hour) A 24000 X 24000 X1 B 20000 X2 20000 X2 Total amount of stream lb/h = 24000 X1 + 20000 X2 The first term in (1) is called the objective function and Z is the value of the objective function. The variable coefficients are called objective function coefficients. The problem requires determining values of X1 and X2 that maximize Z value. Figure 2.1. shows that (1) is a family of parallel straight lines and that for each value of Z we obtain a straight line, whose points represent the possible combinations of X1 and X2 that generate the same amount of steam and thus, of energy. For this reason, they are known as isoproduction lines (isoprofit or isocost, in the case that the objective function corresponds to profit or cost respectively). It can also be noted that the objective function is linear. LINEAR PROGRAMMING HYPOTHESIS 3: LINEARITY All relationships between variables are linear. In linear programming this implies: 1. Proportionality of the contributions. The individual contribution of each variable is strictly proportional to its value, and the proportionality factor is constant for the range of values that the variable may take. 2. Additivity of the contributions. The total contribution of the variables is equal to the sum of the individual contribution, regardless of the value of the variables. A relationship such as Z = 5 X1 + 3 X12 + 2 X2 or Z = 24 X1 + 20 X2 for X1  5 and 10 + 22 X1 + 20 X2 for X1 > 5 would violate the condition of proportionality; whereas Z = 24 X1 for X2 = 0, 20 X2 for X1 = 0 and 22 X1 + 18 X2 for X1 > 0 and X2 > 0 would violate the condition of additivity. Chapter 2. Formulating and solving linear programming models: basic concepts 39 5 1015202530 5 10 15 20 25 30 0 Z = 240 Z = 360 Z = 480 Z=600 X 2 X 1 Figure 2.1. Objective function Hypothesis 3 implies constant scale profits and prevents scale economies. In practice, this condition probably does not strictly hold; in particular, for very low or very high activity values. However, if this condition is fulfilled in an approximate way within the normal range of solution values, a linear programming model would be a good approach. This consideration also excludes the problem of fixed costs when they are presented for positive values of the variable, but not for zero values. In addition to the nonnegativity conditions, the values of the variables should fulfill certain constraints that may be of a physical, economic or legal nature. Constraint of particle emissions The maximum amount of smoke emissions per hour in power plants is limited to 12 kg. According to Table 2.1, one ton of coal A produces 0.5 kg smoke and one ton of coal B produces 1 kg smoke. If the plant burns X1 tons of coal A and X2 of B, the total amount of smoke emitted by both types of coal is equal to the sum of both, which cannot exceed 12 kg/h. Operations research in business administration and management 40 The coefficients of the variables in the constraints are called technical coefficients and the second term of the inequality or independent term is known as right-hand side (RHS) constraint parameter. Constraint of loading installations The system of the conveyor belt that transports the coal from the containers to the pulverizer has a capacity of 20 ton/h. Therefore, the load constraint will be: Constraint of the pulverizer capacity The maximum capacity of the pulverizer is 16 ton/h for coal A or 24 ton/h for coal B. That is, it takes 1/16 h to handle one ton of coal A and 1/24 h to pulverize one ton of coal B. If the solution demands the combination of both types of coal, the time required to pulverize a mixture of X1 ton of A and X2 of B is (1/16)X1 + (1/24) X2. This constraint is expressed as a combination of X1 and X2 for 1 hour. Therefore, the constraint of the pulverizer is: 1 24 1 16 1 21 d XX or Note how the difficulty arising from the different maximum rates has been solved. The rates have been converted to required time per ton and the constraint is expressed terms of time rather than capacity. Constraint of sulphur oxide emissions Maximum sulphur oxide emissions should not exceed 3000 PPM at any time. Since both types of coal are burnt simultaneously, the combination of X1 ton of coal A, and X2 tons of coal B per hour that feeds the combustion chamber is considered as an homogeneous mixture. X1/(X1 + X2) of the mixture is coal A with a sulphur oxide emission rate of 1800 PPM and X2/(X1 + X2) of the mixture is coal B, with a sulphur oxide emission rate of 3800 PPM. The emission rate of the mixture will be the weighted mean value of the individual (2) 0.5 X1 + X2 d 12 (3) X1 + X2 d 20 (4) 1.5 X 1 + X 2 d 24 Chapter 2. Formulating and solving linear programming models: basic concepts 47 Objective Function: C1 X1 + 20 X2 Pulverizer: 1.5 X1 + X2 = 24 20 1 20 5.1 1 C This gives C1 = 30. For an increase in C1 higher than 30, the optimal solution will change from A to B. For C1 = 30 the objective function 30 X1 + 20 X2 takes its maximum value of 480 at every point of line AB. Similarly, if C1 decreases to 10 (all other coefficients remaining constant) the objective function will be parallel to the smoke constraint. If C1 were lower than 10, the optimal solution would change from point A to point C (see Figure 2.4). In conclusion, we can say that if the coefficient C1 is such, that the slope of the line that represents it is between the slope of the constraints of the pulverizer and smoke, the initial optimal solution (point A) is optimum. And we have deduced that if the rest are constant, the solution X1 = 12 and X2 = 6 will be the optimal solution for any value of the X1 coefficient of the objective function for the interval 10 d C1 d 30. Can you determine the interval corresponding to C2 without changes in the initial optimal solution, i.e. point A in Figure 2.4? 2.5.2. SENSITIVITY ANALYSIS OF THE RIGHT-HAND SIDE OF THE CONSTRAINTS Let us see what happens to the optimal solution when the right-hand side of a constraint changes. Suppose that the management is considering the installation of a system that reduces the amount of smoke emissions by 25%. This will allow the plant to fulfill the legal regulations while emitting up to 15 Kg/h of uncontrolled smoke from the combustion chamber. What would be the effect in terms of increasing steam generation? Let us first consider that the maximum allowed smoke emissions increase from 12 to 13 kg/h, all the other coefficients remaining constant. This causes a move upwards in the smoke constraint. Figure 2.5 shows how the feasible region increases. In the new feasible region Z = 408 is not the optimal value of the objective function, as its best value lies at point D. Therefore, the optimal solution changes from A to D. This change occurs due to the fact that the smoke constraint is strictly fulfilled in the optimal solution of the original problem. Now, the new activity levels of the variables are X1 = 11 and X2 = 7.5. The decrease in X1 causes a reduction of 24 steam units, whereas the increase in X2 increases steam production by 30 units. The net increase is 6. Thus the new maximum value of the objective function will be Z = 408 + 6 = 414. The improvement of the optimal value of the objective function due to the unit increase in the RHS of a constraint is called opportunity cost or dual price of the constraint. In this case the opportunity cost of the smoke constraint is 6. Operations research in business administration and management 48 Figure 2.5. Sensitivity analysis of the right-hand side of smoke constraint What would happen if the maximum smoke emissions were 14, 15, 16 and 17 kg/h? Figure 2.5 shows how the area of the feasible region increases with each change to a maximum of 16. Check that for each change the objective function increases by 6. For an increase higher than 16, the smoke constraint becomes redundant. Now the optimal solution will be restricted by the pulverizer, sulphur and load constraints. Thus, the opportunity cost of this constraint is zero for values higher than 16. The original question required the determination of the increase in the production of steam due to the change in the allowable smoke levels from 12 to 15 kg/h. This will be 3 x 6 = 18 steam units/h. What is the opportunity cost of a constraint which is not strictly met in the optimal solution? It becomes clear that if one part of the resource is not used, i.e. the slack variable is positive, the additional amounts of that resource have no value. They would only increase the amount of slack. Therefore, the dual price of that constraint is zero. Determine the dual prices of the other constraints. Observe the relationship between the 5 1015202530 5 10 15 20 25 30 0 LOAD PULVERIZER SULPHUR 4035 SMOKE D A X 1 X 2 Optimal solution: X1 = 11 X2 = 7.5 Z = 414 Chapter 2. Formulating and solving linear programming models: basic concepts 49 opportunity cost of a constraint and the slack variable associated with it. When one resource is completely used its opportunity cost is generally positive (nonnegative to be more exact) and its slack variable is zero, whereas when the slack variable is positive the dual price is zero. Dual prices provide management with valuable information about the profits that can be obtained by smoothing the constraints. If the benefits exceed the cost generated by smoothing a given constraint, then the changes are attractive. 2.6. THE EXTENDED PROBLEM: A NEW VARIABLE The power plant is offered a third type of fuel, coal type C, that has a sulphur oxide emission rate of 2000 PPM, a smoke emission rate of 0.8 kg/ton of burnt fuel, and requires 1/20 h per ton of the pulverizer and loading capacity. Its thermal value is equivalent to 21000 lb of steam per fuel ton. Is it profitable to use this fuel in the plant? Let us reformulate the problem with this third type of coal. Let X3 be the number of coal C tons per hour. Thus Max 24 X1+ 20 X2 + 21 X3 Subject to 0.5 X1 + X2 + 0.8 X3 d 12 (smoke) X1 + X2 + X3 d 20 (load) 1.5 X1 + X2 + 1.2 X3 d 24 (pulverizer) 1200 X1 - 800 X2 + 1000 X3 t0 (sulphur) X1 t 0, X2 t 0 and X3 t 0 The dual prices of the original problem provide all the information needed to know if we are interested in this new coal. If we decide to use one ton of coal C, X3 = 1, we must have the required machine capacity (loading systems and pulverizer) and have the possibility to emit smoke and sulphur that would be generated with it. This is equivalent to reducing the right-hand side of the constraints of the original problem in the following way: 0.5 X1 + X2 d (12-0.8) or 11.2 (smoke) X1 + X2 d (20-1) or 19 (load) 1.5 X1 + X2 d (24-1.2) or 22.8 (pulverizer) 1200 X1 - 800 X2 t(0-1000) or –1000 (sulphur) Operations research in business administration and management 50 The loading system allows us to use a ton of the new type of coal, as we have spare capacity. We can also emit more sulphur, since the latter constraint also has slack. Therefore, the opportunity costs of these two constraints are zero. However, as we can not emit more smoke and we do not have more capacity in the pulverizer, we can only burn a ton of new coal C if we do not burn any coal A and/or B. In this way we have the pulverizer available and the possibility of emitting the smoke needed to burn a ton of coal C. Specifically, to burn one ton of coal C we need to reduce the use of the pulverizer by 1.2 (decreases the RHS). As the opportunity cost is 14, the result will cause a decrease of 1.2 x 14 = 16.8 in the value of the objective function. Similarly, to burn a ton of coal C, we have to stop emitting 0.8 kg of smoke from burning coal A and B. A reduction of 0.8 kg of maximun emission of smoke decreases the value of the objective function by 0.8 x 6 = 4.8. The total decrease of the objective function value is equal to their sum, 21.6 steam units. Futhermore, the additional output per hour obtained by burning one ton of coal C is only 21 units. Thus, the net loss in steam production is 0.6 units. Therefore, in these conditions it is not advantageous to use coal C and the optimal solution remains the same. 2.7. LINEARPROGRAMMINGMODELSOLVINGWITHA SPREADSHEET The graphical solution is only possible if the number of variables is not higher than 2 (3?). Problems with more variables will have to be solved mathematically; for example, by applying the simplex method (an efficient algorithm that will be explained in chapter 3). As real problems have hundreds or thousands of variables and constraints, in practice the problem is solved using optimization software. Since spreadsheets are the most used tools in the business environment we will see its performance for solving linear, integer and nonlinear programming models. Annex 1 explains in detail the procedure for entering data for a linear programming model and solving it in Excel. Table 2.3 presents the data of the problem and the optimal solution. The value of the decision variables, the objective function and the first member of the constraints in the optimal solution are presented in italics. The remaining data are the model coefficients. Tables 2.4 and 2.5 are the reports generated by the Excel Solver tool after solving the model and pick the optimal solution and sensitivity analysis respectively. In Table 2.4 you can see the values of the variables and the objective function at the optimal solution, and the value of the slack variables for the constraints. The column "Status" shows "Binding" to indicate that in this case the constraint is checked strictly, ie the slack variable is zero and "Not Binding" when the slack variable is positive. Chapter 2. Formulating and solving linear programming models: basic concepts 51 Table 2.3. Model and Optimal Solution of the problem of energy production and pollution control A B C D E F G H I 1 ENERGY PRODUCTION AND POLLUTION CONTROL 2 3 Coal A Coal B 4 Steam production in thousands of lb/ton 24 20 5 Used capacity LHS RHS 6 Emission of smoke kg/h 0.5 1 12  12 7 Loading installation 1 1 18  20 8 Pulverizer capacity 1.5 1 24  24 9 Emission of sulphur 1200 -800 9600  0 10 11 Coal A ton/h Coal B ton/h Total Steam Production thousand lb/h 12 12 6 408 Table 2.4. Optimal solution to the problem of energy production and pollution control Microsoft Excel 14.0 Answer Report Objective Cell (Max) Cell Name Original Value Final Value $I$12 TotalSteamProduction 0 408 Variable Cells Cell Name Original Value Final Value Integer $E$12 Coal A (ton/h) 0 12 Contin $F$12 Coal B (ton/h) 0 6 Contin Constraints Cell Name Cell Value Formula Status Slack $G$6 Emission of smoke kg/h 12 $G$6<=$I$6 Binding 0 $G$7 Loading installation 18 $G$7<=$I$7 Not Binding 2 $G$8 Pulverizer capacity 24 $G$8<=$I$8 Binding 0 $G$9 Emission of sulphur oxide 9600 $G$9>=$I$9 Not Binding 9600 Operations research in business administration and management 52 Table 2.5. Sensitivity analysis for the problem of energy production and pollution control Microsoft Excel 14.0 Sensitivity Report Variable Cells Final Reduced Objective Allowable Allowable Cell Name Value Cost Coefficient Increase Decrease $E$12 Coal A (ton/h) 12 0 24 6 14 $F$12 Coal B (ton/h) 6 0 20 28 4 Constraints Final Shadow Constraint Allowable Allowable Cell Name Value Price R.H. Side Increase Decrease $G$6 Emission of smoke kg/h 12 6 12 4 4 $G$7 Loading installation 18 0 20 1E+30 2 $G$8 Pulverizer capacity 24 14 24 4 6 $G$9 Emission of sulphur oxide 9600 0 0 9600 1E+30 Table 2.5 is the sensitivity analysis. Firstly it indicates the range over which each coefficient in the objective function can vary without changes to the optimal solution. For example, the coefficient of X1, which can increase by 6 and decrease by 14, ie, can be between 10 and 30. It also gives us the reduced cost of variables, which is an important concept and can be interpreted as the amount that should improve the objective function coefficient of the variable sufficiently for it to take a nonzero value in the optimal solution. In this case, as the variables have a positive value, its reduced cost is zero. When the variable has a positive value, because it has a lower bound greater than zero, the interpretation of the reduced cost is penalty, in terms of the objective function to introduce the variable in the solution. Secondly the sensitivity analysis provides the range of variation of the right-hand side of the constraint that does not change the value of the opportunity cost. For example, the RHS of the restriction of smoke worth 12 kg/hour can be between 8 and 16, as it can increase by 4 and decrease by 4, without changes in the value of 6 for its opportunity cost. 6 is the increase in steam production (objective function) for additional unit on the RHS, i.e. per each kg/hour more of smoke that can be generated. Please read Annex 1 for detailed information. In summary, to solve a linear programming model with Excel, we introduce the problem data in data cells, which correspond to the technical coefficients (aij), the objective function coefficients (Cj) and the right-hand side of the constraints (bi or RHS). After variable cells are defined, where we have the values of decision variables, the linear functions are introduced that represent the constraints and the objective function. The SUMPRODUCT function of the spreadsheet is useful to introduce linear functions of the model (objective function and constraints). The use of range names in formulas is also interesting to simplify the data entry process and improve the understanding of the model (see Annex 1). Chapter 2. Formulating and solving linear programming models: basic concepts 53 The features of Excel for solving optimization models have improved greatly in recent years. In fact, they have incorporated latest and advanced methods such as genetic algorithms that we explain in the last chapter of the book. However, its use is currently recommended for solving small or medium sized models. For models with thousands of variables and constraints we consider it more appropriate to use more powerful optimization software, including essential modelling languages to generate large models. LINGO and CPLEX are good choices, they also have the ability to import and export data from spreadsheets and databases. 2.8.SOLVINGLINEARPROGRAMMINGMODELWITH OPTIMIZATION SOFTWARE In this section we highlight the LINDO Systems company that has sold a marketing optimization software for more than two decades, such as LINGO which incorporates a model generation language and optimizers to solve linear, integer, nonlinear and stochastic programming models. Furthermore, LINDO Systems has a program called What's Best which is an add-in to Excel and can solve linear, integer, nonlinear and stochastic programming models with spreadsheets, useful for companies that prefer to use this software environment. Students can download the latest version of LINGO and solving examples and case studies of the book (www.lindo.com). In this website manuals and training material such as the book of Linus Schrage are also available. The data input of the energy production and pollution control problem, the solution and sensitivity analysis obtained using LINGO are the following: MODEL: !EXAMPLE 1: ENERGY PRODUCTION AND POLLUTION CONTROL; [OBJ] MAX = 24 * X1 + 20 * X2; [SMOKE] 0.5 * X1 + X2 <= 12; [LOAD] X1 + X2 <= 20; [PULVERIZER] 1.5 * X1 + X2 <= 24; [SULPHUR] 1200 * X1 - 800 * X2 >= 0; END Global optimal solution found at step: 5 Objective value: 408.0000 Variable Value Reduced Cost X1 12.00000 0.0000000 X2 6.00000 0.0000000 Operations research in business administration and management 54 Row Slack or Surplus Dual Price OBJ 408.0000 1.000000 SMOKE 0.0000 6.000000 LOAD 2.0000 0.000000 PULVERIZER 0.0000 14.000000 SULPHUR 9600.0000 0.000000 Ranges in which the basis is unchanged: Objective Coefficient Ranges Current Allowable Allowable Variable Coefficient Increase Decrease X1 24.00000 6.000000 14.00000 X2 20.00000 28.000000 4.00000 Righthand Side Ranges Row Current Allowable Allowable RHS Increase Decrease SMOKE 12.00000 4.000000 4.000000 LOAD 20.00000 INFINITY 2.000000 PULVERIZER 24.00000 4.000000 6.000000 SULPHUR 0.00000 9600.000000 INFINITY As shown in the input data, we should use the symbol * for multiplication and the semi colon (;) to indicate the end of a sentence, which can be a comment, the objective function or a constraint. Comments start with exclamation marks (!) and the names of the objective function and constraints can be indicated in brackets. As in Excel Solver we can get a series of reports after solving the model. First comes an overview of the number and type of variables, constraints and coefficients.Then the model provides the optimal value of the objective function, which is 408 in this example. For each variable it indicates the activity level in the optimal solution (X1 =12 and X2= 6) and the reduced cost, which is zero in this case. The reduced cost can be interpreted as the amount by which the coefficient of the objective function of that variable should improve for it to take a value other than zero in the optimal solution. Another possible interpretation is to consider the reduced cost as the penalty cost of introducing the variable in the solution. Next, we obtain the value of the slack variables (slack or surplus) of the constraints and their opportunity cost or dual price. In this section we can observe a result mentioned earlier, that is, the relationship between these two concepts. When the slack variable of a constraint is zero, i.e., the constraint is strictly met, normally its opportunity cost will be other than zero. And when the slack is positive, the associated opportunity cost is zero. Note that this is so in all the constraints and that the first row is not a constraint, but the objective function of the model. Remember that the opportunity cost is the amount by which the objective function improves per unit increase in the RHS of the constraint. Chapter 2. Formulating and solving linear programming models: basic concepts 55 Thus, for a maximization problem when we increase the RHS of a constraint, the new value of the objective function is given by New optimal value of Z = Former optimal value + ǻ RHS* (opportunity cost of constraint) In the case of minimization problems, the term "improve" logically involves decreasing, thus the new optimal value will be New optimal value of Z = Former optimal value - ǻ RHS* (opportunity cost of constraint) The last two sections correspond to the sensitivity analysis of the objective function coefficients and RHS of the constraints. The first line indicates that the ranges provided are those in which the basis does not change. This concept is explained in chapter 3. Looking at the first part of the table we can say that the coefficient of X1 in the objective function, which is worth 24, may increase by 6 and decrease by 14 units without changes in the optimal solution. This is without changes in the value of variables X1 and X2. Obviously if these values are the same and C1, which is worth 24, increases or decreases, the value of the objective function that is C1*X1 + 20*X2 will change accordingly. The lower part of the sensitivity analysis refers to the variation of the RHS of the constraints. In the first column we have the constraint name and in the second the value in the model (RHS). The third column indicates the increase of RHS value and the fourth column the decrease, without changing the value of the opportunity cost of the constraint. For example, the RHS of the pulverizer constraint is 24 and can increase by four and decrease by six. In other words, its value can be between 18 and 28 without changing its opportunity cost which is 14 (dual price). Interpret the ranges provided for other constraints. 2.9. MODELLING: SOME EXAMPLES 2.9.1. COMMON MISTAKES IN MODELLING There are two extreme ways of learning to build optimization models, one through knowledge of standard examples and other through formulating models creatively. The first option requires much less analytical capability than the second, but it is more limited. It only serves to solve real problems that fit standard models. Obviously, in practice the best approach is to integrate both. The mistakes made in the modelling process can be classified into three categories: 1. Errata or typographical errors 2. Making basic formulation mistakes 3. Approximation errors Operations research in business administration and management 56 The first two types of errors are easy to solve once identified. Typographical errors are harder to find as the model size increases. However, in these cases matrix generators or modelling languages are commonly used, reducing their incidence. Error type 2 is far more serious because it involves not having understood the problem or the formulation of linear programming models. Errors of type 3 have a more subtle character. In general in developing a model that represents a real situation we need to do some form of approximation. For example, certain products are aggregated, the weekdays are grouped or costs that are not proportional to the variable values are considered linear. To avoid errors of this type one should be able to identify those approximations that are acceptable. Optimization software usually has capabilities for providing some data about the model, such as the values ranges of the parameters among others. This information is useful in the identification of errors type 1. These errors also tend to provide solutions that are obviously wrong. Formulation errors are much more difficult to systematize because there are many types. Among the most common is what is known as dimensional analysis: the units of all terms of a restriction must be equal. To avoid this error it is often useful to formulate the problem in words and then write the associated algebraic form. Another associated error with the measurement units is the use of units in such a way that very large or very small numbers can appear in the same model. This can cause significant rounding errors. This can be avoided by scaling the model in order to reduce the difference between the largest and the smallest coefficient value, and make it as small as possible. Good professional optimization software can solve this problem automatically. Another formulation error is called non-simultaneity error. In linear programming all constraints must be satisfied simultaneously. We may want to indicate that, if a product is made, it is made to a minimum level, e.g. 20. And the solution indicates if it is made or not, and if yes, the solution will give us its manufacture level. As we shall see, to indicate these situations we should not write X t20 and X d 0. We need to use an integer programming model. LINGO can generate the required integer variables and constraints if you indicate that this variable is semicontinuous (See Annex 2). Finally, we point out that the fundamental characteristics of a good model to be useful in decision-making are the following: simple, complete, easy to handle, adaptable, appropriate to the situation and producing relevant information for decision-making. It is advisable to re-read the section on Operational Research methodology explained in Chapter 1.The next section presents a well-known problem to learn how to formulate and solve models, as well as discussing the results obtained. This learning process will continue throughout the book with examples and case studies, many of which students perform with the help of the teacher in laboratory sessions. Chapter 2. Formulating and solving linear programming models: basic concepts 63 Table 2.9. Technical characteristics of raw materials and diet requirements Characteristics Raw materials Needs Alfalfa Barley Wild Barley Soy Sunflower Straw C1 C2 Fibre units/kg 0.15 1 0.18 1.05 0.88 0.3 >=6.3 >=8.6 D igestible Protein /Kg 0.02 0.06 0.04 0.4 0.28 0.01 >=0.66 >=0.75 Dry M aterial /Kg 0.22 0.85 0.25 0.9 0.93 0.9 8.8 - 11.6 8- 13 COST (euros /Kg) 0.14 0.30 0.08 0.60 0.42 0.12 CASE STUDY 2: A FEED PROBLEM A multinational company in the food sector has several feed factories in the country. The feed formulations which the company manufactures and distributes is calculated every month in the central headquarters taking into account the prices and availability of raw materials. Table 2.10 shows the data to solve a small example of this real problem. The company needs to calculate the optimal formulation in order to minimize the cost of feed for a certain type of animal, whose nutritional requirements are the following: The feed must have a protein percentage between a minimum of 12% and a maximum of 15%, while the minimum levels of calcium and phosphorus should be 1 and 0.30% respectively. Table 2.10. Characteristics of raw materials and feed requirements Characteristics Corn Wheat Barley Alfalfa Price (euros/ton) 142 134 125 108 Protein % 8.5 11 11 17 Phosphorus % 0.27 0.35 0.37 0.30 Calcium % 0.02 0.04 0.06 1.77 Operations research in business administration and management 64 1. Propose a model to determine the optimal formulation in order to minimize the feed cost 2. Resolve the model using Solver tool from Excel and LINGO. 3. Indicate the formulation and the minimum cost of feed. 4. What are the exact percentages of protein, calcium and phosphorus of the obtained feed? 5. The company needs to buy more barley, but the price has increased by 10 euros/ton. In this situation, should the feed be manufactured with the same raw materials which the optimal solution indicates? 6. The purchasing manager updates market prices and observes that prices of corn and wheat have decreased slightly, exactly 4 euros/ton in both cases. Would this new situation affect production policy and therefore also the purchase of raw materials? 7. The multinational company has launched an environmental program which is a part of the corporate social responsibility, in order to reduce pollution caused by meat production. They are committed to manufacturing the feeds with protein quantities that are closer to animals’ requirements. Therefore, they have proposed reducing the maximum percentage of protein to 14.5%. Would this decision affect the formulation and cost of feed? What happens if the proposal is 13%? If possible, indicate the formulation and cost of feed in both cases from sensitivity analysis. 8. Analyse the differences if there are any, between the information given by Excel and LINGO. CASE STUDY 3: PRODUCTION PROBLEM A company manufactures three products A, B and C. The three products share four machines M1, M2, M3 and M4 in their production process. For product A we need three operations on machines M1, M3 and M4, for product B only two operations on machines M1 and M3 or on machines M2 and M4 are needed, and product C can be manufactured using machines M1 and M3 or machines M2, M3 and M4. The time required in minutes per unit produced for each production possibility on each machine, the variable cost of production per minute, the daily capacity of each machine and the minimum daily demands of the three products are presented in the following Table. The objective consists of determining the production scheme that minimizes the overall variable cost. Solve this problem with LINGO and answer the following questions. Chapter 2. Formulating and solving linear programming models: basic concepts 65 1. How many units of each product are manufactured in each process and what is the overall cost? 2. Which machines have idle capacity and what are these capacity? 3. If it were possible to add an extra time of half an hour per day on machine M1, what effect would it have on the overall production cost? 4. If demand for product B were 40 units, what effect would it have on the overall production cost? 5. What can you say about the effect on the overall cost in the case of an increase in demand for C from 10 to 12 daily units? 6. The company has received an order to produce 5 units per day of a new product, D. Each unit of D requires 2 min on machine M1, 12 min on machine M2 and 6 min on machine M3. The net profit per unit of D is 25 money units. Should this product be manufactured? Justify your answer. In case of an affirmative answer, what would the new value of the objective function be without solving the problem again? Please use the opportunity cost concept. Finally, check if the result indicated is correct. Table 2.11. Technical and economic data Product Process Time (min/unit) Mini mum daily demand M1 M2 M3 M4 A 1 10 6 3 36 B B1 1 8 10 45 B2 2 6 9 C C1 1 8 16 10 C2 2 10 3 8 Variable cost per min (mu) 40 50 24 30 Daily capacity in min 480 480 480 480 CASE STUDY 4: PRODUCTION PROBLEM A company is planning the apple picking and production of cider for the next season. It manufactures several cider products (natural, extra, brut, black label, etc.) that differ in the mixture of apple varieties, which can be grouped as sweet, sour or bitter. The production process has several phases: pressing, maceration, slow fermentation, clarification and stabilization, bottling and labelling. The process yield is high and produces 0.8 litres cider per kilo of apples. The company has built a linear programming model to be able to determine how many apples of each variety it should buy to produce 40,000 litres of natural cider and 10,000 litres of extra cider. Table 2 shows the characteristics of the apple varieties Operations research in business administration and management 66 and of the cider products. The degree of acidity of the cider must be within the range indicated in the table, as must the sugars in the case of the extra cider. The objective is to minimize the company production costs. Table 2.12 Characteristics of the apple varieties and types of cider Characteristics Apple variety Cider products 1 2 3 Natural Extra Degrees of alcohol % 8 6 .5 4 .2 7 4. 8 Volatile acidity gr / litre 1. 3 2 .1 1 .4 1 .2 - 2 0. 7 – 1 .6 Total Acidity gr / litre 2. 2 4 3 .5 3 – 4 .5 3 .5 - 4 Sugars gr / litre 70 45 55 - 50 - 60 Price euros/kg. 0. 4 0. 35 0 .3 MODEL: ! Cider production; ! VARIABLES: V1j, V2j y V3j Kg. Apples of variety 1,2 o 3 needed to produce cider j (N=Natural y E=Extra); [OBJECTIVE_FUNCTION] MIN=0.4*(V1N + V1E) + 0.35*(V2N + V2E) + 0.3 *(V3N + V3E); ! Constraints; [DegreesA_Natural] 0.8*(8*V1N + 6.5*V2N + 4.2*V3N) = 7*40000; [VolatileA_Min_Natural] 0.8*(1.3*V1N + 2.1*V2N + 1.4*V3N) >= 1.2*40000; [VolatileA_Max_Natural] 0.8*(1.3*V1N + 2.1*V2N + 1.4*V3N) <= 2*40000; [TotalA_Min_Natural] 0.8*(2.2*V1N + 4*V2N + 3.5*V3N) >= 3*40000; [TotalA_Max_Natural] 0.8*(2.2*V1N + 4*V2N + 3.5*V3N) <= 4.5*40000; [Quantity_Natural] 0.8*(V1N + V2N + V3N) = 40000; [DegreesA_Extra] 0.8*(8*V1E + 6.5*V2E + 4.2*V3E) = 4.8*10000; [VolatileA_Min_Extra] 0.8*(1.3*V1E + 2.1*V2E + 1.4*V3E) >= 0.7*10000; [VolatileA_Max_Extra] 0.8*(1.3*V1E + 2.1*V2E + 1.4*V3E) <= 1.6*10000; [TotalA_Min_Extra] 0.8*(2.2*V1E + 4*V2E + 3.5*V3E) >= 3.5*10000; [TotalA_Max_Extra] 0.8*(2.2*V1E + 4*V2E + 3.5*V3E) <= 4*10000; [Sugars_MinExtra] 0.8*(70*V1E + 45*V2E + 55*V3E) >= 50*10000; [Sugars_MaxExtra] 0.8*(70*V1E + 45*V2E + 55*V3E) <= 60*10000; [Quantity_Extra] 0.8*(V1E + V2E + V3E) = 10000; END Chapter 2. Formulating and solving linear programming models: basic concepts 67 Global optimal solution found. Objective value: 22246.38 Infeasibilities: 0.000000 Total solver iterations: 10 Variable Value Reduced Cost V1N 16666.67 0.000000 V1E 0.000000 0.1739130E-01 V2N 33333.33 0.000000 V2E 3260.870 0.000000 V3N 0.000000 0.2666667E-01 V3E 9239.130 0.000000 Row Slack or Surplus Dual Price FO 22246.38 -1.000000 DegreesA_Natural 0.000000 -0.4166667E-01 VolatileA_Min_Natural 25333.33 0.000000 VolatileA_Max_Natural 6666.667 0.000000 TotalA_Min_ Natural 16000.00 0.000000 TotalA_Max_Natural 44000.00 0.000000 Quantity_Natural 0.000000 -0.1666667 DegreesA_Extra 0.000000 -0.2717391E-01 VolatileA_Min_Extra 8826.087 0.000000 VolatileA_Max_Extra 173.9130 0.000000 TotalA_Min_Extra 1304.348 0.000000 TotalA_Max_Extra 3695.652 0.000000 Sugars_MinExtra 23913.04 0.000000 Sugars_MaxExtra 76086.96 0.000000 Quantity_Extra 0.000000 -0.2608696 Ranges in which the basis is unchanged: Objective Coefficient Ranges: Current Allowable Allowable Variable Coefficient Increase Decrease V1N 0.4000000 INFINITY 0.1739130E-01 V1E 0.4000000 INFINITY 0.1739130E-01 V2N 0.3500000 0.1052632E-01 INFINITY V2E 0.3500000 0.1052632E-01 INFINITY V3N 0.3000000 INFINITY 0.2666667E-01 V3E 0.3000000 INFINITY 0.2666667E-01 Righthand Side Ranges: Current Allowable Allowable Row RHS Increase Decrease DegreesA_Natural 280000.0 13333.33 12500.00 VolatileA_Min_Natural 48000.00 25333.33 INFINITY VolatileA_Max_Natural 80000.00 INFINITY 6666.667 TotalA_Min_ Natural 120000.0 16000.00 INFINITY TotalA_Max_Natural 180000.0 INFINITY 44000.00 Quantity_Natural 40000.00 1197.605 1355.932 DegreesA_Extra 48000.00 571.4286 6000.000 VolatileA_Min_Extra 7000.000 8826.087 INFINITY VolatileA_Max_Extra 16000.00 INFINITY 173.9130 TotalA_Min_Extra 35000.00 1304.348 INFINITY TotalA_Max_Extra 40000.00 INFINITY 3695.652 Sugars_MinExtra 500000.0 23913.04 INFINITY Sugars_MaxExtra 600000.0 INFINITY 76086.96 Quantity_Extra 10000.00 1038.576 326.4095 Operations research in business administration and management 68 1. Indicate the minimum cost of production and the quantity of apples of each variety that the company should buy for the next period. 2. What is the value of alcohol in degrees, the volatile and total acidity in the natural cider, produced according to optimal solution of the model? 3. The natural cider is produced using apple varieties 1 and 2. Why is variety 3 not used to make natural cider? Under what conditions which would it be interesting to use variety 3 to produce natural cider? 4. What would the optimal solution be if the price of variety 1 was 0.45 euros/kg? And what would happen if the price was 0.39 euros/kg? 5. Will the optimal solution change if the alcohol degree of natural cider decreases to 6.8 %? What happens if the value is 6%? What the changes and what values remain the same in both cases? 6. What would be the effect on the optimal solution if the maximum level of sugars is 55gr/litre in the extra cider? CHAPTER 3 GENERAL METHODS OF LINEAR PROGRAMMING 3.1. BASIC CONCEPTS: CORNER-POINTS AND BASIC SOLUTIONS 71 3.2. THE SIMPLEX METHOD ........................................................................... 75 3.2.1. GENERAL CONCEPTS ............................................................................. 75 3.2.2. THE SIMPLEX METHOD BY SIMULTANEOUS EQUATIONS ............ 75 3.2.3. CRITERIA OF THE SIMPLEX METHOD: ENTERING A BASIC VARIABLE AND A LEAVING BASIC VARIABLE ......................................................... 78 3.2.4. SIMPLEX TABLEAU .................................................................................. 81 3.3. INITIAL BASIC FEASIBLE SOLUTION AND ARTIFICIAL VARIABLES. THE TWO-PHASE METHOD ..................................... 85 3.4. SIMPLEX ALGORITHM WITH BOUNDED VARIABLES ............. 89 3.4.1. LOWER BOUND TECHNIQUE .............................................................. 89 3.4.2. UPPER BOUND TECHNIQUE .............................................................. 93 3.5. THE REVISED SIMPLEX METHOD, THE INTERIOR-POINT ALGORITHM AND THE OPTIMIZATION SOFTWARE .................. 99 3.6. SUMMARY ...................................................................................................... 102 3.7. SELECTED REFERENCES ........................................................................ 103 3.8. CASE STUDIES .............................................................................................. 104 Chapter 3. General methods of linear programming 71 In the previous chapter we graphically solved a linear program with two variables to introduce the basic concepts of linear programming in the most comprehensible and intuitive way possible. However, in practice, problems usually have more variables and constraints and therefore we need some mathematical tools to find the optimal solution. Fortunately, we have a very efficient algebraic technique: the Simplex Method developed by George Dantzig in 1947. The simplex method is an amazing algorithm which received a competitor introduced in 1984 (interior point algorithm of Karmarkar) that seemed to replace it. However, this competitor has not so far fulfilled the expectations that it had initially raised. Today the simplex method remains the basis of software that solves linear programming models in the business sector, both large and small. Only in the case of very large models would the interior point algorithm be preferable and then in combination with the simplex method. This chapter starts with the definitions of the basic concepts of general linear programming techniques, that is, convex sets, corner-points and basic solutions. We will then explain the Simplex method and the dual phase method as well as techniques with bounded variables. We will end the chapter with a brief reference to the revised simplex method and the latest developments in linear programming. Professional business managers need to know the basics of the methods of solving linear programming. This knowledge facilitates the formulation of models and the interpretation of the solutions, improving decision making. In addition, the simplex algorithm and its extensions are the basis of sensitivity analysis, as well as other optimization techniques that we will see in following chapters such as integer programming, multiobjective programming and nonlinear programming. 3.1. BASIC CONCEPTS: CORNER-POINTS AND BASIC SOLUTIONS We will continue using the production model of a power plant as described in the previous chapter. For now, we will simply consider two of the four original constraints. Specifically, the problem will consist of finding the values of the decision variables X1 and X2 that (1) Maximize 24 X1+ 20 X2 and verify the constraints X1 t 0 and X2 t 0 0.5 X1 + X2 d 12 (smoke) 1.5 X1 + X2 d 24 (pulverizer) Operations research in business administration and management 72 Figure 3.1 shows the nonnegativity conditions of the variables and constraints for this problem. As we already know, the set of points (X1, X2) that meet all constraints form the feasible region. The feasible region of a linear programming model is a convex set. A set is convex when, between two given points, all midpoints also belong to the set. This is a characteristic of the feasible region of any linear programming model and it is the principle for the solution procedure known as simplex algorithm. Another key concept is that of corner-points, which are the vertices of the polygon that forms the feasible region (in the case of two variables). In the previous chapter, we have also intuitively seen that if a linear programming model has a finite optimal solution, at least one corner-point of the feasible region will be optimal. Figure 3.1 shows that the corner-points of the problem are A, B, C and D. How are these points generated algebraically? First, we formulate the linear programming model (1) in the standard form by entering the slack variables X3 and X5 to maintain the notation of the original problem. (2) 0.5 X1 + X2 + X3 = 12 (smoke) 1.5 X1 + X2 + X5 = 24 (pulverizer) Note that now each corner-point of the feasible region can be obtained by setting two variables to zero and solving the resulting set of equations (2). For example, point C, which corresponds to the optimal solution, is obtained by setting X3 and X5 to zero. When solving the resulting system of two equations with two unknown quantities we obtain X1=12 and X2=6. We can verify this result and obtain the values of the variables for points A, B and D. However, the selection of variables to be set to zero in order to obtain the corner points is not arbitrary. If we set X1 and X5 to zero we obtain the point E (X2=24 and X3 = -12). This solution is not feasible as X3 is negative and therefore not a corner point. However, any feasible solution obtained by this procedure is a corner point and vice versa. A simple method to determine the values of the variables in the corner points is as follows. If we express the first constraint (2) in terms of X1 and the slack variables, and the second in terms of these latter and X2 we obtain the following equations (3) X1 - X3 + X5 = 12 X2 + 1.5 X3 - 0.5 X5 = 6 Chapter 3. General methods of linear programming 79 four thousand pounds. This is the case, because when increasing the value of X2 by one unit the objective function increases by 20, but X3 and X1 decrease by 2/3, which causes a decrease of the objective function of (2/3) C3 + (2/3) C1 = (2/3) 24 = 16. Therefore, 20 - 16 = 4 is the net effect due to the changes of levels of activity of the basic variables when a unit of the entering basic variable is increased. Regarding our problem, we can add that the basic solution corresponding to (8) consists of burning 16 tons of coal A, nothing of B, the full capacity of the pulverizer machine has been reached (its slack variable X5 is zero) and we can still increase the emission of smoke by 4 more units. When considering whether to burn coal B, we have to reduce the quantity of coal A to have the necessary capacity in the pulverizer to burn 1 ton of coal B. As we can see in (5), 1 ton of coal A only requires 3/2 units of the pulverizer and 1 ton of coal B, 1 unit, therefore to pulverize one ton of coal B it is necessary to decrease the burning of coal A by 2/3. The previous reasoning is based on the use of scarce resources, however, it can be generally applied to any type of variables and constraints. The reduced coefficient of the objective function (Cj - Zj) always represents the variation of the objective function per entering nonbasic variable unit. If it is positive, it will increase the value of the objective function and if it is negative it will decrease this value. The reduced cost of the basic variables is always zero. When there are several nonbasic variables in a basic solution that increase Z (if we are maximizing), one approach is to select the entering basic variable with the best unitary improvement. When there is no positive reduced coefficient, we will not be able to improve Z and therefore, we have reached the optimal solution. CRITERION TO CHOOSE THE ENTERING BASIC VARIABLE The entering basic variable is the variable with the highest (Cj-Zj) value (Maximization). OPTIMALITY CRITERION A feasible basic solution is optimal if any (Cj-Zj) d d 0 for the nonbasic variables (Maximization). Previously, we have seen that a minimization problem, Min Z, can be expressed as a maximization Max (-Z) problem. However, the simplex criterion can also be modified conveniently. Thus, the entering basic variable would be the one which has the smallest (Cj-Zj), and the optimality criteria that (Cj-Zj) t 0. Let us now look at what happens with the levels of activity of the basic variables when a nonbasic variable enters, for example X2 at the second iteration. We have just seen how a unitary increment of X2 causes a decrease of 2/3, in X3 as well as in X1 as can be seen in (8). Similarly, an increase of X2=ș in (8) will cause some proportional decrease of the basic variables. Concretely Operations research in business administration and management 80 (13) X3 = 4 - Į1 X2 = 4 - 2/3 X2 X 1 = 16 - Į2 X2 = 16 - 2/3 X2 As X2 is increased, X1 or X3 will gradually decrease until one of them is zero. If we continue increasing X2, one or the other or both would be negative, therefore the solution would become an infeasible solution and we can never let this happen. Therefore, the highest value that X2 can take, maintaining feasibility, is (14) ș = min (4/ 2/3, 16/ 2/3) = 6 if any of those Įi had been negative or zero, we would have not carried out the corresponding quotient, since the basic variable would increase its value or would remain with the same level of activity. In this case, the basic variable would never be zero and, therefore, it could not be replaced by the entering basic variable. CRITERION FOR THE LEAVING BASIC VARIABLE Given Įi of the entering basic variable, the leaving basic variable is the one that satisfies (15) ș is the value of the new basic variable Xj in the new solution. If there are no positive Įi, ș can be increased without bound because none of the variables in the current basis will be zero. As ș increases, the value of the objective function also increases. If the entering basic variable does not have an upper bound, the objective function could increase to infinity. This situation is known as unbounded solution. CRITERION FOR UNBOUNDED SOLUTIONS If for some nonbasic variable with (Cj-Zj) >0 all the values Įi are not positive, the linear programming model does not have a finite optimal solution. CHANGE OF BASIS: When we pass from a basic solution BS0 to an adjacent basic solution BS1 the following formulas indicate how the levels of activity of the basic variables and the value of the objective function change: (value of the basic variable Xi) Di ș = min for any Di > 0 Chapter 3. General methods of linear programming 81 (16) Xi1 = Xi0 - Įij șj X j1 = șj ' ' Z = șj (Cj -Zj) The first equation tells us the value of Xi1 (basic variable i in the basic solution BS1) when units of the nonbasic variable j (șj) enter in the basis. The coefficient of the equation Įij is thus decreasing the basic variable i in the above solution (Xi0) per unit increase in the nonbasic variable j. The increase of the objective function ' Z is the number of units of the entering basic variable (șj) by its reduced coefficient (Cj-Zj). 3.2.4. SIMPLEX TABLEAU The calculations of the simplex method are carried out in a more appropriate way by using a table structure known as simplex tableau. Table 3.1 represents the initial simplex tableau corresponding to the corner-point A of Figure 3.1 and equations (5). In the first column of Table 3.1 we specify the name of the basic variables, then we have a column for each variable of the linear programming model in the standard form, another for the second member of the constraints and finally, a column to specify the quotient between the value of the basic variable and the Įij coefficient of the entering basic variable. Note that the first row of the table, corresponding to X3 as basic variable, is the first equation of (5), the second row that has X5 as basic variable is the second equation of (5) and, similarly, the third row of Cj-Zj is the equation of the objective function as expressed in (5). Therefore, it is as if we left Z as a basic variable in all the iterations of the algorithm, but with the sign changed. This is why in the cell of column bi and the row (Cj-Zj) of the simplex tableau will appear the value of the objective function will appear with the sign changed. Note also that the coefficients of the basic variables make up the unit matrix, therefore, the values of these variables are those shown in column bi. Applying the entering and leaving criteria of the basic variables, we select first X1 as entering basic variable, as it produces the highest unitary increase in the objective function. As leaving basic variable, the basic variable chosen is the first to be zero, that is, X5. Thus, the new basis will be formed by X3 and X1. It is important to note that at this precise step the algorithm of the simplex implicitly considers the nonnegativity conditions of the variables. Operations research in business administration and management 82 Table 3.1. Initial simplex tableau BASIC VAR. X1 X2 X3 X5 bi bi/Įi X3 0,5 1 1 0 12 24 X5 1,5 1 0 1 24 16 Cj - Zj 24 20 0 0 0 Table 3.2. Second simplex tableau BASIC VAR. X1 X2 X3 X5 bi bi/Įi X3 0 2/3 1 - 1/3 4 6 X1 1 2/3 0 2/3 16 24 Cj - Zj 0 4 0 - 16 - 384 The following step consists of transforming the first tableau into the canonical form corresponding to the new basis. Pivot row is the row of the leaving basic variable and pivot column, the column of the entering basic variable. Pivot is the common element of the pivot column and the pivot row, while the semipivots are the remaining elements of the column of the entering basic variable. Chapter 3. General methods of linear programming 83 Table 3.3. Third simplex tableau: optimal solution BASIC VAR. X1 X 2 X 3 X 5 b i X2 0 1 3/2 -1/2 6 X1 1 0 -1 1 12 Cj - Zj 0 0 -6 -14 -408 To set the corresponding tableau to the following basic solution in canonical form it is necessary that the pivot element be 1 and all the other elements of the pivot column, zero. This is achieved by applying the following rules when passing from an BS to an adjacent BS1: (17) In summary, pivot row ĮIL,j, is transformed by dividing it by the pivot. The remaining lines, D 1 i j, including (Cj-Zj), are transformed by subtracting the pivot row obtained in the first place and multiplied by the corresponding semipivot number. Chart 1 shows an outline of the steps of the simplex algorithm. Table 3.3 is the simplex tableau of the optimal solution. As we already knew and as we can see in this table, the optimal solution consists of using 12 ton/h of coal A and 6 ton/h of coal B, obtaining a vapor production of 408 thousand pounds. Furthermore, this table provides additional information such as the opportunity costs of the scarce resources. What is the dual price of the constraint of smoke? What is its practical meaning? D 1 ij = D 1 IL,j D ij - SEMIPIVOT D IL,j D IL,j D IL,JE PIVOT D 1 IL,j = = Operations research in business administration and management 84 CHART 3.1. SIMPLEX ALGORITM (MAXIMIZATION)   INITIAL FEASIBLE SOLUTION BS0 THE ENTERING BASIC VARIABLE JE: MAX (C j -Z j ) all j nonbasic var. (C j -Z j )=C j - 6D ij -C i (i basic var.)  (C j -Z j )>0 D i  JE  >0 NO NO OPTIMAL SOLUTION UNBOUNDED SOLUTION THE LEAVING BASIC VARIABLE X 0 IL: Min  D L j+ CHANGE OF BASE X i =X i 0 - T j · D ij X j = T j ' Z= T j (C j -Z j ) NEW BASE IN CANONICAL FORM BS 1  D   IL, j =  D IL, j / PIVOT D  ij = D  ij - SEMIPIVOT · D  Il,j Chapter 3. General methods of linear programming 85 3.3.INITIALBASICFEASIBLESOLUTIONANDARTIFICIAL VARIABLES. THE TWO-PHASE METHOD. In the previous example we obtained the basic initial solution from the slack variables, but many problems do not have an initial solution in canonical form. If there are equality constraints, higher or equal or second non positive members (=, t or bi d 0), the only additional problem outlined is to identify the initial basic feasible solution. In this case, there is no guarantee that a feasible solution exists. Therefore, a systematic and efficient procedure is required to generate this basic initial and feasible solution, if it exists. One of the advantages of the simplex method is that the method itself is able to generate its own initial basic feasible solution, provided that one exists. If it does not exist, the simplex method specifies that the problem does not have a solution. When we have equality constraints in a model, there is no slack variable for this constraint that allows us to obtain the initial basic feasible solution. We could consider substituting the equality constraint for other two, one with d and the other with t. This alternative is not very advisable because it increases the number of constraints of the problem. The technique of the artificial variable is preferable. This consists of adding, to the left side of the constraint, a fictitious variable that will be called artificial variable and whose only mission is to be the basic variable of that constraint in the initial basic solution. In the case of tconstraints, the slack variable enters to be subtracted, and if we multiplied the equation by (-1), we would find the second member negative and therefore with an initial infeasible solution. Therefore, in this case we also add an artificial variable. In summary, when we have problems with = or t t constraints, an artificial variable is added for each one of the constraints of this type. This new problem is called the augmented problem. From the artificial variables we obtain an initial basic solution that is infeasible for the original problem because the artificial variables do not have a meaning in it. Therefore, the first thing to do is to find an initial basic feasible solution for our real problem, removing all the artificial variables from the basis. From this new basic solution we will continue searching for the optimal solution. We will see how the two-phase method allows us to find the initial basic feasible solution. This method will be explained with the energy generation example reformulated as a model of minimization of production costs. The additional constraint of having to produce a minimum of 216 thousand pounds of vapor is added. (18) Minimize 24 X1+ 15 X2 X 1 t 0 and X2 t 0 0.5 X1 + X2 d 12 1.5 X1 + X2 d 24 24 X1 + 20 X2 t 216 Operations research in business administration and management 86 In the process that we follow to find the optimal solution we can distinguish two phases. The first corresponds to the iterations required until a feasible solution is found, without the artificial variables. The second phase consists of the additional iterations performed once a feasible basic solution has been found until the optimal solution is reached. The Two-phase method uses two different objective functions, one in each phase. The algorithm starts by introducing the artificial variables that are required to obtain an initial basic solution. Phase 1: The simplex method is used to solve the augmented linear programming whose objective function is the following (20) Minimize Z = Sum of all of the artificial variables and the constraints are the original constraints of the model plus the artificial variables and nonnegativity constraints for all decision and artificial variables. The optimal solution obtained for this problem (Z=0) will be a feasible basic solution for the original problem. Phase 2: The artificial variables are removed, since their value is zero and the simplex is applied from the feasible basic solution obtained after phase 1 until the optimal solution is found. The objective function of this phase is that of the real problem (minimizing the production cost). (21) Minimize Z = Objective function of the problem = 24 X1+15X2 Table 3.4 represents the initial simplex tableau for phase 1 of the example of cost minimization in energy production. Note that row Cj-Zj should be calculated from (12). That is Reduced cost of nonbasic variable Xj: Cj - Zj = Cj - 6 6 Įij Ci where Cj is the coefficient of the nonbasic variable in the objective function (20). Ci is the coefficient of the basic variable i in the objective function (20) and Įij is the coefficient of variable Xj in the row i. For example, C1-Z1= C1 – (Į11 C3 + Į21 C5 + Į31 CArtificial ) = 0 – (0.5*0 +1.5*0 +24*1) = -24 Chapter 3. General methods of linear programming 87 Table 3.4. PHASE 1: Initial simplex tableau BASIC VAR. X1 X2 X3 X5 X6 Xa bi b i/Įi X3 0.5 1 1 0 0 0 12 24 X5 1.5 1 0 1 0 0 24 16 Xa 24 20 0 0 - 1 1 216 9 Cj - Zj -24 -20 0 0 1 0 - 216 Table 3.5. PHASE 1: Second simplex tableau BASIC VAR. X1 X2 X3 X5 X6 Xa b i X3 0 7/12 1 0 1/48 - 1/48 7.5 X5 0 -1/4 0 1 1/16 - 1/16 10.5 X1 1 5/6 0 0 - 1/24 1/24 9 Cj - Zj 0 0 0 0 0 1 0 From Table 3.4 the logic of the simplex means that X1 enters in the basis because it has the smallest (Cj-Zj) and we are minimizing the sum of the artificial variables. As there is only one, we have to set it to zero. When you enter X1 all basic variables decrease in value. For example, X3 decreases by 0.5 for each X1 unit that enters and Xa decreases by 24. The first basic variable that reaches zero exits the basis, being the leaving basic variable, in this case it is the artificial variable. Therefore, in one iteration we finish phase 1 whose optimal solution is shown in Table 3.5. Note that Table 3.6, initial chart of phase 2, is nothing more than the final tableau of phase 1 except that we have removed the column of the artificial variable and recalculated the Cj-Zj row. It is logical that it should be this way because the objective function is now different. Specifically the objective function of the problem, i.e. minimize the cost of production (18). By applying the two-phase method it may not be possible to find a feasible solution to the original problem. However, the technique of the artificial variables indicates that we have a situation of this type. In this example, Table 3.7 corresponds to the optimal solution because no nonbasic variable can reduce the cost, i.e. decrease the value of the objective function. In this case, the optimality criterion is that reduced costs are greater than or equal to zero. Operations research in business administration and management 88 Table 3.6. PHASE 2: Initial simplex tableau BASIC VAR. X1 X2 X3 X5 X6 bi bi/Įi X3 0 7/12 1 0 1/48 7.5 12. 86 X5 0 - 1/4 0 1 1/16 10. 5 X1 1 5/6 0 0 - 1/24 9 10. 8 Cj - Zj 0 - 5 0 0 1 - 216 Table 3.7. PHASE 2: Second simplex tableau: optimal solution BASIC VAR. X1 X2 X3 X5 X6 bi X3 -0 .7 0 1 0 0. 05 1.2 X5 0 .3 0 0 1 0. 05 13.2 X2 6/5 1 0 0 -0 .05 10.8 Cj - Zj 6 0 0 0 0. 75 - 162 If the original problem does not have feasible solutions, then any optimal solution obtained in phase 1 of the Two-phase method leads to a final solution that contains at least one artificial variable higher than zero. Otherwise, all of them are equal to zero. OPTIMALITY CRITERION The optimal solution for the augmented problem is also optimal for the original problem if there are no artificial variables with non-zero values. If not all of the artificial variables are eliminated from the basis, the original problem does not have a feasible solution. Chapter 3. General methods of linear programming 95 For the basic solution to table 3.13, the only variable which increases the objective function is X2' and, by increasing its value, Y1 increases by 3/2 and X4 decreases by 2 for each additional unit in X2'. Thus X4 can reach zero and Y1 can reach its upper bound. The latter is what happens first and the table corresponding to the next feasible basic solution is a little more complicated than in previous cases as, in addition to applying the formulae to change the basis (17), other considerations must be taken into account. In table 3.14 the value of the entering basic variable X2' is 2/3. This value is not obtained by dividing bi by the Įi coefficient. In particular, 2/3 is what has to enter in the basis of X2' for the basic variable Y1 to reach its upper bound of 3. Moreover as the basic variable Y1 reaches its upper bound, it is substituted by Y1´as a nonbasic variable. Therefore, the coefficients of column Y1´are multiplied by (-1). Table 3.11. Initial simplex tableau BASIC VAR. Y1 X2 X3 X4 bi bi/Įi X3 2 3 1 0 7 7/3=2.33 X4 2 1 0 1 7 7/1=7 Cj - Zj 4 5 0 0 - 4 Table 3.12. Simplex tableau: first iteration BASIC VAR. Y1 X2 ' X3 X4 bi bi/Įi X3 2 - 3 1 0 4 4/2=2 X4 2 - 1 0 1 6 6/2=3 Cj - Zj 4 - 5 0 0 - 9 Table 3.13. Simplex tableau: second iteration BASIC VAR. Y1 X2 ' X3 X4 bi bi/Įi Y1 1 - 3/2 1/2 0 2 1/3/2=2/3 X4 0 2 - 1 1 2 2/2=1 Cj - Zj 0 1 - 2 0 - 17 Operations research in business administration and management 96 Table 3.14. Simplex tableau third iteration: optimum solution BASIC VAR. Y1' X2' X3 X 4 bi X2' 2/3 1 - 1/3 0 2/3 X4 - 4/3 0 - 1/3 1 2/3 Cj - Zj - 2/3 0 - 5/3 0 - 17. 66 From Table 3.14 and taking into consideration (29) and (30) the optimal solution is X1 = 4 X2 = 0.33 Z = 17.66 In brief, the upper bound technique applies the following criteria: VALUE OF THE INCREASING NONBASIC VARIABLE (31) Xj = șj = min [ȕ, Uj, įj] Uj = upper bound of the entering basic variable Therefore, the basis change can take place due to three different situations: 1. ȕ The entering basic variable substitutes the leaving basic variable which reaches zero as in the standard simplex algorithm. 2. Uj The entering basic variable reaches its upper bound before a basic variable reaches zero or its upper bound. In this case, Xj has to be replaced by Xj´ or vice versa. The corresponding column must be multiplied by (-1) to obtain the following simplex tableau, in addition to upgrading the values of the basic variables (bi) and of the objective function. The new values of the variables are X i DD i EE  min  D i > 0 base value Xi - upper bound Xi D i G  MIN D i < 0 Chapter 3. General methods of linear programming 97 (32) Xi1 = Xi - Uj Įi Xj = Uj  Xj´= 0 3. į When increasing the entering basic variable, one of the basic variables reaches its upper bound. For this reason, in the following table the complementary variable Xk´ will appear instead of Xk or vice versa and its column will be multiplied by (-1). The nonbasic variable which is increased, Xj substitutes the basic variable Xk. The new values of the variables are (33) Xk = Uj  Xk´= 0 X i1 = Xi - į Į i X j = į In this case, in order to obtain the new table of the basic solution, it is necessary to apply the formulae of the simplex method, except when calculating the new value of the entering basic variable (į) and change the variable, and therefore the sign of its corresponding column. Chart 3.2 outlines the steps of the simplex algorithm with upper bound constraints. Note that the only difference with the simplex method is in the rule for selecting the leaving basic variable. In the simplex method we choose the one which first reaches zero as the leaving basic variable, to avoid an infeasible solution due to a negative variable. In the upper bound technique we select the variable which first becomes infeasible, due to a negative value of the basic variable, exceeding the upper bound of the entering basic variable or the leaving basic variable. Operations research in business administration and management 98 CHART 3.2. UPPER BOUND TECHNIQUE (MAXIMIZATION) NO CHANGE OF BASE Xj=UjX'j=0 X'i=Xi-U j·D i 'Z=Uj(Cj-Zj) MULTIPLY x (-1) COLUMN X'j SIMPLEX ALGORITM CHART 3.1. OPTIMAL SOLUTION Xk=UjX'k=0 X'i=Xi-G·D i X j = G  D' ILj = D ILj / PIVOT (except b IL ) D'ij=Dij- SEMIPIVOT· D' ILj MULTIPLY x (-1) COLUMN X'k T j= G T j=U j T j= E THE LEAVING BASIC VARIABLE IL: TjMin (E,U j,G)  (Cj-Zj)>0 THE ENTERING BASIC VARIABLE JE: MAX (Cj-Zj) all j nonbasic var. (Cj-Zj)=Cj-6Dij-Ci(i basic var.) INITIAL FEASIBLE SOLUTION BS0 Chapter 3. General methods of linear programming 99 3.5.THEREVISEDSIMPLEXMETHOD,THEINTERIORPOINT ALGORITM AND THE OPTIMIZATION SOFTWARE If the simplex algorithm in its form of complete tableau is analyzed in detail, as we have described in sections 3.2 onwards, we will realize that in problems with many more variables than constraints, we are upgrading data at each iteration that are in fact useless. Concretely the only nonbasic variable of interest at each step is the entering basic variable. The revised simplex method maintains the same fundamental logic as the described simplex method and is nothing other than a simplified version that only calculates and stores the required data at each moment. It is therefore a more efficient implementation and the one which is in fact used by optimization software. The revised simplex method has also another important aspect in addition to the advantages of requiring less storage and often less calculation. The computer can have significant rounding problems after performing many iterations. This affects the values Cj-Zj and the ratio of the leaving basic variable. We could, therefore, pick a wrong variable to enter or leave the basis. We reduce these rounding errors to within reasonable limits by determining the inverse of the matrix forming the basis vectors in any iteration. Professional software typically inverts this matrix every few iterations and when the optimality test is met. Special procedures are used to store and update the matrix formed by the coefficients of the basic variables or its inverse, which take into account the dispersion of the matrices helping to correct errors, streamline inversions and reduce storage requirements. The importance of linear programming at the moment is due to the existence of an extraordinarily efficient algorithm: the simplex algorithm, developed by George Dantzig, and the availability of computers that can carry out the large amount of necessary calculations. The theoretical properties of the algorithms can be evaluated through the computational complexity and counterexamples have been created to demonstrate that the simplex algorithm is not polynomial, but rather it is an exponential algorithm. Although in practice the simplex performs very well, researchers have continued to look for polynomial algorithms to solve linear programming models. Narendra Karmarkar, from the ATT Company, published an article in 1984 in which he announced a new algorithm to solve large linear programming models that had the property of being polynomial. Firstly, he claimed that the algorithm could solve large models up to 50 times faster than the simplex method. As no details of the algorithm were given, for copyright reasons, it could not be verified if this claim was true. Later on, some details were made public and, meanwhile, other researchers have developed applications of the algorithm that, so far, have produced contradictory results. At the moment, it is not clear which of the two algorithms is more efficient, although it seems that in the future both will be complementary in linear programming. The biggest advantage of the interior-point algorithm is that the increase in the required computational time becomes greater at a smaller rate than the simplex when the size of the problem Operations research in business administration and management 100 increases. On the other hand, the high preparation time of Karmarkar’s method prevents it from becoming a strong competitor when dealing with relatively small models (dozens or hundreds of functional constraints). In addition, as we will see in the following chapter, the simplex method is excellent for carrying out the postoptimality analysis, while the interior-point algorithm does not enable one to carry out this analysis efficiently, although it obtains dual prices. In summary, in the future it is foreseen that the simplex will continue to be used as a standard linear programming method and Karmarkar’s or one of its versions for very large problems. As the interior-point algorithm converges on the best solution, it is possible that a feasible solution close to the optimal becomes an initial solution for the simplex algorithm, which would allow us to find the optimal solution and carry out the sensitivity analysis. Next we will demonstrate with an example the approach of the interior-point algorithm. The main concepts of the algorithm are the following. Concept 1: To obtain a feasible solution that leads to the optimal solution from the interior of the feasible region. Concept 2: To move in the direction that improves the value of the objective function as fast as possible. Concept 3: To transform the feasible region in order to place the current trial solution near the center thus allowing a large improvement when concept 2 is carried out. We will see the previous ideas with the following linear programming model and its graphical representation: Max Z = X1 + 2 X2 X1 + X2 d 8 X1 t 0 X2 t 0 The algorithm starts with an initial trial solution that should be in the interior of the feasible region as in all of the following. Thus, the initial solution should not be in any of the three straight lines that form the boundary of the feasible region (X1 + X2 = 8, X1 = 0, X2 = 0). (X1, X 2) = (2, 2) are randomly chosen as an initial trial solution. Next, we have to move in the direction that improves the value of the objective function as fast as possible. This direction is that of the gradient of the objective function and it is given by the vector of partial derivatives, that is (1, 2). Note that the components of this vector are the coefficients of the objective function, as this is a linear function. Chapter 3. General methods of linear programming 101 The algorithm begins with the linear programming model in the standard form Max Z = X1 + 2 X2 X1 + X2 + X3 = 8 X1 t 0 X2 t 0 X3 t 0 and the matrix Max Z = CT X A X = b X t 0 Figure 3.2 shows the feasible region of the problem, as well as the path that the trial solutions follow until finding the optimal solution (Hillier and Lieberman, 2010). In this example we have seen that the interior-point algorithm requires more iterations and more calculations than those performed by the simplex algorithm and in the end it only obtains an approximation to the optimal solution. However, we should take into consideration that this algorithm is designed for large problems with many thousands of functional constraints. In this case the simplex would carry out thousands of iterations, while Karmarkar’s algorithm would need a lot less, although with more work per iteration. Currently, the optimization software LINGO incorporates this method (Barrier Solver), in addition to the simplex algorithm. In this section we have seen that the linear programming software does not use the full tableau simplex method. The revised simplex method is used because of the lower storage and computation effort. Furthermore, the revised simplex method also allows the periodic avoidance of rounding errors accumulated over many iterations. The accuracy of the final solution depends on the tolerances of the program or is specified by the user. Errors are possible due to the way in which the computer manipulates and stores decimal numbers. Thus, small differences from zero, for example 10 -6, are considered equal to zero. These limits are called tolerances. The choice is not easy, as the small tolerances are difficult to meet and can promote errors. The large tolerances can treat many non-zero data as if they were zero. The accuracy of the solution can be improved by appropriately scaled input data. Whenever possible, very large and very small data in the same model should be avoided, because that increases the risk of accumulation of errors. The software may have options to scale the data of the problem and eliminate internal scaling before presenting the results. Operations research in business administration and management 102 Figure 3.2. Path of the interior-point algorithm 3.6. SUMMARY In this chapter we have studied general methods for solving any model that adapts to the structure of linear programming as defined in chapter 2. First, we have defined the basic concepts of the solution algorithm par excellence of Operations Research/Management Science, the simplex method. The feasible region of a linear programming model is a convex set and if it has a finite optimal solution, at least one optimal solution is a corner-point (feasible basic solution). The simplex method starts from a feasible basic solution and it moves to another adjacent feasible basic solution and improves the value of the objective function. When it cannot find a better adjacent basic solution, it means that it has found the optimal solution. The criteria used by the simplex method are choosing the most efficient for the entering basic variable and the first basic variable that reaches zero for the leaving basic variable. 2864 8 6 4 2 (2.08,4.92) (2.5,3.5) (2,2) 0X1 X2 (0,8) óptima Chapter 3. General methods of linear programming 103 When all of the constraints of the model have a smaller than or equal to sign (), the first feasible basic solution is found from the slack variables. If this is not the case, we can apply the artificial variable technique to obtain an initial solution and later use the two-phase method to find the optimal solution. In many models the variables are upper and lower bounded. By applying the simplex techniques with bounded variables we avoid having to increase the number of functional constraints of the problem. In the case of lower bounds, it is only required to make a change in the variable, while for variables with upper bounds it is also necessary modify the selection of the variable that leaves the basis at each iteration. The increase in efficiency is so considerable that the optimization software recommends identifying the bound constraints as this special type for as many variables as possible. We have also commented on the most efficient way of implementing the simplex, the revised simplex, which is nothing other than a version of the simplex in which only the necessary data are calculated and stored at each iteration. In addition, this method allows the reduction of rounding errors. Lastly, the basic concepts of the latest developments regarding linear programming solving techniques have been described, in particular the interior-point algorithm. This starts from a point in the interior of the feasible region and it shifts in the direction in which the objective function is improved the quickest way, while maintaining feasibility. This process converges to the optimal solution. It is predicted that it will be used in combination with the simplex for large models with many thousands of functional constraints. Currently, the optimization software LINGO incorporates it (Barrier Solver). 3.7. SELECTED REFERENCES 1. Daellenbach, H.G.; George, J.A. and McNickle, D.C. (1987): Introducción a las técnicas de Investigación de Operaciones. CECSA. 2. Hillier, F.S. and Lieberman G.J. (2010): Introduction to Operations Research. Ninth Edition. McGraw-Hill. 3. Hillier, F.S and Hillier, M.S. (2011): Introduction to Management Science. A Modelling and Case Studies Approach with Spreadsheets. Fourth Edition. McGraw- Hill. 4. LINDO Systems (2011): LINGO. The modeling language and optimizer. 5. Winston, W. L. and S.C. Albright (2012): Practical Management Science. Fourth Edition. South-Western. USA. Operations research in business administration and management 104 3.8. CASE STUDIES CASE STUDY 1 Solve the production planning model of section 3.4.1 without considering the constraints of minimum demand, and applying the simplex algorithm. Then answer the following questions from the final simplex tableau. 1. Indicate the optimal solution. 2. Are all resources completely used? If there are idle resources, indicate which ones and in what quantity. 3. The company is considering redistributing the resources between different departments. Analyze the convenience of the following alternatives and if you consider that there is a better one, indicate it. Explain your reasoning. a) Transfer 25 h/week from department 4 and 5 h/week from department 5 to department 3. b) Transfer 25 h/week from department 4 and 5 h/week from department 5 to department 1. c) Reduce the hours in departments 2 and 5. 4. Indicate the reduced costs of the variables and dual price of the constraints, and analyze the relationship of these with the slack variables. CASE STUDY 2 Given the following linear programming model Max Z = 24 X1 + 20 X2 0.5 X1 + X2 d 12 1.5 X1 + X2 d 24 0 d X1 d 15 0 d X2 d 10 1. Obtain the optimal solution by means of the graphic method. 2. Obtain the optimal solution by means of the simplex algorithm. 3. Find the optimal solution by applying the upper bound technique. CHAPTER 4 DUALITY AND SENSITIVITY ANALYSIS 4.1. THE DUAL PROBLEM AND PRIMAL-DUAL RELATIONSHIPS. 113 4.1.1. THE PRIMAL PROBLEM AND THE DUAL PROBLEM ......................... 113 4.1.2. PRIMAL-DUAL RELATIONSHIPS .......................................................... 114 4.2. DUAL SIMPLEX ALGORITHM ............................................................... 116 4.3.SENSITIVITYANALYSISOFTHECOEFFICIENTS 2)7+(OBJECTIVE FUNCTION ........................................................... 119 4.3.1. MODIFICATION OF A CJ CORRESPONDING TO A NONBASIC VARIABLE .................................................................................................. 120 4.3.2. MODIFICATION OF A CJ CORRESPONDING TO A BASIC VARIABLE ................................................................................................. 121 4.3.3. SIMULTANEOUS MODIFICATIONS OF SEVERAL COEFFICIENTS... 121 4.4. SENSITIVITY ANALYSIS OF THE RIGHT-HAND SIDE OF THE CONSTRAINTS ............................................................................................... 123 4.5. PARAMETRIC LINEAR PROGRAMMING .......................................... 126 4.6. SUMMARY ...................................................................................................... 128 4.7. SELECTED REFERENCES ........................................................................ 128 4.8. CASE STUDIES .............................................................................................. 129 Chapter 4. Duality and sensitivity analysis 113 One hypothesis in linear programming is the certainty with respect to model parameters. In practice, model parameters are usually estimates. Therefore, when we have found the optimal solution for a problem, we have to analyze the effects of modifying the coefficients on the problem solution. For example, prices change with time and we may have used average prices in the model. In such a case, it would be necessary to evaluate whether the optimal solution would change if the price changed within the estimated limits. Fortunately, in linear programming it is very easy to carry out this study from optimal simplex tableaux. This chapter focuses on how to carry out and interpret a sensitivity analysis. However, before studying sensitivity analysis we will introduce the concept of duality and the dual algorithm, which have important applications in economics. Finally, we will study parametric linear programming, since on many occasions the chosen values of some coefficients are only managing decisions. In this case, it is convenient to analyze the response of the problem solution to these decisions. 4.1. THE DUAL PROBLEM AND PRIMAL-DUAL RELATIONSHIPS The problem of determining the opportunity cost of resources is also a linear programming model, which is actually the dual problem of the original problem. Duality is not only an interesting theoretical relationship. Let's describe it, as it is the basis of the concept of opportunity cost, of the dual simplex algorithm and of sensitivity analysis. Every linear programming problem has another linear programming problem associated with it, and between them there are very special relationships. Each is the dual of the other. We shall illustrate it using the problem of production planning presented in section 3.4.1 of chapter 3, without regarding the demand constraints, i.e. the lower bound constraints of the variables. 4.1.1. THE PRIMAL PROBLEM AND THE DUAL PROBLEM x Each problem constraint is associated with one variable of the other problem and vice versa. x The technical coefficients of each problem constraint are the same as the technical coefficients of the corresponding variable in the other problem. x The constraint's right-hand sides are the objective function coefficients of the corresponding variables in the other problem and vice versa. x If we minimize in one problem with t constraints and nonnegative variables, then in the other problem we maximize with constraints  and nonnegative variables. Operations research in business administration and management 114 The dual problem associated with the production planning problem is shown in Table 4.1. In this Table we see that the original problem is referred to as the primal problem. Note that the dual problem has 5 variables, one for each constraint of the primal problem. It also has 3 constraints, one for each variable of the original problem, however, the objective function of the primal is to maximize and the corresponding objective function of the dual is to minimize. Note that the signs of the constraints are different in both problems and that the technical coefficients aij of a constraint in one problem are the associated variable in the other. Table 4.1. The primal problem and the dual problem ORIGINAL PROBLEM Resource allocation Primal Problem NEW PROBLEM Resource price allocation Dual Problem A, B, C t t 0 Max 20 A + 18 B + 21 C 0.20 A + 0.10 B + 0.30 C d 160 0.50 A + 0.07 C d 80 0.10 A + 0.30 B + 0.10 C d 80 0.02 A + 0.02 B + 0.02 C d 40 0.05 A + 0.06 B + 0.05 C d 40 W1, W2, W3, W4 ,W5 t 0 Min 160 W1 + 80 W2 + 80 W3 + 40 W4 + 40 W5 0.20 W1 + 0.50 W2 + 0.10 W3 + 0.02 W4 + 0.05 W5 t 20 0.10 W1 +0.30 W3 + 0.02 W4 + 0.06 W5 t 18 0.30 W1 + 0.07 W2 + 0.10 W3 + 0.02 W4 + 0.05 W5 t 21 4.1.2. PRIMAL-DUAL RELATIONSHIPS The general relationships between the structures of the primal and dual problems are summarized in Table 4.2. There are also relationships between the solutions of both problems, as indicated below. x If both the primal and dual problems have feasible solutions, then both have finite optimal solutions and the optimal Z values are equal. x Complementary slackness theorem: If one constraint of either of the two problems has slack in any optimal solution of that problem, then in the other problem the variable associated with that constraint is zero for any optimal solution. If one variable of either of the two problems is not zero, then in the other problem the associated constraint is strictly fulfilled. This theorem indicates that a resource which is not used completely has a dual price of zero and a resource with a dual price different from zero is scarce. Chapter 4. Duality and sensitivity analysis 115 Table 4.2. Relationships between primal and dual problems PRIMAL PROBLEM DUAL PROBLEM ܯܽݔ݅݉݅ݖ݁ܼൌ෍ܿ ௝ ݔ ௝ ௡ ௝ୀଵ ܯ݅݊݅݉݅ݖ݁ܼൌ෍ܾ ௜ ݓ ௜ ௠ ௜ୀଵ Coefficients of Objective Function RHS Coefficients Coefficients Row i Coefficients Colum j Constraint  σܽଵ௝ݔ௝ ௡ ௝ୀଵ ൑ܾଵ Nonnegative Variable w1 t 0 Constraint  σܽଶ௝ݔ௝ ௡ ௝ୀଵ ൒ܾଶ No positive Variable w2  0 Constraint = σܽଷ௝ݔ௝ ௡ ௝ୀଵ ൌܾଷ Free Variable -  w3   Free Variable -  x1   Constraint = σܽ௜ଵݓ௜ ௠ ௜ୀଵ ൌܿଵ No positive Variable x2  0 Constraint  σܽ௜ଶݓ௜ ௠ ௜ୀଵ ൑ܿଶ Nonnegative Variable x3 t 0 Constraint  σܽ௜ଷݓ௜ ௠ ௜ୀଵ ൒ܿଷ Operations research in business administration and management 116 4.2. DUAL SIMPLEX ALGORITHM The simplex algorithm starts from a basic feasible solution in which every Xj t 0. It approximates the optimal solution maintaining feasibility at each iteration. When all (Cj- Zj) d 0 an optimal solution for maximizing is found ((Cj-Zj) t 0 for minimizing). Sometimes we have initial solutions that are infeasible in the primal and feasible in the dual. That is, we have some Xj d 0, but all (Cj-Zj) d 0 for maximizing ((Cj-Zj) t 0 for minimizing). The dual simplex algorithm leads to primal feasibility, maintaining dual feasibility ((Cj-Zj) d 0). It is important to emphasize the fact that the dual simplex algorithm is a method used to solve any kind of problem, regardless of whether it is primal or dual, although we have explained the algorithm using the dual problem of the production planning model. The only requirement is to have a infeasible primal and a feasible dual solution. Let's consider the dual problem of the production planning model, which is the following: Min 160 w1 + 80 w2 + 80 w3 + 40 w4 + 40 w5 0.20 w1 + 0.50 w2 +0.10 w3 + 0.02 w4 + 0.05 w5 t 20 0.10 w1 + 0.30 w3 + 0.02 w4 + 0.06 w5 t 18 0.30 w1 + 0.07 w2 +0.10 w3 + 0.02 w4 + 0.05 w5 t 21 w1, w2, w3, w4, w5 t 0 We denominate w6, w7 and w8 to the slack variables of the three constraints. Table 4.3, corresponding to the first simplex tableau, shows that the slack variables do not form the unity matrix. By multiplying the three constraints by (-1) we obtain that matrix, but the initial solution is infeasible, because on setting to zero, w1=w2=w3=w4=w5=0, the slack variables take negative values. We know that in this type of situation we can apply the artificial variable technique. However, in this case we are going to apply the dual simplex algorithm, which results from applying the criteria of the primal algorithm to the dual problem. CRITERION OF THE SIMPLEX DUAL ALGORITHM 1: LEAVING BASIC VARIABLE The leaving basic variable Xi is the basic variable with the most negative value OPTIMALITY CRITERION The solution associated with a basic variable is optimal if every Xi t t 0 Chapter 4. Duality and sensitivity analysis 117 CRITERION OF DUAL SIMPLEX ALGORITHM 2: ENTERING BASIC VARIABLE The entering basic variable is the variable with the lowest quotient (Cj-Zj)/ -Į-j if we minimize and the highest quotient if we maximize. Minimization: Min (Cj-Zj)/ -Į-j Maximization: Max (Cj-Zj)/ -Į-j As opposed to the simplex algorithm, first we have to select the leaving basic variable (the most negative) and then the entering basic variable, i.e. the variable capable of increasing the value of the basic variable in the most efficient way. In the illustrating example, w8 leaves and w1 enters because w1 is the variable that involves the lowest increase in the objective function per unit increase in w8. When comparing Table 4.3 with the first simplex tableau of the primal problem (case study 1 in chapter 3), we can see that the column of the entering basic variable corresponds to the row of the leaving basic variable. In the same way, the row of the leaving basic variable in the first iteration of the primal problem solution now corresponds to the column of the entering basic variable. The pivot element is the same, with its sign changed. Table 4.4 and following are obtained applying the same basic change procedures as in the simplex algorithm, given by equations (17) in chapter 3. Table 4.3. Dual algorithm: initial simplex tableau BASIC V. W1 W2 W3 W4 W5 W6 W7 W8 bi W6 -0.2 0 -0.5 0 -0.1 0 - 0.02 - 0.05 1 0 0 -20 W7 -0.1 0 0 ,00 -0.3 0 - 0.02 - 0.06 0 1 0 -18 W8 -0.3 0 - 0.07 -0.1 0 - 0.02 - 0.05 0 0 1 -21 Cj-Zj 160 80 80 40 40 0 0 0 0 Cj-Zj/-Į-ij 160/0.30 = 533.33 80/0.07 = 1142.8 80/0.1 = 800 40/0.02 = 2000 40/0.05 = 800 Table 4.4. Dual algorithm: second simplex tableau BASIC V. W1 W2 W3 W4 W5 W6 W7 W8 bi W6 0 - 0.45 - 0.034 - 0.01 - 0.02 1 0 - 0.66 - 6.14 W7 0 0.02 - 0.27 - 0.01 - 0.04 0 1 - 0.33 - 11.07 W1 1 0.23 0.33 0.07 0.17 0 0 - 3.33 69.93 Cj-Zj 0 42.66 26.67 29.33 13.33 0 0 533.33 -11200 Cj-Zj/- Į-ij 26. 67 /0.27 = 98.77 29.3/0.01 = 2933 13.3/0.04 = 333.25 533.3/0.3 = 1616.5 Operations research in business administration and management 118 Table 4.5. Dual algorithm: third simplex tableau BASIC V. W1 W2 W3 W4 W5 W6 W7 W8 bi W6 0 - 0.45 0 - 0.01 - 0.02 1 - 0.12 - 0.62 - 4.81 W3 0 - 0.07 1 0.04 0.15 0 - 3.70 1.22 40.96 W1 1 0.25 0 0.06 0.12 0 1.22 - 3.73 56.42 Cj-Zj 0 44.63 0 28.34 9.38 0 98.77 500.73 -12293.38 Cj-Zj/- Į- ij 99.17 2834 469 823.08 807.63 Table 4.6. Dual algorithm: optimal simplex tableau BASIC V. W1 W2 W3 W4 W5 W6 W7 W8 bi W2 0 1 0 0.02 0.04 - 2.22 0.27 1.37 10.58 W3 0 0 1 0.04 0.15 - 0.15 - 3.68 1.3 41.68 W1 1 0 0 0.05 0.11 0.55 1.15 - 3.94 53.77 Cj-Zj 0 0 0 27.42 7.39 99.17 86.80 439.14 -12770 .38 If the tables obtained are compared with the tables that result from applying the primal simplex algorithm to the original problem, it can be noted that the dual algorithm comes from applying the simplex criteria to the dual problem. However, we must take into account that the dual algorithm serves to solve either of the two problems, as long as the initial solution is infeasible primal and feasible dual. We know that we can also use the two-phase method for infeasible initial solutions, but in this case it is not necessary for it to be feasible dual. If we analyze the tables of the optimal solution, both for the primal problem and the dual problem, we verify that the opportunity costs of the resources in the production planning problem are given by the dual variables. We can also see that only the completely consumed resources, i.e. the scarce resources have a non-zero opportunity cost in the optimal solution. When analyzing the structure of both linear programming models, we can see that in the primal problem we determine the utilization of resources to know what and how much to produce in order to maximize the company's benefits. That is, we can approach the problem from the point of view of business production or returns. On the other hand, the dual problem considers the distribution or sharing of that income. Therefore, the dual Chapter 4. Duality and sensitivity analysis 119 objective function consists of minimizing the value of the resources used by the company. The constraints make the value of the resources employed in manufacturing one product unit exceed or equal the product unit margin. Does this mean that the evaluation of the resources obtained by the dual program forces the company's benefit to be zero or negative? No, not at all. The complementary slackness theorem allows us to know that if one of the constraints takes a value higher than the second member, then the associated product would not occur. Therefore, if it costs more for a company to manufacture a product than the benefits obtained from it, the company will not be interested in manufacturing that product. Dual variables can be interpreted as a mechanism that allows us to assign the gross margins of the products in the different resources. Verify that the unitary benefit of A can be attributed as 54 % to department 1, 25.6 % to department 2 and 20.4 % to department 3. In nonlinear programming, a similar result is obtained with the economic interpretation of Kuhn-Tucker conditions. Finally, we have to take into account that dual variables do not always present a simple interpretation. Their interpretation will depend on the problem under analysis. 4.3.SENSITIVITYANALYSISOFTHECOEFFICIENTSOFTHE OBJECTIVE FUNCTION The sensitivity analysis of the coefficients of the objective function consists of analyzing the effects of the changes in parameters Cj on the optimal solution. In chapter 2 we studied this effect graphically with the problem of energy generation in a thermal power plant. Remember that changes in one of these coefficients causes changes in the isoproduction slope. If the modification is large enough, the optimal solution may be another corner point of the feasible region (Figure 2.4). Therefore, changes in the Cj parameters may affect the optimality of the present solution, yet not affect its feasibility. How will a change in a Cj parameter affect the optimal simplex tableau? Only (Cj-Zj) will change. Chapter 2 presents the optimal solution and sensitivity analysis for the energy production model. The results indicate the range of values within which a coefficient of the objective function can be changed without changing the basis. The analysis is made by changing one coefficient each time, and maintaining all other coefficients constant. Let's see how these ranges are determined with the simplified example of energy production, i.e. using only the smoke and pulverizer constraints, as we did in chapter 3 to explain the simplex algorithm. Figure 4.1 represents the feasible region and the optimal solution of this problem. It is necessary to emphasize that the optimal solution is the same, but the feasible region is now the polygon OABC. This feasible region is different from that of the original problem because two constraints have been eliminated. Operations research in business administration and management 120 As we have already mentioned, when changing a Cj the only elements that are affected in the optimal simplex tableau are the values of the Cj-Zj. In order to determine the interval of Cj we have to take into account whether the parameter corresponds to a basic or nonbasic variable. Figure 4.1. Feasible region and optimal solution for the simplified problem of energy production 4.3.1. MODIFICATION OF A Cj CORRESPONDING TO A NONBASIC VARIABLE Let's see what happens if we modify C3 in Table 3.3. No Zj would change, since this variable is non basic. The only element affected will be its own Cj-Zj, i.e. C3-Z3, due to the modification of C3. Therefore, C3 can be modified without changes in the optimal solution, as long as C3-Z3 d 0. As Z3=6, then C3 d 6. Thus, the range required is - f d C3 d 6. X2 5 1015202530 5 10 15 20 25 30 X1 0 PULVERIZER SMOKE A B C D OPTIMAL SOLUTION: B X1=12 X2=6 Z=408 Chapter 4. Duality and sensitivity analysis 127 Figure 4.2. Parametric Programming of b1: change in the objective function and activity levels of the variables 8 480 384 30 24 2010 Z b1 8 24 16 30 24 2010 Z b1 X2 X1 X1, X2 Operations research in business administration and management 128 The results of the parameterization are shown in Figure 4.2. Both graphs display the three segments for the independent term of the smoke constraint. The only element which remains constant in each of them is the opportunity cost, as the objective function changes linearly, as does the activity level of the variables. Observe carefully the evolution of the objective function. This linear form by segments and concave is characteristic of parametric programming and highlights the law of decreasing marginal profits of the resources. 4.6. SUMMARY We have seen that duality is the theoretical basis of the opportunity cost and of other important techniques in Operations Research, such as the dual simplex algorithm and sensitivity analysis. It allows us to evaluate which modifications the parameters of the model can experience without affecting the optimal solution. The optimal simplex tableau allows us to calculate, with little computational cost, the range of values of the coefficients of the objective function that can be changed individually without changing the optimal activity levels of the variables. We have only to take into account that the Cj-Zj must remain negative (maximization). Similarly, the ranges for the second members of the constraints are determined subject to the condition that the variables be nonnegative. When the changes cause non feasibility, the dual algorithm allows us to determine the optimal solution in an efficient manner. Finally, we have seen that parametric analysis is just a generalization of sensitivity analysis that determines how the optimal solution evolves when the parameters of the model vary over a wide range. The dual simplex algorithm is a basic tool for this kind of analysis. 4.7. SELECTED REFERENCES 1. Daellenbach, H.G.; George,J.A. and McNickle,D.C. (1987): Introducción a las técnicas de Investigación de Operaciones. CECSA. 2. Hillier, F.S. and Lieberman G.J. (2010): Introduction to Operations Research. Ninth Edition. McGraw-Hill. 3. Hillier, F.S and Hillier, M.S. (2011): Introduction to Management Science. A Modelling and Case Studies Approach with Spreadsheets. Fourth Edition. McGraw- Hill. 4. Winston, W. L. and S.C. Albright (2012): Practical Management Science. Fourth Edition. South-Western. USA. Chapter 4. Duality and sensitivity analysis 129 4.8. CASE STUDIES CASE STUDY 1: DUAL PROGRAM AND DUAL ALGORITHM 1. Develop the dual program associated with the following primal program. Max 3 X1 + 4 X2 + X3 X1 + 3 X2 + 2 X3 t 10 6 X1 + 2 X2 + X3 d 30 X1 + X2 + X3 = 5 X1, X2, X3 t 0 2. Solve the primal problem of the previous section through the dual simplex algorithm. 3. Obtain the optimal solution of the dual program from the results obtained in point 2. CASE STUDY 2: SENSIBILITY ANALYSIS 1. Determine the variation interval for coefficients C2 and C5 in the energy generation problem presented in chapter 2. 2. In the production planning problem solved in case study 1 in chapter 3 the benefits per unit of the three products have been revised. The new values are CA = 40, CB = 30 and CC =12. Is the current solution still optimal? If not, determine the new optimal solution from the optimal simplex tableau. 3. Determine the ranges over which b1 and b3 can change individually in the energy generation problem presented in chapter 2. Compare the result obtained for b1 with the result obtained in section 4.4 and explain why they are different. 4. Determine the ranges over which the bi of the following linear program can change individually (chapter 3-case study 2): Min Z = 0.4 X1 + 0.5 X2 X1, X2 t 0 0.3 X1 + 0.1 X2 d 2.7 0.5 X1 + 0.5 X2 = 6 0.6 X1 + 0.4 X2 t 6 Operations research in business administration and management 130 CASE STUDY 3: SENSIBILITY ANALYSIS From the corresponding simplex table to the optimal solution of the model results of the case study 5 of Chapter 3, answer the following questions. 1. Indicate the optimal solution, the opportunity cost of resources and the variables reduced cost and their meaning. 2. By how much can the unitary profit of X2 vary without changing the optimal solution? Does the total profit vary? What does the sensitivity analysis of the objective function coefficients tell us? 3. By how much can the second member of the R1 constraint vary without changing the base? What changes and what remains constant while varying b1? Why is the sensitivity analysis of the secondary members of the constraints important when making decisions on production problems? CASE STUDY 4: FEED MANUFACTURING AND DISTRIBUTION A multinational feed manufacturing and distribution company has 9 factories in the country. The factory located in Valencia produces183 formulas for 8 different species of animals. Every day, 43 trucks leave the factory to distribute 783,000 Kg. of feed. There are two types of feed: feed flour and feed granule. Feed is also sold in two different ways: in bulk or in sacks. The distribution of the different types of feed is shown in Table 4.13. Of the quantity produced, two of the most important formulas represent a third of the total and the first six imply 55% of the total production. On the factory’s premises an average of 30 T of feed in sacks and all of the feed in bulk is sold directly to clients. The factory has 647 clients and it receives an average of 80 orders per day, of which 6 are filled directly on site and 74 are sent by truck. At the moment, the nearest farm to which feed is distributed is located 15 Km from the factory and the most distant is 340 Km. 35% of the trucks delivering in bulk serve only one client, while this percentage is 7% for the trucks that deliver feed in sacks. The average number of deliveries for trucks which distribute to more than one client is 2-3. For the trucks that distribute sacks, the average is 4-5. The average delivery time of orders is 1.25 days, measured as the difference between the date on which the order is received and the real date of delivery. The person in charge of logistics takes 6 hours each day to prepare the routes for the following day, including checking stocks, availability of trucks, etc. Chapter 4. Duality and sensitivity analysis 131 Table 4.13. Type of products and quantities sent from the factory TYPE NUMBER OF PRODUCTS IN the CATALOG AMOUNT SENT DAILY (Kg) N UMBER OF DAILY TRUCKS Bulk Flour feed 1 2,000 Bulk Granule feed 98 600,000 32 Flour in sacks 6 1,000 Granule in sacks 78 180,000 11 Currently, production is scheduled according to an established production plan, taking pending orders into account. 60% of the daily production is immediately loaded onto the trucks. There are three working shifts in the factory: from 6-14, from 14-22 and from 22-6. Production capacity is 37,000 Kg/hour and packaging 375 sacks/hour. The factory has 12 of 36,000Kg capacity containers and 17 of 17,000Kg capacity containers for bulk storage. The storage capacity for sacks is 4 cells of 32,000 Kg capacity. The real amount of stock available is checked twice a day. Tables 4.14 and 4.15 show the information related to the technical characteristics of the raw materials, cost, as well as the nutrition needs of each type of feed according to the species and the age of the animal. Outline a linear programming model that allows to determine the formulation and cost of 100 T of feed for lambs P1 and 100 T of feed for lambs P3. 1. Do you consider that the optimal formulation that you can obtain with optimization software could be composed of 20 raw materials? Explain your answer. 2. Solve the previous problem and indicate the optimal composition and the cost of feeds P1 and P3. 3. Barley is not part of any of the two previous formulations. Do you believe that it would be part of one of them if its price were 25 m.u./Kg? And if its price were 22.5? What would happen if the prices of barley and wheat decreased by 1 m.u./Kg? First, answer without solving the model again and then check if your answer is correct. 4. Analyze the sensitivity of the optimal to the prices of the remaining raw materials and the utility of this information to the company. Operations research in business administration and management 132 5. If the price of corn were increased by 0.2 m.u./Kg. and that of soy decreased by 0.5 m.u./Kg., would the optimal formulation and the cost of feed P1 change? What about if soy were decreased by 1 m.u./Kg? Why? Check what changes and how different it is from the initial solution. 6. What would be the effect if feed P1 had a minimum level of gross protein of 18.5 and of 1.10 of calcium? Answer applying the 100% rule. 7. Calculate the optimal formulation of minimum cost that takes into consideration that feed P3 cannot have more than 40% corn, 10% gluten and 5% sunflower. 8. This type of company usually has to face limited stocks of raw materials. Determine the cost and the formulations of P1 and P3 from the previous section in the following cases: 8.1. There is only a stock of corn of 50 T. 8.2. The price of the 50 T of corn in stock is 26.2 m.u./Kg and the company can buy in the market as much corn as they wish at 27 m.u./Kg. 8.3. The company has 50 tons of corn in stock that it has to consume. The company can also acquire all the corn they want at 24 m.u. /Kg. Evaluate in each section the consequences there could be for the company to solve the problem by means of simple formulation instead of using a multiformulation model, supposing that half of the production were P1 and the other half P3. 9. Obtain the formulation and the cost of P1 and P3 in such a way that if tapioca, gluten and molasses are part of any of the feed they have a minimum level of 10%. Use the semi-variable option of LINGO. How would you solve it with Solver Excel spreadsheet? Integer variables are needed to incorporate such a situation to a model. Chapter 4. Duality and sensitivity analysis 133 Table 4.14. Nutritional limits of feed for lambs CHARACTERISTICS P 1 P 2 P 3 P 4 P 5 P 6 P 7 P8 U.F.V/Kg Min 1.07 1.02 1.00 1.02 1.02 1.04 0.78 0.98 GROSS PROT. % Min 18.0 17.6 17.2 17.6 17.6 18.0 14.0 16.5 GROSS PROT. % Max 19.0 18.6 18.2 18.6 18.6 19.0 15.0 17.5 GROSS FIBR. % Min - - - - - 14.0 - GROSS FIBR. % Max 4.40 4.30 4.40 4.4 4.5 15.0 - FAT MAT % Min - - - - - - - - FAT MAT % Max 5.30 4.40 4.30 4.40 4.4 4.50 - - STARCH % Min - 35.0 35.0 35.0 35.0 35.0 - 30.0 CALCI UM % Min 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 CALCI UM % Max 1.30 1.10 1.10 1.10 1.10 1.10 1.10 1.10 PHOSPHORUS T.% Min 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 PHOSPHORUS T.% Max 0.44 0.35 0.35 0.35 0.35 0.35 0.35 0.35 M.N.D. % Min - - - - - - - - P.D.I.E . % Min 13.0 12.1 11.9 12.1 12.1 12.3 - 11.2 P.D.I.N. % Min 13.0 12.1 11.9 12.1 12.1 12.3 - 11.2 - 10 Operations research in business administration and management  5BCMF$IBSBDUFSJTUJDTPGUIFSBXNBUFSJBMTDPTUBOEOVUSJFOUT Chapter 4. Duality and sensitivity analysis 1 5BCMF$IBSBDUFSJTUJDTPGUIFSBXNBUFSJBMTDPTUBOEOVUSJFOUTDPOUJOVBUJPO Chapter 5. Integer programming 143 5.3.1. CAPITAL BUDGETING DECISIONS An automobile manufacturing company wants to calculate the optimal distribution of its capital budget for the next years. The future investments that it is considering are the following: a) Renovating its current factory in order to increase its production capacity by 10,000 units per year. b) Constructing a new factory, with a production capacity of 15,000 units per year. c) Putting into practice the results that have been obtained from a survey on workers' motivation at work, which will increase the production by 5,000 units per year. d) Purchasing more productive and technologically more advanced equipment, with which an increase of production of 2,000 units per year will be achieved. Investments a and b are mutually exclusive, and investment d is conditional on the realization of investment a. The company seeks to increase its installed productive capacity, but considers that, due to the maximum sales forecasts, it should not exceed an increase of 16,000 units per year. The Net Present Value (NPV) of the investments, as well as the expenditure and the financial availability are those shown in table 5.2. Table 5.2. Investment data Inve stment NPV Cash-flow Year 1 Year 2 I1 50 60 70 I2 80 100 70 I3 40 30 40 I4 30 20 50 The problem consists of finding out which investments should be carried out in order to optimize their net present value, knowing that the financial availabilities for the first and second period are 150 and 120 m.u. respectively. The integer programming model to solve this problem is the following: Variables We define four binary variables Xj = (0, 1) for j = 1, 2, 3, 4 that will take the value 1 when the investment j is carried out and 0 otherwise. Operations research in business administration and management 144 Objective function The objective is to maximize the Net Present Value of all investments. Max 50 X1 + 80 X2 + 40 X3 + 30 X4 Constraints The expenditure during the first and second year cannot exceed the availability: 60 X1 + 100 X2 + 30 X3 + 20 X4 d 150 70 X1 + 70 X2 + 40 X3 + 50 X4 d 120 Investments a and b are mutually exclusive alternatives: X1 + X2 d 1 Investment d is conditional on the realization of investment a, that is, d can only be carried out if a has been done. These variables are known as contingent decisions, which are decisions that depend upon previous decisions. X4 d X1 The increase of the productive capacity should not exceed the maximum sales forecast: 10000 X1 + 15000 X2 + 5000 X3 + 2000 X4 d 16000 5.3.2. SETUP COST PROBLEM A company can manufacture four products on a production line that goes through three different departments. Table 5.3 shows the manpower/hour needed in each departments per one thousand product units, as well as the availability of hours per month, the gross profit (sale price - variable cost) and the fixed cost of conditioning the production line for each product, i.e. setup costs. The company wants to program the production to maximize the benefits. The linear programming approach does not work when we have setup costs. In linear programming all costs are considered to be variable costs, that is, proportional to the value of the variable, while in this case there is a fixed cost only when the variable value is positive, but zero when the variable value is also zero. It should be emphasized that the setup cost problem only arises when the fixed cost is charged if there is production and is not charged if the production level is zero. When the fixed cost is always charged, the continuous linear programming is valid. Why? Chapter 5. Integer programming 145 Table 5.3. Technical and economical data Product Manpower-hour needed per one thousand units of product Gross profit €/unit Setup Cost € Dep 1 Dep 2 Dep 3 P1 160 120 50 80 200,000 P2 150 200 50 85 200,000 P3 100 180 50 98 90,000 P4 200 175 50 100 150,000 Availability of manpower-hour s/ month 4, 000 4, 800 1, 600 Let´s see the formulation of an appropriate mixed integer programming model to solve the previous problem. We define the variables P1, P2, P3 and P4 to be the size of each production batch in thousands of units. Pj t 0 for j = 1, 2, 3, 4 The profit of producing P1 is B1 = 80,000 P1 - 200,000 for P1 > 0 and B1 =0 for P1 = 0 The profits of the other three products present a similar structure. To represent this by means of a linear function we define some binary variables Yj which have a value of 1 when Pj > 0 and zero when Pj = 0. The objective function is as follows: MAX 80,000 P1 + 85,000 P2 + 98,000 P3 + 100,000 P4 - 200,000 Y1 - 200,000 Y2 - 90,000 Y3 - 150,000 Y4 The constraints will refer to availability of man-hours in the three departments and they will have to guarantee that the setup cost is charged when there is production. Dep1: 160 P1 + 150 P2 + 100 P3 + 200 P4 d 4,000 Dep2: 120 P1 + 200 P2 + 180 P3 + 175 P4 d 4,800 Dep3: 50 P1 + 50 P2 + 50 P3 + 50 P4 d 1,600 Operations research in business administration and management 146 P1 d 100 Y1 P2 d 100 Y2 P3 d 100 Y3 P4 d 100 Y4 The last four constraints ensure that the setup cost is considered whenever the corresponding level of production is positive. The coefficient of the binary variables has to be a number large enough not to limit the level of activity of the Pj, in this case 100 is big enough to not limit the production values. 5.3.3. SITE SELECTION OF INDUSTRIES AND SERVICES Another important application of mixed integer programming is found in problems where the objective is to determine the location and optimal size of a series of factories that produce high consumption goods. The demand and their clients' location are known. The model for a product and one period could be the following: Coefficients b1, b2..., bn: known demands for n clients (j=1, 2 …n) a1, a2..., am: production capacities to install in m factories (i=1, 2 …m) f1, f2..., fm: construction cost of the factories (i=1, 2 …m) Cij: transport cost of a unit of goods from the i-th factory to the j-th client Variables Xij: Number of transported units from factory i to client j yi: Binary variables, 1 indicates that the factory i is built and 0 otherwise for i = 1,2,...,m Objective Function The objective consists of minimizing the total cost (fixed cost of construction of the factories plus the distribution variable costs) satisfying the demand.  ij n j iji m i i XCyfMIN ¦¦  11 Chapter 5. Integer programming 147 Constraints Clients demand j m i ij bX t ¦ 1 j=1, 2… n Production capacity of the factories ii n j ij yaX d ¦ 1 i=1, 2…m This type of model has been applied to problems such as location of milk pasteurization centers, slaughterhouses, feed warehouses, waste treatment plants, etc... 5.3.4. A DISTRIBUTION PROBLEM WITH NONLINEAR COSTS In this section we present a real problem of decision-making and mixed integer programming model that reduces the distribution costs of the company (Maroto, C.; Aliaga, S. and A. Torres, 2000). The operation process of the company is represented in Figure 5.3. The company manages the broiler production process providing farmers with one-day-old chickens, feed and other resources such as technical and sanitary assistance. It is also responsible for collecting and marketing the fattened chicken. Broiler farmers provide the labor and equipped warehouses, and they are paid on the basis of average costs of breeding and production results. Given the economic importance of feed costs, the company is thinking of reducing transport costs from the factory to the farms. The distribution of shipments was carried out with subjective criteria and manually. Therefore, the company was also interested in planning shipments of feed by objective criteria, minimizing costs. The company is responsible for estimating the feed required by each farm and placing orders to the feed factory. This offers prices with a cost structure shown in Table 5.4. As shown in the table, transport prices depend both on the weight of the order and the distance from the factory to the farm. Thus, the company is facing a nonlinear transportation cost structure. The previous method used by the company was to assess the needs for each type of feed on each farm and place as many large orders as possible and the difference with another order. The company is aware that these remaining orders increase the total cost. Operations research in business administration and management 148 Figure 5.3. Operation process of the company Table 5.4. Feed transport costs structure Distance Km 20-24 Tons €/Tons 16 -19.9 Tons €/Tons 12-15.9 Tons €/Tons 8-11.9 Tons €/Tons 4-7.9 Tons €/Tons 0-10 1.94 1.95 1.99 2.36 3.25 10.1- 15 2.20 2.28 2.36 2.74 3.67 … 100.1- 105 6.94 8.17 9.02 9.30 11.06 … 340.1- 345 19.57 23.87 26.80 27.07 30.68 345.1- 350 18.83 24.19 27.17 27.44 31.10 To solve this problem we proposed the following integer programming model. There are many models, at least one for each farm and each batch of broilers. All models have the same structure. Firstly we define the parameters which will have a specific value in each model. COMPANY One-day-old broilers Technical and sanitary assistance Broilers Broiler farmers Feed factory Sales and distribution Chapter 5. Integer programming 149 Parameters The feed orders depend on three factors: the capacity of the silos installed on the farms, the access road to them and the feed intake. The latter is based on the number of chickens, mortality, age, sex, season and type of warehouse. Large orders of 24 tons, which are the ones with lower cost, cannot always be considered if the size of the silo of the farm is smaller or if the accesses prevent the passage of trucks of that size. The problem arises because transport costs are nonlinear, they depend on the distance from the farm to the factory, and on the shipping amount. Thus, for a given farm the most economical rate is that corresponding to 20-24 ton shipments (T1 € / ton). The second most economical rate is the shipping fee from 16 to 19.99 tons (T2), the third from 12 to 15.99 tons (T3), the fourth from 8 to 11.99 tons (T4) and the fifth, and most expensive, is the fee for the smallest shipping, from 4 to 7.99 tons (T5). We can state that the cost is nonlinear, but is constant within each of the five intervals. Three types of feed must be provided throughout the animals’ growth process and the total amount in breeding (P1, P2 and P3) depends on the number and sex of the chicks, as well as other factors such as race, season and type facilities. When the company planned the deliveries manually they made all possible shipments of a larger size, generally leaving a small residue of shipping in tons, but with a very high unit cost. The model should minimize the cost of transportation of P1, P2 and P3 tons of feed to a particular farm. Another parameter affecting the order quantity is what we have called CSi for i = 1, 2, 3, which is the total capacity of the silo except the safety margin for the feed Pi. Finally, Ac is the maximum truck load in terms of the access roads to the farm. 1. Variables We defined two types of variables, continuous variables Xijk representing tons of feed i (i = 1, 2, 3) at the rate j (1, 2 ... 5) in the shipping k (1, 2 ... K) necessary for broiler production on a given farm. K is estimated as the maximum number of shipping for each type of feed needed to supply the larger farm, during each period of consumption. The other type of variables is binary Yijk, which will take value 1 if the rate j is used in shipping k for feed type i and 0 otherwise. These binary variables are necessary due to the nonlinear structure of transport costs and permit us to formulate this problem using linear functions. Xijk tons of feed i=1, 2, 3 at rate j=1,2,…5 in the shipping k = 1,2…K Yijk (0, 1) binary, 1 indicates that the rate j is used in the shipping k for the type of feed i and 0 otherwise. Operations research in business administration and management 150 2. Objective Function The objective function consists of minimizing the transport cost of the feed needed for raising chickens on a specific farm and is given by the cost of all shipments to the farm. All 20-24 tons orders will be charged at price T1, 16 to 19.9 tons at price T2, 12 to 15.9 tons at price T3, 8 to 11.9 at price T4 and the orders between 4 and 7.9 tons at price T5 which is the most expensive. The Tj are fixed for each farm and vary from one to another depending on the distance to the factory. ¦¦¦¦¦¦¦¦¦¦  3 11 55 3 11 44 3 11 33 3 11 22 3 11 11 i K k ki i K k ki i K k ki i K k ki i K k ki XTXTXTXTXTMinZ 3. Constraints Demand for each type of feed: we have a restriction for each type of feed that indicates that the sum of all the sent amounts must be equal to the total required. ¦¦ K k jk j PX 1 11 5 1 ¦¦ K k jk j PX 1 22 5 1 ¦¦ K k jk j PX 1 33 5 1 Silo capacity: no order may exceed the capacity of the silo on the farm minus the estimated safety margin (CSi). The safety margin varies depending on the number of broilers and their period of growth. Xijk d CSi for i=1,2,3; j=1,…5; K=1,…K Truck access: the size of the orders is limited by the tonnage of the trucks that can access the farm. Xijk d Ac for i=1,2,3; j=1,…5; K=1,…K Price list (nonlinear costs): the following restrictions represent the structure of transport costs that the company has to pay to the feed factory. Thus, the first constraint indicates that all orders of feed i with the cheapest rate T1 will have between 20 and 24 tons. There will be as many constraint groups of this type as there are types of feed and possible deliveries. Chapter 5. Integer programming 151 20 Yi1k d Xi1k d 24 Yi1k 16 Yi2k d Xi2k d 19.9 Yi2k 12 Yi3k d Xi3k d 15.9 Yi3k 8 Yi4k d Xi4k d 11.9 Yi4k 4 Yi5k d Xi5k d 7.9 Yi5k All the constraints of the price tariff for i = 1, 2, 3 and k = 1, 2,…K The solution to this model gives the number of orders that we should place to the feed factory and the measured quantity in tons for each batch of chickens and farm, minimizing the cost, which is the largest production cost of the company and improving its decisionmaking. This model not only reduces the costs of their activities, but it also reacts appropriately to any unforeseen needs such as reduction of necessities due to animal death on hot days, electricity failures, diseases, etc. by simply re-running the model with the updated data. Let us consider a simple example of a similar problem. A company needs 85 tons of product 1 and 90 tons of product 2 for next month. The provider has a price that depends on the size of the order. Determine the number of orders to be placed in order to minimize the cost of the product. Table 5.5. Transport cost´s structure Amount of order in tons Cost of Transport Euros/ton 16-20 8 12-15.9 12 5-11.9 16 The variables are Xijk = tons of product i at price j in shipment k; The objective function MINIMIZE 8*(X111 + X112 + X113 + X114 + X115 + X211 + X212 + X213 + X214 + X215) + 12*(X121 + X122 + X123 + X124 + X221 + X222 + X223 + X224) + 16*(X131 + X132 + X133 + X134 + X231 + X232 + X233 + X234); Operations research in business administration and management 152 Constraints: Demand of product P1 X111 + X112 + X113 + X114 + X115 + X121 + X122 + X123 + X124 + X131 + X132 + X133 + X134= 85; Demand of product P2 X211 + X212 + X213 + X214 + X215 + X221 + X222 + X223 + X224 + X231 + X232 + X233 + X234= 90; Currently we can solve this nonlinear cost problem by substituting equations linking the amount of the product with the corresponding binary variable using a type of variable known in LINGO as semi-continuous. For example, to indicate that if the variable X111 has a nonzero value in the optimal solution then this is between 16 and 20, we add to the model the following @SEMIC (16, X111, 20) In this case LINGO generates the necessary binary variables and constraints to take this situation into account. However, in Excel this is not possible and you have to enter all the restrictions, define the binary variables and take into account that in Excel we have to put all variables on the left-hand-side and in the right-hand-side of the constraints only the independent term. 5.3.5. A PROBLEM OF TRANSPORT ROUTES Case study 3 of chapter 4 is a problem of feed manufacturing and distribution for a multinational company in the food industry which has one of its factories in Valencia. In the aforementioned case a linear programming model was formulated to minimize manufacturing costs. In this section we will explain an integer programming model to solve the feed distribution problem to customers, which differs from the theoretical route models presented in Operations Research books. In short, the company manufactures about 150 animal feed products and distributes 800,000 kg per day to an average of 70 clients. The company has a portfolio of 700 clients, whose distance from the factory varies from 15 to 450 km. The company has hired a fleet of trucks with capacities of between 12 and 24 tons, with compartments of 4 tons. Therefore, each delivery route can visit at most six customers. The person responsible for calculating the routes dedicates six hours per day to this activity. In addition, between 5- 30 rush orders are received every day, which means that the routes cannot be recalculated to include these orders. The cost of the routes is a complex function dependent on the distance to the last customer served and the truck loading, which has a minimum cost even if there is no transport of goods. For example, if a 24-ton truck carries 20 tons, the company pays as if 23 tons were transported. Chapter 8. Nonlinear programming 25 Figure 8.9. Data: Returns and beta coefficients of Sharpe Figure 8.10. Efficient portfolio model of Sharpe Operations research in business administration and management 25 In both Markowitz and Sharpe models, it is common to add constraints in order to limit the value of the decision variables so that neither of them represents a very large portfolio fraction. Finally, we can say that there are many other possible models and you can find finance treatises about them. 8.5. SUMMARY The most important feature of nonlinear programming is that no one method is "the best" to solve any nonlinear model. The optimal solution is not a corner point of the feasible region and it can even be an interior point. When function objective and/or constraints are nonlinear, the procedure to find the optimal solution is more complicated than in the linear case. However, there are methods that solve certain types of problems efficiently and many applications in business administration and management that need these methods to improve decision-making. An especially important one is the efficient portfolios of securities investment. Markowitz and Sharpe models are the basis of the modern portfolio theory in finance. 8.6. SELECTED REFERENCES 1. Daellenbach, H.G.; George, J.A.y D.C.McNickle (1987): Introducción a las técnicas de investigación de operaciones. CECSA. 2. Hillier, F.S. and Lieberman G.J. (2010): Introduction to Operations Research. Ninth Edition. McGraw-Hill. 3. Hillier, F.S and Hillier, M.S. (2011): Introduction to Management Science. A Modelling and Case Studies Approach with Spreadsheets. Fourth Edition. McGraw- Hill. 4. LINDO Systems (2011): LINGO. The modeling language and optimizer. 5. LINDO Systems (2006): Optimization in Spreadsheets with What´ s Best! http://www.lindo.com. 6. Luenberger, D.G. (1998): Investment Science. Oxford University Press. Chapters 6 and 7. 7. Winston, W. L. and S.C. Albright (2012): Practical Management Science. Fourth Edition. South-Western. USA. Chapter 8. Nonlinear programming 25 8.7. CASE STUDIES CASE STUDY 1 Solve the following model which represents a problem of investment portfolio graphically. Analyse the differences between this case and graphical solution of a linear programming model. Min 0.09 X12 + 0.04 X1 X2 + 0.06 X22 Constraints: X1 + X2 = 1 0.06 X1 + 0.02 X2  0.03 X1  0.75 X2  0.9 X1  0 X2  0 CASE STUDY 2 Suppose that table 8.2 includes the historical returns of five types of assets and the IBEX-35. Table 8.2. Annual returns YEAR ASSET 1 ASSET 2 ASSET 3 ASSET 4 ASSET 5 IBEX 1999 12,5 19,9 4,1 12,1 5,6 12,0 2000 9,4 9,2 2,6 8,3 6,2 8,3 2001 13,9 19,9 -4,2 10,2 4,5 9,4 2002 7,7 14,3 7,9 8,4 11,2 10,5 2003 8,7 19,2 9,9 8,6 0,9 9,8 2004 11,0 15,8 10,1 6,9 8,6 11,2 2005 8,8 18,2 6,3 6,5 8,5 8,5 2006 10,5 18,6 10,0 7,3 11,6 10,9 2007 12,5 14,5 2,2 8,4 12,9 10,1 2008 14,0 18,2 6,8 7,2 8,7 12,0 2009 6,8 13,6 8,5 10,3 8,8 8,9 2010 14,2 17,1 6,1 12,8 8,4 14,3 2011 10,9 10,0 6,0 11,3 4,3 8,4 2012 9,5 8,5 6,0 7,9 7,3 9,3 Obtain the composition of efficient portfolios for three types of investors, high, medium and low return by using Markowitz and Sharpe models. This problem can be solved with Excel Solver and LINGO. CHAPTER 9 METAHEURISTIC TECHNIQUES: GENETIC ALGORITHMS 9.1. GENETIC ALGORITHMS .......................................................................... 263 9.1.1. SOLUTION ENCODING ......................................................................... 266 9.1.2. FITNESS FUNCTION .............................................................................. 266 9.1.3. SELECTION ............................................................................................. 267 9.1.4. CROSSOVER ........................................................................................... 269 9.1.5. MUTATION .............................................................................................. 275 9.1.6. APPLICATIONS: THE TRAVELING SALESMAN PROBLEM ............... 275 9.2. TABU SEARCH .............................................................................................. 284 9.3. SIMULATED ANNEALING ........................................................................ 287 9.4. SUMMARY ...................................................................................................... 289 9.5. SELECTED REFERENCES ........................................................................ 290 9.6. CASE STUDIES .............................................................................................. 290 Chapter 9.Metaheuristic techniques: genetic algorithms 26 In recent decades a new group of algorithms has appeared, called metaheuristics, and they have been successfully applied to a variety of difficult search and combinatorial optimization problems. They are the latest generation of heuristic algorithms, widely used for solving optimization problems of all kinds when exact methods are not applicable. A metaheuristic algorithm can be defined as an iterative process that guides and/or modifies the operations and/or solutions of one or more subordinate heuristic algorithms to produce higher quality solutions in a reasonable time (Voss et al., 1999). They manipulate a single solution or a combination of these in each iteration, and as the process proceeds the solution or solutions improve. Among the metaheuristics that have appeared we may include those that mimic the behavior of natural systems, both biological and physical, such as the natural evolution of the species, thermodynamics, cooperative work in an ant colony or the behavior of neurons in the brain. From the wide variety of existing metaheuristics, we can highlight, due to their excellent results and the diversity of problems to which they are being applied; genetic algorithms, tabu-search and simulated annealing, to which we will devote this chapter. We can find a detailed description of these and other metaheuristics in Rayward- Smith et al. (1996). Among their applications we can cite routing problems, schedule management, production scheduling, project scheduling with limited resources and many others. Genetic algorithms are explained in detail in the next section, and in the last two points of this chapter tabu-search and simulated annealing are outlined. 9.1. GENETIC ALGORITHMS In the '60s the rapid proliferation of computers led to their use as simulation tools by the scientific community. In the early '70s, a group of researchers from the University of Michigan, led by Professor John Holland (1975), proposed genetic algorithms as computer programs that mimicked the natural evolutionary process and behaved robustly in a variable and uncertain environment. The main theme of the research focused on the robustness of such systems, i.e. how to find the right balance between efficiency and effectiveness to suit different environments. The robustness of the systems, both software and hardware, was a crucial aspect of their design, as the cost of rehabilitation and redesign could be drastically reduced or even eliminated. The resolution of a particular complex problem can be viewed as search in a space of possible solutions and, since we generally look for the best solution, it can be further understood as an optimization problem. Genetic algorithms are algorithms whose search mechanisms imitate a natural phenomenon: the evolution of species through genetic inheritance. In nature, the problem that each species faces is seeking improvements for its own adaptation to the environment. The main idea of genetic algorithms is to do what nature does. In nature, the members of a population compete with each other for resources such as food, water or shelter. At the same time, males compete amongst themselves to attract females. Individuals who are better prepared for survival and who attract females will be those that get more offspring. The less successful individuals will have fewer offspring Operations research in business administration and management 26 or even none. This means that the genes of the fittest will be inherited by a growing number of individuals in successive generations. The combination of the good features of past generations usually produces individuals that are better adapted than their predecessors. In this sense the species evolves into a kind that is better and better adapted to their environment. Let us take a population of rabbits as an example (Michalewicz, 1996). In this population some rabbits are faster and cleverer than the rest. The foxes that feed on these rabbits will find it more difficult to catch fast and clever rabbits, so those will surely survive and do what rabbits do best: make more rabbits. Of course, some of the slow and clumsy rabbits survive due to good luck and may possibly have offspring. The offspring population becomes a good mix of genetic material: fast rabbits have crossed with slower rabbits, some faster rabbits with other very fast ones, slow rabbits with clever ones, clumsy with fast, etc. Additionally, mutations in the genetic material of some individuals in the population can be produced, which may introduce different characteristics from those inherited from previous generations, i.e. introduces greater variability in the population. As a consequence, the resulting rabbit population will be, on average, faster and more “intelligent" than the original population, because most of the parents which survived the foxes were quick and clever. It is interesting to think that the fox population also suffers a similar evolution, since otherwise, the rabbits would become too fast and intelligent to be caught by them. Genetic algorithms follow nature procedure in the previous example step by step. They work on a population of individuals, each of which represents a possible solution to the problem they are applied to. Each individual is assigned a fitness value representing the quality of the solution. The individuals in the population cross with each other to produce new solutions, so that individuals with a better fitness value are more likely to be selected for crossover. When two individuals or solutions are selected for crossover, they produce one or more solutions (children) who inherit some of the characteristics of each of the parents. The least qualified individuals, i.e. the solutions with worse fitness value are less likely, but they also have some possibility to cross with other solutions and pass their features on to the next generation. Figure 9.1 shows, in pseudo code, the general procedure of a genetic algorithm. The first step consists of generating the initial population of solutions. One of the main differences between the genetic algorithms and other sequential algorithms, such as tabu search or simulated annealing, is that the first one manages a set of solutions in every iteration and not only one solution as it is the case of the last two. Once we have the initial population that may have been obtained in a random way, each individual is evaluated, that is, a fitness value is assigned to every individual. Chapter 9.Metaheuristic techniques: genetic algorithms 26 Figure 9.1. Genetic Algorithm: general procedure After all of the members of the initial population have been evaluated, the following steps are repeated until the stopping condition is satisfied. Firstly, the selection of the population is carried out. In this process each of the individuals in the population is copied a number of times, so that the best individuals generally have a higher number of copies than the less skilled individuals. In this way we obtain a new population that replaces the previous one. After that, the crossover process is carried out. The individuals in the population are paired at random and every couple undergoes crossover with a given probability. If the operation is carried out by the couple (parents), two new solutions (children) that replace the previous ones are created. If not, the parents remain unaltered. Thus, in the resulting population individuals from different generations can live together. The effect of the selection process which is carried out before the crossover operation is that the best individuals in the population participate more actively in such processes. Finally, some individuals in the population can mutate, i.e. some solutions can be partially altered, allowing the population to introduce new features or material which have been lost through evolution. The resulting population then is re-evaluated and the termination condition is checked. This condition generally refers to the elapsed computation time, the number of generations or iterations performed, the number of individuals who have been evaluated, the improvement produced in the last iterations, the variability of the population, etc. Obviously, we need to design an encoding for the solutions before we can start applying a genetic algorithm, this being one of the fundamental aspects of the design and therefore the subsequent efficiency of the genetic algorithm. That is, we need to define how to represent each of the possible solutions in an appropriate way. Genetic Algorithm Procedure Create_initial_population Evaluate_population While not (termination_condition) Select_population Cross_population Mutate_population Evaluate_population Operations research in business administration and management 26 9.1.1. SOLUTIONS ENCODING The genetic algorithm operates on an encoded representation of the solutions, equivalent to the genetic material of the individuals, rather than directly on the given solutions. A solution to the problem can be represented as a set of parameters. These parameters, known as genes, can be placed one after the other, forming a chain of values, which are referred to as a chromosome. In genetic terms, the parameter set represented by a chromosome is called a genotype. It contains the information necessary to construct an organism, known as a phenotype. In the genetic algorithm proposed by Holland each of the solutions is represented by a chain on a binary alphabet, i.e. a chain consisting of only zeros and ones. Although the simple genetic algorithm (proposed by Holland) used a binary encoding, other types of encodings have been developed, such as strings of integers or real numbers and even chains in which genes do not contain numbers. That means that the strings can be defined using any alphabet. Sometimes the chromosome does not directly represent a solution to the problem, but the information needed by a particular algorithm to solve the specific problem, such as for example, a heuristic algorithm which is able to find good solutions to the problem. In this case, we should apply such a procedure using the information represented in the chromosome in order to obtain a solution. Regardless of whether they directly represent a solution to the problem or not, individuals from the population are generally referred to as solutions. An appropriate encoding of the solutions is crucial to the success of the genetic algorithm, and the rest of the procedures to be designed that will manipulate and act on the solutions will depend on this encoding. Once we have defined the encoding, the next step is to create the initial population of solutions of a certain size. There are generally two ways to generate the individuals of that population: at random or using some heuristic algorithm. The advantages of the first mechanism are the required time and the diversity of the generated solutions, but it may have the disadvantage of creating a mediocre population which may need a lot of time to converge to good solutions. The second method does not have the above mentioned drawback, since the solutions are usually of a better quality, so it can converge faster. However, we should avoid generating a population with little diversity, because this lack of diversity could lead to a premature convergence, by being trapped in a local optimum. We must also take into account the time needed to create the population by this method because, if it is too high, a random population may be advisable. 9.1.2. FITNESS FUNCTION The fitness function or evaluation function is the one that assigns, to each of the individuals in the population, a fitness value which indicates the suitability of that individual with respect to other individuals who are part of the population. Chapter 9.Metaheuristic techniques: genetic algorithms 27 Ľ Ľ Ľ 3 2 5 7 1 9 4 6 8 Father Son " " " " 1 9 4 " " Figure 9.5(a). PMX crossover example: 1st step The defined interchanges have been marked with arrows in the previous figure. These are: 2 ļ 1 5 ļ 9 8 ļ 4 The next step is to inherit those genes marked by ", from the other parent and do not produce conflict with each other, i.e. they do not appear repeatedly. It means that the daughter now inherits genes from the father and the son from the mother. 1 3 4 6 2 5 8 7 9 Mother Daughter 3 " " 7 2 5 8 6 " 3 2 5 7 1 9 4 6 8 Father Son " 3 " 6 1 9 4 7 " Figure 9.5 (b). PMX crossover example: 2nd step Finally, the exchanges defined above serve to inherit the rest of the genes, which are those that could not be inherited in the previous step by producing conflicts: 1 3 4 6 2 5 8 7 9 Mother Daughter 3 1 9 7 2 5 8 6 4 3 2 5 7 1 9 4 6 8 Father Son 2 3 8 6 1 9 4 7 5 Figure 9.5 (c). PMX crossover example: 3rd step In the previous step, the daughter should have inherited a "2" in the second position from the father, but this would have caused a conflict since the "2" appeared in the daughter in the 5th position. Therefore, we used the previously defined set of exchanges whereby the "2" has been exchanged for a "1", which is finally displayed on the second position of the daughter. The same applies to the third and final positions of the daughter. This fact is also given in the first, third and last positions of the son. Operations research in business administration and management 27 Another crossover which has been defined for this type of problems is the order crossover proposed by Davis (1985). As in the previous crossover, the first step consists of randomly generating two crossover points k1 and k2 so that 1 d k1 d k2 d l. In the same way as in the PMX, each of the descendants inherits the genes contained between positions k1 and k2 from one parent. The difference from the previous crossover is the following: the remaining genes are now inherited by the offspring in the relative order in which they appear in the other parent. Let us see the application in the next example. Suppose again that k1=4 and k2=7: 1 3 4 6 2 5 8 7 9 Mother Daughter " " " " 2 5 8 " " 3 2 5 7 1 9 4 6 8 Father Son " " " " 1 9 4 " " Figure 9.6(a). Order crossover example: 1st step Now the daughter will inherit the genes marked as ?, in the relative order in which they appear in the father. That is, the daughter has only inherited the genes "2", "5" and "8", so she must inherit the rest. These will be inherited one by one keeping the relative order in which they appear in the father. The relative order of these genes in the father is 3 - 7 - 1 - 9 - 4 - 6: 1 3 4 6 2 5 8 7 9 Mother Daughter 3 7 1 9 2 5 8 4 6 3 2 5 7 1 9 4 6 8 Father Son " " " " 1 9 4 " " Figure 9.6 (a). Order crossover example: 2nd step The main difference between the first three crossover techniques exposed (one-point crossover, two-point crossover and multi-point crossover) with respect to the mentioned later (PMX and order crossover) is that the latter ones incorporate problem-specific knowledge, while in the former, no reference has been made at all to the type of problem they solve. One of the advantages of incorporating problem-specific knowledge is that non feasible solutions which are sometimes difficult to manage can be avoided (as could have happened in the traveling salesman problem if we had used any of the first three techniques). Chapter 9.Metaheuristic techniques: genetic algorithms 27 9.1.5. MUTATION Once the crossover process has finished the mutation procedure is applied. The purpose of this process is to introduce some variability into the population, introducing some new features or characteristics in individuals, which were in the population in the past, but were lost during the process of evolution. That is, the mutation, unlike the process of crossover, is a kind of blind search that seeks to ensure that in the solution space there is no point with a zero probability of being examined. Mutation affects each of the genes of each of the individuals in the population with a certain probability, the mutation probability, Pm, which is usually quite small (much smaller than the crossover probability). That is, each and every one of the genes has equal probability of being affected by the mutation. Mutating a gene consists of altering its value. The simple mutation consists of exploring each individual, and for each of its genes, generate a random number between 0 and 1, so that if the number is less than or equal to Pm, then the value of that gene is chosen randomly among the remaining symbols of the alphabet. As with the crossover operator, mutation may also incorporate problem-specific knowledge. 9.1.6. APPLICATIONS: THE TRAVELLING SALESMAN PROBLEM Since the metaheuristic techniques in general and the genetic algorithms in particular are suitable to be used in combinatorial optimization problems, they have many applications in the field of decision making in administration and business management. Below there are some examples of genetic algorithms that have been successfully designed and applied to solve business and management problems such us: stock exchange index prediction, collection routes for freight vehicles, resource allocation in project scheduling, allocation of human resources for construction, shifts, inventory management, economic predictions, etc. The travelling salesman problem is one of the classic problems in Operational Research in which a salesman must visit a number of cities and he wants to find the optimal path that minimizes the total distance to travel. Take the following simple example. A travelling salesman of the ADESA company has to plan visits to be made to some of his customers over the following week. There are ten customers to visit and they are located in Alicante, Valencia, Sevilla, Cádiz, La Coruña, Santander, Madrid, Barcelona, Ciudad Real and Zamora. Figure 9.7 shows the distance between each pair of cities on the usual route used by the traveling salesman (road, highway, freeway, etc.). We then seek a cyclic route for him to visit every city once and finish in the same city where he started. Thus, the same route would be valid for any of the starting cities. For example, if the optimal route was ALÆ VLCÆBCNÆCRÆSANÆCORÆSEVÆCADÆZAMÆMAD Operations research in business administration and management 27 we could choose any of the cities as the starting city. If we start from Alicante, the first city to visit will be Valencia and then Barcelona, Ciudad Real, Santander, Córdoba, Sevilla, Cádiz, Zamora, Madrid and back to Alicante. If we start from Córdoba instead, we will go in the first place to Sevilla and then to Cádiz, Zamora, Madrid, Alicante, Valencia, Barcelona, Ciudad Real, Santander and back to Córdoba. Obviously, the total distance travelled in both routes is exactly the same. Figure 9.7. Distances between cities The above problem has many other applications such as the collection of money in city phone boxes, the establishment of a fibre optic line between a group of users or the delivery of pizzas of a particular dealer. There are several alternatives to solve the above problem. The first is to present a binary linear programming model. There are different possibilities for its formulation. In one of them, the resulting model would have a total of 100 binary variables and 101 constraints. In general terms, with this formulation, the mathematical model would have a total of n2 variables and n2 +1 constraints, where n is the number of cities. In many cases, these models are not solvable in practice, making it necessary to employ heuristics or metaheuristics. Let us see how to design a genetic algorithm to solve the above mentioned problem. Chapter 9.Metaheuristic techniques: genetic algorithms 27 Solutions encoding To design an appropriate encoding for the solutions to the problem, we have to think about how to express a solution to it. In this problem, a solution can be represented by the order in which the cities should be visited, for example: MADÆVALÆALÆCADÆSEVÆCORÆCRÆZAMÆSANÆBCN would be a way of expressing a solution, considering that from Barcelona we would finally return to Madrid. Thus, any permutation of the cities, represents a feasible solution to the problem. One way to represent the solutions would be to encode them using ordered lists in which each gene is one of the cities to visit. The above solution can be expressed as: MAD VLC AL CAD SEV COR CR ZAM SAN BCN To simplify the notation, from now on we will represent each city by their order in the list of names in alphabetical order, so that the above solution would be represented as: 6 9 1 3 8 5 4 10 7 2 With the above encoding, any list that consists of a permutation of cities represents a feasible solution to the problem. We want to obtain the best, ie the optimal solution among all the feasible solutions. There are n! different permutations for a problem with n cities. In this case we would have a total of 10!=3,628,800 possible orderings. Initial Population Since any permutation of the cities represents a solution of the problem, a simple and low computational effort method to create the initial population would consist of generating random solutions. An alternative could be to apply heuristic algorithms that gave us solutions to the problem and use these as initial population. Both methods could also be combined to generate the initial population. An important parameter to consider in the algorithm is the size of the population that we are going to manage. It is common to use a standard size of 50 to 100 individuals, although other sizes may be advisable. The size is often determined after some preliminary tests. Operations research in business administration and management 27 Evaluation It is necessary to define a function that assigns a fitness value for each solution, which indicates the value of the solution in relation to the objective. In our case, the objective is to minimize the total distance travelled along the route, so that the best solution would be the one whose total distance is minimal. 6 9 1 3 8 5 4 10 7 2 Solution represents a route in which the total distance is 3743 kilometres. The total distance travelled could be the direct fitness value, so that the best individuals would be those who have a lower fitness value. However, many standard mechanisms (mainly selection ones) used in genetic algorithms are designed to maximize the fitness values. Therefore, we could transform the fitness values of the individuals so that the best individuals have the highest fitness values and not the lowest. That is, the optimal solution of this problem should have the highest possible fitness value. One way of doing it, amongs many others, would be to establish an upper bound on the total distance travelled and to subtract the value of this distance bound for each individual in the population. One way to establish an upper bound on the distance travelled would be to choose the greatest distance from each of the columns of the table and add them. Thus, this upper bound would be given by: OF_Upper_bound = 815+1284+1284+811+908+663 +1056 +1046 +808 +988=9663 Now, the fitness value of each individual would be obtained by subtracting, from the previous bound, the distance of the route that it represents. Thus, we would get an adequacy value of 9663-3743=5920 for the solution shown above, which represented a route of 3743 kilometres. The solution 2 4 6 8 10 1 3 5 7 9 representing a route of 5511 kilometres, would have a fitness value of 4151 lower than the previous one. The optimal solution would have the highest fitness value and the worst solution would have the lowest fitness value among all possible. Selection Any selection mechanism outlined in the previous section could be used in this example. Chapter 9.Metaheuristic techniques: genetic algorithms 27 Crossover For this problem and with the solutions encoded in this way, we could apply any type of previously defined crossover mechanism that works for permutations, for example PMX crossover or order crossover both presented in section 9.1.4 of this chapter. We could also define a specific type of crossover for this problem, taking into account their special conditions and incorporating them to generate the offspring in an efficient way. We should also set the crossover probability. Values around 80-90% are often used, but, as with the population size, it is usually set after performing some tests. Mutation The mutation involves making random changes to a solution mimicking the mutations that occur on the genetic material of living creatures in nature. Such mutations could make desirable or undesirable attributes appear in individuals. It moves through the solution and each gene is mutated with a certain probability of mutation, which is usually low, at around 1%, although it can vary depending on the problem. For this problem, mutating a single gene could consist of inserting it at any position of the chromosome, or exchanging it directly for the front or rear ones. A simple genetic algorithm such as the one described in the preceding paragraphs, is able to solve sizable instances of this problem in very reasonable computation times obtaining very good solutions which makes these techniques the best alternative to solving some real problems. To solve this problem with Solver, we have two options. The first is to build a linear programming model and use the method "Simplex LP" to solve it. It should be borne in mind that the resulting linear model can be large and the time required for solving it can be extremely long. Due to its size it may be unsolvable even on high-end workstations. Furthermore, we have to take into account the limitation in the number of variables and number of constraints of the Solver version employed. In particular, the default version in Excel solves linear models with up to 200 variables, with no limit on the number of constraints. We could not solve problems with 15 cities or more by formulating the binary programming model discussed above with Solver. The second option would consist of employing the "Evolutionary" method, that uses genetic algorithms and is especially designed for unsmoothed type problems. Let us see how to easily define the problem and then find out now to use the "Evolutionary" method supported by Excel Solver to solve it. First we define the distance matrix, as shown in Figure 9.7. This matrix is symmetric and zeros always appear in its diagonal. Then we should prepare the cells in which the solution to the problem will be displayed once solved and how to calculate, based on the solution, the value of the objective function, ie, the total distance in kilometres. Operations research in business administration and management 2 We will use two columns, ORDER and DISTANCE. The first column is left blank, because cells B16: B25 are used to represent the solution once the problem has been solved. That is, the value in cell B17 indicates the number of the city to visit after having visited the one whose number appears in cell B16 and so on. The second column will serve to calculate the total distance travelled by the salesman if you follow the order given in the solution indicated by the column ORDER. To obtain this order, we will use the INDEX function. The syntax of this function is: = INDEX (array, row_num, column_num) and it returns the value of an item in a table or matrix selected by the row and column indices given. Thus, in cell C17 we want to calculate the distance from the city whose number appears in cell B16 to the city whose number appears in cell B17, for which we write =INDEX ($C$2:$L$11; B16; B17) in that cell and drag the formula to cells C18 to C25. In cell B16 we write =INDEX (C2:L11; B25; B16). If Column B has been left blank, # VALUE! will appear in these cells when writing the formulas, since we are using numerical values that do not exist in these formulas. This is not a mistake. If we fill in cells B16: B25 with a list of values between 1 and 10 (a feasible solution to the problem) we see that in column C the corresponding distance between each pair of cities on the route is displayed. Finally, in cell C26 we calculate the sum of the distances travelled by typing =SUM (C16: C25). The value displayed in the cell is the total distance travelled, which we want to minimize. We can now press the button to open the Solver dialog box and define the model to be solved, based on the sheet set, as shown in Figure 9.8. Set Objective: in this case, the total distance travelled is displayed in cell C26. To: Our goal is to minimize the total distance. By Changing Variable Cells: On the sheet we have reserved space for the variables in cells B16 to B25 Subject to the Constraints: Clicking the Add button, Solver displays the dialog box to add constraints: Cell Reference: select the range of cells that represent the variables, ie the range B16: B25 Chapter 9.Metaheuristic techniques: genetic algorithms 2 In the centre of this dialog box, which is normally used to indicate the sign of inequality or the character of the variables, we select diff, which indicates that in these cells Solver must calculate a permutation of the integer values that are consecutive and start at 1, that is, a permutation of the integers between 1 and 10 in our case. Figure 9.8. Solver Parameters Select a solving method: we select "Evolutionary" to apply the mechanism based on genetic algorithms. Moreover, the way in which we have defined the problem makes it impossible to use the LP Simplex method. Then, before solving the problem, we can configure this method, for which we must press the Options button and go to the tab "Evolutionary", which displays the dialog box shown in Figure 9.9. Next we set the values shown in Figure 9.9 for the different parameters (as an exercise, the student could try to change the values of the different parameters and observe the effect they have on the solution and the time it takes to find it). Once we click Solve, Excel starts the search for the best solution. During the search process, in the bottom bar of the screen, the method displays information about the process, such as the total number of solutions evaluated and the objective value of the best solution found so far. We can interrupt the search process by pressing the Esc key at any time. In this case, Solver displays the best solution found so far. The best solution found by "Evolutionary" Solver for this example is shown in Figure 9.10, representing a total distance of 3142 kilometres. So, if the traveller started, for example, from Valencia Operations research in business administration and management 28 (City 9) the route to follow would consist of visiting Barcelona first, and then going to Santander, Zamora, Madrid, Ciudad Real, Córdoba, Sevilla, Cádiz, Alicante and returning to Valencia. The reverse route would be equivalent, with the same distance travelled. As the solution is given by a metaheuristic technique, we cannot generally know whether it is the optimal solution to the problem or not. In this case we can ensure that it is, because we have optimality solved the problem by other methods and the optimal solution is already known. If Solver finishes its execution without being interrupted, it permits the user to generate two different reports, called Answer and Population, which are presented in Figures 9.11 and 9.12. In the Answer report, the software shows the options used by the resolution method, the total time and the number of solutions evaluated. It also indicates the value of the target cell and the best value of the variables. Figure 9.9. Options of Evolutionary Solver Chapter 9.Metaheuristic techniques: genetic algorithms 28 The choice of the parameter t has a significant influence on the behaviour of the algorithm. Its initial value and the manner in which this value decreases along the process must be set, this is called cooling program. If cooling is too fast, the technique tends to behave as a simple local search mechanism and can be trapped in a local optimum or a low quality solution. Moreover, if the cooling is too slow, the running time of the algorithm can become prohibitive. Apart from the temperature parameter definition, the probability of acceptance of a new solution s’ V(s) must also be set, where s is the current solution. As discussed above, this probability depends on the objective value of the new solution (or its difference from the value of the current solution) and the current temperature, t. If we denote by ' the difference between the objective values of the current solution s and the new solution s', defined as ' =f(s’)-f(s), and assuming that we minimize the objective function value, the probability of accepting s' might be defined by: ° ¯ ° ®  t' ' o ' 0 01 )'( / ife if ssP t The above formula would be a possible definition of the probability of acceptance. There are many other alternatives and the researcher should be the one responsible for choosing it properly, as was the case of the temperature parameter. Figure 9.14 shows the basic operation of the technique in pseudocode. The first step consists of generating the starting solution either randomly or by some heuristic procedure. The temperature parameter, t, must also be initialized with a certain value. Then, these steps are repeated until the termination criterion is satisfied. The set of solutions accessible from the current one is generated, and a solution is chosen from this set. In its simplest form, such a solution is chosen randomly, although another mechanism could be used. If this solution is better than the one we had, it is accepted as current solution, if not it is accepted with a certain probability of acceptance. Finally the temperature is decreased. Once the termination condition has been satisfied, the current solution is proposed by this technique as the solution to the problem. Some of the completion criterion that can be set are: xThe set V(s) is empty. xA number of iterations have been completed. xThe temperature reaches the minimum value (usually 0) xAn acceptable solution has been found. Operations research in business administration and management 2 Finally, the most remarkable difference between simulated annealing and tabu search is the use of the memory by the latter. Recently, some variations of the technique, known as hybrid techniques, have appeared. They incorporate the use of the memory to improve the efficiency of the technique in an effective way, among other new features. Simulated Annealing Procedure Generate_initial_solution(s) t=init_temp while not (termination_criterion) Generate V(s) s’ =choose solution from V(s) if s’ is better than s s=s’ else P=calculate P(s-->s’,t) s=s’ with probability P update t Figure 9.14. Simulated Annealing: general procedure 9.4. SUMMARY This chapter has been dedicated to metaheuristic techniques in general and genetic algorithms in particular. Metaheuristic techniques are being successfully applied to a wide variety of combinatorial optimization problems, difficult problems, for which exact techniques do not allow us to find the solution in many cases due to the enormous computational effort required. For many of these problems, heuristic techniques that provide good results have been developed. However, metaheuristics improve these results since they make a deep search of the solution space with acceptable computational effort. Genetic algorithms are based on the mechanisms of natural evolution, guided by the principle of survival of the fittest. Starting with an initial population of solutions, mechanisms that mimic natural processes affecting the species are applied to it, thus evolving populations of a better quality. The main difference between genetic algorithms and other metaheuristics such as tabu search or simulated annealing, is that the former handles a set or population of solutions at each iteration and the latter ones a single solution per iteration. These three techniques are the most used metaheuristics, but there is not one that can always offer the best results for any problem. Chapter 9.Metaheuristic techniques: genetic algorithms 2 9.5. SELECTED REFERENCES 1. Alcaraz, J. (2001), Genetic Algorithms for Resource-Constrained Project Scheduling, ProQuest Information and Learning. 2. Alcaraz, J. and Maroto, C. (2006), A hybrid genetic algorithm based on intelligent encoding for project scheduling, en: Perspectives in modern project scheduling, Springer. 3. Goldberg, D.E. (1989), Genetic Algorithms in Search, Optimization, and Machine Learning, Addison Wesley. 4. Glover, F. y Laguna, M. (1997), Tabu Search, Kluwer Academic Publishers. 5. Holland, H.J. (1975), Adaptation in natural and artificial systems, University of Michigan Press. 6. Rayward-Smith, V.J., Osman, I.H., Reeves, C.R. and Smith, G.D. (Editors) (1996), Modern Heuristic Search Methods, John Wiley and Sons. 7. VoE, S., Martello, S., Osman, I.H. y Roucairol, C. (Editores) (1999), Meta-heuristics. Advances and Trends in Local Search Paradigms for Optimization, Kluwer Academic Publishers. 8. Winston (2011), Microsoft Excel 2010: Data Analysis and Business Modeling, Microsoft Press. 9.6. CASE STUDIES CASE STUDY 1 Solve the travelling salesman model from section 9.1.6 eliminating the cities of Zamora and Cádiz and including the city of Badajoz. 1. What is the minimum total distance travelled? 2. How long did Solver take to solve the problem? 3. Does the solution provided by Solver change if we limit the maximum number of subproblems solved to 200? 4. What is the route to follow if we want to start and finish in Madrid? And what if the path should start and end in Zamora? Operations research in business administration and management 29 CASE STUDY 2: SCHEDULING JOBS WITH DUE DATES WITH EXCEL EVOLUTIONARY SOLVER Among the combinatorial optimization problems in which metaheuristic techniques are the only alternatives in practice, we can mention the job scheduling or sequencing operations. In general, we have to decide the order in which a series of tasks or operations are performed in order to optimize a certain criterion. The following case presents a simple example to be solved with Evolutionary Solver. We have a set of 16 jobs that need to be performed sequentially and we know the processing time in days, and the delivery date in days from the date on which the execution of the first job starts for each of them. These delivery or due dates are approximate in the sense that they can be exceeded, but we must also try to ensure that the amount of time by which a job exceeds the delivery date is not too long. In short, the problem consists of determining the order in which jobs are to be executed so as to minimize the total number of days that a delay is incurred in terms of due dates. Figure 9.15 shows an Excel spreadsheet with the problem data. The jobs have been numbered from 1 to 16. The execution times and due dates, in days, are presented in columns B and C. In the previous sheet we have included three additional columns. The column Order is reserved to reflect the solution provided by Solver, ie, it must contain a permutation of jobs. In column Finish, the number of days until the end of the execution of a job, if executed in the order shown in column D, must be calculated. So, if, as is now shown in that column, the first scheduled job were job 16, with a duration of 5 days, and the second were job 1, with a duration of nine days, this work would finish after 14 days. In the last column we calculate the delay for each job, with respect to the due date, if executed in the specified order. If job 1 finishes in 14 days, the delay is 0. Finally, in cell F18 we calculate the sum of days overdue, which would be 303 in this case. Solve the above problem with Evolutionary Solver and answer the following questions: 1. In what order should the jobs be sequenced? 2. When does job 12 finish? What day should the execution of job number 4 start? 3. How many days will job number 8 be delayed with respect to its due date? 4. What is the sum of the days delayed? 5. Which is the job with the longest delay? Chapter 9.Metaheuristic techniques: genetic algorithms 29 Figure 9.15. Defining the job scheduling problem with Excel ANNEX 1 THE SOLVER OF THE EXCEL SPREADSHEET Annex 1.The Solver of the Excel spreadsheet 295 A1.1. FORMULATING AN OPTIMIZATION MODEL Spreadsheets are data analysis tools most commonly used in the business environment. Among its benefits for improving decisions it is the possibility of solving optimization models -linear, integer and nonlinear programming modelswith Solver tool. To access Solver it is necessary to install it first. For Excel Spreadsheet 2010 and 2013 you should go to Office button, choose Excel Options, and in the Add-Ins dialogue box, check whether Solver is installed or not. If it has not been installed, select Excel Add- Ins in the Manage window and click the Go button. This brings up a window with the add-ins that incorporate by default Excel and the ones you want to install can be selected. To install Solver we mark it and click the OK button. Once installed, you can access the Solver on the Data tab. The Solver tool available in Excel 2010 and 1013 introduces three methods of solving optimization models, Simplex LP, GRG Nonlinear and Evolutionary. We will use the example of energy production and pollution control described in Chapter 2 to explain the input of a linear programming model in the spreadsheet and its resolution by Simplex LP method. Chapter 9 describes how to use the Evolutionary method to solve the Traveling Salesman Problem (TSP). We always start entering the problem data on a sheet. The data of the problem we want to solve have been introduced as we can see in Figure A1.1. The data cells are shaded in light yellow. To facilitate the building and interpretation of the model it is convenient to use range names. So in this case we used SteamProduction as a range names for cells E4:F4, RHS for I6:I9 and TechnicalCoefficients is the name of the cell range E6:F9. To enter a range name we just have to select the cells and go to Formulas/Define name. Range names can not contain spaces. So if you have more than one word, it is useful to begin each word with a capital letter and eliminate spaces to facilitate understanding. As we have already seen, in Chapters 1 and 2, to correctly formulate an optimization model in general and a linear programming model in particular, we need to know: 1. The decisions to make. 2. The constraints we have. 3. How to measure the performance of our decisions. In this case the decisions are tons of each type of coal that we will use to produce steam, which is transformed into energy, i.e. the model variables. Constraints that limit the values that can take these decision variables are the firm's technological capacity (capacity of the loading system and the pulverizer) and environmental regulatory restrictions limiting the release of pollutants (smoke and sulfur oxide). The more energy the company can produce with available resources and meeting environmental regulations the better our decisions. Therefore, the objective is to maximize the total steam production. Operations research in business administration and management 296 Table A.1.1. Data of the energy production and pollution control problem (Chapter 2) A B C D E F G I 1 ENERGY PRODUCTION AND POLLUTION CONTROL 2 3 Coal A Coal B 4 Steam production in thousands of lb/ton 24 20 5 RHS 6 Emission of smoke kg/h 0,5 1 12 7 Loading installation 1 1 20 8 Pulverizer capacity 1,5 1 24 9 Emission of sulphur 1200 -800 0 10 The decision variables will appear in cells E12:F12 to which we assigned the range name UsedCoal. The cells where Solver must store the value of the variables of the solved model should be reserved for that purpose. They are the variable cells, which may initially be assigned a zero value and after solving the model we will have the optimal variable values. The constraint values are introduced in CapacityUtilization range in the cells G6:G9. These cells collect the first member of the constraints of the problem (Chapter 2, section 2.2.3). As shown in Figure A.1.2 it is calculated: G6= =SUMPRODUCT(E6:F6;UsedCoal) G7=SUMPRODUCT(E7:F7;UsedCoal) G8=SUMPRODUCT(E8:F8;UsedCoal) G9=SUMPRODUCT(E9:F9;UsedCoal) For this small example, we could have directly used the product and the sum. However, with the SUMPRODUCT function of the spreadsheet we illustrate how to introduce constraints of linear models. These cells represent the value of the left hand side (LHS) of the constraints in the optimal solution. Therefore, they are result cells which contain the values of the left hand of the constraints, i.e. they depend on the value that the decision variables have taken. In cells H6:H9 we input the signs of the constraints to facilitate understanding the data in the spreadsheet. To solve the model these conditions of lower, higher or equal operators must be specified in a dialogue box as we will see in section A1.2. Annex 1.The Solver of the Excel spreadsheet 303 Table A.1.4. Solver Answer report for the energy production and pollution control problem (Chapter 2) Microsoft Excel 14.0 Answer Report Worksheet: [SteamProduction.xls]Data1 Report Created: Result: Solver found a solution. All Constraints and optimality conditions are satisfied. Solver Engine Engine: Simplex LP Solution Time: 0,016 Seconds. Iterations: 3 Subproblems: 0 Solver Options Max Time Unlimited, Iterations Unlimited, Precision 0,000001 Max Subproblems Unlimited, Max Integer Sols Unlimited, Integer Tolerance 1%, Assume NonNegative Objective Cell (Max) Cell Name Original Value Final Value $I$12 TotalSteamProduction 0 408 Variable Cells Cell Name Original Value Final Value Integer $E$12 Coal A (ton/h) 0 12 Contin $F$12 Coal B (ton/h) 0 6 Contin Constraints Cell Name Cell Value Formula Status Slack $G$6 Emission of smoke kg/h 12 $G$6<=$I$6 Binding 0 $G$7 Loading installation 18 $G$7<=$I$7 Not Binding 2 $G$8 Pulverizer capacity 24 $G$8<=$I$8 Binding 0 $G$9 Emission of sulphur oxide 9600 $G$9>=$I$9 Not Binding 9600 Table A.1.4 presents the Answer report, which has three sections, which refer to the objective function, variables and constraints. The first section shows the value of the objective function, which in our problem is 408, which means that the maximum steam production is at 408,000 pounds of steam per hour. The second section displays the optimal solution, namely the optimum value for each of the variables, and the nature of these (continuous in this case). Finally, for each of the constraints of the model it first indicates the value taken by the left hand side of the constraint. The status indicates whether the constraint is strictly satisfied (binding) or not (non-binding). The last column indicates the slack of that constraint. Operations research in business administration and management 304 Sensitivity report (Table A.1.5) presents information relating to sensitivity analysis. For each variable the report indicates the value taken in the optimal solution, the reduced cost (the quantity that should improve the coefficient of the variable, if its value is zero, so it could take a nonzero value in the optimal solution) and the possible increase and decrease of the coefficient of the variable without changing the optimal solution. Regarding the constraints Shadow Price gives its opportunity cost and the interval in which its right hand side may differ from the initial value so that the opportunity cost remains constant. Table A.1.5. Solver Sensitivity report for the energy production and pollution control problem (Chapter 2) Microsoft Excel 14.0 Sensitivity Report Worksheet: [SteamProduction.xls]Data1 Variable Cells Final Reduced Objective Allowable Allowable Cell Name Value Cost Coefficient Increase Decrease $E$12 Coal A (ton/h) 12 0 24 6 14 $F$12 Coal B (ton/h) 6 0 20 28 4 Constraints Final Shadow Constraint Allowable Allowable Cell Name Value Price R.H. Side Increase Decrease $G$6 Emission of smoke kg/h 12 6 12 4 4 $G$7 Loading installation 18 0 20 1E+30 2 $G$8 Pulverizer capacity 24 14 24 4 6 $G$9 Emission of sulphur oxide 9600 0 0 9600 1E+30 A1.3. SOLVING OTHER TYPES OF MODELS As already discussed above Solver also incorporates, apart from Simplex LP, that solves any linear programming model (continuous or integer), two other techniques, GRG Nonlinear and Evolutionary that allow us to solve nonlinear models, whether smooth or non-smooth. Nonlinear models are those in which the objective functions and/or any of the constraints contains references to formulas that do not follow the pattern variables multiplied by constants. If, for example, x and y are variables of the model, any appearance of references to the same formulas as below would make the model nonlinear: x x2 x xy x sin x x xy Annex 1.The Solver of the Excel spreadsheet 305 If the model only includes functions with ordinary mathematical operators as above, we can use the GRG Nonlinear method to solve it. That procedure uses the generalized reduced gradient method, based on finding points where the slope is zero, the condition met by the maxima and minima. In general, methods for solving nonlinear models start searching at a given starting point and they approach the solution in successive iterations, so that the solution found may depend on the chosen starting point, particularly in functions that may have different local maxima or minima. To avoid this inconvenience, GRG Nonlinear features a Multiple Start option, which allows us to specify the number of starting points. The process solves the problem starting from each of these points and eventually returns the best solution found. This option works best if variables are imposed reasonable upper and lower bounds. The GRG Nonlinear method is not suitable when in the model references including non-smooth functions appear, such as MAX, MIN, ABS, IF, SUMIF, SUMIFS, COUNTIF, COUNTIFS. In this case, we recommend using Evolutionary method, based on genetic algorithms, described in Chapter 9. The options of this method allows us to, among other things, specify the size of the population to be used, set the mutation rate or limit the time that can elapse without improving the value of the objective function to complete the search process. In Chapter 9 it is described how to use this method to solve two optimization problems; the traveling salesman problem and a problem of sequencing jobs. A1.4. BUILDING GOOD SPREADSHEET MODELS There are many ways of representing a model in a spreadsheet and one of the advantages is precisely the flexibility it offers. Although Excel has many features such as range names, shadows, borders... that create "good" models that are easy to understand, debug and modify, it is also easy to create bad models. Here are some tips that will facilitate the construction of good models. 1. Enter, organize and clearly identify the data The full model is built on the data structure. We must carefully introduce and present all data before the rest of the model. The structure of the model should fit the data as much as possible. We should group the data conveniently and put labels that clearly identify them. In the data presented in a table we should put headers with an overview and each column and each row should have the name that identifies the input data. We must also identify data units. Enter data oriented in the same way is not only clearer, but also allows us to use the SUMPRODUCT function. This function assumes that the two ranges have exactly the same number of rows and columns. Operations research in business administration and management 306 2. Enter each data only in a single cell, do not repeat data in different cells If data is needed in more than one formula, always refer to the original data cell instead of repeating the data in different sites. This model could be modified more easily. If the data change, we would only need to modify them once. We would not need to search in the whole model how many times the data that have changed appear. 3. Separate data from formulas. The formulas should refer to the data cells Avoid using data directly in formulas. You have to enter the numbers in the data cells and refer to them where necessary. Separating data from the formulas has a double advantage. Firstly, all data are visible in the spreadsheet instead of being hidden in the formulas. To view the data makes the model easier to interpret. Secondly, the model is easier to modify because changing data only requires modifying the corresponding data cell. We do not need to modify formulas. This is important in the sensitivity analysis. 4. Keep the model simple and as easy to interpret as possible Avoid using complicated functions of Excel when there are available functions that are simpler and easier to interpret. Use whenever possible SUMPRODUCT or SUM. This makes the model easier to interpret and helps to ensure that the model is linear (linear models are much easier to solve than nonlinear). 5. Use range names One way to refer to a group of cells or a cell in a formula in the spreadsheet is to identify it with a letter and number. A better alternative is to use descriptive range names. To do this, select the cells and put the range name. The range names are especially important when writing a formula for a cell result. Writing the formula in terms of range names makes it easier to interpret. Range names also make that the description in the Solver model is easier to understand. In general, it is advisable to name a range for each group of data cells, variable cells, objective cell and the two sides of the constraints, LHS and RHS. As no spaces are allowed in range names, we should start each word with a capital letter to enhance understanding. When we modify a model using range names we have to ensure that the range names still refer to the correct cells. When rows or columns are inserted, it must be done in the middle of the range, and not at the end. 6. Using absolute and relative references to copy formulas easily When we need to use a formula several times, we can introduce it once and then use Excel commands to replicate. Using absolute and relative references in the formula not only helps building models, but also makes them easier to change. Annex 1.The Solver of the Excel spreadsheet 307 7. Use borders, shading and colours for different types of data It is very important to distinguish the data cells, variable cells, the result cells and the objective cell in the spreadsheet. The use of shadows, borders and colours help us visualize the model quickly. 8. View the entire model in the spreadsheet The Solver uses a combination of spreadsheet and the Solver dialogue box to specify the model to be solved. For example, we can specify the inequalities in the Solver dialogue box without putting them into the spreadsheet. However, it is recommended that each model element appears on the screen. This is useful for later updates. In particular, all the elements of a constraint must appear on the screen. A good test is not using the Solver dialogue box in order to understand any model element. We must be able to identify the variable cells, the objective cell and constraints only by looking at the spreadsheet. ANNEX 2 THE MODELLING LANGUA GE AND OPTIMIZER: LINGO Annex 2. The modelling language and optimizer: LINGO 311 A modelling language and an optimizer are necessary tools to solve real decision making problems in practice. Thus they are also essential in teaching and learning the techniques that allow us to formulate, model and solve real decision making problems. Among software packages available in the market we have chosen LINGO for several reasons. First, it is an optimization software that incorporates a modelling language which allows generating big optimization models easily. It also permits importing and exporting data from and to Excel and databases. Furthermore it is available for Linux platform and a wide variety of hardware systems (compatible PC, Macintosh and working stations). As well as this for different sizes of models, from student's versions that may solve problems with 200 variables and 100 constraints, to more powerful versions that allow solving models with an unlimited number of variables and constraints. Evaluation versions can be downloaded from the LINDO Systems website (www.lindo.com). A2.1. FEATURES OF LINGO LINGO is an optimizer that allows us: 1. To solve direct models consisting of equations with independent variables and simultaneous equation systems. 2. To solve optimization models in which an objective function has to be maximized or minimized and whose variables must fulfil a number of constraints. It solves linear, integer, nonlinear and stochastic programming models. A Global optimizer is also included to find a global optimum in nonlinear programming. In addition a new feature is Chance-Constrained Programming. In this case one or more sets of constraints are allowed to be violated with a specified probability. This tool is useful when certain resources or demands are random. 3. To generate models through a modelling language, particularly useful for large models with many equations of similar structure. Furthermore, it allows the creation of the structure of the model and keeping it apart from the model's data. Data can be loaded from a file or spreadsheet. When using the modelling language, the system converts the expressions to the required form to be solved with the appropriate algorithm. For linear programming models the system uses the revised simplex method. It also has the interior point algorithm (Barrier Solver), useful for solving linear and quadratic models with a very big number of variables and constraints. If the system detects integer variables, it finds the solution with the branch and bound algorithm, adding cuts to limit the non-integer feasible region. For nonlinear models, it uses the generalized reduced gradient algorithm and the sequential linear programming algorithm. A Global optimizer is also included to find a global optimum in nonlinear programming. Finally, LINGO also incorporates a library with statistical, financial and mathematical formulae. Operations research in business administration and management 312 A2.2. ENTERING AND SOLVING MODELS The models can be input in the conventional way typing the functions or using the modelling language. In both cases the model is between two commands which are MODEL: and END. For example, the model Max 24 X1+ 20 X2 0.5 X1 + X2 d 1 X1 + X2 d 20 1.5 X1 + X2 d 24 1200 X1 - 800 X2 t 0 X1 t 0 X2 t 0 is indicated in the following way: MODEL: !EXAMPLE 1: ENERGY PRODUCTION AND POLLUTION CONTROL; [OBJ] MAX = 24 * X1 + 20 * X2; [SMOKE] 0.5 * X1 + X2 <= 12; [LOAD] X1 + X2 <= 20; [PULVERIZER] 1.5 * X1 + X2 <= 24; [SULPHUR] 1200 * X1 800 * X2 >= 0; END Note that in the input data we have to type the symbol * for multiplication and semicolon (;) for the end of a sentence, which may be a comment, the objective function or constraints. The comments start with the exclamation mark (!) and the names of the objective function and the constraints in brackets. We can also write variables in the Right-Hand-Side (RHS) of constraints. In LINGO menu, the option Solve displays the optimal solution, and the option Range the sensitivity analysis, as shown below for the previous example. To obtain the sensitivity analysis, it is necessary to select Prices & Ranges and the model has to be solved previously. To do so go to LINGO menu / Options…/ General Solver/ Dual computations/ Prices & Ranges. Annex 2. The modelling language and optimizer: LINGO 319 A2.4. VARIABLE DOMAIN FUNCTIONS: BOUND, FREE, INTEGER, BINARY AND SEMICONTINUOUS By default LINGO restricts variables to nonnegative values if Variables assumed non-negatives box is checked in LINGO Menu/ Options/ General Solver. That is, the variables can assume any real value from zero to positive infinity. @BND (lower_bound, variable_name, upper_bound) assigns lower and upper bounds to the variables. It is important to remember that a more efficient algorithm is used to solve the model if the bounds are indicated in this way. In addition, bounds do not count as constraints and larger models can be solved. @FREE(variable_name) allows the variable to take negative values, i.e., between negative infinity and positive infinity. @GIN (variable_name) makes the variable only take integer values. @BIN(variable_name) makes the variable be binary, i.e., take only 0/1 values. @SEMIC(lower_bound, variable_name, upper_bound) indicates a semicontinuous variable which is zero or lies within nonnegative range. LINGO generates the necessary binary variables and constraints that count for the size of models. LINGO supports SOS (Special Ordered Sets) and the following types of @SOS functions: @SOS1 At most, only one variable belonging to an SOS1 set will be greater than zero. @SOS2 At most, only two variables in a SOS2 set can be different from zero. If two variables are nonzero, then the variables will be adjacent to one another. @SOS3 In the SOS3 set one variable will be equal to 1 exactly and all remaining variables will be equal to zero. Any variable in SOS sets count as integer variables against the limit of integer variable imposed in some versions of LINGO. @CARD This function is related to cardinality sets of variables. It allows specifying a set of variables with at most N variables allowed to be nonzero. This function can improve the efficiency of branch & bound algorithm and reduce the number of variables and constraints of the model. Operations research in business administration and management 320 A2.5. MENUS: FILE, EDIT, LINGO, WINDOW AND HELP LINGO for Windows has five menus: File, Edit, LINGO, Windows and Help. We will describe some options briefly. FILE Menu: New (F2) creates a model. Open (Ctrl+O) opens an existing text file. Save (Ctrl+S) saves the active window as text. It may save models, reports or commands. Save as (F5) saves the active window with the name given by the user in the dialog box. It can save models, reports or commands. Close (F6) closes the active window. If it is a model with no name or the file has been modified, the program asks if you want to save the changes. Print (F7) sends the information of the active window to a printer. Print Setup (F8) to select a printer. Print Preview (Shift+F8) to view the document. Log Output (F9) sends all the following screens to a text file. You can select, overwrite on the existing file or add the following output. Take Commands (F11) Use this option to read batch files with models and commands to execute automatic operations. Export File (IMPORT and EXPORT). It serves to import and export files in MPS format. This format developed by IBM is useful to transfer models to other software or platforms. Database User Imp. For entering user ID and password information to access data base with @ODBC function. License shows information of software license. Exit (F10) to exit LINGO. EDIT Menu: Undo (Ctrl+Z) undoes the last action. Redo (Ctrl+Y) undoes the last command undo. Cut (Ctrl+X) cuts the selected text and sends it to the clipboard. Copy (Ctrl+C) copies the selected text to the clipboard. Paste (Ctrl+V) inserts the selected text at the place indicated by the cursor. Paste Special opens a dialog for pasting objects. Select All (Ctrl+A) selects all the contents of the edition window. Find… (Ctrl+F) searches for a string of text in the active window. Annex 2. The modelling language and optimizer: LINGO 321 Find Next (Ctrl+N) finds the next instance of the text most recently searched. Replace (Ctrl+H) permits us to find and replace text; this option is useful, for example, to change the names of the variables. Go to line (Ctrl+T) to introduce the line number of the active window in which we want to place the cursor. Match parenthesis (Ctrl+P) to find the closing parenthesis to that selected. It is useful in embedded sentences. If no parenthesis has been selected, LINGO chooses the one closest to the position of the cursor. Paste function to insert functions at the current cursor position. Choose first the category and then the function from the menu. Select Font... (Ctrl+J) to select the letter font of the active window or printer. Sometimes it is easier to display the document with courier font. Insert New Object Lets you insert OLE objects in the active window, such as tables, equations, charts… Links This option allows modifying the properties of the links to the external objects of a LINGO document. Object Properties (ALT+Enter) If we select this option after selecting an external object, LINGO allows us to change the object's options. LINGO Menu: Solve (Ctrl+U) solves the model stored in the memory. If there is more than one, LINGO solves the model of the active window. Solution (Ctrl+W) generates a solution report (text or graphical format) for the active window. We may want to see only the variables with nonzero values and/or only the constraints that are binding. Range (Ctrl+R) generates the report of sensitivity analysis, giving the range of values in which it can: 1. Change one coefficient of the objective function without modifying the optimal values of the decision variables. 2. Change one coefficient of the RHS without modifying the optimal values of the opportunity costs and the reduced costs. To enable range computations, select the General Solver Tab under LINGO/Options and in the Dual Computations list box, choose the Prices & Ranges option. Options (Ctrl+I) allows us to change some parameters of the LINGO interface, as well as LINGO solve the model. Interface shows a dialog box to control the appearance of LINGO, the output and the default file format. General Solver allows us, among many other possibilities, to ckeck the box Variables assumed non-negatives to place a lower bound of zero on all variables. Dual computations box permits us to select Prices & Ranges to obtain sensitivity analysis report. In General Solver tab we can indicate time and number of iterations used to solve the model by Runtime Limits. Operations research in business administration and management 322 Linear Solver provides options that allow configuring the way LINGO solves linear models. Among other possibilities we can choose primal simplex, dual simplex or interior point algorithm (Method/Primal simplex/Dual Simplex o Barrier). You can check a box to scale a model. The box Initial Linear Feasibility.Tol allows changing the tolerance value of the initial linear feasibility and by default it is 0.0000003. It is used at the initial stage of linear model solving in order to see whether a constraint is satisfied. Violations smaller than tolerance are ignored. The box Final Linear Feasibility.Tol controls the tolerance value of the final solution feasibility and by default it is 0.00000001. It is used at the final stages of model solving to see if the constraints are satisfied. Violations smaller than tolerance are ignored. Nonlinear Solver controls options that affect the algorithms to solve nonlinear models. Inicial Nonl Feasibility Tol. box indicates the tolerance of the initial nonlinear feasibility. By default, it is 0.001. Similarly, the box Final Nonl Feasibility.Tol provides the tolerance of the final nonlinear feasibility. By default, it is 0.000001. The two previous tolerances are used in a similar way to those used in linear models. Integer Pre-Solver has options to reformulate the model in order to solve it as fast as possible with branch and bound algorithm. The integer pre-solver operates only with linear integer models. Integer Solver tab provides options that allow us to configure the way in which LINGO solves integer programming models. The Branching box has two options for controlling the branching strategy used in branch and bound algorithm. The Direction field controls how LINGO makes branching decisions (up, down or both). Priority field permits us to decide if binary variables have priority in branching process. Due to a round-off error on digital computers, it is not always possible to find integer values for integer variables. We can manage several options in Integrality box, such as Absolute Integrality and Relative Integrality. The former tolerance is used as a test for integrality in integer programming models. This tolerance measures the difference between the variable value and an integer value. The latter tolerance is a similar concept measured in relative terms. LP Solver box allows us to select the algorithm to use in branch and bound process (primal simplex, dual simplex and barrier solver). Optimality box is used to control three tolerances. The Absolute Optimality tolerance is a positive value r, indicating to the branch and bound solver that it should only search for integer solutions with objective values at least r units better than the best integer solutions found so far. The Relative Optimality tolerance is a similar concept to the previous tolerance. In this case r is ranging from 0 to 1, indicating that branch and bound should only search for integer solutions with the objectives values at least 100* r % better than the best integer solution found so far. The Time to Relative tolerance is the number of seconds before the branch and bound solver begins using the Relative Optimality tolerance. Finally the Tolerances box includes some tolerances for controlling the branching strategy: Hurdle, node selection and strong branch. Hurdle allows entering a known value of objective function. Then LINGO will only search for integer solution in which the objective is better than the hurdle value. The Node Selection option permits controlling the order in which the algorithm selects branch nodes in the tree (Depth First, Worst Bound and Best Bound). Global Solver is an additional option of LINGO. It converts non-convex models into smaller convex models. It uses techniques such as linear programming and constraint propagation within a branch and bound framework to find global solution to non-convex models. Annex 2. The modelling language and optimizer: LINGO 323 Generate generates the current model report, useful for model verification. Picture represents the model in matrix form. This allows identifying repetitive structures in the model, and finding possible mistakes. Debug is a command useful in the search for problems in both infeasible and unbounded linear models. Model Statistics This option generates model statistics, such as number of variables, number of constraints, etc... Look (Ctrl+L) generates a report containing the model formulation. You can see all or selected rows. WINDOW Menu: Command Window (Ctrl+1) opens an access window to the command line. In general, Windows users do not require this window. Status Window (Ctrl+2) provides information about: Total number of variables in the model, grouped as linear and nonlinear. Status of the algorithm with the current status of the solution, the number of iterations performed, current sum of non-feasibilities, current value of the objective function, the best integer solution and the bound of the integer solution. The number of constraints of the model, divided into linear and nonlinear. The number of coefficients different from zero, divided into linear and nonlinear. Current memory used to store data. Time run to obtain the solution. Furthermore, this window has an option to stop the solving process. In this case, it provides the best solution found up to that moment including the message that it may not be optimal or feasible. There is an option to close the window. Finally, there is an option to indicate how often (in seconds) we want the window to be updated (update interval). In integer programming the window updates whenever a better integer solution is found, regardless of the value introduced. On the other hand, updating too often may increase solution times. Send to back (Ctrl+B) To send the active window to the back. For example, to move from the model window to the solution window. Finally LINGO also has other common options in Windows, applications, such as Close All, Tile, Cascade and Arrange Icons. Help menu allows us to access LINGO help. Operations research in business administration and management 324 A2.6. LINGO FUNCTIONS LINGO has several types of functions as follows: Standard operators, which are the arithmetic operators, the logical operators and the equality and inequality relationships. Arithmetic operators: Power^, multiplication*, division /, addition+ and subtraction-. Logical operators: #NOT#, #EQ#, #NE#, #GT#, #GE#, #LT#, #LE#, #AND# and #OR#. Equality and inequality relations: =,  and . It also accepts < and > for less or equal and higher or equal, respectively. These relationships should not be confused with the logical operators #EQ#, #LE# and #GE#. Variable domain functions: @BIN, @BND, @FREE, @GIN, @SEMIC, @SOS1, @SOS2, @SOS3, @CARD. File Import: @IMPORT and @FILE. The latter is used when the data are stored in a file different from the model. Financial functions: @FPA (I, N). @FPL (I,N). Mathematical functions: @ABS, @COS, @EXP… Set-Looping functions: @FOR, @MAX, @MIN, @SUM. Probability functions: @PBN, @PCX… ANNEX 3 MULTIPLE CRITERIA SOFTWARE FOR COLL ABORATIVE DECISION MAKING: EXPERT CHOICE COMPARION SUITE Annex 3. Multiple criteria software for collaborative decision making 327 A3.1. MODELLING: DESIGN OF DECISION HIERARCHY Expert Choice Comparion Suite is a web application designed for multiple criteria decision making both for a decision maker and for a working group. It uses the Analytic Hierarchy Process (AHP) and other methods to evaluate alternatives of a decision problem from the considered objectives (Rating Scale, Utility Curves or Step Function). Comparion facilitates tracking the preferences of all participants, their data and comments. The participants or group members can be: Project owner, the only one that can create a project in the web application (it is enough to indicate a name), Project manager, who can create and modify the structure and options of the project or decision problem and the Project evaluator that may only issue the requested value judgments. The project director or the manager can collect qualitative and quantitative information from all evaluators. Create a project Only the Project owner will be able to create a project. To log in into Comparion CoreTM as project owner or project manager, use the e-mail address and the password and instructions received from Expert Choice. To introduce the data for a new problem, click on the New Project button on the main menu. Enter the name and the description of the project and click OK. Decision hierarchy Structuring the decision problem includes defining criteria and objectives, identifying alternatives, mapping alternatives to objectives and defining measurement methods. Click on Structure in the main menu and Objectives on the secondary menu on the left of the screen. Select the goal of the project (decision problem). To enter the goal, right click on Goal and enter the goal description. Alternatively, you can click the left mouse button and enter the goal name. Additionally, you can introduce information about the project in the right-handwindow (Edit Information Document). To add objectives, right click on goal and select “Add (level below)” in “Objectives” which is in the hand corner of the window. A window will pop up. Enter your objectives in the pop up window. Click OK to add the objectives. Add the description or other necesary information. You can also create sub-objectives by selecting the desired objective and clicking on Add (level below). Operations research in business administration and management 328 Figure A.3.1 Structure of the multiple criteria decision making problem To add alternatives, right click on the word Alternatives on the main menu Structure and select Add to enter the alternatives one by one or select Paste from clipboard. Use this command to copy alternatives from another source (Figure A.3.1). Alternative to objective mapping is useful if you have a structure where certain alternatives cannot be measured against some objectives. Full mapping is the default mapping, that is, all objectives are related to all alternatives. In other words, all of the alternatives contribute to reaching all of the objectives. To define the relation, click on Contributions on the left side of the window and uncheck (click the check mark) the box next to the alternatives that you do not want to evaluate against the highlighted objective. A3.2. MULTIPLE CRITERIA METHODS After introducing the objectives and the alternatives we have to define the evaluation multiple criteria methods. This can be done from the main menu, under Measure. The measurement method determines how each of the evaluation steps are presented to the evaluator or evaluators in the case of collaborative decision making. The weight of the objectives can be obtained by pairwise comparison or direct assignment. Methods for evaluating the alternatives against the objectives of the lowest level of the hierarchy are as follows: 1. Rating Scale 2. Pairwise Comparison 3. Utility Curves (Simple o Advanced) 4. Step Function 5. Direct Input