Chapter 2 An Introduction to Linear Programming Instructor

  • Slides: 46
Download presentation
Chapter 2: An Introduction to Linear Programming Instructor: Dr. Mohamed Mostafa

Chapter 2: An Introduction to Linear Programming Instructor: Dr. Mohamed Mostafa

Overview • • Linear Programming Problem Formulation A Simple Maximization Problem Graphical Solution Procedure

Overview • • Linear Programming Problem Formulation A Simple Maximization Problem Graphical Solution Procedure Extreme Points and the Optimal Solution A Simple Minimization Problem Special Cases 2

Linear Programming n Linear programming has nothing to do with computer programming. n The

Linear Programming n Linear programming has nothing to do with computer programming. n The use of the word “programming” here means “choosing a course of action”. n Linear programming is a problem-solving approach developed to help managers make decisions.

Linear Programming (LP) Problem • The maximization or minimization of some quantity is the

Linear Programming (LP) Problem • The maximization or minimization of some quantity is the objective in all linear programming problems. • All LP problems have – Constraints that limit the objective function value. – feasible solution satisfies all the problem's constraints. – optimal solution is 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.

Linear Programming (LP) Problem • If both the objective function and the constraints are

Linear Programming (LP) Problem • If both the objective function and the constraints are linear, the problem is referred to as a linear programming problem. • Linear functions are functions in which each variable appears in a separate term raised to the first power and is multiplied by a constant (which could be 0). • Linear constraints are linear functions that are restricted to be "less than or equal to", "equal to", or "greater than or equal to" a constant.

Which are NOT linear functions? 1. -2 x 1 + 4 x 2 –

Which are NOT linear functions? 1. -2 x 1 + 4 x 2 – 1 x 3 < 80 2. 3√x 1 - 2 x 2 ≥ 15 3. 2 x 1 x 2 + 5 x 3 < 17 4. 4 x 1 + 7 x 3 = 12 6

Problem Formulation • Problem formulation or modeling is the process of translating a verbal

Problem Formulation • Problem formulation or modeling is the process of translating a verbal statement of a problem into a mathematical statement. • Formulating models is an art that can only be mastered with practice and experience. • Every LP problem has some unique features, but most problems also have common features. • General guidelines for LP model formulation are illustrated on the slides that follow.

Guidelines for Model Formulation • • • Read and Understand the problem. Describe the

Guidelines for Model Formulation • • • Read and Understand the problem. Describe the objective. Describe each constraint. Define the decision variables. Write the objective in terms of the decision variables. Write the constraints in terms of the decision variables.

Problem Statement • A Starbucks wants to maximize hourly profit on sales of lattes

Problem Statement • A Starbucks wants to maximize hourly profit on sales of lattes and cappuccinos. They make $5 per latte and $7 per cappuccino. • In any given hour, – The latte frother can blend up to 6 cups per hour. – The maximum milk supply in each hour is 19 cups. Lattes require 2 cups, and cappuccinos take 3. – The lid station can provide a max of 8 lids per hour. Each latte and cappuccino must have a lid. How can Starbucks maximize profit in each hour on sales of lattes and cappuccinos? 9

Max 5 x 1 + 7 x 2 s. t. x 1 < 6

Max 5 x 1 + 7 x 2 s. t. x 1 < 6 2 x 1 + 3 x 2 < 19 x 1 + x 2 < 8 x 1 > 0 and x 2 > 0 Objective Function “Regular” Constraints Non-negativity Constraints

Graphical Solution • Prepare a graph of the feasible solutions for each of the

Graphical Solution • Prepare a graph of the feasible solutions for each of the constraints. • Determine the feasible region that satisfies all the constraints simultaneously. Type of constraint Feasible region (usually) will be – > above/to the right – < below/to the left – = the line • Draw an objective function 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. 11

Starbucks: Graphical Solution x 2 8 7 6 5 4 3 2 1 1

Starbucks: Graphical Solution x 2 8 7 6 5 4 3 2 1 1 2 3 4 5 6 7 8 9 10 x 1

Starbucks: Graphical Solution x 2 First Constraint Graphed 8 x 1 = 6 7

Starbucks: Graphical Solution x 2 First Constraint Graphed 8 x 1 = 6 7 6 Shaded region contains all feasible points for this constraint 5 4 3 2 (6, 0) 1 1 2 3 4 5 6 7 8 9 10 x 1

