Chapter 4 Simplex Method Section 4.1 Setting Up the Simplex Method Section 4.2 The Simplex Method...

107
Chapter 4 Simplex Method Section 4.1 Setting Up the Simplex Method Section 4.2 The Simplex Method Section 4.3 The Standard Minimum P roblem Section 4.4 Mixed Constraints Section 4.5 Multiple Solutions, Un bounded Solutions, and No Solution s Section 4.6 What’s Happening in th

Transcript of Chapter 4 Simplex Method Section 4.1 Setting Up the Simplex Method Section 4.2 The Simplex Method...

Chapter 4 Simplex Method Section 4.1 Setting Up the Simplex Method Section 4.2 The Simplex Method Section 4.3 The Standard Minimum Problem Section 4.4 Mixed Constraints Section 4.5 Multiple Solutions, Unbounded Soluti

ons, and No Solutions Section 4.6 What’s Happening in the Simplex Met

hod? (Optional) Section 4.7 Sensitivity Analysis

4.1 Setting up the Simplex Tableau

In chapter 4 we are going to study an _________ technique that applies to all linear programming problems. The technique is called the _________ Method. Basically it involves _____________ the

constraints so we have a system of linear ____________ and then using augmented matrices

to find specific solutions to the system of equations.

Standard Maximum Problem

1. The objection function is to be _______________.

2. Each constraint is written using the ___ inequality (_____________ the nonnegative conditions).

3. The constants in the constraints to the right of < are ___________ negative.

4. The variables are restricted to _____________ values (nonnegative conditions).

ExampleMaximize the objection function z = 4x1 + 12x2

subject to the constraints 1 2

1 2

1 2

3 1802 100

2 2 40

x xx xx x

and the nonnegative conditions x1 > 0 and x2 > 0.

1. The objection function is to be maximized.2. Each constraint is written using the < inequality (excluding the

nonnegative conditions).3. The constants in the constraints to the right of < are never

negative (180, 100, and 40 in the example).4. The variables are restricted to nonnegative values (nonnegative

conditions).

This problem has the properties of a standard maximum problem.

Geometric Form

A graph of the __________________ is useful in seeing the steps of the simplex method.

In the geometric approach, we examine the ____________ of the feasible region for _____________ values.

A corner point occurs at the ___________________ of a pair of boundary lines.

Not all pairs of boundary lines intersect at a corner point. The point must lie within the feasible region.

ExampleGraph the feasible region for the following problem: Maximize the objection function z = 4x1 + 12x2

subject to the constraints 1 2

1 2

1 2

3 1802 100

2 2 40

x xx xx x

and the nonnegative conditions x1 > 0 and x2 > 0.

The boundaries for the feasible region are formed by the lines

1 2

1 2

1 2

1

2

3 1802 100

2 2 4000

x xx xx x

xx

1 23 180x x

1 22 100x x

1 22 2 40x x

0

20

40

60

80

20 40 60 80 100 120

Slack VariablesThe equations for the boundary lines give only point on the boundaries. In order to represent points in the interior of the feasible region some new variables are introduced, called slack variables. Slack variables allow us to view the problem as a system of equations.

The first step in the simplex method converts the constraints to a linear equation. This is accomplished by introducing one slack variable for each constraint, usually denoted by si.

1 2 1

1 2 2

1 2

3 1802 1000, 0

x x sx x sx x

0

20

40

60

80

20 40 60 80 100 120

1 2 13 180x x s

1 2 22 100x x s

(40,60) s1 = 0, s2 = –6

(52,24) s1 = 0, s2 = 0

(10,45)s1 = 105 s2 = 0

(10,20)s1 = 130 s2 = 50

Consider

ExampleWrite a system of equations using slack variables which includes the objection function z = 20x1 + 35x2 + 40x3

subject to the constraints 1 2 3

1 2 3

1 2 3

1 2 3

5 3 17 1407 2 4 2563 9 11 5402 16 8 99

