chapter 3 linear programming

35
QMT425-FSKM 1 Topic 3 : Linear Programming 1. Objectives of the business frequently to maximize profit or minimize cost. 2. LP is a technique that helps in resource allocation decisions. 3. LP is a model consisting of linear relationships representing a firm’s decisions given an objective and resource constraints. Steps in application 1. Identify problem as solvable by linear programming. 2. Formulate a mathematical model of the unstructured problem. 3. Solve the model. Requirements of a linear programming problem 1. One objective function. (maximize or minimize objective) 2. One or more constraints. 3. Alternative courses of action. 4. Objective function and constraints are linear. Assumption of LP 1. Certainty 2. Proportionality 3. Additively 4. Divisibility 5. Non-negative Model Components •Decision variables : mathematical symbols representing levels of activity of a firm. •Objective function : a linear mathematical relationship describing an objective of the firm, in terms of decision variables, that is maximized or minimized •Constraints : restrictions placed on the firm by the operating environment stated in linear relationships of the decision variables. •Parameters : numerical coefficients and constants used in the objective function and constraint equations.

Upload: adykasyah

Post on 08-Apr-2015

1.735 views

Category:

Documents


18 download

TRANSCRIPT

Page 1: Chapter 3 Linear Programming

QMT425-FSKM

1

Topic 3 : Linear Programming 1. Objectives of the business frequently to maximize profit or minimize cost. 2. LP is a technique that helps in resource allocation decisions. 3. LP is a model consisting of linear relationships representing a firm’s decisions given an

objective and resource constraints. Steps in application 1. Identify problem as solvable by linear programming.

2. Formulate a mathematical model of the unstructured problem. 3. Solve the model. Requirements of a linear programming problem 1. One objective function.

(maximize or minimize objective)

2. One or more constraints.

3. Alternative courses of action.

4. Objective function and constraints are linear. Assumption of LP 1. Certainty

2. Proportionality

3. Additively

4. Divisibility

5. Non-negative

Model Components

•Decision variables: mathematical symbols representing levels of activity of a firm. •Objective function: a linear mathematical relationship describing an objective of the firm, in terms of decision variables, that is maximized or minimized •Constraints: restrictions placed on the firm by the operating environment stated in linear relationships of the decision variables. •Parameters: numerical coefficients and constants used in the objective function and constraint equations.

Page 2: Chapter 3 Linear Programming

QMT425-FSKM

2

Formulating LP Problems 1. Completely understand the managerial problem being faced. 2. Identify the objective and the constraints. 3. Define the decision variables. 4. Use decision variable to write mathematical expressions for objective function and the

constraints. A Maximization Model Example Problem Definition The Beaver Creek Pottery Company is a small crafts company. The company employs skilled artisans to produce clay bowls and mugs. The two primary resources used by the company are special pottery clay and skilled labor. Given these limited resources the company desires to know how many bowls and mugs to produce each day in order to maximize profit. The two products have the following resource requirements for production and profit per item produced.

Product

Resource Requirements Labor (hr/ unit)

Clay (lb/ unit)

Profit (RM/ unit)

Bowl 1 4 40 Mug 2 3 50

There are 40 hours of labor and 120 pounds of clay available each day for production.

Product

Resource Requirements Labor (hr/ unit)

Clay (lb/ unit)

Profit (RM/ unit)

Bowl 1 4 40 Mug 2 3 50 Available 40 120

Page 3: Chapter 3 Linear Programming

QMT425-FSKM

3

Decision Variables: x1= number of bowls to produce/day x2= number of mugs to produce/day Objective function Maximize Z = 40x1 + 50x2 where Z= profit per day Resource Constraints: x1 + 2x2 ≤ 40 hours of labor 4x1 + 3x2 ≤ 120 pounds of clay Non-negativity Constraints: x1≥ 0; x2≥ 0 Complete Linear Programming Model: Maximize Z = 40x1 + 50x2 subject to x1 + 2x2 ≤ 40 4x1 + 3x2 ≤ 120 x1 , x2≥ 0 A Minimization Model Example A farmer is preparing to plant a crop and needs to fertilize a field. There are two brands of fertilizer to choose from. Super-gro and Crop-quick. Each brand yields a specific amount of nitrogen and phosphate, as follows:

Brand

Chemical contribution Nitrogen (lb/ bag)

Phosphate (lb/ bag)

Super-gro 2 4 Crop-quick 4 3

The farmer’s requires at least 16 pounds of nitrogen and 24 pounds of phosphate. Super-gro costs RM6 per bag and Crop-quick costs RM3. The farmer wants to know how many bags of each brand to purchase in order to minimize the total cost of fertilizing.

Page 4: Chapter 3 Linear Programming

QMT425-FSKM

4

Brand

Chemical contribution Cost

(RM/ bag) Nitrogen (lb/ bag)

Phosphate (lb/ bag)

Super-gro 2 4 6 Crop-quick 4 3 3 Requires at least 16 24