Second Constraint Graphed x 2 8 (0, 6 1/3) 7 6 2 x 1

Second Constraint Graphed x 2 8 (0, 6 1/3) 7 6 2 x 1 + 3 x 2 = 19 5 4 3 2 1 Shaded region contains all feasible points for this constraint 1 2 3 4 (9 1/2, 0) 5 6 7 8 9 10 x 1

Third Constraint Graphed x 2 (0, 8) 8 7 x 1 + x 2

Third Constraint Graphed x 2 (0, 8) 8 7 x 1 + x 2 = 8 6 5 4 3 2 1 Shaded region contains all feasible points for this constraint 1 2 3 4 (8, 0) 5 6 7 8 9 10 x 1

Combined-Constraint Graph Showing Feasible Region x 2 x 1 + x 2 = 8

Combined-Constraint Graph Showing Feasible Region x 2 x 1 + x 2 = 8 8 7 x 1 = 6 6 5 4 3 2 x 1 + 3 x 2 = 19 Feasible Region 2 1 1 2 3 4 5 6 7 8 9 10 x 1

Objective Function Line x 2 8 7 (0, 5) 6 Objective Function 5 x

Objective Function Line x 2 8 7 (0, 5) 6 Objective Function 5 x 1 + 7 x 2 = 35 5 4 3 2 (7, 0) 1 1 2 3 4 5 6 7 8 9 10 x 1

Selected Objective Function Lines x 2 8 7 5 x 1 + 7 x

Selected Objective Function Lines x 2 8 7 5 x 1 + 7 x 2 = 35 6 5 x 1 + 7 x 2 = 39 5 4 5 x 1 + 7 x 2 = 42 3 2 1 1 2 3 4 5 6 7 8 9 10 x 1

Optimal Solution x 2 Maximum Objective Function Line 5 x 1 + 7 x

Optimal Solution x 2 Maximum Objective Function Line 5 x 1 + 7 x 2 = 46 8 7 Optimal Solution (x 1 = 5, x 2 = 3) 6 5 4 3 2 1 1 2 3 4 5 6 7 8 9 10 x 1

 • Solve for the Extreme Point at the Intersection of the Two Binding

• Solve for the Extreme Point at the Intersection of the Two Binding Constraints 2 x 1 + 3 x 2 = 19 x 1+ x 2 = 8 The two equations will give: x 2 = 3 Substituting this into x 1 + x 2 = 8 gives: x 1 = 5 Solve for the Optimal Value of the Objective Function 5 x 1 + 7 x 2 = 5(5) + 7(3) = 46

Extreme Points and the Optimal Solution • The corners or vertices of the feasible

Extreme Points and the Optimal Solution • The corners or vertices of the feasible region are referred to as the extreme points. • An optimal solution to an LP problem can be found at an extreme point of the feasible region. • When looking for the optimal solution, you do not have to evaluate all feasible solution points; consider only the extreme points of the feasible region.

Extreme Points x 2 8 7 5 (0, 6 1/3) 6 5 4 4

Extreme Points x 2 8 7 5 (0, 6 1/3) 6 5 4 4 (5, 3) 3 Feasible Region 2 1 3 (6, 2) 2 (6, 0) 1 (0, 0) 1 2 3 4 5 6 7 8 9 10 x 1

Max x 2 8 7 5 6 5 (x 1 , x 2 )

Max x 2 8 7 5 6 5 (x 1 , x 2 ) 1 (0, 0) 2 (6, 0) 3 (6, 2) Z 0 30 44 (5, 3) 5 (6 1/3, 0) 46 30 5/3 4 4 4 3 Feasible Region 2 1 Z = 5 x 1 + 7 x 2 3 1 1 2 2 3 4 5 6 7 8 9 10 x 1 23

Problem • A woodcarving ﻧﺤﺖ ﺍﻟﺨﺸﺐ agency manufactures two types of wooden toys: soldiers