x x xx x xx x xx x x

SOLUTION

Since we want to find the value of z that comes from the solution to the system we ____________ the objective function. Its form needs to have all terms on the ____________________.

Simplex TableauThe simplex method uses matrices and row operations on matrices to determine an optimal solution. The matrix used is called the simplex tableau. Setting up a simplex tableau is illustrated using a previous example.

EXAMPLEMaximize the objection function z = 4x1 + 12x2

subject to the constraints 1 2

1 2

1 2

1 2

3 1802 100

2 2 400, 0

x xx xx xx x

First, write the problem as a system of equations using _________ __________ and then form the augmented matrix of the system.

Example continued

The system of equations is

The augmented matrix of this system is

1 2 1 2 3

_ _ _ _ _ _ _

_ _ _ _ _ _ _

_ _ _ _ _ _ _

_ _ _ _ _ _ _

x x s s s z

This is the simplex tableau.

Simplex TableauFind the maximum value of the objective function

z = 10x + 15y

subject to the constraints 4 3602 300

0, 0

x yx y

x y

1. The objection function is to be ________________.2. Each constraint is written using the _____ inequality (excluding

the nonnegative conditions).3. The constants in the constraints to the right of < are ________

negative (180, 100, and 40 in the example).4. The variables are restricted to _______________ values

(nonnegative conditions).

This problem has the properties of a standard maximum problem.

Simplex TableauFind the maximum value of the objective function

z = 10x + 15y

subject to the constraints 4 3602 300

0, 0

x yx y

x y

Your TurnSet up the simplex tableau for the following standard maximum problem

Operations that can be performed without altering the solution set of a linear system

1. Interchange any two rows

2. Multiply every element in a row by a nonzero constant

3. Add elements of one row to corresponding elements of another row

ERO’s

• Rowswap(Matrix, Row A, Row B)• Switches Row A and Row B

• Row+(Matrix, Row A, Row B)• Adds Row A to Row B and replaces Row B

• *Row(Value, Matrix, Row)• Multiplies Row by value and replaces the row

• *Row+(Value, Matrix, Row A, Row B)• Multiplies Row a by the value, adds the result

to Row B, and replaces Row B

HW 4.1

Pg 257-260 1-25

Basic Method

Section 4.2

If a linear programming problem has k x’s in the constraints, then a basic solution is obtained by setting k variables (except z) to zero and solving for the others.

1 2 1 2 3

3 1 1 0 0 0 180

1 2 0 1 0 0 100

2 2 0 0 1 0 40

4 12 0 0 0 1 0

x x s s s z

Consider the simplex tableau

A basic solution can be found by setting any two variables to zero and solving for the others.

Basic Feasible Solution

Call the number of x variables in a linear programming problem k. A ______________ of the system of equations is a solution with k variables (except z) set to zero and with none of the slack variables or x’s negative.

The variables set to zero are called ___________ variables. The others are called __________ variables.

Correctly carried out, the simplex method finds only basic ____________ solutions that are corner points of the feasible region.

Summary

• A system of n constraints in k variables converts to a system of n equations in _________ variables.

• The ____________ variables are classified as either basic or nonbasic variables.

• There is a basic variable for each equation, __ basic variables. The other __ variables are nonbasic.

• The value of the basic variables are found by setting all nonbasic variables to ______ in each of the equations and then solving for basic variables.

Basic and Nonbasic Variables

A linear programming problem with n constraints using k variables is converted into a system of equations by including a slack variable for each constraint.

ExampleUse the simplex method to maximize z = 2x1 + 3x2 + 2x3, subject to 1 2 3

1 2 3

1 2 3

2 2 133 8

0, 0, 0

x x xx x x

x x x

Example continuedSince there are three x’s, all basic solutions have three variables set to zero. Using the initial tableau, the initial basic feasible solution would be ______________________________________However, since there are negative entries in the last row, this solution is not optimal.

1 2 3 1 2

2 1 2 1 0 0 13