Decision variables x1 = bags of Super-gro x2 = bags of Crop-quick Objective function Minimize Z = 6x1 + 3x2 where 6x1 = cost of bags of Super-gro 3x2 = cost of bags of Crop-quick Model constraints 2x1 + 4x2 ≥ 16 lb (nitrogen constraint) 4x1 + 3x2 ≥ 24 lb (phosphate constraint) x1, x2 ≥ 0 (nonnegativity constraint) Complete LP model Minimize Z = 6x1 + 3x2 subject to 2x1 + 4x2 ≥ 16 4x1 + 3x2 ≥ 24 x1, x2 ≥ 0

Page 5: Chapter 3 Linear Programming

QMT425-FSKM

5

Exercise 1. The Flair Furniture Company produces inexpensive tables and chairs. Each table takes

4 hours of carpentry and 2 hours in the painting and varnishing shop. Each chair requires 3 hours in carpentry and 1 hour in painting and varnishing. During the current production period, 240 hours of carpentry time are available and 100 hours in painting and varnishing time are available. Each table sold yields a profit of RM7, each chair produced is sold for a RM5 profit. Determine the best possible combination of tables and chairs to manufacture in order to reach the maximum profit.

2. The Kalo Fertilizer Company makes a fertilizer using two chemicals that provide

nitrogen, phosphate and potassium. A pound of ingredient 1 contributes 10 ounces of nitrogen and 6 ounces of phosphate, while a pound of ingredient 2 contributes 2 ounces of nitrogen, 6 ounces of phosphate and 1 ounce of potassium. Ingredient 1 costs RM3 per pound and ingredient 2 costs RM5 per pound. The company wants to know how many pounds of each chemical ingredient to put into a bag of fertilizer to meet minimum requirements of 20 ounces of nitrogen, 36 ounces of phosphate and 2 ounces of potassium while minimizing cost.

Page 6: Chapter 3 Linear Programming

QMT425-FSKM

6

Graphical Method • Graphical solution is limited to LP problems with only two decision variables. • Graphical methods provide visualization of how a solution for a linear programming

problem is obtained. Example: Maximization model How many bowls (x1) and mugs (x2) to produce daily, given limited amounts of labor and clay.

Maximize Z = 40x1 + 50x2

subject to

x1 + 2x2 ≤ 40 4x1 + 3x2 ≤ 120

x1 , x2≥ 0 First step Plot the constraints on the graph. x1 + 2x2 = 40 x1 = 0, x2 = 20 x2 = 0 , x1 = 40 4x1 + 3x2 = 120 x1 = 0, x2 = 40 x2 = 0 , x1 = 30

Page 7: Chapter 3 Linear Programming

QMT425-FSKM

7

Second step Shade the feasible solution area (area on the graph bounded by the constraint equation). Third step Find the optimal solution. We can use either Isoprofit solution method or corner point solution method. 1. Isoprofit solution method

Let Z = 800 800 = 40x1 + 50x2 x1 = 0, x2 = 16 x2 = 0 , x1 = 20

Optimal solution x1 = 24, x2 = 8 Z = 40 (24) + 50 (8) = RM1360

Page 8: Chapter 3 Linear Programming

QMT425-FSKM

8

2. Corner point solution method

A (x1 = 0, x2 = 20) Z = 40(0) + 50(20) = 1000 B (x1 = 24, x2 = 8) use simultaneous equation Z = 40(24) + 50(8) = 1360 C (x1 = 30, x2 = 0) Z = 40(30) + 50(0) = 1200 D (x1 = 0, x2 = 0) Z = 40(0) + 50(0) = 0 Optimal solution x1 = 24, x2 = 8 Z = 40 (24) + 50 (8) = RM1360 * Produce 24 bowls and 8 mugs to get max. profit RM1360. Example: Minimization model How many bags of Super-gro (x1) and Crop-quick (x2) to purchase in order to minimize the total cost of fertilizing?

A

B

C D

Page 9: Chapter 3 Linear Programming

QMT425-FSKM

9

Minimize Z = 6x1 + 3x2

subject to 2x1 + 4x2 ≥ 16 4x1 + 3x2 ≥ 24 x1, x2 ≥ 0 First step Plot the constraints on the graph. 2x1 + 4x2 = 16 x1 = 0, x2 = 4 x2 = 0 , x1 = 8 4x1 + 3x2 = 24 x1 = 0, x2 = 8 x2 = 0 , x1 = 6

Second step Shade the feasible solution area (area on the graph bounded by the constraint equation).

Page 10: Chapter 3 Linear Programming

QMT425-FSKM

10

Third step Find the optimal solution. We can use either Isocost solution method or corner point solution method. 1. Isocost solution method

Let Z = 18 18 = 6x1 + 3x2 x1 = 0, x2 = 6 x2 = 0 , x1 = 3

Optimal solution x1 = 0, x2 = 8 Z = 6(0) + 3(8) = RM24

Page 11: Chapter 3 Linear Programming

QMT425-FSKM

11

2. Corner point solution method

A (x1 = 0, x2 = 8) Z = 6(0) + 3(8) = 24 B (x1 = 4.8, x2 = 1.6) use simultaneous equation Z = 6(4.8) + 3(1.6) = 33.6 C (x1 = 8, x2 = 0) Z = 6(8) + 3(0) = 48 Optimal solution x1 = 0, x2 = 8 Z = 6(0) + 3(8) = RM24 * Should not purchase Super-gro and purchase 8 bags of Crop-quick and the minimum total cost will be RM24. Exercise Find optimal solution for ex.1 and 2 using graphical method.

