1 / 63

Introduction to Linear Programming

This is an overview of Linear Programming (LP) and its problem formulation. It covers the steps for model formulation, assumptions of LP, and a graphical solution procedure for maximization problems.

epowers
Download Presentation

Introduction to Linear Programming

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. Operations ResearchInstructor: Xiaoxi Li (李晓蹊)Wuhan University, 2017 Fall

  2. Introduction to LP (week two) • Linear Programming Problem: an overview • Problem Formulation • A Simple Maximization Problem • Graphical Solution Procedure • Extreme Points and the Optimal Solution • Computer Solutions • A Simple Minimization Problem • Special (Irregular) Cases • Examples from Hillier and Lieberman

  3. Linear Programming: An Overview • Objectives of business decisions frequently involve maximizing profit or minimizing costs. • Linear programming uses linear algebraic relationships to represent a firm’s decisions, given a business objective, and resource constraints. • To illustrate: • both the objective f(x) and the constraint g(x) are linear in x.

  4. Model Components • Decision variables (the decisions)- mathematical symbols representing levels of activity of a firm -- the vector “x”. • Objective function (goal)- a linear mathematical relationship describing an objective of the firm, in terms of decision variables -- the function “f(x)” , to be maximized or minimized. • Constraints (physical restrictions) – requirements or restrictions placed on the firm by the operating environment, stated in linear relationships of the decision variables – the inequality “g(x) ≦ b” . [Note: =, ≦ or ≧ is allowed but not >or <.] • Parameters (model in detail) - numerical coefficients and constants used in the objective function and constraints – the number “b” and “c1, c2” when “f(x)=c1x1 + c2x2 , x=(x1x2 )”.

  5. Summary of Model Formulation Steps Step 1 : Clearly define the decision variables. Step 2 : Construct the objective function in terms of the decisions variables, including fixing the parameters. Step 3 : Formulate the constraints in terms of the decisions variables, including fixing the parameters.

  6. Assumptions of Linear Programming Model • Proportionality- The rate of change (slope) of the objective function and constraint equations is constant. • Additivity- Terms in the objective function and constraint equations must be additive, i.e. f(x,y)=3x+5y. • Divisibility-Decision variables can take on any fractional value and are therefore continuous as opposed to integer in nature. • Certainty - Values of all the model parameters are assumed to be known with certainty (non-probabilistic).

  7. Linear Programming (LP) Problem • A feasible solution satisfies all the problem's constraints. • An optimal solution is a feasible solution that results in the largest possible objective function value when maximizing (or smallest when minimizing). • A graphical solution method can be used to solve a linear program with two variables.

  8. Example 1: A Simple Maximization Problem Objective Function Max Z=5x1 + 7x2 s.t. x1< 6 2x1 + 3x2< 19 x1 + x2< 8 x1> 0 and x2> 0 “Regular” Constraints Non-negativity Constraints

  9. Example 1: Graphical Solution x2 • First Constraint Graphed 8 7 6 5 4 3 2 1 x1 = 6 (x1 ≦ 6 ) Shaded region contains all feasible points for this constraint (6, 0) x1 1 2 3 4 5 6 7 8 9 10

  10. Example 1: Graphical Solution x2 • Second Constraint Graphed 8 7 6 5 4 3 2 1 (0, 19/3): x1 =0, x2 =19/3 2x1 + 3x2 = 19 (2x1 + 3x2 ≦ 19) Shaded region contains all feasible points for this constraint (19/2, 0): x2 =0, x1 = 19/2 x1 1 2 3 4 5 6 7 8 9 10

  11. Example 1: Graphical Solution x2 • Third Constraint Graphed (0, 8) 8 7 6 5 4 3 2 1 x1 + x2 = 8 (x1 + x2 ≦ 8 ) Shaded region contains all feasible points for this constraint (8, 0) x1 1 2 3 4 5 6 7 8 9 10

  12. Example 1: Graphical Solution x2 • Combined-Constraint Graph Showing Feasible Region x1 + x2 = 8 8 7 6 5 4 3 2 1 x1 = 6 2x1 + 3x2 = 19 Feasible Region x1 1 2 3 4 5 6 7 8 9 10

  13. Example 1: Graphical Solution x2 • Objective Function Line 8 7 6 5 4 3 2 1 (0, 5) Objective Function 5x1 + 7x2 = 35 (7, 0) x1 1 2 3 4 5 6 7 8 9 10

  14. Example 1: Graphical Solution • Selected Objective Function Lines x2 8 7 6 5 4 3 2 1 5x1 + 7x2 = 35 5x1 + 7x2 = 39 Direction for increasing Z 5x1 + 7x2 = 42 x1 1 2 3 4 5 6 7 8 9 10

  15. Example 1: Graphical Solution x2 • Optimal Solution Maximum Objective Function Line 5x1 + 7x2 = 46 8 7 6 5 4 3 2 1 Optimal Solution (x1 = 5, x2 = 3) x1 1 2 3 4 5 6 7 8 9 10

  16. Summary of the Graphical Solution Procedure for Maximization Problems • Prepare a graph of the feasible solutions for each of the constraints. • Determine the feasible region that satisfies all the constraints simultaneously. • Draw an objective function line (e.g. iso-profit line). • Move parallel objective function lines toward larger objective function values without entirely leaving the feasible region. • Any feasible solution on the objective function line with the largest value is an optimal solution.

  17. Computer Solutions • LP problems involving 1000s of variables and 1000s of constraints are now routinely solved with computer packages. • Linear programming solvers are now part of many spreadsheet packages, such as Microsoft Excel. • Leading commercial packages include CPLEX, LINGO, MOSEK, Xpress-MP, and Premium Solver for Excel.

  18. Interpretation of Computer Output • In this chapter we will discuss the following output: • objective function value • values of the decision variables • slack and surplus • In the next chapter we will discuss how an optimal solution is affected by a change in: • a coefficient of the objective function • the right-hand side value of a constraint

  19. Example 1: Spreadsheet Solution • Partial Spreadsheet Showing Problem Data

  20. Example 1: Spreadsheet Solution • Partial Spreadsheet Showing Solution • Decision variables: B10:C10; • Maximized Objective: C12=B6*B10+C6*C10; • Constraints: define B15=B3*B10+C3*C10 and set B15<=D3; define B16=B4*B10+C4*C10 and set B15<=D4; define B15=B5*B10+C5*C10 and set B15<=D5.

  21. Example 1: Spreadsheet Solution • Interpretation of Computer Output We see from the previous slide that: Objective Function Value = 46 Decision Variable #1 (x1) = 5 Decision Variable #2 (x2) = 3 “Slack” in Constraint #1 = 6 – 5 = 1 “Slack” in Constraint #2 = 19 – 19 = 0 “Slack” in Constraint #3 = 8 – 8 = 0

  22. Example 2: A Simple Minimization Problem • LP Formulation Min 5x1 + 2x2 s.t. 2x1 + 5x2> 10 4x1-x2> 12 x1 + x2> 4 x1, x2> 0

  23. Example 2: Graphical Solution • Graph the Constraints Constraint 1: When x1 = 0, then x2 = 2; when x2 = 0, then x1 = 5. Connect (5,0) and (0,2). The ">" side is above this line: check that (0,0) is not in the feasible area. Constraint 2: When x2 = 0, then x1 = 3. But setting x1 to 0 will yield x2 = -12, which is not on the graph. Thus, to get a second point on this line, set x1 to any number larger than 3 and solve for x2: when x1 = 5, then x2 = 8. Connect (3,0) and (5,8). The ">" side is to the right. Constraint 3: When x1 = 0, then x2 = 4; when x2 = 0, then x1 = 4. Connect (4,0) and (0,4). The ">" side is above this line.

  24. Example 2: Graphical Solution • Constraints Graphed x2 6 5 4 3 2 1 Feasible Region 4x1-x2> 12 x1 + x2> 4 2x1 + 5x2> 10 x1 1 2 3 45 6

  25. Example 2: Graphical Solution • Graph the Objective Function Set the objective function equal to an arbitrary constant (say 20) and graph it. For 5x1 + 2x2 = 20, when x1 = 0, then x2 = 10; when x2= 0, then x1 = 4. Connect (4,0) and (0,10). • Move the Objective Function Line Toward Optimality Move it in the direction which lowers its value (down), since we are minimizing, until it touches the last point of the feasible region, determined by the last two constraints.

  26. Example 2: Graphical Solution • Objective Function Graphed x2 Min 5x1 + 2x2 6 5 4 3 2 1 4x1-x2> 12 x1 + x2> 4 2x1 + 5x2> 10 x1 1 2 3 45 6

  27. Example 2: Graphical Solution • Solve for the Extreme Point at the Intersection of the Two Binding Constraints 4x1 - x2 = 12 x1+ x2 = 4 Adding these two equations gives: 5x1 = 16 or x1 = 16/5 Substituting this into x1 + x2 = 4 gives: x2 = 4/5 • Solve for the Optimal Value of the Objective Function 5x1 + 2x2 = 5(16/5) + 2(4/5) = 88/5

  28. Example 2: Graphical Solution • Optimal Solution x2 6 5 4 3 2 1 4x1-x2> 12 x1 + x2> 4 Optimal Solution: x1 = 16/5, x2 = 4/5, 5x1 + 2x2 = 17.6 2x1 + 5x2> 10 x1 1 2 3 45 6

  29. Summary of the Graphical Solution Procedurefor Minimization Problems • Prepare a graph of the feasible solutions for each of the constraints. • Determine the feasible region that satisfies all the constraints simultaneously. • Draw an objective function line (e.g. iso-cost line). • Move parallel objective function lines toward smaller objective function values without entirely leaving the feasible region. • Any feasible solution on the objective function line with the smallest value is an optimal solution.

  30. Example 2: Spreadsheet Solution • Partial Spreadsheet Showing Problem Data

  31. Example 2: Spreadsheet Solution • Partial Spreadsheet Showing Formulas

  32. Example 2: Spreadsheet Solution • Partial Spreadsheet Showing Solution

  33. Example 2: Spreadsheet Solution • Interpretation of Computer Output • We see from the previous slide that: • Objective Function Value = 17.6 • Decision Variable #1 (x1) = 3.2 • Decision Variable #2 (x2) = 0.8 • “Surplus” in Constraint #1 = 10.4 - 10 = 0.4 • “Surplus” in Constraint #2 = 12.0 - 12 = 0.0 • “Surplus” in Constraint #3 = 4.0 - 4 = 0.0

  34. Special (Irregular) Cases • Case 1: Infeasibility • Case 2: Unbounded solution • Case 3: Infinitely many optimal solutions

  35. Case 1: Infeasibility • No solution to the LP problem satisfies all the constraints, including the non-negativity conditions. • Graphically, this means a feasible region does not exist. • Causes include: • A formulation error has been made. • Too many restrictions have been placed on the problem (i.e. the problem is over-constrained).

  36. Example: Infeasible Problem • Consider the following LP problem. Max 2x1 + 6x2 s.t. 4x1 + 3x2< 12 2x1 + x2> 8 x1, x2> 0

  37. Example: Infeasible Problem • There are no points that satisfy both constraints, so there is no feasible region (and no feasible solution). x2 10 2x1 + x2> 8 8 6 4x1 + 3x2< 12 4 2 x1 2 4 6 8 10

  38. Case 2: Unbounded Solution • The solution to a maximization LP problem is unbounded if the value of the solution may be made indefinitely large without violating any of the constraints. • For real problems, this is the result of improper formulation. (Quite likely, a constraint has been inadvertently omitted.)

  39. Example: Unbounded Solution • Consider the following LP problem. Max 4x1 + 5x2 s.t. x1 + x2> 5 3x1 + x2> 8 x1, x2> 0

  40. Example: Unbounded Solution • The feasible region is unbounded and the objective function line can be moved outward from the origin without bound, infinitely increasing the objective function. x2 10 3x1 + x2> 8 8 6 Max 4x1 + 5x2 4 x1 + x2> 5 2 x1 2 4 6 8 10

  41. Case 3: Infinitely Many Optimal Solutions The objective function is parallel to a constraint line. Any point between B and C achieves the maximal value 1 200. Maximize Z= 40x1 + 30x2 subject to: x1 + 2x2  40 4x2 + 3x2  120 x1, x2  0 Figure. An Example with Infinitely Many Optimal Solutions

  42. Prototype Model from Hillier and Lieberman The Wyndor Glass Co. produces high-quality glass products, including windows and glass doors. It has three plants: Plant 1produces Aluminum frames Plant 2produces wood frames Plant 3produces the glass and assembles the products.

  43. The company has decided to produce two new products. Product 1: An 8-foot glass door with aluminum framing Product 2: A 4x6 foot double-hung wood framed window Problem: Assume that all the products can be sold. The company wants to know what should be the best mix of the two productsin order to maximize their total profit, subject to the restriction imposed by the limited production capacities available in the 3 plants.

  44. Products produced in batches of 20, and the production rate is defined as the number of batches produced per week. To get the answer, we need to collect the following data: (a). Number of hours of production time available per week in each of plant for new products (available capacity); (b). Production time used (needed) in each plant for producing each batch of each new product (production rate); (c). Profit per batch of each new product (unit contribution).

  45. (a) Number of hours of production time available per week in each plant for these two new products. (Most of the time in the 3 plants is already committed to current products, so the available capacity for the 2 new products is quite limited). The number of hours of production time available per week for the new products: in Plant 1 is at most 4; in Plant 2 is at most 12; in Plant 3 is at most 18.

  46. (b) Theproduction time (number of hours) used in each plant for the production of one batch of each new product (Product 1 requires some production capacity in Plants 1 and 3, but none in Plant 2;Product 2 needs only Plants 2 and 3 but not 1). To produce each batch of Product 1,the production time needed in Plant 1 is : 1 hour; in Plant 2 is: 0 hours; in Plant 3 is :3 hours. To produce each batch of Product 2,the production time needed in Plant 1 is : 0 hour; in Plant 2 is: 2 hours; in Plant 3 is :2 hours.

  47. (c) Profit per batch produced of each new product: it is $3,000 for Product 1; it is $5,000 for Product 2。 The data collected are summarized in Table 3.1. This is a linear programming problem of the classic product mix type.

  48. Formulation as a Linear Programming Problem We put: x1 = number of batches of product 1 produced per week x2 = number of batches of product 2 produced per week Z = total profit (in 1000 dollars) from producing the two new products. x1and x2 are the decision variables. Using the data of Table 3.1: (Plant 1:Total production time required) (Production time available,Plant 1) (Plant 2:Total production time required) (Production time available, Plant 2) (Plant 3:Total production time required) (Production time available, Plant 3)

  49. Graphical Solution Fig. 3.2 Shaded area shows values of (x1, x2) , called feasible region Fig. 3.1 Shaded area shows values of (x1, x2) allowed by x1≥ 0, x2≥ 0, x1≤ 4

More Related