1 1 3 0 1 0 8

2 3 2 0 0 1 0

x x x s s z

For reference:

Now, find the pivot element1 2 3 1 2

2 1 2 1 0 0 13

1 1 3 0 1 0 8

2 3 2 0 0 1 0

x x x s s z

Example continuedUsing the pivot element, perform the following row operations to obtain the next tableau.

1 2 3 1 2

2 1 2 1 0 0 13

1 1 3 0 1 0 8

2 3 2 0 0 1 0

x x x s s z

For reference:

1 2 3 1 2

_ _ _ _ _ _ _

_ _ _ _ _ _ _

_ _ _ _ _ _ _

x x x s s z

Example continued1 2 3 1 2

1 0 5 1 1 0 5

1 1 3 0 1 0 8

1 0 11 0 3 1 24

x x x s s z

Example continuedThe new tableau is 1 2 3 1 2

_ _

_ _ _

_ _ _

_ _ _ _ _

_ _ _ _

_ _ _ _

x x x s s z

The basic feasible solution from the tableau is

1 2 3 1 2__, __, __, __, __, __x x x s s z

Since there are ______________ entries in the last row, ___________ is a ____________.

Summary – Simplex MethodStandard Maximization Problem1. Convert the problem to a system of equations:

a) Convert each inequality to an equation by adding a slack variable.b) Write the objective function z = ax1 + bx2 + … + kxn as

–ax1 – bx2 – … – kxn + z = 0.2. Form the initial simplex tableau from the equations.3. Locate the pivot element of the tableau:

a) Locate the most negative entry in the bottom row. It is in the pivot column. If there is a tie for most negative, choose either.

b) Divide each entry in the last column (above the line) by the corresponding entry in the pivot column. Choose the smallest positive ratio. It is in the pivot row. In case of a tie for pivot row, choose either.

c) The element where the pivot column and pivot row intersect is the pivot element.

Summary continued

4. Modify the simplex tableau by using row operations to obtain a new basic feasible solution.a) Divide each entry in the pivot row by the pivot element to

obtain a 1 in the pivot position.b) Use the pivot row and row operations to obtain zeros in the

other entries of the pivot column.5. Determine whether z has reached its maximum.

a) If there is a negative entry in the last row of the tableau, z is not maximum. Repeat the process in steps 3 and 4.

b) If the bottom row contains no negative entries, z is maximum and the solution is available from the final tableau.

Summary continued

6. Determine the solution from the final tableau.a) Set k variables to zero, where k is the number of x’s used in

the constraints. These are the nonbasic variables. They correspond to the columns that contain more than one nonzero entry.

b) Determine the values of the basic variables. These basic variables correspond to unit columns.

Example2

3 22

3 4 34

0, 0

Maximze z x y

Subject to

x y

x y

x y

A large agricultural program has 250 acres and $8000 available for cultivation of three crops: barley, oats, and wheat. Barley requires $10 per acre of cultivation and oats requires $15 per acre of cultivation and wheat requires $12 per acre of cultivation. Barley requires 7 hours of labor per acre, oats require 9 hours of labor per acre, and wheat requires 8 hours of labor per acre. The firm has 2100 hours of labor available. The profits per acre of each crop are: barley $60, oats $75, wheat $70. How many acres of each crop should be planted to maximize profit?

A stereo store sells three brands of stereo systems, brands A, B, and C. It can sell a total of 100 stereo systems per month. Brands A, B, and C take up, respectively, 5, 4, and 4 cubic feet of warehouse space, and a maximum of 480 cubic feet of warehouse space is available. Brands A, B and C generate sales commissions of $40, $20, and $30, respectively, and $3200 is available to pay sales commissions. The profit generated from the sale of each brand is $70, $210, and $140, respectively. How many of each brand of stereo system should be sold to maximize the profit?