A

B

C

Page 12: Chapter 3 Linear Programming

QMT425-FSKM

12

Slack and Surplus Variables • In graphical solution, the model constraints are considered as equations (=), rather than ≤

or ≥ inequalities. • There is a standard procedure for transforming inequality constraints into equations. • The complete LP model with slack or surplus variables referred as standard form LP model. Slack Variables • In graphical solution, the model constraints are considered as equations (=), rather than ≤

or ≥ inequalities. • There is a standard procedure for transforming inequality constraints into equations. • The complete LP model with slack variables referred as standard form LP model. Slack variables A slack variable is added to a ≤ constraint to convert it to an equation (=). • Slack variables represents the amount of unused resources. • Slack variable contribute nothing to the objective function value. Example: The Beaver Creek Pottery Company:

Maximize Z = 40x1 + 50x2 subject to x1 + 2x2 ≤ 40 (labor)

4x1 + 3x2 ≤ 120 (clay) x1 , x2≥ 0 Convert to standard form of LP model

Maximize Z = 40x1 + 50x2 + 0s1 + 0s2 subject to x1 + 2x2 + s1 = 40 (labor)

4x1 + 3x2 + s2 = 120 (clay) x1 , x2 , s1 , s2 ≥ 0 Consider a hypothetical solution x1 = 5, x2 = 10. Substituting these values into the equation yields. Z = 40(5) + 50(10) = 700 (5) + 2(10) + s1 = 40, then s1 = 15 4(5) + 3(10) + s2 = 120, then s2 = 70 • In this example, x1 = 5 bowls, x2 = 10 mugs. • s1 = 15 hr represents the amount of unused labor • s2 = 70 lb represents the amount of unused clay

Page 13: Chapter 3 Linear Programming

QMT425-FSKM

13

Surplus Variables A surplus variable is subtracted from a ≥ constraint to convert it to an equation (=). • Surplus variable represents an excess above a constraint requirement level. • Surplus variable contribute nothing to the objective function value. Example: Fertilizer model LP model Minimize Z = 6x1 + 3x2

subject to 2x1 + 4x2 ≥ 16 (nitrogen) 4x1 + 3x2 ≥ 24 (phosphate) x1, x2 ≥ 0 Standard form of LP model

Minimize Z = 6x1 + 3x2 + 0s1 + 0s2 subject to 2x1 + 4x2 - s1 = 16

4x1 + 3x2 - s2 = 24 x1 , x2 , s1 , s2 ≥ 0 Consider a hypothetical solution x1 = 0, x2 = 10. Substituting these values into the equation yields Z = 6(0) + 3(10) = 30 2(0) + 4(10) - s1 = 16, then s1 = 24 4(0) + 3(10) - s2 = 24, then s2 = 6 • In this example s1 and s2 can be interpreted as the extra amount of nitrogen and phosphate

above the minimum requirement level, 16 lb and 24 lb that would be obtained by purchasing 10 bags of Crop-quick fertilizer.

Artificial Variables • An artificial variable is a variable that has no physical meaning in terms of a real world LP

problem. It simply allow us to create a basic feasible solution to start the simplex algorithm. An artificial variable is not allowed to appear in the final solution to the problem.

• Whenever an artificial or surplus variable is added to one of the constraints, it must also be

included in the other equations and in the objective function, just as what we have done for slack variables.

• Each artificial variable is assigned an extremely high cost to ensure it does not appear in the

final solution.

• To handle ≥ constraint, surplus variable is subtracted and then artificial variable is added.

Page 14: Chapter 3 Linear Programming

QMT425-FSKM

14

• To convert an equality (=), we add an artificial variable to the equation. Example 1:

Maximize Z = x1 + 2x2 + 2x3 subject to

x1 + x2 + 2x3 ≤ 12 2x1 + x2 + 5x3 = 20 x1 + x2 - x3 ≥ 8 x1, x2, x3 ≥ 0 Standard form:

Maximize Z = x1 + 2x2 + 2x3 + 0s1 + 0s2 - MA1 - MA2 subject to

x1 + x2 + 2x3 + s1 = 12 2x1 + x2 + 5x3 + A1 = 20 x1 + x2 - x3 - s2 + A2 = 8 x1 , x2 , x3, s1 , s2 , A1 , A2 ≥ 0 Example 2: Minimize Z = 6x1 + 3x2

subject to 2x1 + 4x2 ≥ 16 4x1 + 3x2 = 24 x1, x2 ≥ 0 Standard form:

Minimize Z = 6x1 + 3x2 + 0s1 + MA1 + MA2 subject to 2x1 + 4x2 - s1 + A1 = 16

4x1 + 3x2 + A2 = 24 x1 , x2 , s1 , A1 , A2 ≥ 0

Page 15: Chapter 3 Linear Programming

QMT425-FSKM

15

Simplex Method (Maximization) Setting up the first simplex tableau • Before setting up the first simplex tableau, it is essential to write the problem in standard

form. • Consider the Pottery Company problem:

Maximize Z = 40x1 + 50x2 subject to x1 + 2x2 ≤ 40

4x1 + 3x2 ≤ 120 x1 , x2≥ 0 • In standard form, the problem written as:

