Optimization Techniques (UMA035) Dr. Meenakshi Rana Professor Department of Mathematics Thapar Institute of Engineering and Technology Patiala-147004 (INDIA) Contents 1 Mathematical Programming Problem 1 2 Linear Programming Problem 1 3 Illustrations on Mathematical Formulation of LPPs 2 3.1 Product Allocation Problem . . . . . . . . . . . . . . . . . . . . . . . . 2 3.2 Product Allocation Problem . . . . . . . . . . . . . . . . . . . . . . . . 4 3.3 Scheduling Problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 3.4 Trim-Loss Problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 3.5 Transportation Problem . . . . . . . . . . . . . . . . . . . . . . . . . . 7 3.6 Scheduling Problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 3.7 Allocation Problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 4 Solution of LPP involving two variables using Graphical method 4.1 Examples-Graphical Method . . . . . . . . . . . . . . . . . . . . . . . . 9 10 1 Mathematical Programming Problem A General problem in Optimization Techniques, known as, Mathematical Programming Problem is : Optimize f (x) subject to the constraints gi (x), 1 ≤ i ≤ m. If both f (x) and gi (x) are linear functions then we call it as a Linear Programming Problem (LPP). If both or any one of f (x) or gi (x) is a non-linear fucntions then then we call it as a non- Linear Programming Problem. (NLPP) Linear Programming deals with the problem of optimizing a linear objective function subject to linear equality and inequality constraints on the decision variables. Linear programming has many practical applications (in transportation, production planning, diet problem etc.) 2 Linear Programming Problem A Linear Programming Problem (LPP) consists of three components, namely The Decision Variables (activities),The Objective (goal) and The Constraints (restrictions). 1. Decision Variables (activities) that we seek to determine. 2. The Objective (goal) that we need to optimize (maximize or minimize). 3. The Constraints (restrictions) that the solution must satisfy. The procedure for mathematical formulation of a linear programming problem consists of the following major steps : 1. Study the given situation to find the key decisions to be made. 2. Identify the variables involved and designate them by symbols xj (j = 1, 2, ...). 3. State the feasible alternatives which generally are : xj ≥ 0 for all j. 4. Identify the constraints in the problem and express them as linear inequalities or equations, LHS of which are linear functions of the decision variables. 1 5. Identify the objective function and express it as a linear function of the decision variables. A general LPP is given as: Objective function z = (c1 x1 + c2 x2 + · · · + cn xn ) subject to a11 x1 + a12 x2 + · · · + a1n xn ≤, ≥, = b1 a21 x1 + a22 x2 + · · · + a2n xn ≤, ≥, = b2 ········· am1 x1 + am2 x2 + · · · + amn xn ≤, ≥, = bm where x1 , x2 , · · · , xn ≥ 0 1 ≤ i ≤ m, 1≤j≤n where xi are decision Variables, ci are cost/profit for decision variables, bj are resource/availability variables and aij are corresponding coefficients for variables xi , (Note: Variables may be restricted or unrestricted in a LPP.) The above in the Matrix format can be written as: Objective function z = C T X subject to AX ≤, ≥, = b, where matrix A = (aij )mxn , C T = (c1 , c2 , · · · , cn ), X T = (x1 , x2 , · · · , xn ), and bT = (b1 , b2 , · · · , bn ). 3 Illustrations on Mathematical Formulation of LPPs Here are some problems from real life, which have been put in the mathematical format. 3.1 Product Allocation Problem A company has three operational departments (weaving, processing and packing) with capacity to produce three different types of clothes namely suitings, shirtings and 2 woollens yielding a profit of Rs. 2, Rs. 4 and Rs. 3 per metre respectively. One metre of suiting requires 3 minutes in weaving, 2 minutes in processing and 1 minute in packing. Similarly one metre of shirting requires 4 minutes in weaving, 1 minute in processing and 3 minutes in packing. One metre of woollen requires 3 minutes in each department. In a week, total run time of each department is 60, 40 and 80 hours for weaving, processing and packing respectively. Formulate the linear programming problem to find the product mix to maximize the profit. Solution: Mathematical Formulation The data of the problem is summarized below : Departments Weaving Processing Packing (in minutes) (in minutes) (in minutes) Suiting 3 2 1 2 Shirtings 4 1 3 4 Woollens 3 3 3 3 40×60 80×60 Availability(minutes) 60×60 Profit 1. The key decision is to determine the weekly rate of production for the three types of clothes. 2. Let us designate the weekly production of suitings, shirtings and woollens by x1 metres, x2 metres and x3 metres respectively. 3. Since it is not possible to produce negative quantities, feasible alternatives are sets of values of x1 , x2 and x3 satisfying x1 ≥ 0, x2 ≥ 0 and x3 ≥ 0. 4. The constraints are the limited availability of three operational departments. One metre to suiting requires 3 minutes of weaving. The quantity being x1 metres, the requirement for suiting alone will be 3x1 units. Similarly, x2 metres of shirting and x3 metres of woollen will require 4x2 and 3x3 minutes respectively. Thus, the 3 total requirement of weaving will 3x1 + 4x2 + 3x3 , which should not exceed the available 3600 minutes. So, the labour constraint becomes 3x1 +4x2 +3x3 ≤ 3600. Similarly, the constraints for the processing department and packing departments are 2x1 + x2 + 3x3 ≤ 2400, x1 + 3x2 + 3x3 ≤ 4800 respectively. 5. The objective is to maximize the total profit from sales. Assuming that whatever is produced is sold in the market, the total profit is given by the linear relation z = 2x1 + 4x2 + 3x3 . The linear programming problem can thus be put in the following mathematical format : Find x1 , x2 and x3 so as to maximize z = 2x1 + 4x2 + 3x3 subject to the constraints : 3x1 + 4x2 + 3x3 ≤ 3600 2x1 + x2 + 3x3 ≤ 2400 x1 + 3x2 + 3x3 ≤ 4800 x1 ≥ 0 , x2 ≥ 0 and x3 ≥ 0 3.2 Product Allocation Problem A pharmaceutical company produces three types of medicines M1 , M2 , M3 . For manufacturing these medicines, three types of ingredients I1 , I2 , I3 are required. One M1 requires 3 units of I1 and 2 units of I2 ; One M2 requires 2 units of I1 , 3 units of I2 and 4 units of I3 ; One M3 requires 4 units of I1 and 3 units of I3 . The company has a stock of 40 units of I1 , 30 units of I2 , and 45 units of I3 . The profit per unit for M1 , M2 , M3 are Rs. 8, Rs. 13, Rs. 10 respectively. Formulate the problem as an LPP so that company maximize the profit. Solution: 4 Let xi be the number of units of medicines Mi produced; i = 1, 2, 3 respectively. Maximize Z= 8x1 + 13x2 + 10x3 subject to 3x1 + 2x2 + 4x3 ≤ 40 2x1 + 3x2 ≤ 30 4x1 + 3x3 ≤ 45 x1 , x2 , x3 ≥ 0 3.3 Scheduling Problem A hotel operating 24 hours has the following minimum requirement of waiters: Period Time Minimum no. of waiters required 1 7am–11am 6 2 11am–3pm 12 3 3pm–7pm 8 4 7pm–11pm 16 5 11pm–3am 5 6 3am–7am 3 A waiter reports to the hotel manager at the beginning of the period and continues to work for 8 hours. Formulate the problem as an LPP to minimize the total number of waiters required. Solution: Let xi be the number of waiters starting work at ith period i = 1, 2, · · · , 6 respectively Minimize Z= x1 + x2 + · · · + x6 subject to x1 + x2 ≥ 12 x2 + x3 ≥ 8 x3 + x4 ≥ 16 x4 + x5 ≥ 5 x5 + x6 ≥ 3 x6 + x1 ≥ 6 x1 , x2 , · · · , x6 ≥ 0 and are integers. 5 3.4 Trim-Loss Problem The Pacific Paper Company produces paper rolls with a standard width of 20 feet each. Special customer orders with different widths are produced by slitting the standard rolls. typical orders ( which may vary daily) are summarized in the following table: Order desired Width(ft) desired number of rolls 1 5 150 2 7 200 3 9 300 In practice, an order is filled by setting the knives to the desired widths. Find the minimum number of standard rolls to be slit according to the given data. Formulate the problem as an LPP model. Solution: We note that, Knife setting Required width 1 2 3 4 5 6 Min. No. of rolls 5 0 2 2 4 1 0 150 7 1 1 0 0 2 0 200 9 1 0 1 0 0 2 300 4 3 1 0 1 2 Trim loss per foot of length Let xi be the number of standard rolls to be slit according to the setting i; i = 1, 2, 3, 4, 5, 6 Minimize Z= x1 + x2 + · · · + x6 subject to 2x2 + 2x3 + 4x4 + x5 ≥ 150 (5–ft rolls) x1 + x2 + 2x5 ≥ 200 (7–ft rolls) x1 + x3 + 2x6 ≥ 300 (9–ft rolls) x1 , · · · , x6 , ≥ 0 6 3.5 Transportation Problem A dairy firm has two milk plants, daily milk production of 6 million litres and 9 million litres respectively. Each day, the firm must fulfil the needs of its three distribution centres which have the milk requirement of 7, 5, 3 million litres, respectively. Cost of transportation of 1 million litres of milk from each plant to each distribution centre is given in hundreds of rupees below. Formulate the LP model to minimize the transportation cost. Dist. center Plant 1 2 3 Supply 1 2 3 11 6 2 1 9 6 9 Demand 7 5 3 Solution: Let xi be the number of units of milk Mi produced; i = 1, 2, 3 respectively Maximize Z= 2x11 + 3x12 + · · · + 6x23 subject to x11 + x12 + x13 ≤ 6 x21 + x22 + x23 ≤ 9 x11 + x21 ≥ 7 x12 + x22 ≥ 5 x13 + x23 ≥ 3 x11 , · · · , x23 ≥ 0 3.6 Scheduling Problem The super bazar in a city daily needs between 32 and 40 workers depending on the time of day. The rush hours are between Noon and 2 pm. The table indicates the number of workers needed at various hours when the bazar is open. Dist. center 7 Time Period No. of workers needed 9-11 am 32 11-1 pm 40 1-3pm 35 3-5 pm 33 The super bazar now employs 34 full-time workers, but needs a few part time workers also. A part time worker must put in exactly 4 hours per day, but can start any time between 9 am and 1 pm. Full time workers work from 9 am to 5 pm but are allowed an hour for lunch (half of the full time workers eat at 12 noon, the other half at 1 pm). The management of the super bazar limits part-time hours to a maximum of 50 percent of the day’s total requirement. Part-time earn Rs. 48 per day on the average, while full timers earn Rs. 140 per day in salary and benefits on the average. The management wants to set a schedule that would minimize total manpower costs. Solution: Let y be the full time workers and xj be the part time workers starting at 9 am, 11 am, and 1 pm respectively; j = 1, 2, 3. Minimize (total daily manpower cost) z= 140y + 48(x1 + x2 + x3 ) subject to y + x1 ≥ 32 (9 am–11am need) 1 y + x1 + x2 ≥ 40 2 1 y + x2 + x3 ≥ 35 2 y + x3 ≥ 33 y ≤ 34 (11 am–1 pm need) (1 pm–3 pm need) (3 pm–5 pm need) (full timer available) 4(x1 + x2 + x3 ) ≤ 0.50(32 + 40 + 35 + 33) (part timers hours cacnot exceed 50% of total hours required each day which is the sum of the workers needed each hour) y, x1 , x2 , x3 ≥ 0 8 3.7 Allocation Problem A company has two grades of inspectors, I and II, who are to be assigned for a quality control inspection. It is required that at least 2000 pieces be inspected per 8 hour day. Grade I inspectors can check pieces at the rate of 50 per hour with an accuracy of 97inspectors can check pieces at the rate of 40 per hour with an accuracy of 95rate of grade I inspector is Rs. 4.50 per hour and that of grade II is Rs. 2.50 per hour. Each time an error is made by an inspector , the cost to the company is Rs. 2.00. The company has available for inspection job, 10 grade I and 5 grade II inspectors. Formulate the problem (DO NOT SOLVE) to minimize the total cost of inspection. Solution: Try yourself. 4 Solution of LPP involving two variables using Graphical method Definition: Feasible Solution A set of real values of X = (x1 , x2 , . . . , xn )which satisfies the constraints AX(≤, ≥, =)b and satisfies the non-negativity restriction X ≥ 0. Definition: Feasible Region The collection of all the feasible solution is called as the feasible region. When a LPP is solved, feasible region may be bounded or unbounded, one of the following cases will occur: Case 1: The LPP has a unique solution when it has only one optimal solution. Case 2: The LPP has more than one optimal solutions. This is the case of alternative ( or Multiple) optimal solutions. In this case we may find infinite optimal solution. Case 3: The LPP is infeasible (it has no feasible solution). This means that the feasible region contains no points. Case 4: The feasible region is unbounded and in this unbounded feasible region objective function is not bounded then we say LPP is unbounded. Case 5: The feasible region is unbounded and in this unbounded feasible region objective function is bounded then we say LPP is bounded. 9 If the objective function Z is a function of two variables, then the problem can be solved by graphical method. Procedure of solving LPP by graphical method is as follows: (i) Formulation of the problem into LPP model (i.e) objective function and the constraints are written down. (ii) Consider each inequality constraints as equation. (iii) Plot each constraint equation on the graph as each constraint equation will geometrically represent a straight line. (iv) Shade the feasible region and identify the feasible solutions. (v) Every point on the line will satisfy the equation of line. If the inequality constraints corresponding to that line is ≤ then the region below the line lying in the first quadrant (due to non- negativity of variables) is shaded or as per given conditions. For the inequality constraints with ≥ sign the region above the line in the first quadrant is shaded or as per given conditions. The point lying in common region will satisfy all the constraints simultaneously. Thus, the common region obtained is called feasible region. This region is the region of feasible solution. The corner points of this region are identified. (vi) Finding the optimal solutions. The values of Z at various corners points of the region of feasible solution are calculated. The optimum (maximum or minimum) Z among these values is noted. Corresponding solution is the optimal solution. 4.1 Examples-Graphical Method 10 Graphical Method - Linear Programming Problem Problem 1: Reddy Mikks produces both interior and exterior paints from two raw materials, M1 and M2. The following table provides the basic data of the problem: Tonnes of raw materials per ton of Maximum Daily Exterior Interior paint availability (tons) Paint Raw material M1 6 4 24 Raw material M2 1 2 6 Profit per tonnes 5 4 ($100) A market survey indicates that the daily demand for interior paint cannot exceed that for exterior paint by more than 1 tonne. Also, the maximum daily demand for interior paint is 2 tonnes. Reddy Mikks wants to determine the optimum product mix of interior and exterior paints that maximizes the total daily profit. Formulate the problem and solve it graphically. Formulation: Maximize Z = 5 x1 + 4 x2 subject to 6 x1 + 4 x2 ≤ 24, x1 + 2 x2 ≤ 6, -x 1 + x2 ≤ 1, x2 ≤ 2, x1 , x2 ≥ 0 LPP Model: Using the graphical method solve the following LPP: Corner (x1, x2) Z Point A (0, 0) 0 B (4, 0) 20 C (3, 1.5) 21 (Maximum) D (2, 2) 18 E (1, 2) 13 F (0, 1) 4 Optimum, Z = 21 at (3,1.5) Solution Space Feasible Solution Direction of Z (Objective Function) Z = 5 x1 + 4 x2 = Constant Z1= 5 x1 + 4 x2 = 10 Z1= 5 x1 + 4 x2 = 20 Red Arrow shows the direction of objective function. In this case it shows the direction of increase as objective function is of maximization. Problem 2: Use graphical method to solve the LPP Minimize Z = 2 x1 + 3 x2 subject to x1 + x2 ≤ 30, x1 - x2 ≥ 0 , x2 ≥3 , 0 ≤ x1 ≤ 20 , 0 ≤ x2 ≤ 12 Corner (x1, x2) Point A (3, 3) Z 15 (Minimum) (20, 3) 49 (20, 10) 70 (12, 12) 60 (18, 12) 72 B C E D Optimum, Z minimum = 15 at (3, 3) Problem 3: (Alternate Optima) Use graphical method to solve the LPP Maximize Z = 2 x1 + 4 x2 subject to x1 + 2 x2 ≤ 5, x1 + x2 ≤ 4, x1 , x2 ≥ 0 Corner (x1, x2) Point O (0, 0) A (4, 0) B (3, 1) C Z 0 8 10 (Maximize) (0, 2.5) 10 (Maximize) Optimum , Zmax = 10 at B and C point and their linear combination Problem 4: (Unbounded Solution) Use graphical method to solve the LPP Maximize Z = 6 x1 + x2 subject to 2 x1 + x2 ≥3, x1 - x2 ≥ 0, x1 , x2 ≥ 0 Corner (x1, x2) Z Point A (1, 1) 7 B (0, 3) 3 Zmax = Unbounded Solution Problem 5: Use graphical method to solve the LPP Maximize Z = 2 x2 - x1 subject to x1 - x2 ≥ - 1, - 0.5 x1 + x2 ≤ - 2, x1 , x2 ≥ 0 Problem 6: (Infeasible Solution) Use graphical method to solve the LPP Maximize Z = x1 + x2 subject to x1 + x2 ≤ 1, -3 x1 + x2 ≥ 3, x1 , x2 ≥ 0 No Feasible Region or no common region or Infeasible Solution Problem 7: Use graphical method to solve the LPP Maximize Z = x1 + x2 subject to x1 - x2 ≥ 0, 3 x1 - x2 ≤ -3, x1 , x2 ≥ 0