The XYZ Corporation plans to open three different types of fast food restaurants. Type A restaurants require an initial cash outlay of $600,000, need 15 employees, and are expected to make an annual profit of $30,000. Type B restaurants require an initial cash outlay of $400,000, need 9 employees, and are expected to make an annual profit of $30,000. Type C restaurants require an initial cash outlay of $300,000, need 5 employees, and are expected to make an annual profit of $25,000. The XYZ Corporation has $48,000,000 available for initial outlays, does not want to hire more than 1000 new employees, and would like to open at most 70 restaurants. How many restaurants of each type should be opened to maximize the expected profit?

HW 4.2

Pg 275-278 1-20, 21-35 odd, 37, 43, 45

4.3 The Standard Minimum

Duality

Dietary Requirements A certain diet requires at least 60 units of carbohydrates, 45 units of protein, and 30 units of fat each day. Each ounce of Supplement A provides 5 units of carbohydrates, 3 units of protein, and 4 units of fat. Each ounce of Supplement B provides 2 units of carbohydrates, 2 units of protein, and 1 unit of fat. If Supplement A costs $1.50 per ounce and Supplement B costs $1.00 per ounce, how many ounces of each supplement should be taken daily to minimize the cost of the diet?

HW 4.3

Pg 289-291 13-23

4.4

Mixed Constraints

Standard Max?

1 2

1 2

1 2

1 2

Minimize 2 3 ,subject to :

2 10

2 11

0, 0

z x x

x x

x x

x x

1 2

1 2

1 2

1 2

Minimize 15 40 ,subject to :

5 3 210

2 250

0, 0

z x x

x x

x x

x x

1 2 3

1 2 3

1 2 3

1 2 3

1 2 3

Minimize 15 20 5 ,subject to :

72 48 94 2360

5 4 2 30

2 8 40

0, 0, 0

z x x x

x x x

x x x

x x x

x x x

Minimizing a Function

1 2

1 2

1 2

1 2

Minimize 2 3 ,subject to :

2 10

2 11

0, 0

z x x

x x

x x

x x

Minimizing a Function

1 2

1 2

1 2

1 2

Minimize 15 40 ,subject to :

5 3 210

2 250

0, 0

z x x

x x

x x

x x

Your Turn

1 2 3

1 2 3

1 2 3

1 2 3

1 2 3

Minimize 15 20 5 ,subject to :

72 48 94 2360

5 4 2 30

2 8 40

0, 0, 0

z x x x

x x x

x x x

x x x

x x x

Standard Max?

Mixed ConstraintsThe simplex method assumes all constraints are of the form

a1x1 + a2x2 + … + anxn ______ b

Realistically this is _____________ true. The simplex method can still be used if we modify these mixed constraints.

We modify a _____ constraint by multiplying through by –1, which reverses the sign, giving a _______ constraint.

We modify an = constraint by replacing it with two constraints, a _____ and a ______ constraint. This can be done because the statement c = d is equivalent to c > d and c < d.

Guidelines

Modification of > and = ConstraintsFor the simplex method:

Replace a1x1 + a2x2 + … + anxn > bwith –a1x1 – a2x2 – … – anxn < –b

Replace a1x1 + a2x2 + … + anxn = bwith a1x1 + a2x2 + … + anxn < band a1x1 + a2x2 + … + anxn > b

which in turn should be written

a1x1 + a2x2 + … + anxn < band –a1x1 – a2x2 – … – anxn < –b

ExampleModify the following problem and set up the initial simplex tableau. Maximize z = 8x1 + 2x2 + 6x3, subject to

1 2 3

1 2 3

1 2 3

1 2 3

6 4 5 684 3 322 4 3 36

0, 0, 0

x x xx x xx x x

x x x

SummarySimplex Method for Problems with Mixed Constraints

1. For minimization problems, maximize w = –z.2. (> constraint) For each constraint of the form

a1x1 + a2x2 + … + anxn > b multiply the inequality by –1 to obtain –a1x1 – a2x2 – … – anxn < –b