Maximize Z = 40x1 + 50x2 + 0s1 + 0s2 subject to x1 + 2x2 + s1 = 40

4x1 + 3x2 + s2 = 120 x1 , x2 , s1 , s2 ≥ 0 • We begin the solution at the origin:

First simplex tableau

Cj Basic variables

x1 40

x2 50

s1 0

s2 0

Quantity

0 s1 1 2 1 0 40 0 s2 4 3 0 1 120 Zj 0 0 0 0 0 Cj-Zj 40 50 0 0

Basic feasible solution x1 = 0 x2 = 0 s1 = 40 s2 = 120 Z = 0

• Variables in solution mix are referred as basic variables, in this example are s1 and s2. • Variables not in the solution mix are called non-basic variables (x1 and x2). • Cj : Profit contribution per unit of each variable. • Zj : In the quantity column, provides total contribution.

Page 16: Chapter 3 Linear Programming

QMT425-FSKM

16

Calculations for the values of Zj are as follows:

Zj (for column x1) = 0(1) + 0(4) = 0 Zj (for column x2) = 0(2) + 0(3) = 0 Zj (for column s1) = 0(1) + 0(0) = 0 Zj (for column x1) = 0(0) + 0(1) = 0

Simplex solution procedure

1. Determine which variable to enter into the next solution mix. Identify the column with the largest positive number in the Cj-Zj row. The column identified is called the pivot column.

2. Determine which variable to replace. Divide each amount in the quantity column with amount in pivot column. The row with the smallest nonnegative number will be replaced in the next tableau. This row referred as pivot row.

3. Compute new values for the pivot row. Divide every number in the row by pivot number. 4. Compute new values for each remaining row. All remaining rows are calculated as

follows: New row numbers

= numbers in old row

- Number in old row above or below pivot number

x Corresponding number in the new

row. The row replaced in step 3

5. Compute the Zj and Cj-Zj rows. If all numbers in the Cj-Zj row are zero or negative, we

have found the optimal solution. Iteration 1

Cj Basic variables

x1 40

x2 50

s1 0

s2 0

Quantity

0 s1 1 2 1 0 40 0 s2 4 3 0 1 120 Zj 0 0 0 0 0 Cj-Zj 40 50 0 0

Iteration 2

Cj Basic variables

x1 40

x2 50

s1 0

s2 0

Quantity

50 x2 ½ 1 1/2 0 20 0 s2 5/2 0 -3/2 1 60 Zj 25 50 25 0 1000 Cj-Zj 15 0 -25 0

Cj 40 50 0 0 Zj 0 0 0 0

Cj-Zj 40 50 0 0

Page 17: Chapter 3 Linear Programming

QMT425-FSKM

17

Iteration 3 Cj Basic

variables x1 40

x2 50

s1 0

s2 0

Quantity

50 x2 0 1 4/5 -1/5 8 40 x1 1 0 -3/5 2/5 24

Zj 40 50 16 6 1360 Cj-Zj 0 0 -16 -6

Optimal solution: x1 = 24, x2 = 8 , s1 = 0, s2 = 0 Z = 40 (24) + 50 (8) = RM1360 Row s2 (1 iteration) (2 iteration)

Column Current row

- Pivot column coefficient

x New pivot row

= New row number

x1 4 - 3 x ½ = 5/2 x2 3 - 3 x 1 = 0 s1 0 - 3 x ½ = -3/2 s2 1 - 3 x 0 = 1 Quantity 120 - 3 x 20 = 60

Row x2 (2 iteration) (3 iteration)

Column Current row

- Pivot column coefficient

x New pivot row

= New row number

x1 ½ - ½ x 1 = 0 x2 1 - ½ x 0 = 1 s1 ½ - ½ x -3/5 = 4/5 s2 0 - ½ x 2/5 = -1/5 Quantity 20 - ½ x 24 = 8

Exercise 1. Max z = 300x1 + 250x2 subject to

2x1 + x2 ≤ 40 x1 + 3x2 ≤ 45 x1 ≤ 12

x1 , x2≥ 0 (Optimal solution: x1 = 12, x2 = 11, s1 = 5, s2 = 0, s3 = 0, Z = 6350)

2. Max z = 7x1 + 5x2 subject to

2x1 + x2 ≤ 100 4x1 + 3x2 ≤ 240 x1 , x2≥ 0

(Optimal solution: x1 = 30, x2 = 40, s1 = 0, s2 = 0, Z = 410)

Page 18: Chapter 3 Linear Programming

QMT425-FSKM

18

Four Special Cases in LP Four special cases may arise when solving an LP problem

1. Multiple Optimal Solutions/Alternate optimal solution

• This is the case when the objective function’s isoprofit or isocost line runs perfectly parallel to one of the problem’s constraint.

• Provide greater flexibility to the decision maker.

Example:

Maximize Z = 40x1 + 30x2 subject to x1 + 2x2 ≤ 40

4x1 + 3x2 ≤ 120 x1 , x2≥ 0

• Two corner points having the same maximum value indicate the LP problem has alternate optimal solution (Point B and C).

Multiple optimal solutions is detected if the final tableau has Cj-Zj value equal to 0 for a non-basic variable ( variable that is not in the final solution mix).

