1 / 92

MATS-30004

MATS-30004. Quantitative Methods Dr Huw Owens www.personalpages.manchester.ac.uk/staff/huw.owens. Linear Programming. What is Linear Programming?

csawyer
Download Presentation

MATS-30004

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. MATS-30004 Quantitative Methods Dr Huw Owens www.personalpages.manchester.ac.uk/staff/huw.owens

  2. Linear Programming • What is Linear Programming? • A way of calculating how to allocate limited resources like raw materials and labour to products and services to give the maximum possible profit or revenue. • Why is it useful? • Linear programming is probably the most-used type of quantitative business model. • It can be applied to any environment where finite resources must be allocated to competing activities or processes for maximum benefit (e.g. an investment portfolio of stocks to maximise return or allocation of a fixed budget between competing departments).

  3. Linear Programming Objectives • Objectives of these lectures: • After these lectures you should be able to: • Formulate a small linear programming problem and solve it using a graph. • Understand the limitations of linear programming.

  4. Introduction • The function of most organisations is to transform resources into products and services. • In order to achieve this the organisation must decide how much of each type of product or service to supply whilst using limited resources. • Linear programming has nothing to do with computer programming! In this context it just means planning. • Linear programming has two main stages: • The management-decision problem must be formulated as a linear programming model. • The model must be solved mathematically. • When there are only two competing activities the mathematical solution can be found by drawing a graph. (In more complex problems a computer is used)

  5. Linear Programming -The Graphical Method • Linear programming is a problem solving approach that has been developed to help managers making decisions. It has the following major characteristics: • It Minimises or maximises some quantities. In linear programming, the minimisation or maximisation of some quantity is the objective; • In all linear programming problems, there are restrictions or constraints that limit the degree to which the objective can be pursued; • Both the objective and constraint functions are linear.

  6. Example 1 • A small towel company makes two types of towels, standard and deluxe. Both types have to go through two processing departments, cutting and sewing. It takes 1 minute to cut a standard towel but 2 minutes to cut a deluxe towel. Similarly, it takes 3 minutes to sew a standard towel and 2 minutes to sew a deluxe towel. The machines are such that in every production run, the time available for cutting is 160 minutes and the time for sewing is 240 minutes. The contribution to income per standard towel is £1.00, and per deluxe towel is £1.50. How should the production be scheduled to maximise the contribution to income?

  7. Formulating the problem • Firstly, define the decision variables. • A linear programming problem always has an expression to be maximised (or minimised) called the objective function and one or more constraints or restrictions. If we define the decision variables correctly then we should be able to express the whole problem in terms of them.

  8. Example 1 • This is a typical linear programming problem. • The objective is obviously to maximise the contribution to income by properly scheduling the production of the standard and deluxe towels. • As we are told, one standard towel contributes £1.00 to income, one deluxe contributes £1.50 to income. If the manufacturer was not limited by its production ability, an easy answer to the question would be to make as many deluxe towels as possible to maximise the contribution to income. However, as in most (if not all) of the cases, the manufacturer’s production ability is limited.

  9. Example 1 • The restrictions, or using the formal term “constraints”, are stated as follows: • “It takes 1 minute to cut a standard towel but 2 minutes to cut a deluxe towel. Similarly, it takes 3 minutes to sew a standard towel and 2 minutes to sew a deluxe towel. The machines are such that in every production run, the time available for cutting is 160 minutes and the time for sewing is 240 minutes.” • In short, the time available to each machine is limited, and different towel takes different amount of time for processing. These constraints will affect the answer to the question, as under such constraints it may no longer true that the more deluxe towels are made the more profitable. Linear programming is an approach to find the best answer in such circumstances.

  10. Example 1 • This maximising problem can be summarised into the following table. • The objective and the constraints are formulated mathematically. If we assume that in the production schedule, there will be x1 standard towels and x2 deluxe towels to be made, then

  11. Example 1 • the total contribution to income, P, will be • P = 1x1+ 1.5x2 = x1+ 1.5x2 (£) • the constraints will be • x1 + 2x2 160 (min.) for cutting • 3x1 + 2x2 240 (min.) for sewing • Also, the quantities of the 2 types of towels to be produced can not be negative numbers, so we can also add • x1 0 • x2 0 • to the constraints list.

  12. Example 1 • Now, the maximisation problem can be expressed in a standard form in the following: • The expression describing the objective is called the objective function, and the expressions that describe the constraints are known as the constraint functions. • Maximise P = x1+ 1.5x2 • Subject to x1 + 2x2 160 • 3x1 + 2x2 240 • x1 0 • x2 0

  13. Example 2 • The redwood Furniture Company manufactures tables and chairs as part of its line of patio furniture. For simplicity, we assume that only two resources are consumed in manufacturing the patio furniture: wood (300 board feet in inventory), and labour (110 hours available). The Table below shows the resources consumed and the unit profits for each product.

  14. Example 2 • The owner wishes to determine how many tables and chairs should be made to maximise the total profits from patio furniture. • Note that 1 board foot = 1 ft2 1 inch (thickness) • To formulate a linear programming problem, we will need to study the practical case very carefully in an attempt to understand the whole problem. On the basis of understanding, The following four steps are necessary for the formulation of a linear programming problem.

  15. Step 1-Defining the variables • The unknown quantities involved in a linear program are known as the variable. These variables are directly related to the objective function and the constraint functions. The quantities of them are the decision to be made by solving the problem. Once they are identified, the variables are defined, conventionally by x1, x2, …, xn, where n is the number of the variables.

  16. Step 1 • Before we solve the redwood problem, we don’t know how many tables and chairs will be produced. • And, we realise that the quantities of the tables and chairs to be made are directly related to the profit and the resource consumption. • It is clear that we need to determine the numbers of tables and chairs by solving the problem. • So, in this case, the numbers of tables and chairs are the variables of the problem. We defined these two variables by using the following symbols: • x1 - number of tables to be made • x2 - number of chairs to be made

  17. Step 2 – Expressing the constraints • In real-world problems, the use of any resources is limited to some extent. Any decision to be made must take such limitations into account. In the redwood example, it is assumed that only two types of resources will be consumed, i.e., wood (the raw material), and labour. This means the production of table and chairs is dependent on the two resources available. • Let us consider wood resource first. According to the problem, there are 300 board feet of wood available for the production of tables and chairs. Then we know that the consumption of wood in the production is not possible to exceed the figure of 300 board feet. That is • wood for tables + wood for chairs  300

  18. Step 2 • Because a single table consumes 30 board feet of wood and a single chair 20 board feet, we know that • wood for tables = 30x1 • wood for chairs = 20x2 • Therefore, the limitation, or more professionally, the constraints on the use of wood can be expressed mathematically as • 30x1 + 20x2 300 • Similarly, the constraint function on the use of labour is • 5x1 + 10x2 110 • As we have seen in the graphical method, the constraints functions construct the feasible region of the linear programming problem. Any feasible solution can only be found within the feasible region.

  19. Step 3 – The Objective Function • In programming problems, the objective function is the one to be optimised. For instance, if it is about profit, the solution must make the objective have its maximum value. If, on the other hand, the objective function is about cost, the solution must make it reach its minimum value. In linear programs, the objective function is actually the sum of profit or cost of all the individual items. • In the Redwood example, we know that each table made will contribute £6, and each chair £8 to the profit. So, the objective function in this case is • P = 6x1 + 8x2 • where P is the total profit.

  20. Step 3 • The objective function may involve other targets than profit or cost. A marketing manager may wish to maximise sales, an advertiser may desire to maximise exposure to potential buyers, and an investor would want to maximise rate of return. Similarly, a project manager may want to minimise time needed to finish, while a freight dispatcher might want to minimise delays. • Generally, in relation to the objective functions, P is used for maximisation problems and C for minimisation problems.

  21. Step 4 – The complete model • Incorporating all of these expressions forms our mathematical model, known as a linear program. The mathematical model for the Redwood problem is as follows: • Letting • x1 - number of tables to be made • x2 - number of chairs to be made • Maximise P = 6x1 + 8x2 (objective) • Subject to 30x1 + 20x2 300 (wood) • 5x1 + 10x2 110 (labour) • where x1, x2 0 (non-negativity) • (The optimal solution of this problem is x1 = 4 tables and x2 = 9 chairs. The profit P = £96.)

  22. Solution - Using the Graphical Method • A linear programming problem involving only two variables can be solved using a graphical solution procedure. To find solution using the graphical method, we use the following procedure: • Draw the 2D co-ordinate system with x1 being the horizontal axis and x2 being the vertical axis. Any pair of (x1, x2) corresponds to a point in the 2D space; • Draw the constraints in the co-ordinate system to show the feasible region of the problem. A feasible region represents the space within which a feasible solution can be found under the given circumstance.

  23. Using the Graphical Method • Each constraint, due to linearity, will be represented by a straight line. Consider the first constraint in example 1. • x1 + 2x2 160 • To draw the line, it is necessary to change it to • x1 + 2x2 = 160 • A simple way of drawing a line is to use the “two-points” method. To obtain the two points, we let • x1 = 0, x2 = 80, 1st point = (0, 80) • x2 = 0, x1 = 160,  2nd point = (160, 0)

  24. Try for yourself • Draw a straight line through points A(0, 80) and B(160, 0) as shown in Figure 1. Line AB adds the first constraint to the 2D space. Since the constraint is • x1 + 2x2 160 • the region beyond line AB becomes non-feasible, and the region under line AB is the feasible region corresponding to the constraint. • In the same way, other constraints can be represented in the 2D space. As a result, the final feasible region is within the polygon AEDO. In other word, solutions found only within this region is feasible to the problem.

  25. 3x1 + 2x2 = 240 C A E x1 + 2x2 = 160 D B O Figure 1

  26. Find the optimal solution that enables the objective function to have the optimal value. Let us assume that the P = £110. The objective function becomes • 110 = x1+ 1.5x2 • Using the same method used for drawing the constraints, we can draw the profit line through points (110,0) and (0, 73), as shown in Figure 2.

  27. x1 + 2x2 = 160 110 = x1+ 1.5x2 3x1 + 2x2 = 240 Answers

  28. 140 = x1+ 1.5x2 x1 + 2x2 = 160 110 = x1+ 1.5x2 3x1 + 2x2 = 240 • As illustrated in Figure 2, the profit line can still be moved further to the upper-right to increase the profit. Let us suppose this time that the profit will be £140. The profit line then goes through points (140, 0) and (0, 93), and it is shown in Figure 3.

  29. 140 = x1+ 1.5x2 x1 + 2x2 = 160 110 = x1+ 1.5x2 130 = x1+ 1.5x2 3x1 + 2x2 = 240 • Figure 3 indicates that the profit line is out of the feasible region. This means that profit value we used is too large. Let us now change the profit to £130, and record the new profit line into Figure 4. 4 E

  30. This time the profit line is in touch with vertex E, which is the far most in the direction of profit increase. Any shift of the profit line away from the origin will make the profit line out of the feasible region. Therefore, we can determine that the optimal solution has been found at vertex E which corresponds to x1 = 40, x2 = 60. • The conclusion to the example problem is that under the given circumstance, the most profitable production schedule is to make 40 standard towels and 60 deluxe towels. The total contribution to income accordingly will be £130 per production run.

  31. Tips: • The feasible region is formed by the straight lines that represent constraints. It is always a type of irregular polygon; • The profit lines representing different profit levels are parallel to one another. Once one profit line is drawn, the optimal solution can be located by moving the profit line in parallel; • The optimal solution to a linear programming problem is always at one of the vertices of the polygon representing the feasible region.

  32. Sensitivity Analysis • Sensitivity analysis is the study of how changes in the coefficients of a linear program would affect the optimal solution. Using the sensitivity analysis, we can answer questions such as the following: • How will a change in a coefficient of the objective function affect the optimal solution? • How will a change in the right-hand-side value for a constraint affect the optimal solution? • The primary reason that sensitivity analysis is important to decision-makers is that the real-world problems exist in a dynamic environment. • prices of raw material change; • demand fluctuates; • companies purchase new machinery to replace old; • global labour markets cause changes in production cost; • and so on.

  33. Sensitivity Analysis Introduction • If a linear programming model has been used in such an environment, we expect some of the coefficients to change over time. • The manager will want to determine how such changes would affect the optimal solution to the original linear programming problem. • Sensitivity analysis provides the information needed to respond to such changes without requiring the complete solution of a revised problem. • Sensitivity analysis is performed on the objective function coefficients and the right-hand-side (RHS) values for the constraints.

  34. Objective function coefficients • Consider our towel factory example again… • Maximise P = x1+ 1.5x2 • Subject to the constraints • x1 + 2x2 160 • 3x1 + 2x2 240 • x1 0 • x2 0 • We understand from mathematics point of view that if the contributions to income of the standard and deluxe towel change, the tangent, i.e. the slope, of the profit line will change. • We need to know how much change in the coefficients will alter the original optimal solution to the problem. From Figure 5 we can see that if the profit line rotates pivoted at point E between the two constraint lines, point E will remain to be the optimal solution of the problem .

  35. E Figure 5

  36. If we represent the objective function in the general form P = c1x1+ c2x2, then the tangent of the objective function is -c1/c2. • For the optimal solution to remain at point E, the tangent of the objective function must be between the tangent values of the two constraints which meet at point E. • In the example, the tangent of the first constraint is -1/2, and that of the second is -3/2. Therefore, the tangent of the objective function should be • 1/2 c1/c2 3/2 • When one of the two coefficients is known, the range for the other will be known.

  37. RHS values of the constraints • As the constraints determine the feasible region of an optimisation problem, the change of the value of any constraint will affect the feasible region. • If the feasible region is changed, the optimal solution can be changed accordingly. • To illustrate this aspect of sensitivity analysis, let us consider what happens when the RHS value of the first constraint changes from 160 to 180. The revised problem becomes: • Maximise P = x1+ 1.5x2 • Subject to • x1 + 2x2 180 • 3x1 + 2x2 240 • x1 0 • x2 0

  38. Because of the change in the RHS value of the first constraint, the feasible region of the our problem has changed, as shown in Figure 6, from OAED to OA’E’D. • As the feasible region has changed, the optimal solution can be changed as well. In this case, the optimal solution is changed from (40, 60) to (30, 75).

  39. A’ E’ A E D O Figure 6

  40. Accordingly, the new contribution value is • P = 30 + 1.575 = £142.50 • Compared to the original contribution £130.00, an increase in contribution is • £(142.50 -130.00) = £12.50 • Thus, the increased contribution occurs at a rate of £12.50/20 min. = £0.625/min. for cutting the towel. • The improvement in the value of the objective function per unit change in the RHS of the constraint is called the dual price.

  41. Here, in our example, the dual price for increasing the total time for cutting towels from 160 minutes to 180 minutes is £0.625 per minute; in other words, if we increase the cutting by 1 minute, the value of the objective function will improve by 62.5 pence. • Conversely, if we decrease the cutting time by 1 minute, the objective function will get worse by 62.5 pence. • The dual price can generally be used to determine what will happen to the value of the objective function when we make a one-unit change in the RHS value of a constraint. • We caution that the dual price may be applicable only for small changes in the RHS values. As more and more resources are obtained and the RHS value continues to increase, other constraints will become binding and limit the change in value of the objective function.

  42. Limitations of Linear Programming • In general, because the feasible region is a continuous area on the graph, the optimal solution of a linear programming problem can be fractional, which might not make sense. • If you get a fractional solution the intuitive thing to do is to round the solution to the nearest integer (whole number). • BUT this rounding may take your solution outside of the feasible region!! • ALSO, even when the rounded values lie within the feasible region it can be shown that they do not necessarily give the optimal solution. • When the decision variables take large values, the chances are that rounding will not make much of a difference and the rounded solution will be relatively close to the maximum. • When the decision variables take small values, rounding can give a completely false solution that is nowhere near the maximum and a technique called integer programming should be used. • An obvious constraint is that the objective function and constraints are all linear (this means that every decision variable is multiplied by some number)

  43. In a production context this means that the amount of resources used to produce a unit and the amount of profit generated by a unit remains the same, regardless of the number of units produced. • So if production is doubled, the resources used will double and the profit will be doubled and so on. • This may not be appropriate for a real situation. (e.g. Higher production levels may reduce the manpower required per unit or increase the profit per unit).

  44. The Simplex Method • In previous section, we discussed how the graphical method can be used to solve linear programming problems involving two decision variables. • However, most linear programming problems are too big to be solved graphically, and an algebraic solution procedure must be employed. • The simplex method is the most widely used algebraic procedure for solving linear programming problems. • In this section, we will explain the simplex method through the following example.

  45. Example 1 • HighTech Industries assembles two models of personal computers, HT Deskpro and HT Portable, using imported electronic components. • The Deskpro generates a profit contribution of £50 per unit, and the Portable £40. Each Deskpro unit requires 3 hours of assembly time, and Portable 5 hours. For a week’s production, a maximum of 150 hours of assembly time can be made available. • For some reason, inventory only keeps 20 Portable display components per week. Finally, only 300 square feet of warehouse space can be made available for new production. Assemble each Deskpro requires 8 square feet of warehouse space, and each Portable requires 5 square feet. How should HighTech develop its production schedule for both products?

  46. Example 1 • Translating the above verbal description into mathematical form, let x1 be the number of the Deskpro assembled, and x2 the number of Portables assembled, we have the following model: • Maximise: P = 50 x1 + 40x2 • Subject to: • 3x1 + 5x2 150 Assembly time (1) • x2 20 Portable display (2) • 8x1 + 5x2 300 Warehouse capacity (3) • x1, x2 0

  47. Insertion of Slack Variables • We notice that the constraints are in the form of inequality. In order to solve the problem using the simplex method, the first step is to get rid of the inequality signs by inserting slack variables, which are the correct amounts that enable the inequalities to be expressed as equality. • We insert s1, s2, and s3 as slack variables into constraint (1), (2), and (3) respectively. Then we have • 3x1 + 5x2 + s1 = 150 (1’) • x2 + s2 = 20 (2’) • 8x1 + 5x2 + s3 = 300 (3’) • To make equations (1’), (2’), and (3’) hold, understandably, s1 s2, and s3 must be greater than zero.

  48. Now, we can re-express the problem in the following format for the simplex method: • Maximise: P = 50 x1 + 40x2 + 0s1+ 0s2+ 0s3 • Subject to: • 3x1 + 5x2 + s1 = 150 (1’) • x2 + s2 = 20 (2’) • 8x1 + 5x2 + s3 = 300 (3’) • x1, x2, s1, s2, s3 0

  49. Construction of the Simplex Tableau • We need to set up a tableau in order to use the simplex method to solve the problem. This tableau is constructed using the coefficients of the objective function and the constraint functions. If we adopt the general notation • = objective function coefficient for variable j • = RHS value for constraint i • = coefficient associated with variable j in constraint i • we can show this portion of the initial simplex tableau as follows:

  50. Or, it can be simply remembered as • where • c row = row of the objective function coefficients • b column = column of the RHS values of the constraint equations • A matrix = m rows and n columns of coefficients of the variables in the constraint equations

More Related