3. (= constraint) Replace each constraint of the form a1x1 + a2x2 + … + anxn = bwith a1x1 + a2x2 + … + anxn < band a1x1 + a2x2 + … + anxn > bThe latter is written –a1x1 – a2x2 – … – anxn < –b

1. Form the initial simplex tableau.

Summary continued5. If no negative entry appears in the last column of the initial

tableau, proceed to Phase II, otherwise, proceed to Phase I.6. (Phase I) If there is a negative entry in the last column,

change it to a positive entry by pivoting in the following manner. (Ignore a negative entry in the objective function [last row] for this step.)a) The pivot row is the row containing the negative entry

in the last column.b) Select a negative entry in the pivot row that is to the left

of the last column. The most negative entry is often a good choice. This entry is the pivot element.

c) Reduce the pivot element to 1 and the other entries of the pivot column to 0 using row operations.

Summary continued7. Repeat the parts of step 6 as long as a negative entry

occurs in the last column. When no negative entries remain in the last column (except possibly in the last row), proceed to Phase II.

8. (Phase II) The basic solution to the tableau is now feasible. Use the standard simplex procedure to obtain the optimal solution.

Maximize 5 10 ,subject to :

20

2 100

0, 0

z x y

x y

x y

x y

Minimize 3 2 ,subject to :

10

15

0, 0

z x y

x y

x y

x y

Maximize 40 30 ,subject to :

5

2 3 12

0, 0

z x y

x y

x y

x y

Maximize 3 ,subject to :

2 5 100

10, 0

z x y

x y

x y

Minimize 3 5 ,subject to :

20

2 10

0, 0, 0

p x y z

x y z

y z

x y z

Your Turn

: 6 4

:

3 2 60

2 3 24

25

Maximize z x y

Subject to

x y

x y

x y

HW 4.4

Pg 305-308 1-49 odd

4.5

Multiple SolutionsNo Solution

Your TurnMaximize z = 18x + 24y, subject to 3 4 48

2 223 2 42

0, 0

x yx yx y

x y

Multiple Solutions

Section 4.5

To determine whether a problem has more than one optimal solution:1. Find an optimal solution by the usual simplex method.2. Look at zeros in the bottom row of the final tableau. If a zero

appears in the bottom row of a column for a nonbasic variable, there might be other optimal solutions.

3. To find another optimal solution, if any, use the column of a nonbasic variable with a zero at the bottom as the pivot column. Find the pivot row in the usual manner, and then pivot on the pivot element.

4. If this new tableau gives the same optimal value of z at another point, then multiple solutions exist.

5. Given the two optimal solutions, all points on the line segment joining them are also optimal solutions.

Maximize z = x1 + 4x2, subject to 1 2

1 2

1 2

34 4

0, 0

x xx x

x x

Your Turn

Unbounded = No Max

Unbounded SolutionsWhen you arrive at a simplex tableau that has no positive entries in the pivot column, the feasible region is unbounded and the objective function is unbounded. There is no maximum value and thus no solution.

Example continued

Checking the pivot row we find that all ratios are ___________. When this occurs, there is no _________. Since the feasible region is unbounded, a maximum value does not exist.

Your TurnMaximize z = 8x1 + 24x2, subject to

1 2

1 2

1 2

102 3 60

0, 0

x xx x

x x

No Feasible SolutionWhen a simplex tableau has a negative entry in the last column and no other entries in that row are negative, then there is no feasible solution to the problem.

Example continued

Since x1, s1, and s2 cannot be negative, there are no values that can be used on the left-hand side that will give a negative number. Therefore, __________________________________.

Summary 3 New Situations Multiple Solutions No Solution – Unbounded No Solution – No feasible region

Summary Multiple Solutions

1 2 3

1 32 2

1 0 1 2 0 0 4

0 1 0 0 9

0 0 2 3 1 0 12

0 0 6 0 0 1 288

x y s s s z

Summary No Solution – Unbounded

3 0 1 1 0 7

4 1 0 1 0 4

17 0 0 4 1 16