Cj Basic Var

x1 x2 s1 s2 Quantity 3 2 0 0

2 x2 3/2 1 1 0 6 0 s2 1 0 1/2 1 3 Zj 3 2 2 0 12 Cj-Zj *0 0 -2 0

Page 19: Chapter 3 Linear Programming

QMT425-FSKM

19

2. An Infeasible Problem

• Infeasibility is a condition that arises when there is no solution to a LP problem that

satisfies all of the constraints given. • Infeasible problems do not typically occur, but when they do there are a result of

errors in defining the problem or in formulating the LP model. Example: Maximize Z= 5x1 + 3x2 subject to 4x1 + 2x2 ≤ 8 x1 ≥ 4 x2 ≥ 6 x1, x2 ≥ 0

The tableau is the final tableau because all Z 0≥ . An infeasible problem is detected When an artificial variable still in the final solution mix.

Cj Basic Var

x1 x2 s1 s2 s3 A1 A2 Quantity 5 3 0 0 0 -M -M

3 x2 2 1 ½ 0 0 0 0 4

-M A1 1 0 0 -1 0 1 0 4

-M A2 -2 0 -1/2 0 -1 0 1 2

Zj 6+M 3 3/2+M/2 M M -M -M 12-6M

Cj-Zj -1-M 0 -3/2-M/2

-M -M 0 0

Page 20: Chapter 3 Linear Programming

QMT425-FSKM

20

3. An Unbounded Problem

• The solution space is not completely closed in. • In an unbounded problem the objective function can increase indefinitely without

reaching a maximum value. • Like an infeasible solution, typically reflects an error in defining the problem or in

formulating the model. Example: Maximize Z= 4x1 + 2x2 subject to

x1 ≥ 4 x2 ≤ 2

x1, x2 ≥ 0

\

• An unbounded problem is detected when all entries in the pivot column are non- positive, hence there will be no leaving variable.

Cj Basic Var

x1 x2 s1 s2 Quantity Ratio 6 9 0 0

9 x2 -1 1 2 0 30 30/-1 = -300 s2 -2 0 -1 1 10 10/-1 = -10 Zj -3 9 18 0 270 Cj-Zj 15 0 -18 0

Page 21: Chapter 3 Linear Programming

QMT425-FSKM

21

4. Degeneracy

• A redundant constraint is one that does not affect the feasible solution region.

Example: Maximize Z = x1 + 2x2 subject to x1 + 1x2 ≤ 20

2x1 + x2 ≤ 30 x1 ≤ 25

x1 , x2≥ 0

When more than one row have similar smallest nonnegative numbers. Lead to a situation known as cycling.

Cj Basic Var

x1 x2 x3 s1 s2 s3 Quantity

5 8 2 0 0 0 0 x2 ¼ 1 1 -2 0 0 10 10/ 4/1 =40

0 s2 4 0 1/3 -1 1 0 20 20/4= 5

0 s3 2 0 2 2/5 0 1 10 10/2 = 5

Zj 2 8 8 16 0 0 80

Cj-Zj 3 0 -6 -16 0 0

Page 22: Chapter 3 Linear Programming

QMT425-FSKM

22

Sensitivity Analysis with the simplex tableau • Sensitivity analysis is the analysis of the parameter changes on the optimal solution. • Changes in Resources or RHS Values

- Making changes in the resources or the RHS values result in changes in the feasible region and often the optimal point. This would also affect the value of the objective function.

• Shadow price (marginal value or dual value) is the change in value of the objective function

for every additional unit of a scarce resource. It is also refer to maximum amount the firm should pay for every additional unit of resource to make available.

Example: High Note Sound is a firm that makes compact disks CD players (x1) and stereo receivers (x2). LP model: Maximize Profit = 50x1 + 120x2 subject to

2x1 + 4x2 ≤ 80 (hours of electricians’ time available) 3x1 + x2 ≤ 60 (hours of audio technicians’ time available) x1 , x2≥ 0

The graphical solution of the above problem is as follows:

Optimal solution: x1 = 0 CD player, x2 = 20 stereo receivers, Z = RM2400

Page 23: Chapter 3 Linear Programming

QMT425-FSKM

23

Maximize Profit = 50x1 + 120x2 subject to

2x1 + 4x2 ≤ 81 3x1 + x2 ≤ 60 x1 , x2≥ 0

Shadow prices can be obtained from an optimal solution simplex tableau. These are the numbers in the z-row of slack variable columns.

Basic Var

x1 x2 s1 s2 Quantity

x2 ½ 1 ¼ 0 20 s2 5/2 0 -1/4 1 40 Z 10 0 30 0 2400

1 additional unit of the electrician’s hour, assuming no cost incurred, causes the total profit to increase to RM2430. This is an increase of RM30. Hence, the 1 additional hour of electrician’s time is worth RM30. This is known as shadow price for electrician’s hour.

Page 24: Chapter 3 Linear Programming

QMT425-FSKM

24

The tableau indicates the optimal solution is: x1 = 0 CD players x2 = 20 stereo receivers s1 = 0 hour of unused time of electrician’s s2 = 40 hours of unused time of audio technician’s Z = RM2400 Example The management of a company has formulated the following linear programming problem.

