LINEAR PROGRAMMING Vassilis Kostoglou E-mail: vkostogl@it.teithe.gr URL: www.it.teithe.gr/~vkostogl/en LINEAR PROGRAMMING - V. Kostoglou 1 The problem of limited resources • Every business activity requires resources • There are several types of resources, such as: – Capital – Human resources – Equipment – Available time – Raw materials • In real life there are constraints in all types of resources making them limited • The problem: the optimal allocation of limited resources LINEAR PROGRAMMING - V. Kostoglou 2 What is Mathematical Programming? Mathematical programming is used to find the optimal or best available solution to a problem that requires a decision or set of decisions about how best to use a set of limited resources to achieve an objective. Steps involved in Mathematical Programming - Conversion of a stated problem into a mathematical model that abstracts all the essential elements of the problem - Exploration of different solutions of the problem - Finding out the optimal of most suitable solution Linear programming requires that all the mathematical functions of the model are linear functions. LINEAR PROGRAMMING - V. Kostoglou 3 What is Linear Programming (LP)? A mathematical technique helping to plan and make decisions relative to the necessary balances to allocate resources. Calculates find the minimum or maximum value of the objective function. Guarantees the optimal solution to the model formulated. Linear programming is a widely used mathematical modeling technique to determine the optimum allocation of resources among competitive requirements. Resources typically include raw materials, manpower, machinery, time, capital, space, volume etc. LINEAR PROGRAMMING - V. Kostoglou 4 LP is a powerful tool which has been proved very useful due to its application in many different types of real business problems in areas like finance, production, sales and distribution, personnel management, marketing and several others. As its name implies, the LP model consists of linear objective function and linear constraints, implying that the variables of the model have a proportionate relationship. LINEAR PROGRAMMING - V. Kostoglou 5 Historical overview 1928 – John von Neumann published the Relative Central Theorem of Game Theory 1944 – Von Neumann and Morgenstern published the Theory of Games and Economic Behavior 1936 – W.W. Leontief published "Quantitative Input and Output Relations in the Economic Systems of the US" which was a linear model without objective function 1939 – Kantoravich (Russia) actually formulated and solved a LP problem 1941 – Hitchcock poses the Transportation Problem (special case of LP) WW II – Allied forces formulate and solve several LP problems related to military LINEAR PROGRAMMING - V. Kostoglou 6 A breakthrough occurred in 1947... US Air Force wanted to investigate the feasibility of applying mathematical techniques to military budgeting and planning. George Dantzig proposed that the interrelations among activities in a large organization can be viewed as a LP model and that the optimal program (solution) can be obtained by minimizing a single linear objective function. Air Force initiated the project SCOOP (Scientific Computing of Optimum Programs). SCOOP began in June 1947 and at the end of that summer Dantzig and associates had developed: 1) An initial mathematical model of the general linear programming problem. 2) A general method of solution called the Simplex method. LINEAR PROGRAMMING - V. Kostoglou 7 The essentials of the Linear Programming model For a given problem situation, there are certain essential conditions that need to be solved by using Linear Programming: 1. Limited resources: limited number of labour, material equipment and finance 2. Objective: refers to the optimization aim (maximize profits or minimize costs) 3. Linearity: the increase of labour input will cause a proportionate increase of output 4. Homogeneity: products, workers, efficiency, and machines are assumed to be identical 5. Divisibility: it is assumed that resources and products can be divided into fractions (in practice these fractions are not possible, like production of one-third of a computer - in these cases a modification of Linear Programming called Integer Programming can be used) LINEAR PROGRAMMING - V. Kostoglou 8 Some characteristic LP applications 1. Scheduling school buses to minimize the total distance traveled. 2. Allocating police patrol units to high crime areas in order to minimize response time to calls. 3. Scheduling bank tellers so that needs are met during each hour of the day while minimizing the total labour cost. 4. Selecting the product mix in a factory to make best use of machine and labour hours available while maximizing the company's net profit. 5. Picking blends of raw materials in animal feed production plants to produce finished feed combinations at minimum cost. 6. Determining the distribution system that minimizes total shipping cost. LINEAR PROGRAMMING - V. Kostoglou 9 7. Developing a production schedule that will satisfy future demands for a firm’s product and at the same time will minimize the total production and inventory costs. 8. Allocating the available renting space in a new shopping mall so that to maximize the revenues of a leasing company. LINEAR PROGRAMMING - V. Kostoglou 10 Requirements of an LP problem 1. LP problems seek to maximize or minimize a quantity (usually profit or cost) expressed as an objective function. 2. The presence of restrictions or constraints limits the degree to which an objective can be pursued. 3. There must be alternative courses of action to choose from. 4. The objective function and the constraints in linear programming problems must be expressed in terms of linear equations or inequalities. LINEAR PROGRAMMING - V. Kostoglou 11 A Linear Programming model seeks to maximize or minimize a linear function, subject to a set of linear constraints. The linear model consists of the following components: - A set of decision variables - An objective function - A set of constraints LINEAR PROGRAMMING - V. Kostoglou 12 The importance of Linear Programming Many real world problems lend themselves to linear programming modeling. Also many of these real problems can be approximated by linear models. There are well-known successful LP applications in: – Manufacturing – Marketing – Finance and investment – Advertising – Agriculture There are efficient techniques that solve LP models. The outputs generated from LP computer packages provide a very useful “what if” analysis called sensitivity analysis. LINEAR PROGRAMMING - V. Kostoglou 13 Assumptions of the linear programming model The parameters' values are known with certainty. The objective function and the constraints exhibit constant scale returns. Τhe additivity assumption: There are no interactions between the decision variables. The continuity assumption: Variables can take any value within a given feasible range. LINEAR PROGRAMMING - V. Kostoglou 14 Integer and mixed-integer problems A LP problem in which all the decision variables must have integer values is called an integer programming problem. A problem in which only some of the decision variables must have integer values is called a mixed-integer programming problem. Sometimes, some (or all) of the decision variables must have the value of either 0 or 1. Such problems are then called zero-one mixed-integer programming problems. Simplex method cannot be used to such problems. Advanced methods are available for this purpose. LINEAR PROGRAMMING - V. Kostoglou 15 Generally about LP Problems of resources’ optimal allocation. Expressed with a linear first degree function. Optimization of a function which is subjected to constraints. For non linear functions “non linear programming” is used. Other cases: Mathematical programming, Integer programming, Programming of separable variables. LINEAR PROGRAMMING - V. Kostoglou 16 A model example A chemical factory produces three independent products A, B and C. Each product is processed sequentially by the machines Χ, Y and Ζ as following: - Product Α: processing by the machines Χ and Y - Product Β: processing by the machines Χ, Y and Ζ - Product C: processing by the machines Y and Ζ Graphical representation of the production process LINEAR PROGRAMMING - V. Kostoglou 17 Each product liter requires one unit of machine capacity Daily machine capacities: - Χ: 100 units - Υ: 200 units - Ζ: 400 units Net profits for each liter of Α, Β and C are in proportion 3:4:2 Unlimited demand for products Α and C Maximum daily demand of Β: 80 liters According to current management’s decision, the following amounts are produced daily: 80 liters of product Β, 20 liters of product Α and 120 liters of product C. Is this the most appropriate policy regarding profit maximization? LINEAR PROGRAMMING - V. Kostoglou 18 Configuration of the mathematical model max F = 3*x1+4*x2+2*x3 with structure constraints: x1+x2 100 (for machine Χ) x2+x3 200 (for machine Y) x1+x2+x3 400 (for machine Ζ) x2 80 (from daily maximum demand) and non-negativity constraints x1, x2, x3 0 LINEAR PROGRAMMING - V. Kostoglou 19 The standard LP model max f (X) c1 x1 c2 x... cn xn with structure constraints: a11 x1 a12 x2 ... a1n xn b1 a21 x1 a22 x2 ... a2 n xn b2 ............................................ am1 x1 am 2 x2 ... amn xn bm and non-negativity constraints x1 0, x2 0, ... , xn 0 LINEAR PROGRAMMING - V. Kostoglou 20 Model variations Minimization of the objective function Some of the constraints may have > or >= or < or = Some of the decision variables are not necessarily non-negative In every case, a mathematical representation equivalent to the standard LP model has to be determined. LINEAR PROGRAMMING - V. Kostoglou 21 Alternative LP model formulation max f (X) C * X with constraints A * X P0 X0 where a11 a12 ... a1n a a ... a 22 2n 21 . . . . A . . . . . . . . an1 an 2 ... ann x1 x 2 . X . . xn b1 b 2 . P0 . . bm LINEAR PROGRAMMING - V. Kostoglou C [c1 c2 ... cn] 22 LP terminology Restrictive line A straight line corresponding to a constraint of the model. Vertex or extreme point A point at which two restrictive lines are intersecting. Solution Every combination of the decision variables’ values. Feasible solution A solution satisfying all the constraints. Non feasible solution A solution not satisfying at least one of the constraints. LINEAR PROGRAMMING - V. Kostoglou 23 Feasible region The (curved) region of feasible solutions formed by the restrictive lines. Extreme point feasible solution Is one of the vertexes of the feasible region. Neighboring feasible solutions They are connected with an edge (boundary) of the feasible region. Basic solution (extreme point solution) A solution corresponding to a vertex (has non-zero variables equal to the number of the constraints). Non basic solution A solution that is not on a vertex of the feasible region and can be feasible or non feasible. LINEAR PROGRAMMING - V. Kostoglou 24 Basic feasible solution A basic solution that corresponds to a vertex of the feasible region and all its variables are non-negative. Slack value Any excess of an available resource (constraint symbol < or <). Surplus value Any "surpassing" (surplus) of a requirement (constraint symbol > or >). Auxiliary variables Variables corresponding to slack values and surplus values. Basic (non basic) variable A non-zero (zero) variable in a solution containing decision and auxiliary variables. Active (or mandatory) constraint When the resource is completely consumed or there is no surplus (zero slack or surplus respectively). LINEAR PROGRAMMING - V. Kostoglou 25 Non mandatory constraint When a resource is not exhausted (<) or a requirement is being surpassed (>) (non-zero slack or surplus respectively). Optimal solution The feasible solution of an extreme point that gives to the objective function the optimal value (maximum or minimum). The optimal solution can be only one; however there are a case with unlimited optimal solutions or no optimal solution or the value of the objective function tends to infinity. In every case the amount of feasible solutions of an extreme point is finite. When a feasible solution of an extreme point is better than all its neighboring then this solution is the optimal. Optimal value The value of the objective function that corresponds to the optimal solution. LINEAR PROGRAMMING - V. Kostoglou 26 Example 1 A manufacturing industrial unit produces three conventional television models (standard, deluxe and super) and a high-tech model (high-tech). Management is certain that all production can be purchased in the market. Each device passes in the production process from all three relevant departments: the workshop, the assembly, and the final control. The number of working hours required for each device type in each department is listed in the following table. Departments /TV types Standard Deluxe Super High-tech Workshop 12 15 15 25 Assembly 10 12 13 20 Control 1/2 3/5 2 2 LINEAR PROGRAMMING - V. Kostoglou 27 The total capacity of the unit and the capacities of the three departments do not allow more than 2500, 3000 and 240 man-hours per day in the workshop, assembly and control respectively. Moreover, due to existing signed contracts at least 50 standard and 50 deluxe devices must be produced daily. The net profit (selling price - total unit cost) from the sale of one unit of each device is: Standard Deluxe Super Profit (€) 25 30 40 Hightech 100 Questions: 1. Formulate a linear programming model to determine the optimal production mix. 2. Investigate the possibility of reducing the dimensions of the Simplex tableau by removing any redundant constraints. LINEAR PROGRAMMING - V. Kostoglou 28 Problem analysis Decision variables: The production quantities of the four TV types: x1, x2, x3, x4 Objective function: Maximization of the total profit - F = 25*x1 + 30*x2 + 40*x3 + 100*x4 Constraints for each department Constraints for the production quantities LINEAR PROGRAMMING - V. Kostoglou 29 Model formulation max F 25x1 30x2 40x3 100x4 with constraints 12 x1 15 x2 15 x3 25 x4 2500 10 x1 12 x2 13x3 20 x4 3000 (1 / 2) x1 (3 / 5) x2 2 x3 2 x4 240 x1 50 x2 50 and x1 , x2 , x3 , x4 0 LINEAR PROGRAMMING - V. Kostoglou 30 Observing the first two structure constraints it can be seen that: 10 x1 12 x2 13x3 20 x4 12 x1 15x2 15x3 25x4 2500 3000 i.e. the left side of the second constraint is obviously smaller than the right side. So, the second constraint is surplus and therefore it can be removed. The problem can be simplified more if the following transformation of variables is carried out: x1 50 x1 50 0 x1 0 x2 50 x2 50 0 x2 0 LINEAR PROGRAMMING - V. Kostoglou 31 Substituting in the constraints x1 x1 50 and x2 x2 50 indicates that 12 x1 15 x2 15 x3 25 x4 1150 (1 / 2) x1 (3 / 5) x2 2 x3 2 x4 185 Dividing the first constraint by ~ 6.22 (= 1150/185) indicates that 1.93x1 2.4 x2 2.4 x3 4 x4 185 This relation 'covers' the second constraint of the problem LINEAR PROGRAMMING - V. Kostoglou 32 Final LP model of the problem max F 25x1 30x2 40x3 100x4 with just one structure constraint 12x1 15x2 15x3 25x4 1150 and x1, x2 , x3 , x4 0 where x1 x1 50 x2 x2 50 F F 2750 LINEAR PROGRAMMING - V. Kostoglou 33 Example 2 A housewife faces the problem of purchasing quantities of meat, potatoes and vegetables, which constitute her main personal diet. She has already been informed by the dietitian of a women's magazine that her full weekly diet nutrition should contain as a minimum requirement 8 units of carbohydrates, 15 units of protein and 6 units of vitamins. The unit numbers of these three constituents contained in each unit of weight (kg) of the three foods and the food unit costs are shown in the following table. Foods Meat Potatoes Vegetables Carbohydrates 3 1 1 Proteins 4 3 4 Vitamins 1 3 1 Cost (€/kg) 10 1 2 Nutrients LINEAR PROGRAMMING - V. Kostoglou 34 The housewife would like to know the quantities of each food she should purchase, so that to meet the minimum requirements of these basic ingredients and minimize the total purchasing cost. After some time a new nutrient requirement consisting of 7 units of calcium has been added to housewife’s dietary. Each kg of meat, potatoes and vegetables contain 2, 1 and 4 units of calcium, respectively. How this additional requirement of the new ingredient affects the quantities that must be purchased with a minimum cost? LINEAR PROGRAMMING - V. Kostoglou 35 Problem analysis Decision variables: The quantities (kg) of meat, potatoes and vegetables - x1, x2, x3 Objective function: Minimization of total cost: F = 10*x1 + 1*x2 + 2*x3 Constraints of nutrients (minimum required quantities) LINEAR PROGRAMMING - V. Kostoglou 36 Model formulation min F 10x1 x2 2 x3 with constraints 3 x1 1x2 1x3 8 4 x1 3 x2 4 x3 15 1x1 3 x2 1x3 6 and x1 , x2 , x3 0 LINEAR PROGRAMMING - V. Kostoglou 37 For the new additional nutrient (calcium) the addition of a new constraint is required: 2 x1 1x2 4 x3 7 When the problem with the new constraint is solved the influence of the new nutrient to the cost and composition of the diet can be determined. What is sensitivity analysis LINEAR PROGRAMMING - V. Kostoglou 38 Example 3 A hydraulic components production small company manufactures two types of safety valves. For this purpose the company buys matrices (molds) from an external supplier, and then processes, holes and smoothes them. The respective production rates expressed in number of valves per hour - of the above three phases are presented in the following table. Valves production rates per phase Type Α Type Β Phase Processing 30 40 Holing 28 35 Smoothing 30 25 Valve type LINEAR PROGRAMMING - V. Kostoglou 39 Each matrix for type A valves costs €2, while that for type B valves costs €3. The ready valves of type A and B are sold €5 and €6 respectively. The use of the three basic production machines (lathe, drill, and grinder) implies a current operating cost, which equals €20, €14 and €20 per working hour respectively. It is considered that there is no restriction in the amounts or combination of the valves of the two types that can be sold in the market. Develop the appropriate mathematical model to determine the mix of production that maximizes the total net profit. LINEAR PROGRAMMING - V. Kostoglou 40 Problem analysis Decision variables: The number of valves of type Α and Β produced per hour - x1, x2 Constraints: There are not obvious constraints originating neither from the production process nor from the capacities of the 3 phases. The only constraint is time; essentially the hourly rates of valves production. Lathe (phase 1): In one hour it produces 30 valves Α or 40 valves Β one unit of type Α is produced in 1/30 of the hour, while one unit of type Β in 1/40 of the hour x1 units of type Α in x1/30 hours and x2 units of type Β in x2/40 hours total required time: x1/30 + x2/40 The time constraint of lathe is: x1/30 + x2/40 1 (hour) LINEAR PROGRAMMING - V. Kostoglou 41 Drill (phase 2): In one hour it produces 28 valves of type Α or 35 valves of type Β one unit of type Α is produced in 1/28 of the hour and the 1Β in 1/35 x1 units of A in x1/28 and x2 units of B in x2/35 total time: x1/28 + x2/35 The time constraint of lathe is: x1/28 + x2/35 1 (hour) Grinder (phase 3): In one hour produces 30 valves Α or 25 valves Β one unit of type Α in 1/30 of the hour, while one unit of type Β in 1/25 x1 units of A in x1/30 and x2 units of B in x2/25 total time: x1/30 + x2/25 The time constraint of lathe is: x1/30 + x2/25 1 (hour) LINEAR PROGRAMMING - V. Kostoglou 42 Cost of each valve of type Α: If in 1 hour the lathe produces 30 units and the hourly operating cost is €20, this means that the cost of each unit is €20/30. In the drill (with the same reasoning) the cost is €14/28. In the grinder the production cost of each unit is €20/30. Total cost of producing a unit of type A: 20/30 +14/28 +20/30 = €11/6 Cost of each valve of type B: With the same analysis and by summing the individual costs on the 3 machines, the total production cost of each unit is: 20/30 +14 / 28 +20 / 30 = €11/6 Net profit from the sale of each unit: Profit from the sale of each unit of type A: €5 - (€2 + €11/6) = €7/6 Profit from the sale of each unit of type B: €6 - (€3 + €17/10) = €13/10 Total hourly production profit: (7/6)*x1 + (13/10)*x2 LINEAR PROGRAMMING - V. Kostoglou 43 The LP model max F 7 13 x1 x2 6 10 with constraints x1 x2 1 30 40 x1 x2 1 28 35 x1 x2 1 30 25 and x1 , x2 0 LINEAR PROGRAMMING - V. Kostoglou 44 Example 4 A company manufactures two new models of modern refrigerators with corresponding names "no frost'' and" freezer ". The production area is divided in three departments: the forming part (F) where the final surfaces are formed, the assembly (A), and the painting (P) where the final finishing and painting of the refrigerators are made. Each refrigerator type needs a different number of working hours in each department. So, each batch of 12 refrigerators "no frost" needs 60, 80 and 20 working hours in departments F, A and P respectively, while the respective batch of 12 refrigerators "freezer" needs 70, 85 and 10 working hours in each of the three departments respectively. The staffing of the departments is such, that the working hours available to each of them are 2400, 3000 and 600 respectively during a working month. Design a monthly production schedule minimizing the total idle time of the staff. LINEAR PROGRAMMING - V. Kostoglou 45 Problem analysis Decision variables: Number of batches of the 2 refrigerators types - xNF, xF Constraints in the available working hours in each department: Forming (F): 60xNF + 70xF 2400 Assembly (A): 80xNF + 85xF 3000 Painting (P): 20xNF + 10xF 600 The difficulty of the problem lies in the creation of the objective function as there are no economic data, the aim being to minimize the unused time. LINEAR PROGRAMMING - V. Kostoglou 46 Observing the composition of the three constraints referred to man-hours, it comes up that the unused time in each department is the difference between the right (available working hours) and the left (actual working hours) side of the corresponding constraint. Thus we can define new variables x1, x2, and x3, symbolizing the unused (idle) times of departments F, A and P respectively. Idle times of each department: Department F: 60xNF + 70xF 2400 60xNF + 70xF + x1 = 2400 Department A: 80xNF + 85xF 3000 80xNF + 85xF + x2 = 3000 Department P: 20xNF + 10xF 600 20xNF + 10xF + x3 = 600 LINEAR PROGRAMMING - V. Kostoglou 47 LP model formulation min F 6000 160xNF 165xF with constraints 60 x NF 70 xF 2400 80 x NF 85 xF 3000 20 x NF 10 xF 600 and xNF , xF 0 LINEAR PROGRAMMING - V. Kostoglou 48 Example 5 Nori & Leets Co., one of the largest steel producers in the world, is located next to Steeltown and is nearly the sole employer of its inhabitants. Steeltown grew and progressed rapidly along with the company, which now employs nearly 50.000 of its inhabitants. For this reason the mentality of its residents for many years has been: "whatever is good for Nori & Leets is good for the city too." However this has now changed, because uncontrolled air pollution from factory furnaces has altered the city environment and endangered the health of the population. A recent uprising of the shareholders led to the election of a new enlarged managing board. New management is determined to pursue a responsible social policy and has already discussed with officials of the municipality and representatives of the citizens about what should be done concerning the problem of air pollution. They have mutually concluded to strict specifications of air quality for city’s atmosphere. LINEAR PROGRAMMING - V. Kostoglou 49 The three main types of pollution factors in the atmosphere of the region are particulates, sulfuric oxides and hydrocarbons. The new measures require that the company must reduce its annual emissions of these pollution factors by the following amounts (expressed in thousands of tons). Required annual reductions of contaminants’ emissions Pollution factor Particulates Required reduction of annual emission rate (thousand tons) 60 Sulfuric oxides 150 Hydrocarbons 125 The managing board instructed company’s engineers to determine how the required decreases can be achieved in the most economical manner. LINEAR PROGRAMMING - V. Kostoglou 50 The operation of the factory implies two main pollution sources: a) the blast furnaces used to produce cast iron, b) the open hearth furnaces used to convert iron into steel. In both cases, engineers suggested that the most effective ways of mitigating pollution are: 1) increasing the height of the furnaces, 2) using filters (including gas traps) in the furnaces, and 3) improving the quality of fuels (using cleaner high-quality ingredients) used in the furnaces. All these methods have some specific technological limits on the amount of the emission of the pollution factors that can wipe out as shown in the table below. Nevertheless, these methods can be used in any fraction (percentage) of their potential of pollution mitigation. Moreover, as the function of the three methods is independent, the emission reduction achieved by each of them is not significantly affected by simultaneous use of anyone of the others. LINEAR PROGRAMMING - V. Kostoglou 51 Reductions of emission rates by the full use of each method of pollution mitigation (in thousand tons per year) Higher furnaces Pollution factors Filter use Improved fuels Blast Open hearth Blast Open hearth Blast furnaces furnaces furnaces furnaces furnaces Open hearth furnaces Particulates 12 9 25 20 17 13 Sulfate oxides 35 42 18 31 56 49 Hydrocarbons 37 53 28 24 29 20 After the collection of the above data it became obvious that none of the three methods was sufficient itself to achieve all necessary reductions in environmental pollution. However, the combination of all methods in full capacity on the one hand would be more than enough, and on the other hand the total cost would be prohibitive for the company if, as natural, the prices of its products should continue to be competitive. LINEAR PROGRAMMING - V. Kostoglou 52 For these reasons the company's engineers concluded that a combination of these methods should be used, probably with fractions (percentages) of their full capacity of pollution mitigation based on the corresponding costs. Moreover, because of the differences between the blast furnaces and the open hearth furnaces, probably should not be used the same combination of methods in these two types of furnaces. It was also specified that the cost of a method’s reduced use is directly proportional to the percentage of its capacity. Thus, for any given fraction used, the corresponding annual cost is equal to the appropriate percentage of the full cost. The company then conducted detailed costing to estimate the total annual cost for the implementation of each of the three pollution mitigating methods. Apart of the increased operating and maintenance costs, it was also given emphasis in both the fixed cost of each method (which was converted to its equivalent on annual basis) and at any intermediate loss in the efficiency of the production process. This analysis resulted in the following estimates of the annual cost for using each method to full capacity. LINEAR PROGRAMMING - V. Kostoglou 53 Annual cost of using each pollution mitigation method (in millions of €) Mitigation method Blast furnaces Open hearth furnaces Higher furnaces 8 10 Filter use 7 6 Improved fuels 11 9 The final stage of the preliminary study was the development of a general frame for the overall plan of the company on pollution mitigation. The project consists of determining the methods which will be used for the reduction of the pollution and the possible fractions of their use. Due to the combined nature of the problem of determining the plan that meets all the requirements at minimum cost, an Operational Research group was formed to solve it. The group adopted an approach using Linear Programming. Which was it? LINEAR PROGRAMMING - V. Kostoglou 54 Problem analysis Decision variables: x1: heighten the blast furnaces x2: heighten the open hearth furnaces x3: filter use in the blast furnaces x4: filter use in the open hearth furnaces x5: fuels improvement in the blast furnaces x6: fuels improvement in the open hearth furnaces where xi (i = 1, 2, …6) the fraction used of the corresponding method Total cost: 8x1+10x2+7x3+6x4+11x5+9x6 LINEAR PROGRAMMING - V. Kostoglou 55 Constraints from the reductions of the pollution factors: For the particulates: 12x1+9x2+25x3+20x4+17x5+13x6 60 For the sulfate oxides: 35x1+42x2+18x3+31x4+56x5+49x6 150 For the hydrocarbons: 37x1+53x2+28x3+24x4+29x5+20x6 125 LINEAR PROGRAMMING - V. Kostoglou 56 The LP model min F 8x1 10x2 7 x3 6 x4 11x5 9 x6 with nine structure constraints 12 x1 9 x2 25 x3 20 x4 17 x5 13x6 60 35 x1 42 x2 18 x3 31x4 56 x5 49 x6 150 37 x1 53x2 28 x3 24 x4 29 x5 20 x6 125 x1 , x2 , x3 , x4 , x5 , x6 1 and x1 , x2 , x3 , x4 , x5 , x6 0 LINEAR PROGRAMMING - V. Kostoglou 57 Example 6 A paper industry produces among other products white high resolution paper, which is wrapped in two meters long pieces in standardized cylinders of one meter height. The white paper is cut into a number of smaller and probably different lengths, with fixed height of one meter, in order to meet all customers’ orders. The paper industry received last week the following orders. The lengths are expressed in palms (tenths of meter, i.e. 10 cm), which is the usual measure of this type of paper. Weekly orders Length (palms) Number of items 9 30 7 150 5.5 65 LINEAR PROGRAMMING - V. Kostoglou 58 The industry would like to cut the fixed length of 20 palms white papers so that to satisfy all the above orders, and to minimize the total wastage (loss). Design an appropriate mathematical model for solving the problem of the paper industry with the use of Linear Programming. LINEAR PROGRAMMING - V. Kostoglou 59 Problem analysis It is not possible to cut more than three pieces of white paper from one cylinder (e.g. 3*5.5 = 16.5 and 3.5 palms as wastage - this way can be symbolized as: 5.5, 5.5, 5.5 – wastage 3.5). Each cylinder can be cut to one, two or three pieces by the following 13 possible ways (lengths of pieces - wastage): (9, 0, 0 - 11) - (9, 9, 0 - 2) - (9, 7, 0 - 4) - (9, 5.5, 0 - 5.5) - (9, 5.5, 5.5 - 0) (7, 0, 0 - 13) - (7, 7, 0 - 6) - (7, 7, 5.5 - 0.5) - (7, 5.5, 0 - 7.5) - (7, 5.5, 5.5 - 2) (5.5, 0, 0 – 14.5) - (5.5, 5.5, 0 - 9) and (5.5, 5.5, 5.5 - 3.5). Every possible way of cutting the blotting paper can be represented by a variable xi. Consequently 13 variables are defined: x1, x2, …x13 (i = 1, 2,.. 13): number of cylinders that are cut by the ith way LINEAR PROGRAMMING - V. Kostoglou 60 Total loss: Minimization of the objective function F = 11*x1 + 2*x2 + 4*x3 + 5.5*x4 + 0*x5 + 13*x6 + 6*x7 + 0.5*x8 + 7.5*x9 + 2*x10 + 14.5*x11 + 9*x12 + 3.5*x13 Constraints: For the 30 pieces of 9 palms: 1x1 + 2x2 + 1x3 + 1x4 + 1x5 = 30 For the 150 pieces of 7 palms: 1x3 + 1x6 + 2x7 + 2x8 + 1x9 + 1x10 = 150 For the 65 pieces of 5,5 palms: 1x4 + 2x5 + 1x8 + 2x9 + 2x10 + 1x11 + 2x12 + 3x13 = 65 Also, for all variables non-negativity constraints apply. LINEAR PROGRAMMING - V. Kostoglou 61 Organization of the mathematical model 1) Conversion of the objective function and constraints in the LP model format. 2) Change the inequality direction of the required constraints, so that the right hand sides of all constraints are non-negative numbers. Consequently, if the right hand side of a constraint is negative, a change of the sign and the inequality direction is needed (multiplying both sides by -1). 3) Conversion of the structure constraints which are inequalities to equivalent equalities. This is achieved by the addendum (addition if the direction of the inequality is < or or deduction if the direction is of the format > or ) of new nonnegative variables, which are called dummy variables (slack or surplus). 4) Construction in the left hand side of the structure constraints of a complete unary table by adding the appropriate number of new variables, called artificial variables. LINEAR PROGRAMMING - V. Kostoglou 62 Methodology of graphical solution 1. Each constraint is initially considered as equality and is plotted by a line (or a level in three-dimensional problems). 2. The part of the level (or of the space in three-dimensional problems), which’s all points verify a specific constraint is identified for every constraint. [The fastest way is to check whether the intersection of the axes (coordinate 0,0) verifies the constraint (what is valid for this coordinate will also be valid for all points belonging to the same semi-level)] 3. The intersection of all semi-levels is defined, which verifies all the constraints. Consequently all vertices of the intersection are being defined. 4. The objective function f(x) is plotted, consisting of the family of parallel lines with a standard direction coefficient. The different values of the objective function are represented by the corresponding parallel lines. LINEAR PROGRAMMING - V. Kostoglou 63 5. The objective function line moves in parallel to herself to the direction where her value increases (or decreases if the aim is its minimization), until it meets with the part of the level which is the intersection of all constraints. From the family of lines meeting the intersection of the constraints, only the lines crossing the intersection vertices are considered. 6. The values of the lines crossing the intersection vertices are calculated. The vertex, from which passes the line with the highest (smallest in minimization problems) value is the optimum solution of the problem. The values of the variables consisting the optimum solution are the coordinates of this vertex. LINEAR PROGRAMMING - V. Kostoglou 64 Graphical solution of maximization problems max f(x) = x1 + 2x2 with structure constraints 2x1 + x2 20 x1 + x2 12 x1 + 3x2 15 and non-negativity constraints x1, x2 0 LINEAR PROGRAMMING - V. Kostoglou 65 Graphical solution of maximization problem LINEAR PROGRAMMING - V. Kostoglou 66 Vertex Coordinates f(x) value Α (0,0) 0 Β (0,5) 10 C (9,2) 13 D (10,0) 10 Thus, the maximum value of f(x) is 13, the corresponding line meets vertex C, and the values of the variables are x1 = 9 and x2 = 2. LINEAR PROGRAMMING - V. Kostoglou 67 Graphical solution of minimization problems min z(x) = 24x1 + 18x2 with structure constraints 120x1 + 60x2 480 56x1 + 112x2 440 103x1 + 120x2 720 and non-negativity constraints x1 , x2 0 LINEAR PROGRAMMING - V. Kostoglou 68 Graphical solution of minimization problem LINEAR PROGRAMMING - V. Kostoglou 69 Solving the system of the two equations results in: x1 = 1.752 and x2 = 4.496 Thus, the minimum value of the objective function is: Min Ζ = 24*1.752 + 18*4.496 = 122.98 LINEAR PROGRAMMING - V. Kostoglou 70 The Simplex method A large variety of Simplex-based algorithms exist to solve LP problems. Other (polynomial type) algorithms have been developed for solving LP problems: - Khachian algorithm (1979) - Kamarkar algorithm (AT&T Bell Labs, mid 80s) None of these algorithms has been able to beat Simplex in actual practical applications; hence Simplex (in its various forms) is and will most likely remain the most dominant LP algorithm for at least the near future. LINEAR PROGRAMMING - V. Kostoglou 71 Fundamental theorem Extreme point (or Simplex filter) theorem: If the maximum or minimum value of a linear function defined over a polygonal convex region exists, then it is certain that this value is at the boundary of the region. A finite number of extreme points imply a finite number of solutions. Hence, the search is reduced to a finite set of points. However, a finite set can still be too large for practical purposes. Simplex method provides an efficient systematic search guaranteed to converge in a finite number of steps. LINEAR PROGRAMMING - V. Kostoglou 72 General form of the initial Simplex tableau Base x1 x2 … xn xn+1 xn+2 ... xn+m R.H. xn+1 a11 a12 ... a1n 1 0 ... 0 b1 xn+2 a21 a22 ... a2n 0 1 ... 0 b2 ............................................................. ... ... xn+m am1 -f c1 am2 ... amn 0 0 ... 1 bm c2 ... 0 0 ... 0 0 cn LINEAR PROGRAMMING - V. Kostoglou 73 Previous Simplex tableau Base x1 ... xm xm+1 ... Xs ... xn+m R.H. x1 1 ... 0 a1,m+1 ... a1,s ... a1,n b1 ... ... ... ... ... ... ... ... 0 0 ... ... ... ... ... ... ... ... ... ... ... xr 0 0 ar,m+1 ar,s ar,n br ... ... ... ... ... ... ... ... 0 0 ... ... ... ... ... ... ... ... ... ... ... xm 0 ... 1 ar,m+1 ... am,s ... am,n bm ... 0 ... 0 cm+1 ... cs ... cn -f0 ... LINEAR PROGRAMMING - V. Kostoglou 74 New (current) Simplex tableau Base x1 … … ... xr … ... ... xm -f x1 .. xr .. .. 1 0 - a1sarr 0 ... ... ... 1 0 arr= ars … … ... ... ... ... 0 -amsarr 0 .... csarr..... xm .... xm+1 ......... xs ............ xn+m 0.. ...a1,m+1 -a1,sar,m+1 0 a1,m+1 -a1,sar,m+1 ... ... … ... ... ... ... ... ar,m+1 ar,n 0 ar,m+1 = 1 arn = ars ars ... ... … … ... ... ... ... ... ... ... ... 1 am,n+1 -am,sar,m+1 0 am,n -am,sar,n 0 cm+1 -csar,m+1 .... 0 .... cn-csar,n LINEAR PROGRAMMING - V. Kostoglou R.H. b1-a1,sb’r … … br = b’r ars … … … bm-amsbr -f0-csar,n 75 Basic steps of Simplex 1. Begin the search at an extreme point (i.e. a basic feasible solution). 2. Determine if the movement to an adjacent extreme point can improve the optimization of the objective function. If not, the current solution is optimal. If improvement is possible, then proceed to the next step. 3. Move to the adjacent extreme point which offers (or at least appears to offer) the best improvement in the objective function. 4. Continue with steps 2 and 3 until the optimal solution is found or it can be shown that the problem is either unbounded or infeasible. LINEAR PROGRAMMING - V. Kostoglou 76 Synopsis of Simplex method steps (after the determination of the initial basic feasible solution) Step 1: Identification of the incoming non-basic variable. Step 2: Identification of The outgoing non-basic variable. Step 3: By elementary operations between the lines of the current tableau the next Simplex tableau is indicated, in which are reflected the changes that practically lead to the next vertex of the feasible region. Step 4: The new (current) basic feasible solution is being tested whether it is optimal. If this solution is optimal then the procedure stops, otherwise: Move to step 1. LINEAR PROGRAMMING - V. Kostoglou 77 Steps of LP problem solution - Maximization problems 1. Introduction to the base of the variable xs with the largest positive coefficient cs (lowest negative in minimization problems). 2. Removal from the base of the variable xr with the smallest positive quotient br/ars, where ars > 0. 3. Formulation of a new Simplex tableau replacing into the base variable xr with xs. 4. Calculation of the elements of variable xs new line by dividing the corresponding elements of variable xr previous row of with the pivot element ars. 5. Replacement of all remaining elements according to the equation: New element = respective previous element – [(respective element of previous column of xs)*(respective element of new row of xr)] 6. Back to step 1 LINEAR PROGRAMMING - V. Kostoglou 78 The above procedure is repeated continuously until one of the followings occurs: a) All cost coefficients become negative or zero. In this case the optimal solution has been found. or b) All the ais coefficients become negative or zero. In this case the problem is unbounded and there is no finite solution. LINEAR PROGRAMMING - V. Kostoglou 79 Solution of the model example (see p. 17) max F = 3*x1+4*x2+2*x3 with structure constraints x1+x2 100 x2+x3 200 x1+x2+x3 400 x2 80 and non-negativity constraints x1, x2, x3 0 LINEAR PROGRAMMING - V. Kostoglou 80 Adding the appropriate number of slack variables (artificial variables are not needed as all structure constraints are of the type ) the model example is formulated as: maxf = 3x1 + 4x2 + 2x3 x1 + x2 + x4 x2 + x3 + x5 = 100 = 200 x1 + x2 + x3 = 400 x2 + x6 + x7 = 80 LINEAR PROGRAMMING - V. Kostoglou 81 Sequential Simplex tableaux (maximization problem) Base x4 x5 x6 x7 -f x1 1 0 1 0 3 x2 1 1 1 1* 4 x3 0 1 1 0 2 x4 1 0 0 0 0 x5 0 1 0 0 0 x6 0 0 1 0 0 x7 0 0 0 1 0 R.H. 100 200 400 80 0 x4 x5 x6 x2 -f 1* 0 1 0 3 0 0 0 1 0 0 1 1 0 2 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 -1 -1 -1 1 -4 20 120 320 80 -320 x1 x5 x6 x2 -f 1 0 0 0 0 0 0 0 1 0 0 1* 1 0 2 1 0 -1 0 -3 0 1 0 0 0 0 0 1 0 0 -1 -1 0 1 -1 20 120 300 80 -380 LINEAR PROGRAMMING - V. Kostoglou 82 x1 x3 x6 x2 -f 1 0 0 0 0 0 0 0 1 0 x1 x3 x6 x7 -f 1 0 0 0 0 1 1 -1 1 -1 0 1 0 0 0 1 0 -1 0 -3 0 1 -1 0 -2 0 0 1 0 0 -1 -1 1 1* 1 20 120 180 20 -620 0 1 1 0 0 -1 0 0 0 -3 0 1 -1 0 -2 0 0 1 0 0 0 0 0 1 0 100 200 100 80 -700 Optimal solution: x1 = 100, x2 = 0, x3 = 200, x4 = 0, x5 = 0, x6 = 100, x7 = 80 and maxf = 700 LINEAR PROGRAMMING - V. Kostoglou 83 Steps of LP problem solution – Minimization problems 1. Formulation of the artificial function F = Σxi, where xi the artificial variables expressed as functions of the other variables of the corresponding constraint. 2. Construction of the first Simplex tableau, putting an extra line at the bottom with the coefficients of the artificial function F under those of the initial function f. 3. Minimization of F with the known procedure of Simplex method (steps 1 to 6 of the algorithm), inserting each time into the base, the variable with the smallest negative coefficient ci. 4. Repetition of the minimization procedure for function F, until it takes the value zero (where all the cost coefficients become negative or zero). 5. Removal of the coefficient row of F and of the columns of all artificial variables. LINEAR PROGRAMMING - V. Kostoglou 84 6. Minimization of the initial function f, inserting each time in the base the variable with the smallest negative coefficient. 7. Repetition of the minimization procedure for function f, until all cost coefficients become positive or zero. LINEAR PROGRAMMING - V. Kostoglou 85 Solution of a minimization problem The following minimization problem is given: minf = x1 + 2x2 with structure constraints 2x1 + x2 6 x1 + x2 = 4 x1 + x2 8 and non-negativity constraints x1 0, x2 0 LINEAR PROGRAMMING - V. Kostoglou 86 The existing inequalities are transformed to equalities (by adding slack variables x3 and x4) and the unary table is created (by adding the artificial variables x5 and x6). Thus, the problem is formulated as following: minf = x1 + 2x2 with constraints 2x1 + x2 + x3 x1 + x2 x1 + 3x2 =6 + x5 - x4 =4 + x6 = 8 and x1, x2, x3, x4, x5, x6 0 According to the algorithm, at first the artificial function F has to be created. F = x5 + x6 = (4 - x1 - x2) + (8 - x1 - 3x2 + x4) F = 12 - 2x1 - 4x2 + x4 Simplex tableaux are following, up to the determination of the optimal solution, minimizing successively functions F and f. LINEAR PROGRAMMING - V. Kostoglou 87 Sequential tableaux of Simplex method (minimization problem) Base x3 x5 x6 -f -F x1 2 1 1* 1 -2 x2 1 1 3 2 -4 x3 1 0 0 0 0 x4 0 0 -1 0 1 x5 0 1 0 0 0 x6 0 0 1 0 0 R.H. 6 4 8 0 -12 x3 x5 x2 -f 5/3 2/3* 1/3 1/3 0 0 1 0 1 0 0 0 1/3 1/3 -1/3 2/3 0 1 0 0 -1/3 -1/3 1/3 -2/3 10/3 4/3 8/3 -16/3 -F x3 x1 x2 -f -F -2/3 0 1 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 -1/3 -1/2 1/2 -1/2 1/2 0 0 -5/2 3/2 -1/2 -1/2 1 4/3 1/2 -1/2 1/2 -1/2 1 -4/3 0 2 2 -6 0 LINEAR PROGRAMMING - V. Kostoglou 88 Final Simplex tableau Base x3 x1 x2 -f x1 0 1 0 0 x2 0 0 1 0 x3 1 0 0 0 x4 R.H. -½ 0 ½ 2 -½ 2 ½ -6 Optimal solution: x1 = 2, x2 = 2, x3 = x4 = x5 = 0 and min f = 6 LINEAR PROGRAMMING - V. Kostoglou 89 Models without unique optimal solutions • Infeasibility: Occurs when a model has no feasible point. • Unboundness: Occurs when the objective function can become infinitely large (max) or infinitely small (min). • Alternate solution: Occurs when more than one point optimizes the objective function LINEAR PROGRAMMING - V. Kostoglou 90 LP application case study A product mix problem A manufacturer, named Giga Ltd., has fixed amounts of different resources such as raw material, labour, and equipment. These resources can be combined to produce anyone of several different products. The quantity of the ith resource required to produce one unit of the jth product is known. The decision maker wishes to produce the combination of products that will maximize total income. The Giga company produces two large products: I and II. The raw material requirements, space needed for storage, production rates, and selling prices for these products are given in the following table. LINEAR PROGRAMMING - V. Kostoglou 91 Production data for Giga company Product Storage space (m2 /unit) Raw material (kg/unit) Production rate (units/hr) Selling price ($/unit) I 4 5 60 13 II 5 3 30 11 The total amount of raw material available per day for both products is 1575 kg. The total storage space for all products is 1500 m2, and a maximum of 7 hours per day can be used for production. LINEAR PROGRAMMING - V. Kostoglou 92 Graphical solution LINEAR PROGRAMMING - V. Kostoglou 93 Analysis of the problem When the decision variables are more than two, it is always advisable to use Simplex method to avoid a lengthy graphical procedure. The Simplex method is not used to examine all the feasible solutions. It deals only with a small and unique set of feasible solutions, the set of vertex points (i.e. extreme points) of the convex feasible space that contains the optimal solution. The application of the Simplex method yielded the following optimum production programme for Giga: The company can maximize its sale income to € 4335 by producing 270 units of product I and 75 units of product II. There will be no surplus of raw materials or production time, but there will be 45 units of unused storage space. The managers are interested to know whether it is worthwhile to increase the production by purchasing additional units of raw materials and by either expanding its production facilities or working overtime. LINEAR PROGRAMMING - V. Kostoglou 94 The critical questions are: • Which is the income value (or marginal value) of each additional unit of each type of resources? • Which is the maximum cost (or marginal cost) that they should be willing to pay for each additional unit of resources? LINEAR PROGRAMMING - V. Kostoglou 95 Answers to these questions can be obtained from the objective function in the last tableau of the Simplex solution: Z 15 16 S2 S 3 $4335 7 7 that is, Z $4335 15 16 S2 S3 7 7 As S1, S2 and S3 represent the surplus resources, negative values of these variables (i.e., -S1, -S2, -S3) represent additional units of these resources that can be made available. The income values (or marginal values) of additional units of these resources can be obtained by taking the partial derivatives of Z with respect to -S1, -S2 and -S3. LINEAR PROGRAMMING - V. Kostoglou 96 Therefore, the marginal value of one additional unit of each resource is: Storage space Z $0 ( S1 ) Z 15 Raw materials $ ( S ) 7 2 Z 16 Production time $ ( S3 ) 7 Thus, the marginal values of additional units of resources can be obtained directly from the coefficients of the objective function in the last tableau of a Simplex solution. LINEAR PROGRAMMING - V. Kostoglou 97 The Giga Company should be willing to pay up to $15/7 for an additional unit of raw materials and up to $16/7 for an additional unit of production time. If the actual cost of an additional unit of these resources is smaller than the marginal value, the company should be able to increase its income by increasing production. However, the marginal values above are valid only as long as there is surplus storage space available. LINEAR PROGRAMMING - V. Kostoglou 98 Sensitivity analysis This analysis helps to test the sensitivity of the optimal solution with respect to changes of the objective function coefficients, the coefficients in the constraints’ inequalities, or the constant terms (right hand sides) of the constraints. For example in the above case study: The actual selling prices (or market values) of the two products may vary from time to time. Over which ranges can these prices change without affecting the optimality of the present solution? Will the present solution remain the optimal solution if the amount of raw materials, production time or storage space is suddenly changed because of shortages, machine failures or other unexpected events? The amount of each resource type needed to produce one unit of product type can be either increased or decreased. Will such charges affect the optimal solution? LINEAR PROGRAMMING - V. Kostoglou 99