Summary No Solution – No feasible region

1 2 1 21 1

3 3

1233

0 1 0 10

1 0 0 20

8 0 0 8 1 480

x x s s z

HW 4.5

Pg 316-318 1-33

What’s happeningMaximize 5 4 , subject to :

2 4 80

2 3 120

4 160

0, 0

z x y

x y

x y

x y

x y

Convert to Equations1

2

3

2 4 80

2 3 120

4 160

5 4 0

x y s

x y s

x y s

x y z

2 4 0 80

2 3 0 120

4 0 160

x y

x y

x y

Setting slack variables to 0 gives the boundary lines of the feasible region

Initial Tableau

1 2 3

2 1 1 0 0 0 80

2 3 0 1 0 0 120

4 1 0 0 1 0 160

5 4 0 0 0 1 0

x y s s s z C

Basic Solution

Need to pick pivot

1 2 3

2 1 1 0 0 0 80

2 3 0 1 0 0 120

4 1 0 0 1 0 160

5 4 0 0 0 1 0

x y s s s z C

Need to pick pivot

2 2 3

2 1 1 0 0 0 80

2 3 0 1 0 0 120

4 1 0 0 1 0 160

5 4 0 0 0 1 0

x y s s s z C

1

2

3

2 0 80

2 0 120

4 0 160

x s

x s

x s

2 2 3

1 1/ 2 1/ 2 0 0 0 40

0 2 1 1 0 0 40

0 1 2 0 1 0 0

0 3 5/ 2 0 0 1 200

x y s s s z C

2 2 3

1 0 3/ 4 1/ 4 0 0 30

0 1 1/ 2 1/ 2 0 0 20

0 0 5/ 2 1/ 2 1 0 20

0 0 7 / 4 3/ 4 0 1 230

x y s s s z C

HW 4.6

Pg 324-325 1-10

Sensitivity AnalysisChanges in the Objective FunctionHow does a change in the data affect the optimal solution?

EXAMPLEThe problem to maximize z = 16x + 24y, subject tohas the solution

Maximum is z = 416 at (8,12) How much change can occur in a device profit, and the point (8,12) still yields the maximum profit?

5 4 882 32

0, 0

x yx y

x y

Example continuedSOLUTIONUse the slopes of the boundary lines 5x + 4y = 88 and x + 2y = 32 and the slope of an arbitrary objective function, z = Ax + By, to find the answer.The objective function with slope –A/B through (8,12) must lie between the lines 5x + 4y = 88 (slope = –5/4) and x + 2y = 32 (slope = –1/2). Thus, the slope of the objective function must lie between the slopes of the boundary lines,

5 1 1 5 which can be written as

4 2 2 4

A A

B B

Thus, device profits with a ratio between 0.5 and 1.25 will yield a maximum total profit at (8,12).Ex. Device profits of A = 18 and B = 24 gives A/B = 18/24 = 0.75 which has a total maximum profit at (8,12).

A feasible region is defined by3x + 4y ≤ 397x + 2y ≤ 47x≥0, y≥0

Determine which of the following objective functions have their maximum value at the intersection of 3x + 4y = 39 and 7x + 2y = 47

A) z = 9x + 3y

B) z = 2x + 8y

C) z = 10x + 9y

The figure shows the feasible region determined by4x + 5y ≤ 1827x + 2y ≤ 170x≥0, y≥0Find the value of A and B so that the objective function z = Ax + BY has it maximum at (18, 22)

A linear programming problem seeks to maximize z = Ax + By, subject to9x + 5y ≤ 8525x + 6y ≤ 150x≥0, y≥0Find the range of slopes of the objective function so that the maximum z occurs at (0, 17)

A linear programming problem seeks to maximize z = Ax + By, subject to5x + 2y ≤ 2402x + 3y ≤ 140x≥0, y≥0Find the range of slopes of the objective function so that the maximum z occurs at (48, 0)

HW 4.7

Pg 334-335 1-13