Let x1 = quantity of product 1 to produce x2 = quantity of product 2 to produce x3 = quantity of product 3 to produce Maximize Profit, Z = 321 x9x3x7 ++ subject to 4x1 + 5x2 + 6x3 ≤ 360 kg (raw material) 2x1 + 4x2 + 6x3 ≤ 300 hours (machine time) 9x1 + 5x2 + 6x3 ≤ 600 hours (workers’ time)

x1,x2,x3≥ 0

The following is the final simplex tableau for the above problem. Use this to answer the questions below.

Basic x1 x2 x3 s1 s2 s3 RHS x1 1 0 0 -0.2 0 0.2 48 x3 0 0.83 1 0.3 0 -0.13 28 s2 0 -1 0 -1.4 1 0.4 36 Z 0 7.5 0 1.3 0 0 a

Page 25: Chapter 3 Linear Programming

QMT425-FSKM

25

1. State and the interpret the optimal solution. x1 = 48; produce 48 units of product 1 x2 = 0; produce 0 unit of product 2 x3 = 28; produce 28 units of product 3 s1 = 0; raw material is fully utilized s2 = 36; 36 hours machine time is unused s3 = 0; workers’ time is fully utilized

2. Determine the value of a. Z = a = maximize profit = 588RM)28(9)0(3)48(7x9x3x7 321 =++=++

3. How many hours of workers’ time, machine time and amount of raw material are used to reach the optimal solution? amount of raw material used: 4(48)+5(0)+6(28) = 360 kg hours of machine time used : 2(48)+4(0)+6(28) = 264 hours; unused = 300-264 = 36 hours hours of workers’ time used: 9(48)+5(0)+6(28) = 600 hours

4. What are the shadow prices of the resources? The shadow prices of raw material = RM1.30

machine time = RM0 workers’ time = RM0

5. What does a zero shadow price mean? How could this happen? Shadow price RM0 means that 1 additional unit of the resource is worth nothing. The resource is not fully utilized. e.g. optimal solution s2 = 36

6. Is it worthwhile to pay RM2 for 1 additional kg of the raw material? Explain. Not worthwhile because the maximum amount to pay is RM1.30.

7. Should the company pay RM4 for 3 more kg of the raw material? Explain.

kg/33.1RMkg3

4RM= ;

Not worthwhile because the maximum amount to pay is RM1.30

Page 26: Chapter 3 Linear Programming

QMT425-FSKM

26

The Dual • Every LP primal model has a dual model. • The first way of stating a linear problem is called the primal of the problem. The second

way of stating the same problem is called the dual. • The optimal solutions for both ways are equivalent, but are derived through alternative

procedures.

Example: Primal model

Maximize Profit = 50x1 + 120x2 subject to

2x1 + 4x2 ≤ 80 3x1 + x2 ≤ 60 x1 , x2≥ 0 Step to form a dual

1. If the primal is a maximization, the dual is a minimization and vice versa. 2. The RHS values of the primal constraints become the dual’s objective function

coefficients. 3. The primal objective function coefficients become the RHS values of the dual

constraints. 4. The transpose of the primal constraint coefficients become the dual constraint

coefficients. 5. Constraint inequality signs are reversed.

Dual model for above problem Minimize Opportunity Cost = 80y1 + 60y2

subject to 2y1 + 3y2 ≥ 50 4y1 + y2 ≥ 120 y1, y2 ≥ 0

Page 27: Chapter 3 Linear Programming

QMT425-FSKM

27

Optimal tableau of primal model Primal model

Cj Basic Var

x1 x2 s1 s2 Quantity 50 120 0 0

120 x2 ½ 1 ¼ 0 20 0 s2 5/2 0 -1/4 1 40 Zj 60 120 30 0 2400 Cj-Zj -10 0 -30 0

Primal solution: x1 = 0 x2 = 20 s1 = 0 s2 = 40 Z = RM2400 In the final simplex tableau of primal problem, the absolute values of the numbers in the cj – zj row under slack variables represent the solutions to the dual problem Dual solution: y1 = 30 y2 = 0 s1 = 10 s2 = 0 Z = RM2400 Optimal tableau of dual model Dual model

Cj Basic Var

y1 y2 s1 s2 Quantity

80 60 0 0 80 y1 1 ¼ 0 -1/4 30

0 s1 0 -5/2 1 -1/2 10

Zj 80 20 0 -20 2400

Cj-Zj 0 -40 0 -20

Dual solution: y1 = 30 y2 = 0 s1 = 10 s2 = 0 Z = RM2400

Page 28: Chapter 3 Linear Programming

QMT425-FSKM

28

To obtain primal solution, in the final simplex tableau of dual problem, the absolute values of the numbers in the cj – zj row under slack variables represent the solutions to the primal problem Primal solution: x1 = 0 x2 = 20 s1 = 0 s2 = 40 Z = RM2400 Sample questions 1. Use the graphical method to solve the following linear programming model.

0,418235

86cos

≥≥≤+≥++=

yxyyxyxtoSubject

yxtMinimize

2. Consider the following linear programming problem.

0,,302420225

16007002000

321

321

321

321

≥≥++≥++

++=

xxxxxxxxx

toSubjectxxxZMinimize

a) Write the dual for the above linear programming problem in variable Y. b) The following is an incomplete final simplex tableau for the dual from Question

