Upcoming SlideShare
×

# Linear Programming Module- A Conceptual Framework

9,915 views

Published on

Linear Programming Module - A Conceptual Framework.

1 Comment
2 Likes
Statistics
Notes
• Full Name
Comment goes here.

Are you sure you want to Yes No
• Linear programming is very interesting to learn

Are you sure you want to  Yes  No
Views
Total views
9,915
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
249
1
Likes
2
Embeds 0
No embeds

No notes for slide

### Linear Programming Module- A Conceptual Framework

1. 1. Linear Programming Module- A Conceptual Framework Prepared By P.K. ViswanathanIntroduction:An economist faces the problem of making an optimum allocation of resources amongcompeting projects. A business-planning manager has to decide how many units of eachproduct be produced to maximize profit subject to constraints on production capacity anddemand for these products. We need a model that can help us to find the best solution inthe context of constraints that are operating on the problem. Linear programmingprovides solutions to such problems. The word programming implies planning.Learning Objectives:After reading this module, you will be able to: Know what is Linear Programming (LP)  Formulate Linear Programming Problems  Use Graphical Method to Solve LP  Appreciate Shadow Prices and Interpret  Appreciate Computer Solutions for Large LP problems Contents: 1. What is Linear Programming? 2. Steps in formulating LP Problems 3. Solution-Graphical Method 4. Computer Solution 5. A Comprehensive Case on LP 6. Module Summary 7. Review Questions1. What is Linear Programming?Linear Programming (LP) is concerned with the best way of allocating scarce resourcesamong competing ends. The word optimization is used in the context of eithermaximizing or minimizing an objective function. Organizations do have problems suchas minimizing cost of production, or maximizing the profit. The resources that areavailable in limited quantities are called constraints and the optimization will have to takeplace subject to the constraints the organization has. 1
2. 2. "Programming" here means planning and has nothing to do with computer programming.The word linear" is very important. Linear implies that the objective function andconstraints are all linear namely the variables are raised to the power 1 only. Theconstraints could be of three types: 1) less than or equal to 2) equal to and 3) greater thanor equal to. Symbolically, they are represented as respectively. , ,To put it succinctly, linear programming is a very widely used OR model that maximizesor minimizes an objective function subject to a number of limiting factors calledconstraints. All relationships among the variables are linear. That is objective function,and constraints are all linear. Another requirement of LP is that all variables must be non-negative (0 or positive). You cannot have a negative solution in linear programmingalthough mathematically you may get negative solutions for the decision variables.Some Examples where LP is applied  An advertising company wants to maximize exposure of a client’s product and has a choice of advertising in different media that include TV, Radio, and magazines. These media charge different advertising costs. The ad company has to achieve its objective of maximizing exposure subject to the constraints of ad budget, minimum and maximum number of ads in the various media. LP can help the company solve this problem.  furniture manufacturer producing a number of items would like to maximize his A profit. He has certain commitments to his customers in the form of minimum and maximum quantities to be supplied for each item. Also in his plant, the available production time in each of the 3 departments is limited. LP can help him find an optimum product mix that can maximize his total profit.  Applications of linear programming are plenty. Product mix problem, media planning, transportation problem, blending problem, scheduling of nurses and doctors to the patients in a hospital, and capital investment are among the many where linear programming can be applied.2. Steps in formulating LP Problems  Identify the decision variables. Decision variables are those for which you are trying to find the solution. Identifying the decision variables is important in solving an LP problem  Formulate the objective function in terms of the decision variables If the organization’s goal is to maximize profit, the objective function will be a maximization case. Likewise, in a blending problem, if the aim is to minimize cost, then the objective function will be a minimization case. At any rate, you must be able to express the objective function in terms of the decision variables. 2
3. 3.  Formulate the constraints in terms of the decision variables. Constraints represent limitations on resources. They will also have to be written in terms of the decision variables. Note: As the solution for the decision variables should not turn out to be negative, you have to specify that they are zero or positive. This is termed as non-negativity constraint. In any LP problem, it is generally understood that all the decision variables are non- negative.Example: One of the divisions of a small-scale unit manufactures two products. Both theproducts require two raw materials and the consumption per unit production is givenbelow: Table -Consumption in kg per unit production Product 1 Product 2 Maximum Availability of Raw Materials (kg)Raw Material1 2 3 18Raw Material2 1 1 8Further, it is known from market research that product 1 cannot be sold more than 4 units.The profit per unit of product 1 is \$ 15, and product 2 is \$ 21. You will have to help thissmall-scale unit decide how many units of product 1 and product 2 to produce so as tomaximize the total profit.FormulationIdentify the decision variables:Let x1 be the number of units of product 1 to be producedLet x2 be the number of units of product 2 to be producedFormulate the objective function in terms of the decision variables:The profit per unit of product is \$. 15 and product 2 is \$.21. If you produce x1 units ofproduct 1 and x2 units of product 2, then the total profit =15x1 + 21x2 . This has to bemaximized. In linear programming terminology, we write the objective function asZ = 15x1 + 21x2 . Z is to be maximized.Formulate the constraints in terms of the decision variables:The maximum quantity of product 1 that can be sold is 4 units. Sox1  (Sales constraint) 4 3
4. 4. The maximum availability of raw material 1 is 18 kg. To produce x1 units of product1 andx2 units of product 2, you need 2x1 + 3x2 kg. So,2x1 + 3x2 18 (raw material 1 availability) (see table of consumption above)Similarly we can work out the raw material availability constraint for raw material 2. Andit isx1 + x2 8 (raw material 2 availability)Complete formulation for the example:Maximize Z = 15x1 + 21x2Subject to:x1 42x1 + 3x2 18x1 + x2 8And x1, x2 0(non-negativity)Inline Question: Linear programming is one of the computer programming languages.True or False.Answer: The statement is false. The word programming means planning and linear meansthe relationships among the variables are raised to the power 1. This has nothing to do withcomputer programming language.Assumptions in Linear Programming: 1) Proportionality: Because we assume linear relationship among variables in LP, proportionality is inevitable. Suppose you need 5 kg of input to produce one unit. Then to produce two units, you need 10 kg of input. This is not necessarily true. 2) Additivity: When we formulate the constraints, we add resource requirements of the decision variables. We ignore the interaction term in the expression. Interaction measures the effect of any combination of decision variables. 3) Divisibility: Divisibility does not guarantee integer solutions. In a particular problem, fractional solution does not make sense. For example, in a product mix problem, you may get a solution that says produce 10.3 units of model 1 and 14.4 4
5. 5. units of model 2. It does not make sense. Rounding to the whole number sometimes may vitiate the solutions. Of course you have a technique called integer linear programming that can help you solve problems where you are looking for integer solutions.4) Certainty: In linear programming, you assume all variables are known without any doubt. Thus, you assume a deterministic or certainty scenario. But in reality, you may have to assess carefully the magnitude of uncertainty.3. Solution-Graphical MethodGraphical method of solving a linear programming model is possible only for twovariables. To get a feel for linear programming, graphical method is extremely useful.Let us take the same example used for formulating LP model. Example Problem:Graphical SolutionConstraint Lines and Feasibility RegionDrawn in a combined manner x2 8 x1 + x2= 8 7 6 A(0,6) X 1=4 5 4 B (4, 3 1/3) 3 Feasibility Region 2 2 x1 + 3x2 =18 1 D(0,0) C(4,0) x1 1 2 3 4 5 6 7 7 8 8 9 9 10 10 5
6. 6. Please see the feasibility region in the diagram bounded by thick lines with corner pointsco-ordinates marked by A(0,6), B(4, 3 1/3), C(4,0) and D(0,0). This is the region thatsatisfies all the three constraints. Co-ordinates for B is obtained by solving the twoequations X1 = 4 and 2X1+3X 2 =18. Do not read the co-ordinates from the graph. You maynot get the accuracy. The word feasibility is important here. It says that every pair of co-ordinate points in this region is a feasible solution to the problem given. But, what is theoptimum solution? See next. Optimal Solution In any linear programming problem the optimum solution when it exists is always one of the corner points in the feasibility region. Select that corner point which gives the maximum Z value. (Note: For minimization case select that corner point that gives the minimum Z value). In our case we need to select the maximum Z value. Corner Point Z Value : Z= 15x1 + 21x2 A(0,6) 126 B(4, 3 1/3) Optimum 130 C(4,0) 60 D(0,0) 0 6
7. 7. The optimum solution that maximizes the profit is to produce 4 units of product 1 and3 1/3 units of product 2. The maximum profit is \$. 130.Inline question: If the example problem discussed is a minimization problem, what is theoptimum solution?Answer: Take that corner point that gives the minimum value of Z. Omit the trivialsolution D(0,0) that says don’t produce any thing. Z is minimum for C(4,0). The value of Z=60. The optimum solution is to produce 4 units of product 1 and 0 units of product 2.Assignment: Solve the following LP problem graphically:Maximize Z = 8X1 + 10X2Subject to: 8X1 + 4X2 240 6X1 +12X2 360 X1, X2 04. Computer Solution:Graphical method just provides some insights into linear programming. It can solveproblems having two variables only. In practice, complex problems involving more thantwo variables are encountered. The efficient way of solving such problems is to use“Solver” in Microsoft Excel. You can get output giving insights into shadow prices andsensitivity analysis apart from the usual optimum solution. The method used for solvinglinear programming problems is called “simplex method” discovered by Dantiz. Doing thismanually in practice is not only time consuming but also error prone. Computer solution issimple and best.The emphasis in this module is on your ability to formulate a linear programming modelfor a given problem and then solve it using “Solver”. The technical terms associated withlinear programming purely from a mathematical perspective will be avoided. For amanager, a problem well formulated is half solved. The simple slogan I would popularize is“Excel in formulating any LP problem and solve it using Excel”.Before we move on to solving some complex LP problems, let us first solve a simpleproblem using solver. Take the example used for graphical method. Follow the step-by-stepprocedure. The formulation of this problem on the spreadsheet is given below: 7
8. 8. Model Formulation on the spreadsheetExplanation on the Formulation:This is a crucial step in using solver. Column A is used for labeling the linear programmingvocabulary. Decision Variables appear in cell A2. In Column B and C, Product1 andProduct 2 are labeled. Corresponding to Row 2 and columns B and C values 1 and 1 areentered. These are the initial values of the decision variables X1 and X 2 we have used whileformulating the LP model. These initial values are varied by solver to get the optimumvalues of X1 and X2. Please remember, solver cannot accept X1 and X2 in the respectivecells. Please note that you are at liberty to use your own labeling and Excel is flexible inthis regard.In A4 cell Objective Function is written. Against this label, under Column B and C values15 and 21 are entered. These are the unit profits of the two products. F3 is labeled as TotalProfit and F4 gives the profit that is obtained by multiplying the coefficients of theobjective function with the initial values of the decision variables. That is (15)(1)+21(1)=36. In order that Excel understands this, you create a formula in F4(target cell)=B4*B2+C4*C2. Excel will vary the values of B2 and C2 to get the optimum values ofProduct1 and Product2. 8
9. 9. Then we label in Column A in Row 6 Constraints. Under this we further label theindividual constraints namely Sales for Product1, Raw material1 availability, and Rawmaterial2 availability. In Column B and C we enter the coefficients of the decisionvariables corresponding to these constraints. The value 1 is entered under column Bcorresponding to Sales for Product1 and value 0 is entered under column C for Product2. InColumn D corresponding to Sales for product1, the value 1 appears. This is calculated bythe formula =B7*B2+C7*C2 and this is 1. In Column E corresponding to Sales forProduct1, we label the symbol < = meaning less than or equal to constraint. This labeling isdone for our own understanding and Excel ignores this. In Column F corresponding toSales for Product1, we have entered the value 4. Now if you look at the entire Row 4, forthe constraint Sales for Product1, you are saying B7*B2+C7*C2 < = 4. This is same assaying X1 < =4. Likewise the constraints on raw material 1 and raw material 2 are workedout. For better clarity, spreadsheet showing model equations are given next:Spreadsheet Giving Model Equations 9
10. 10. Solution: Now you are ready to invoke solver. Click Tools, and click Solver. You getIn “Set Target Cell” highlight F4 that contains the objective function. In “Equal To” clickMax because you want to maximize the objective function. “By Changing Cells” isSolver’s way of saying that the initial values of the decision variables are varied untiloptimal solution is reached. You highlight the cells B2:C2. You now getSolution continues: 10
11. 11. You now come to “Subject to the Constraints”. Solver accepts all the three types ofconstraints (< =, =, > =). When you develop a model, you better arrange the constraintsaccording to types in the spreadsheet itself. That is all < = are done first; then > = and then=. This will save a lot of time. You can enter a set of constraints together in Solver byhighlighting the appropriate cells. Here all the constraints are < = and are arranged in thatorder. You click “Add” and you getIn “Cell Reference” you highlight D7:D9. Click < =. Then highlight cells F7:F9 forconstraint values. You have now entered all constraints. You get nowClick OK and you getComplete Formulation of LP Model for the Example 11
12. 12. The last two things that remain to be done by you is to tell Solver that you are solving alinear programming model and the decision variables are non-negative. Click Options.Then click Assume Linear Model and Assume Non-Negative. After this, you click Solveand you getNow click OK. You get the solution shown next.Model Giving Optimal SolutionAs you can see the optimum solution is to produce 4 units of Product1 and 3.33 units ofProduct2. The maximum total profit is \$. 130. Constraints 1 and 2 are fully exhaustedmeaning that the resources are fully utilized. In the LP parlance, the word slack is used.Here slack is 0. Slack represents the unused quantity of a resource. For constraint3, there is 12
13. 13. a slack of 0.67 kg that was unutilized. This cannot be helped as things stand. Any attemptwe make to use more of this will not give a profit better than \$.130.Sensitivity AnalysisFinding the solution to a linear programming model is only a first step. A manager wouldlike to know how sensitive the solution is to changes in inputs and assumptions. Let usinterpret the sensitivity analysis output given by solver for the LP problem just solved.When you click solve, you actually getIf you now press OK, you get the optimum solution. Before clicking OK, highlightSensitivity and then click OK. You get 13