Problem • A woodcarving ﻧﺤﺖ ﺍﻟﺨﺸﺐ agency manufactures two types of wooden toys: soldiers and trains. A soldier sells for $27 and uses $10 worth of raw materials. Each soldier that is manufactured increases his variable labor and overhead costs (Examples include rent, gas, electricity, and wages) by $14. A train sells for $21 and uses $9 worth of raw materials. Each train built increases his variable labor and overhead costs by $10. The manufacture of soldier and trains requires two types of skilled labor: carpentry and finishing. A soldier requires 2 hours of finishing labor and 1 hour of carpentry labor. A train requires 1 hour of finishing and 1 hour of carpentry labor. Each week he can obtain all the raw material he needs but only 100 hours of finishing and 80 carpentry hours. Demand for trains is unlimited, but at most 40 soldiers are bought every week. Formulate the problem that may maximize the company’s weekly profit and solve it graphically.

Problem • The following table summarizes the key facts about two products, A and

Problem • The following table summarizes the key facts about two products, A and B, and the resources Q, R, and S required to produce them. Formulate a linear programming model for this problem. The profit per unit is $3 for Product A and $2 for Product B. Resource Usage per Unit Produced Product A Product B Amount of Available Resource Q 2 1 2 R 1 2 2 S 3 3 4

Assignment • The Primo Insurance Company is introducing two new product lines: special risk

Assignment • The Primo Insurance Company is introducing two new product lines: special risk insurance and. Mortgages ﺭﻫﻦ ﻋﻘﺎﺭﻯ The expected profit is $5 per unit on special risk insurance and $2 per unit on mortgages. Management wishes to establish sales quotas ﺣﺼﺺ ﺍﻟﻤﺒﻴﻌﺎﺕ for new product lines. The work req. are as follows. Formulate the LP model and solve it graphically. Department Work-hours per unit Work hours Available Special Risk Mortgage Underwriting ﺍﻻﻛﺘﺘﺎﺏ - ﺗﻌﻬﺪ ﺑﺎﻟﺘﻤﻮﻳﻞ 3 2 2, 400 Admin. ﺍﻹﺷﺮﺍﻑ 0 1 800 Claims ﺍﻟﻤﻄﺎﻟﺒﺎﺕ - ﺍﻟﺸﻜﺎﻭﻯ 2 0 1, 200

Computer Solution: Windows QM Demo version available at: http: //wps. prenhall. com/bp_weiss_software_1/0, 6750, 91664

Computer Solution: Windows QM Demo version available at: http: //wps. prenhall. com/bp_weiss_software_1/0, 6750, 91664 -, 00. html

Solving Graphically: Minimization Problem • Prepare a graph of the feasible solutions for each

Solving Graphically: Minimization Problem • 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. • 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.

A Simple Minimization Problem LP Formulation Min 5 x 1 + 2 x 2

A Simple Minimization Problem LP Formulation Min 5 x 1 + 2 x 2 s. t. 2 x 1 + 5 x 2 > 10 4 x 1 - x 2 > 12 x 1 + x 2 > 4 x 1, x 2 > 0

Graphical Solution Constraints Graphed x 2 6 Feasible Region 5 4 x 1 -

Graphical Solution Constraints Graphed x 2 6 Feasible Region 5 4 x 1 - x 2 > 12 4 x 1 + x 2 > 4 3 2 x 1 + 5 x 2 > 10 2 1 1 2 3 4 5 6 x 1

Objective Function Graphed x 2 Min 5 x 1 + 2 x 2 6

Objective Function Graphed x 2 Min 5 x 1 + 2 x 2 6 5 4 x 1 - x 2 > 12 4 x 1 + x 2 > 4 3 2 x 1 + 5 x 2 > 10 2 1 1 2 3 4 5 6 x 1

 • Solve for the Extreme Point at the Intersection of the Two Binding

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

LP in Standard Form • A linear program in which all the variables are

LP in Standard Form • A linear program in which all the variables are non-negative and all the constraints are equalities is said to be in standard form • To attain ﻟﺘﺼﻞ standard form you must 1. < constraints: Add slack variable ﻣﺘﻐﻴﺮ ﺍﻟﺮﻛﻮﺩ to constraint (coefficient of 0 in obj function) 2. > constraints: Subtract surplus ﻓﺎﺋﺾ from constraint (coefficient of 0 in obj function) 3. = constraints: Add artificial variable ﻣﺘﻐﻴﺮ ﺍﻻﺻﻄﻨﺎﻋﻲ to constraint (coefficient of –M in obj function)

 • Slack and surplus variables represent the difference between the left and right