2(a).

i. Complete the above simplex tableau. ii. State the optimal solution for the dual. iii. State the optimal solution for the primal based on the final simplex tableau.

Cj Basic variable

20 30 0 0 0 Y1 Y2 S1 S2 S3 Quantity

30 Y2 1.25 1 0.25 0 0 500 0 S2 0.75 0 -0.25 1 0 200 0 S3 -0.5 0 -0.5 0 1 600 Zj Cj-Zj

Page 29: Chapter 3 Linear Programming

QMT425-FSKM

29

3. A manufacturer has two versions of a toy house. The version X requires 23 sq cm of

plywood, 2 pounds of plastic and 15 minutes of assembling. The version Y requires 31 sq cm of plywood, 3 pounds of plastic and 25 minutes of assembling. There are 9000 sq cm of plywood, 100 pounds of plastic and 42 hours of assembling time available. Each unit of version X results in RM4 of profit and for version Y the unit profit is RM5. The manufacturer will not produce more than 25 units of version Y and there must be a minimum of 5 units of each version produced to cater for previous orders. Formulate (do not solve) a linear programming model with the objective of maximizing profit.

4. A manufacturer produces two types of cotton cloths: denim and corduroy. Corduroy is a

heavier grade cotton cloth.

Maximize profit = 21 X5.4X6 + subject to

3250X5.2X5.3 21 ≤+ (cotton usage, meters) 300032.3 21 ≤+ XX (processing time, hours)

5101 ≤X (demand for corduroy, meters) 0, 21 ≥XX The final simplex tableau for the above problem is shown below:

Cj Basic Variable

6 4.5 0 0 0 QuantityX1 X2 S1 S2 S3

0 S1 0 0 1 -0.83 -0.83 325 6 X2 0 1 0 0.33 -1.07 456

4.5 X1 1 0 0 0 1 510 Zj 6 4.5 0 1.5 1.2 Cj-Zj 0 0 0 -1.5 -1.2

X1 = number of meters of corduroy produced, X2 = number of meters of denim produced,

S1, S2, and S3 are the slack variables for cotton usage, processing time and demand for corduroy respectively.

a) Determine the optimal production level and calculate the maximum profit obtained. b) How much cotton and processing time are left over in the optimal solution? c) What is the maximum amount the manufacturer is willing to spend for an additional

processing time? d) If we increase one hour of processing time at cost RM3 will it be worthwhile? Why?

Page 30: Chapter 3 Linear Programming

QMT425-FSKM

30

5. Solve the following linear programming model graphically.

toSubject

xxZMaximize 21 5040 +=

10012040

32

4

2

2

2

1

1

1

≥≤≤

+++

xxx

xxx

x1, x2 0≥ 6. Rahman the successful farmer has a 50 acres farm on which to plant tomatoes and

cucumbers. He has 300 hours of labor per week and 800 tons of fertilizer available and has contracted for shipping space for a maximum of 26 acres worth of tomatoes and 37 acres worth of cucumbers. An acre of tomatoes requires 10 hours of labor and 8 tons of fertilizer, whereas an acre of cucumbers requires 3 hours of labor and 20 tons of fertilizer. The profit from an acre of tomatoes is RM400 and the profit from an acre of cucumbers is RM300. Formulate the linear programming model for this problem to maximize profit.

7. The simplex tableau for the above problem (6) is given below. The s1, s2, s3, s4 and s5

are the slack variables for available land, labor, fertilizer and shipping space for tomatoes and cucumbers, respectively.

Cj Basic

Var 400 x1

300 x2

0 s1

0 s2

0 s3

0 s4

0 s5

Quantity

0 s4 0 0 0.43 -0.14 0 1 0 4.57 300 x2 0 1 1.43 -0.14 0 0 0 28.57 0 s3 0 0 -25.14 1.71 1 0 0 57.14

400 x1 1 0 -0.43 0.14 0 0 0 21.43 0 s5 0 0 -1.43 0.14 0 0 1 8.43 Zj Cj - Zj

a) Complete the above simplex tableau. Does this tableau optimal? Explain. b) Specify the optimal solution and the total profit. c) Of all the available resources, how much of each has been used? d) Does this problem have any alternative optimal solution? Explain. e) State the dual solution.

8. Write the dual of this primal model:

Maximize 30x1 + 20x2 + 40x3 Subject to:

5x1 + 9x2 + 8x3 ≤ 450 3x1 – 4x2 ≥ 120

x1, x2, x3 ≥ 0

Page 31: Chapter 3 Linear Programming

QMT425-FSKM

31

9. Consider the simplex tableau below.

Cj Solution Mix

7 3 9 0 0 0 Quantity X1 X2 X3 S1 S2 S3

7 X1 1 0.5 0 0.5 -0.5 0 30 9 X3 0 0.5 1 -0.17 0.33 0 40 0 S3 0 -2.5 0 -3.5 2.5 1 90 Zj 7 8 9 2 -0.5 0 570 Cj-Zj 0 -5 0 -2 0.5 0

a) Perform another simplex iteration. b) Give the solution obtained. c) Is the solution obtained in b) optimal? Explain. SOLUTION:

