370 likes | 506 Views
Readings. Readings. Chapter 2 An Introduction to Linear Programming. Overview. Overview. Overview. Graphical Solutions. Graphical Solutions. Graphical Solutions. Overview
E N D
Readings • Readings • Chapter 2 • An Introduction to Linear Programming
Overview • Overview
Graphical Solutions • Graphical Solutions
Graphical Solutions Overview Graphical Solutions to linear programs arise from graphing the feasible solutions for each constraint and a constant-value line for the objective function to identify which constraints bind (hold with equality) at the optimal solution. Then, solve those constraints to compute the optimal solution.
Graphical Solutions Example 1: Max 5x1 + 7x2 s.t. x1< 6 2x1 + 3x2< 19 x1 + x2< 8 x1> 0 and x2> 0 Graph the first constraint of Example 1 from Lesson I.1, plus non-negativity constraints. x2 8 7 6 5 4 3 2 1 x1 = 6 is the binding edge of the first constraint, where it holds with equality. Shaded region contains all feasible points for this constraint The point (6, 0) is on the end of the binding edge of the first constraint plus the non-negativity of x2. x1 1 2 3 4 5 6 7 8 9 10
Graphical Solutions Example 1: Max 5x1 + 7x2 s.t. x1< 6 2x1 + 3x2< 19 x1 + x2< 8 x1> 0 and x2> 0 Graph the second constraint of Example 1, plus non-negativity constraints. x2 The point (0, 6 1/3) is on the end of the binding edge of the second constraint plus the non-negativity of x1. 8 7 6 5 4 3 2 1 2x1 + 3x2 = 19 is the binding edge of the second constraint. The point (9 1/2, 0) is on the end of the binding edge of the second constraint plus the non-negativity of x2. Shaded region contains all feasible points for this constraint x1 1 2 3 4 5 6 7 8 9 10
Graphical Solutions Example 1: Max 5x1 + 7x2 s.t. x1< 6 2x1 + 3x2< 19 x1 + x2< 8 x1> 0 and x2> 0 Graph the third constraint of Example 1, plus non-negativity constraints. x2 The point (0, 8) is on the end of the binding edge of the third constraint plus the non- negativity of x1 8 7 6 5 4 3 2 1 x1 + x2 = 8 is the binding edge of the third constraint The point (8, 0) is on the end of the binding edge of the third constraint plus the non-negativity of x2 Shaded region contains all feasible points for this constraint x1 1 2 3 4 5 6 7 8 9 10
Graphical Solutions Example 1: Max 5x1 + 7x2 s.t. x1< 6 2x1 + 3x2< 19 x1 + x2< 8 x1> 0 and x2> 0 Intersect all constraint graphs to define the feasible region. x2 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
Graphical Solutions Example 1: Max 5x1 + 7x2 s.t. x1< 6 2x1 + 3x2< 19 x1 + x2< 8 x1> 0 and x2> 0 Graph a line with a constant objective-function value. For example, 35 dollars of profit. x2 8 7 6 5 4 3 2 1 (0, 5) objective function value 5x1 + 7x2 = 35 (7, 0) x1 1 2 3 4 5 6 7 8 9 10
Graphical Solutions Example 1: Max 5x1 + 7x2 s.t. x1< 6 2x1 + 3x2< 19 x1 + x2< 8 x1> 0 and x2> 0 Graph alternative constant-value lines. For example, 35 dollars, 39 dollars, or 42 dollars of profit. x2 8 7 6 5 4 3 2 1 5x1 + 7x2 = 35 5x1 + 7x2 = 39 5x1 + 7x2 = 42 x1 1 2 3 4 5 6 7 8 9 10
Graphical Solutions Example 1: Max 5x1 + 7x2 s.t. x1< 6 2x1 + 3x2< 19 x1 + x2< 8 x1> 0 and x2> 0 Graph the maximum constant-value line, graph the optimal solution, then determine the binding constraints. x2 8 7 6 5 4 3 2 1 Maximum constant-value line 5x1 + 7x2 = 46 Second and third constraints bind at the optimal solution x1 1 2 3 4 5 6 7 8 9 10
Graphical Solutions Example 1: Max 5x1 + 7x2 s.t. x1< 6 2x1 + 3x2< 19 x1 + x2< 8 x1> 0 and x2> 0 • The optimal solution (x1, x2 ) is where the second and third constraints bind (hold with equality): x1 + x2 = 8 and 2x1 + 3x2 = 19. • Solve those equalities using linear algebra, matrices, determinates (det), and Cramer’s rule: 1x1 + 1x2 = 8 2x1+ 3x2 = 19 • 1 • 3 x1 x2 8 19 = • 1 • 3 • 8 1 • 19 3 x1 = det/ det = (8x3-1x19)/(1x3-1x2) = 5 • 1 • 3 • 1 8 • 2 19 x2 = det/ det= (1x19-8x2)/(1x3-1x2) = 3
Graphical Solutions Summary of a graphical solution procedure • Graph the feasible solutions for each constraint. • Determine the feasible region that simultaneously satisfies all the constraints. • Draw a constant-value line for the objective function. • Move parallel value lines toward larger objective function values without leaving the feasible region. • Any feasible solution on the objective function line with the largest value is an optimal solution (or optimum). • That solution can be found by solving the binding (equality) constraints.
Slack and Surplus Variables Slack and Surplus Variables
Slack and Surplus Variables Overview Slack and Surplus Variables measure the deviation of inequality constraints from binding equalities. Thus they measure how much non-binding constraints can change before they affect an optimum.
Slack and Surplus Variables Example 1: Max 5x1 + 7x2 s.t. x1< 6 2x1 + 3x2< 19 x1 + x2< 8 x1> 0 and x2> 0 • Compute slack variables at the optimum to Example 1. x2 Binding third constraint: x1 + x2 = 8 Binding edge of first constraint: x1 = 6 8 7 6 5 4 3 2 1 s3 = 0 s1 = 1 Binding second constraint: 2x1 + 3x2 = 19 Optimal solution (x1 = 5, x2 = 3) s2 = 0 x1 1 2 3 4 5 6 7 8 9 10
Extreme Points Extreme Points
Extreme Points Overview Extreme Points are the corners (or vertices) of the feasible region of a linear program. An optimal solution can be found at extreme points. Thus finding extreme points is an alternative to graphing solutions.
Extreme Point Solutions Example 1: Max 5x1 + 7x2 s.t. x1< 6 2x1 + 3x2< 19 x1 + x2< 8 x1> 0 and x2> 0 • Compute the extreme points in Example 1 by solving pairs of binding constraints. x2 8 7 6 5 4 3 2 1 (0, 6 1/3), where 2x1 + 3x2 = 19 and x1 = 0 5 (5, 3), where 2x1 + 3x2 = 19 and x1 + x2 = 8 4 Feasible region (6, 2), where x1 + x2 = 8 and x1 = 6 3 (6, 0), where x2 = 0 and x1 = 6 (0, 0) 2 1 x1 1 2 3 4 5 6 7 8 9 10
Extreme Point Solutions Example 1: Max 5x1 + 7x2 s.t. x1< 6 2x1 + 3x2< 19 x1 + x2< 8 x1> 0 and x2> 0 • Evaluate the objective function at each of the extreme points in Example 1. • Point (5,3) thus maximizes the objective function, with value 46. (Likewise, point (0,0) minimizes.) (0, 0) Extreme point has objective value 5x1 + 7x2 = 0 1 (6, 0) Extreme point has objective value 5x1 + 7x2 = 30 2 (6, 2) Extreme point has objective value 5x1 + 7x2 = 42 3 (5, 3) Extreme point has objective value 5x1 + 7x2 = 46 4 (0, 6 1/3) Extreme point has objective value 5x1 + 7x2 = 44 1/3 5
Computer Solutions Computer Solutions
Computer Solutions Overview Computer Solutions are available to linear programs with many variables and constraints. Computed values include the objective function, decision variables, and slack and surplus variables.
Computer Solutions • LP problems involving many variables and constraints are now routinely solved with computer packages. • Linear programming solvers are now part of many spreadsheet packages, such as Microsoft Excel. • The Management Scientist program has a convenient LP module. • In remainder of this lesson we will interpret the following output: • objective function value • values of the decision variables • slack and surplus • In a forthcoming lesson, we will interpret the output the shows how an optimal solution is affected by a change in: • a coefficient of the objective function • the right-hand side value of a constraint
Computer Solutions Example 1: Max 5x1 + 7x2 s.t. x1< 6 2x1 + 3x2< 19 x1 + x2< 8 x1> 0 and x2> 0 • To use The Management Scientist 6.0 program, select New under the File menu.
Computer Solutions Example 1: Max 5x1 + 7x2 s.t. x1< 6 2x1 + 3x2< 19 x1 + x2< 8 x1> 0 and x2> 0 • Decision Variable Names can be changed, if desired. • Enter objective function coefficients in the Objective Function portion of the input screen. • In the Constraints section, enter constraint coefficients, constraint relationship (<, =,>), where < abbreviates <, and > abbreviates >. And enter the constraint right-hand-side constants. • Do not enter non-negativity constraints. They are assumed.
Computer Solutions Example 1: Max 5x1 + 7x2 s.t. x1< 6 2x1 + 3x2< 19 x1 + x2< 8 x1> 0 and x2> 0 • Under the Solution menu, select Solve for the Optimal Solution. Maximized objective function value = 46 Optimal x1 = 5 and x2 = 3
Resource Allocation with Sales Maximums Resource Allocation with Sales Maximums
Resource Allocation with Sales Maximums Overview Resource Allocation Problems with Sales Maximums constrain the maximum output D that can be sold at a given price P. The demand curve for output is assumed to be of the following special form: • At price P, demand quantity is D • At any price less than P, demand quantity does not increase, but remains D • At any price greater than P, demand quantity drops from D to 0
Resource Allocation with Sales Maximums • Question: The Monet Company produces four type of picture frames: 1, 2, 3, 4. The four types differ in size, shape and materials used. • Each type requires a certain amount of skilled labor, metal, and glass: • Each frame of type 1 uses 2 hours of labor, 4 ounces of metal, 6 ounces of glass, and sells for $28.50. • Each frame of type 2 uses 1 hour of labor, 2 ounces of metal, 2 ounces of glass, and sells for $12.50. • Each frame of type 3 uses 3 hours of labor, 1 ounces of metal, 1 ounces of glass, and sells for $29.25. • Each frame of type 4 uses 2 hours of labor, 2 ounces of metal, 2 ounces of glass, and sells for $21.50.
Resource Allocation with Sales Maximums • Each week, Monet can buy up to 4000 hours of skilled labor and 10,000 ounces of glass. • The unit costs are $8.00 per labor hour, $0.50 per ounce of metal, and $0.75 per ounce of glass. • Market constraints are such that it is impossible to sell more than: • 1000 type 1 frames, • 2000 type 2 frames, • 500 type 3 frames, • 1000 type 4 frames. • How can Monet maximize its weekly profit?
Resource Allocation with Sales Maximums • Answer: First, compute unit profit for each type of frame: • Frame 1: Unit profit = Sales price – input costs • = 28.5 – 2x8 – 4x.5 – 6x.75 • = 28.5 – 16 – 2 – 4.5 = $6.00 • Frame 2: Unit profit = 12.5 – 1x8 – 2x.5 – 2x.75 • = 12.5 – 8 – 1 – 1.5 = $2.00 • Frame 3: Unit profit = 29.25 – 3x8 – 1x.5 – 1x.75 • = 29.25 – 24 – .5 – .75 = $4.00 • Frame 4: Unit profit = 21.5 – 2x8 – 2x.5 – 2x.75 • = 21.5 – 16 – 1 – 1.5 = $3.00
Resource Allocation with Sales Maximums • Let xibe weekly salesof frames of type i(i = 1, 2, 3, 4). Maximize 6x1 + 2x2 + 4x3 + 3x4 (profit objective) subject to 2x1 + x2 + 3x3 + 2x4 4000 (labor constraint) 6x1 + 2x2 + x3 + 2x4 10,000 (glass constraint) x1 1000 (frame 1 sales constraint) x2 2000 (frame 2 sales constraint) x3 500 (frame 3 sales constraint) x4 1000 (frame 4 sales constraint) x1, x2, x3, x4 0 (nonnegativity constraints) • 6x1 = Profit from frames of type 1 • 2x1 = Labor used in frames of type 1 • 4x1 = Glass used in frames of type 1
Resource Allocation with Sales Maximums Maximize 6x1 + 2x2 + 4x3 + 3x4 subject to 2x1 + x2 + 3x3 + 2x4 4000 6x1 + 2x2 + x3 + 2x4 10,000 x1 1000 x2 2000 x3 500 x4 1000 x1, x2, x3, x4 0
Resource Allocation with Sales Maximums Maximize 6x1 + 2x2 + 4x3 + 3x4 subject to 2x1 + x2 + 3x3 + 2x4 4000 6x1 + 2x2 + x3 + 2x4 10,000 x1 1000 x2 2000 x3 500 x4 1000 x1, x2, x3, x4 0
Resource Allocation with Sales Maximums Maximize 6x1 + 2x2 + 4x3 + 3x4 subject to 2x1 + x2 + 3x3 + 2x4 4000 6x1 + 2x2 + x3 + 2x4 10,000 x1 1000 x2 2000 x3 500 x4 1000 x1, x2, x3, x4 0 • Maximum weekly profit of $10,000. • Xi is optimal weekly salesof frames of type i(i = 1, 2, 3, 4).
BA 452 Quantitative Analysis End of Lesson A.2