• Slack and surplus variables represent the difference between the left and right sides of the constraints. Slack is any unused resource, while surplus is the amount over some required minimum level. • The objective function coefficient for slack and surplus variables is equal to 0. • If slack/surplus variables are equal to 0 for a constraint, the constraint is said to be binding ﻟﻡ.

Slack Variables (for < constraints) Max 5 x 1 + 7 x 2 +

Slack Variables (for < constraints) Max 5 x 1 + 7 x 2 + 0 s 1 + 0 s 2 + 0 s 3 s. t. x 1 + s 1 2 x 1 + 3 x 2 x 1 + x 2 = + s 2 6 = 19 + s 3 = 8 x 1, x 2 , s 1 , s 2 , s 3 > 0 s 1 , s 2 , and s 3 are slack variables Example in Standard Form

Optimal Solution 8 Third Constraint: x 1 + x 2 = 8 7 s

Optimal Solution 8 Third Constraint: x 1 + x 2 = 8 7 s 3 = 0 x 2 First Constraint: x 1 = 6 s 1 = 1 6 5 Second Constraint: 2 x 1 + 3 x 2 = 19 4 3 2 1 Optimal Solution (x 1 = 5, x 2 = 3) 1 2 3 4 s 2 = 0 5 6 7 8 9 10 x 1

Surplus Variables Minimization Example in Standard Form Min 5 x 1 + 2 x

Surplus Variables Minimization Example in Standard Form Min 5 x 1 + 2 x 2 + 0 s 1 + 0 s 2 + 0 s 3 s. t. 2 x 1 + 5 x 2 - s 1 4 x 1 - x 2 - s 2 x 1 + x 2 s 1 , s 2 , and s 3 are surplus variables - s 3 x 1, x 2, s 1, s 2, s 3 > 0 = 12 = 4

LP’s Special Case: Alternative Optimal Solutions Max 4 x 1 + 6 x 2

LP’s Special Case: Alternative Optimal Solutions Max 4 x 1 + 6 x 2 s. t. x 1 < 6 2 x 1 + 3 x 2 < 18 x 1 + x 2 < 7 x 1 > 0 and x 2 > 0

Boundary constraint 2 x 1 + 3 x 2 < 18 and objective function

Boundary constraint 2 x 1 + 3 x 2 < 18 and objective function Max 4 x 1 + 6 x 2 are parallel. All points on line segment A – B are optimal solutions. x 2 x 1 + x 2 < 7 7 6 5 Max 4 x 1 + 6 x 2 A B 4 x 1 < 6 2 x 1 + 3 x 2 < 18 3 2 1 1 2 3 4 5 6 7 8 9 10 x 1

Infeasibility Max 2 x 1 + 6 x 2 s. t. 4 x 1

Infeasibility Max 2 x 1 + 6 x 2 s. t. 4 x 1 + 3 x 2 < 12 2 x 1 + x 2 > 8 x 1, x 2 > 0

 • There are no points that satisfy both constraints, so there is no

• There are no points that satisfy both constraints, so there is no feasible region (and no feasible solution). x 2 10 2 x 1 + x 2 > 8 8 6 4 x 1 + 3 x 2 < 12 4 2 2 4 6 8 10 x 1

Unbounded Problem Max 4 x 1 + 5 x 2 s. t. x 1

Unbounded Problem Max 4 x 1 + 5 x 2 s. t. x 1 + x 2 > 5 3 x 1 + x 2 > 8 x 1, x 2 > 0

The feasible region is unbounded and the objective function line can be moved outward

The feasible region is unbounded and the objective function line can be moved outward from the origin without bound, infinitely increasing the objective x 2 function. 10 3 x 1 + x 2 > 8 8 M ax 6 4 x 1 4 +5 x 2 x 1 + x 2 > 5 2 2 4 6 8 10 x 1

Assignment • The Sanders Garden Shop mixes two types of grass seed into a

Assignment • The Sanders Garden Shop mixes two types of grass seed into a blend. Each type of grass has been rated (per pound) according to its shade tolerance, ability to stand up to traffic, and drought resistance, as shown in the table. Type A seed costs $1 and Type B seed costs $2. If the blend needs to score at least 300 points for shade tolerance, 400 points for traffic resistance, and 750 points for drought resistance, how many pounds of each seed should be in the blend? How much will the blend cost?