1. Graphical method

Optimal solution: X = 1, Y = 4 with minimum cost Z = RM38

CORNER POINT X Y Z

A 0 5 40 B 0 9 72 C 3.33 4 52 D 1 4 38

Choose lowest Z value

X + Y = 5 X = 0, Y = 5 Y = 0, X = 5 3X + 2Y =18 X = 0, Y = 9 Y = 0, X = 6 Y = 4

A

B

C

D

Page 32: Chapter 3 Linear Programming

QMT425-FSKM

32

2. a)

0, 160023

7002200045

3020

21

21

21

21

21

≥≤+≤+≤+

+=

yyyy

yyyy

toSubjectyyZMax

b) i. Complete the above simplex tableau.

ii. Optimal sol. for dual model ii. Optimal sol. for primal model Y1 = 0 Y2 = 500 S1 = 0 S2 = 200 S3 = 600 Z = 15 000

X1 = 7.5 X2 = 0 X3 = 0 S1 = 17.5 S2 = 0 Z = 15 000

Cj Basic variable

20 30 0 0 0 Y1 Y2 S1 S2 S3 Quantity

30 Y2 1.25 1 0.25 0 0 500 0 S2 0.75 0 -0.25 1 0 200 0 S3 -0.5 0 -0.5 0 1 600 Zj 37.5 30 7.5 0 0 15000 Cj-Zj -17.5 0 -7.5 0 0

Refer to Cj-Zj row of dual final tableau

Page 33: Chapter 3 Linear Programming

QMT425-FSKM

33

3.

0, 5525

2520251510032

90003123

54

produced Y)(version house toy produced X)(version house toy

≥≥≥≤

≤+≤+≤+

+=

==

yx x y y

yxyx

yxtoSubject

yxZMax

yx

4.

a) Optimal production level/Optimal solution:

X1 = 510 X2 = 456 S1 = 325 S2 = 0 S3 = 0

Max profit, Z = 6.0 X1 + 4.5X2 = 6(510) + 4.5(456) = RM5112

b) From optimal solution, cotton left over = 325 meters and no processing time left (fully utilized).

c) RM 1.50 d) Not worthwhile because the maximum amount to pay is RM 1.50.

Page 34: Chapter 3 Linear Programming

QMT425-FSKM

34

5. Graphical method

An infeasible problem 6.

0, cucumbers) space, (shipping 37 tomatoes)space, (shipping 26

r)(fertilize 800208(labor) 300310

available) (land 500

00400

cucumbers wuth land of acre toes with tomaland of acre

≥≤≤

≤+≤+

≤+

+=

==

yx y x

yxyx

yxtoSubject

yxZMax

yx

7. a)

Cj Basic Var

400 x1

300 x2

0 s1

0 s2

0 s3

0 s4

0 s5

Quantity

0 s4 0 0 0.43 -0.14 0 1 0 4.57

300 x2 0 1 1.43 -0.14 0 0 0 28.57

0 s3 0 0 -25.14 1.71 1 0 0 57.14

400 x1 1 0 -0.43 0.14 0 0 0 21.43

0 s5 0 0 -1.43 0.14 0 0 1 8.43

Zj 400 300 257 14 0 0 0 17143

Cj - Zj 0 0 -257 -14 0 0 0

Page 35: Chapter 3 Linear Programming

QMT425-FSKM

35

b) The optimal solution and the total profit. X1 = 21.43 X2 = 28.57 S1 = 0 S2 = 0 S3 = 57.14 S4 = 4.57 S5 = 8.43 Total profit, Z = 400X1 + 300X2 = 400(21.43) + 300(28.57) = RM 17143

c)

Resources: Land - fully utilized Labor - fully utilized- fully utilized Used fertilizer = 8X1 + 20X2 = (21.43) + 20(28.57) = 742.84, unused = 57.14 Used shipping space for tomatoes = X1 = 21.43, unused = 4.57 Used shipping space for cucumbers = X2 = 28.57, unused = 8.43

d) No. Alternative optimal solution occurs when there is a zero value in row Cj-Zj of the final tableau under a variable that is not in the final solution mix.

e) Dual solution.:

y1 = 257, y2 = 14, y3 = 0, y4 = 0, y5 = 0, s1 = 0, s2 = 0, Z = 17143

8. The dual model: Minimize Z = 450y1 + 120y2 Subject to: 5y1 + 3y2 ≥ 30 9y1 - 4y2 ≤ 20 8y1 ≥ 40 y1, y2 ≥ 0 9. a)

a)Cj

Solution Mix

7 3 9 0 0 0 Quantity X1 X2 X3 S1 S2 S3

7 X1 1 0 0 -0.2 0 0.2 48 9 X3 0 0.83 1 0.29 0 -0.13 28.12 0 S2 0 -1 0 -1.4 1 0.4 36 Zj 7 7.47 9 1.21 0 0.23 589.1 Cj-Zj 0 -4.47 9 -1.21 0 -0.23

b) Optimal solution

X1 = 48 X2 = 0 X3 = 28.12 S1 = 0 S2 = 36 S3 = 0

Z = 589.1

c) The solution is optimal. All values in Cj-Zj row are zero or negative.