33
The Simplex Method The geometric method of solving linear programming problems presented before. The graphical method is useful only for problems involving two decision variables and relatively few problem constraints. What happens when we need more decision variables and more problem constraints? We use an algebraic method called the simplex method, which was developed by George B. DANTZIG (1914-2005) in 1947 while on assignment with the U.S. Department of the air force.

The Simplex Method - MMDU, Mullana - North India's … content/BCA_504 Comp...Standard Maximization Problems in Standard Form A linear programming problem is said to be a standard

Embed Size (px)

Citation preview

Page 1: The Simplex Method - MMDU, Mullana - North India's … content/BCA_504 Comp...Standard Maximization Problems in Standard Form A linear programming problem is said to be a standard

The Simplex MethodThe geometric method of solving linear programming problemspresented before. The graphical method is useful only forproblems involving two decision variables and relatively fewproblem constraints.

What happens when we need more decision variables and more problem constraints?

We use an algebraic method called the simplex method, whichwas developed by George B. DANTZIG (1914-2005) in 1947 whileon assignment with the U.S. Department of the air force.

Page 2: The Simplex Method - MMDU, Mullana - North India's … content/BCA_504 Comp...Standard Maximization Problems in Standard Form A linear programming problem is said to be a standard

Standard Maximization Problems in Standard Form

A linear programming problem is said to be a standard maximization problem instandard form if its mathematical model is of the following form:

Maximize the objective function

Subject to problem constraints of the form

With non-negative constraints

max 1 1 2 2 ... n nZ P c x c x c x= = + + +

1 1 2 2 ... , 0n na x a x a x b b+ + + ≤ ≥

1 2, ,..., 0nx x x ≥

Page 3: The Simplex Method - MMDU, Mullana - North India's … content/BCA_504 Comp...Standard Maximization Problems in Standard Form A linear programming problem is said to be a standard

Slack Variables

“A mathematical representation of surplus resources.” In real life problems, it’s unlikely that all resources will be used completely, so there usually are unused resources.

Slack variables represent the unused resources between the left-hand side and right-hand side of each inequality.

Page 4: The Simplex Method - MMDU, Mullana - North India's … content/BCA_504 Comp...Standard Maximization Problems in Standard Form A linear programming problem is said to be a standard

Basic and Nonbasic VariablesBasic variables are selected arbitrarily with the restriction that

there be as many basic variables as there are equations. Theremaining variables are non-basic variables.

This system has two equations, we can select any two of the fourvariables as basic variables. The remaining two variables arethen non-basic variables. A solution found by setting the twonon-basic variables equal to 0 and solving for the two basicvariables is a basic solution. If a basic solution has no negativevalues, it is a basic feasible solution.

1 2 1

1 2 2

2 323 4 84x x sx x s+ + =+ + =

Page 5: The Simplex Method - MMDU, Mullana - North India's … content/BCA_504 Comp...Standard Maximization Problems in Standard Form A linear programming problem is said to be a standard

SIMPLEX METHOD

Step-1Write thestandard

maximizationproblem in

standard form, introduce slack

variables to form the initial system,

and write theinitial tableau.

Step-3Select

thepivot

column

Step-5Select

the pivot element

andperformthe pivot operatio

n

STOPThe optimal solution has been found.

STOPThe linear programming problem has

no optimal solution

Step 2Are there

anynegative

indicatorsin the

bottomrow?

Step 4Are there

any positiveelements in

the pivot column

above thedashed

line?

Simplex algorithm for standard maximization problems

Page 6: The Simplex Method - MMDU, Mullana - North India's … content/BCA_504 Comp...Standard Maximization Problems in Standard Form A linear programming problem is said to be a standard

To solve a linear programming problem in standard form, use the following steps.

1- Convert each inequality in the set of constraints to an equation by adding slackvariables.

2- Create the initial simplex tableau.3- Select the pivot column. ( The column with the “most negative value” element

in the last row.)4- Select the pivot row. (The row with the smallest non-negative result when the

last element in the row is divided by the corresponding in the pivot column.)5-Use elementary row operations calculate new values for the pivot row so that

the pivot is 1 (Divide every number in the row by the pivot number.)6- Use elementary row operations to make all numbers in the pivot column equal

to 0 except for the pivot number. If all entries in the bottom row are zero orpositive, this the final tableau. If not, go back to step 3.

7- If you obtain a final tableau, then the linear programming problem has amaximum solution, which is given by the entry in the lower-right corner ofthe tableau.

Page 7: The Simplex Method - MMDU, Mullana - North India's … content/BCA_504 Comp...Standard Maximization Problems in Standard Form A linear programming problem is said to be a standard

Pivot

Pivot Column: The column of the tableau representing the variable to be entered into the solution mix.

Pivot Row: The row of the tableau representing the variable to be replaced in the solution mix.

Pivot Number: The element in both the pivot column and the pivot row.

Page 8: The Simplex Method - MMDU, Mullana - North India's … content/BCA_504 Comp...Standard Maximization Problems in Standard Form A linear programming problem is said to be a standard

Simplex Tableau

Most real-world problems are too complex tosolve graphically. They have too many cornersto evaluate, and the algebraic solutions arelengthy. A simplex tableau is a way tosystematically evaluate variable mixes in orderto find the best one.

Page 9: The Simplex Method - MMDU, Mullana - North India's … content/BCA_504 Comp...Standard Maximization Problems in Standard Form A linear programming problem is said to be a standard

All variables Solution

Basic variables coefficients

0

Initial Simplex Tableau

Page 10: The Simplex Method - MMDU, Mullana - North India's … content/BCA_504 Comp...Standard Maximization Problems in Standard Form A linear programming problem is said to be a standard

EXAMPLE

The Cannon Hill furniture Company produces tablesand chairs. Each table takes four hours of laborfrom the carpentry department and two hours oflabor from the finishing department. Each chairrequires three hours of carpentry and one hourof finishing. During the current week, 240 hoursof carpentry time are available and 100 hours offinishing time. Each table produced gives a profitof $70 and each chair a profit of $50. How manychairs and tables should be made?

Page 11: The Simplex Method - MMDU, Mullana - North India's … content/BCA_504 Comp...Standard Maximization Problems in Standard Form A linear programming problem is said to be a standard

All information about example

Resource Table s ( ) Chairs ( ) Constraints

Carpentry (hr) 4 3 240

Finishing (hr) 2 1 100

Unit Profit $70 $50

1x 2x

Objective Function

Carpentry Constraint

Finishing Constraint

Non-negativity conditions

1 270 50P x x= +

1 24 3 240x x+ ≤

1 22 1 100x x+ ≤

1 2, 0x x ≥

STEP 1

Page 12: The Simplex Method - MMDU, Mullana - North India's … content/BCA_504 Comp...Standard Maximization Problems in Standard Form A linear programming problem is said to be a standard

The first step of the simplex method requires that each inequalitybe converted into an equation. ”less than or equal to”inequalities are converted to equations by including slackvariables.

Suppose carpentry hours and finishing hours remain unusedin a week. The constraints become;

or

As unused hours result in no profit, the slack variables can beincluded in the objective function with zero coefficients:

1 2 1

1 2 2

4 3 2402 100

x x sx x s+ + =+ + =

1s 2s

1 2 1 2

1 2 1 2

4 3 0 2402 0 100

x x s sx x s s+ + + =+ + + =

1 2 1 2

1 2 1 2

70 50 0 070 50 0 0 0

P x x s sP x x s s= + + +− − − − =

Page 13: The Simplex Method - MMDU, Mullana - North India's … content/BCA_504 Comp...Standard Maximization Problems in Standard Form A linear programming problem is said to be a standard

The problem can now be considered as solving a system of 3 linearequations involving the 5 variables in such a waythat P has the maximum value;

Now, the system of linear equations can be written in matrix formor as a 3x6 augmented matrix. The initial tableau is;

1 2 1 2, , , ,x x s s P

1 2 1 2

1 2 1 2

1 2 1 2

4 3 0 2402 0 100

70 50 0 0 0

x x s sx x s s

P x x s s

+ + + =+ + + =

− − − − =

Page 14: The Simplex Method - MMDU, Mullana - North India's … content/BCA_504 Comp...Standard Maximization Problems in Standard Form A linear programming problem is said to be a standard

Basic Variables x1 x2 S1 S2 P

Right Hand Side

S1 4 3 1 0 0 240S2 2 1 0 1 0 100P -70 -50 0 0 1 0

The tableau represents the initial solution;

The slack variables S1 and S2 form the initial solution mix. The initial solution assumes that all avaliable hours are unused. i.e. The slack variables take the largest possible values.

1 2 1 20, 0, 240, 100, 0x x s s P= = = = =

STEP 2

Page 15: The Simplex Method - MMDU, Mullana - North India's … content/BCA_504 Comp...Standard Maximization Problems in Standard Form A linear programming problem is said to be a standard

Variables in the solution mix are called basic variables. Each basicvariables has a column consisting of all 0’s except for a single 1.all variables not in the solution mix take the value 0.

The simplex process, a basic variable in the solution mix isreplaced by another variable previously not in the solutionmix. The value of the replaced variable is set to 0.

Page 16: The Simplex Method - MMDU, Mullana - North India's … content/BCA_504 Comp...Standard Maximization Problems in Standard Form A linear programming problem is said to be a standard

Select the pivot column (determine which variable to enter into thesolution mix). Choose the column with the “most negative”element in the objective function row.

STEP 3

Basic Variables x1 x2 S1 S2 P

Right hand side

S1 4 3 1 0 0 240S2 2 1 0 1 0 100P -70 -50 0 0 1 0

Pivot column

x1 should enter into the solution mix because each unit of x1 (a table)contributes a profit of $70 compared with only $50 for each unit of x1 (achair)

Page 17: The Simplex Method - MMDU, Mullana - North India's … content/BCA_504 Comp...Standard Maximization Problems in Standard Form A linear programming problem is said to be a standard

Step 4

No, There aren’t any positive elements in the pivot column above the dashed line.

We can go on step 5

Page 18: The Simplex Method - MMDU, Mullana - North India's … content/BCA_504 Comp...Standard Maximization Problems in Standard Form A linear programming problem is said to be a standard

STEP 5Select the pivot row (determine which variable to replace in the solution mix).

Divide the last element in each row by the corresponding element in thepivot column. The pivot row is the row with the smallest non-negativeresult.

Basic Variables x1 x2 S1 S2 P

Right hand side

S1 4 3 1 0 0 240S2 2 1 0 1 0 100P -70 -50 0 0 1 0

240 / 4 60=

100 / 2 50=

Pivot columnPivot row

Enter

Exit

Pivot number

Page 19: The Simplex Method - MMDU, Mullana - North India's … content/BCA_504 Comp...Standard Maximization Problems in Standard Form A linear programming problem is said to be a standard

Should be replaced by x1 in the solution mix. 60 tables can be made with 240unused carpentry hours but only 50 tables can be made with 100 finishinghours. Therefore we decide to make 50 tables.

Now calculate new values for the pivot row. Divide every number in the rowby the pivot number.

BasicVariables x1 x2 S1 S2 P

Righthandside

S1 4 3 1 0 0 240x1 1 1/2 0 1/2 0 50P -70 -50 0 0 1 0

2

2R

Page 20: The Simplex Method - MMDU, Mullana - North India's … content/BCA_504 Comp...Standard Maximization Problems in Standard Form A linear programming problem is said to be a standard

BasicVariables x1 x2 S1 S2 P

Righthandside

S1 0 1 1 -2 0 40x1 1 1/2 0 1/2 0 50P 0 -15 0 35 1 3500

2 14.R R− +

2 370.R R+

Use row operations to make all numbers in the pivot column equal to 0 except for the pivot number which remains as 1.

If 50 tables are made, then the unused carpentry hours are reduced by 200hours (4 h/table multiplied by 50 tables); the value changes from 240 hours to 40hours. Making 50 tables results in the profit being increased by $3500; the valuechanges from $0 to $3500.

Page 21: The Simplex Method - MMDU, Mullana - North India's … content/BCA_504 Comp...Standard Maximization Problems in Standard Form A linear programming problem is said to be a standard

In this case, Now repeat the steps until there are no negative numbers in the last row.

Select the new pivot column. x2 should enter into the solution mix.Select the new pivot row. S1 should be replaced by x2 in the solution mix.

1 2 1 250, 0, 40, 0, 3500x x s s P= = = = =

Basic Variables x1 x2 S1 S2 P

Right hand side

S1 0 1 1 -2 0 40x1 1 1/2 0 1/2 0 50P 0 -15 0 35 1 3500

40 /1 40=

50 / 0,5 100=

New pivot column

New pivot row

Enter

Exit

Page 22: The Simplex Method - MMDU, Mullana - North India's … content/BCA_504 Comp...Standard Maximization Problems in Standard Form A linear programming problem is said to be a standard

Basic Variables x1 x2 S1 S2 P

Right hand side

x2 0 1 1 -2 0 40x1 1 0 -1/2 3/2 0 30P 0 0 15 5 1 4100

Calculate new values for the pivot row. As the pivot number is already 1,there is no need to calculate new values for the pivot row.

Use row operations to make all numbers in the pivot column equal toexcept for the pivot number.

1 21 .2

R R− +

1 315.R R+

Page 23: The Simplex Method - MMDU, Mullana - North India's … content/BCA_504 Comp...Standard Maximization Problems in Standard Form A linear programming problem is said to be a standard

If 40 chairs are made, then the number of tables are reduced by20 tables (1/2 table/chair multiplied by 40 chairs); the valuechanges from 50 tables to 30 tables. The replacement of 20tables by 40 chairs results in the profit being increased by$600; the value changes from $3500 to $4100.

As the last row contains no negative numbers, this solution gives the maximum value of P.

Page 24: The Simplex Method - MMDU, Mullana - North India's … content/BCA_504 Comp...Standard Maximization Problems in Standard Form A linear programming problem is said to be a standard

Result

This simplex tableau represents the optimalsolution to the LP problem and is interpretedas:

and profit or P=$4100The optimal solution (maximum profit to be

made) is to company 30 tables and 40 chairs for a profit of $4100.

1 2 1 230, 40, 0, 0x x s s= = = =

Page 25: The Simplex Method - MMDU, Mullana - North India's … content/BCA_504 Comp...Standard Maximization Problems in Standard Form A linear programming problem is said to be a standard

Example-2

A farmer owns a 100 acre farm and plans to plant atmost three crops. The seed for crops A,B, and C costs$40, $20, and $30 per acre, respectively. A maximumof $3200 can be spent on seed. Crops A,B, and Crequire 1,2, and 1 workdays per acre, respectively,and there are maximum of 160 workdays available. Ifthe farmer can make a profit of $100 per acre oncrop A, $300 per acre on crop B, and $200 per acreon crop C, how many acres of each crop should beplanted to maximize profit?

Page 26: The Simplex Method - MMDU, Mullana - North India's … content/BCA_504 Comp...Standard Maximization Problems in Standard Form A linear programming problem is said to be a standard

The Dual Problem: Minimization with problem constraints of the form ≥

• Linear programming problems exist in pairs. That is inlinear programming problem, every maximizationproblem is associated with a minimization problem.Conversely, associated with every minimization problemis a maximization problem. Once we have a problemwith its objective function as maximization, we can writeby using duality relationship of linear programmingproblems, its minimization version. The original linearprogramming problem is known as primal problem, andthe derived problem is known as dual problem.

Page 27: The Simplex Method - MMDU, Mullana - North India's … content/BCA_504 Comp...Standard Maximization Problems in Standard Form A linear programming problem is said to be a standard

Primal Problem Dual ProblemMinimize Z=cx Maximize W=yb

Subject to Ax≥b Subject to yA≤c

and x≥0 And y≥0

Thus, the dual problem uses exactly the same parametersas the primal problem, but in different locations. Tohighlight the comparison, now look at these same twoproblems in matrix notation.

Primal problem 𝑎𝑎11 𝑎𝑎12 𝑎𝑎13 A= 𝑏𝑏11 𝑏𝑏12 𝑏𝑏13 𝑐𝑐11 𝑐𝑐12 𝑐𝑐13

Dual problem

𝑎𝑎11 𝑏𝑏11 𝑐𝑐11 AT= 𝑎𝑎12 𝑏𝑏12 𝑐𝑐12 𝑎𝑎13 𝑏𝑏13 𝑐𝑐13

Page 28: The Simplex Method - MMDU, Mullana - North India's … content/BCA_504 Comp...Standard Maximization Problems in Standard Form A linear programming problem is said to be a standard

As an example, ⇒ ⇒ ⇒ Consequently, (1) the parameters for a constraint in either problem are the coefficients of a variable in the other problem and (2) the coefficients for the objective function of either problem are the right sides for the other problem.

Dual Problem in algebraic

form Maximize Z=4y1+12y2+18y3

Subject to y1+3y3 ≤ 3

2y2+2y3 ≤ 5

and y1≥0 , y2≥0 ,y3≥0

Dual problem

1 0 3 3 AT= 0 2 2 5 4 12 18 1

Primal problem

1 0 4

A= 0 2 12

3 2 18

3 5 1

Primal Problem in

algebraic form Minimize C=3x1+5x2

Subject to x1 ≥ 4

2x2 ≥ 12 3x1+2x2 ≥18

and x1≥0, x2≥0

Page 29: The Simplex Method - MMDU, Mullana - North India's … content/BCA_504 Comp...Standard Maximization Problems in Standard Form A linear programming problem is said to be a standard

Primal Dual

(a) Maximize. Minimize

(b) Objective Function. Right hand side.

(c) Right hand side. Objective function.

(d) i th row of input-output coefficients.

i th column of input output coefficients.

(e) j th column of input-output coefficients.

j the row of input-output coefficients.

Summary

Page 30: The Simplex Method - MMDU, Mullana - North India's … content/BCA_504 Comp...Standard Maximization Problems in Standard Form A linear programming problem is said to be a standard

WORKED – OUT PROBLEM 1 The procedure for forming the dual problem is summarized in the box below: Formation of the Dual Problem Given a minimization problem with problem constraints, Step 1. Use the coefficients and constants in the problem constraints and the objective function to form a matrix A with the coefficients of the objec-tive function in the last row. Step 2. Interchange the rows and columns of matrix A to form the matrix AT, the transpose of A. Step 3. Use the rows of AT to form a maximization problem with ≤ problem constraints. Forming the Dual Problem Minimize C = 40x1 + 12x2 + 40x3 subject to 2x1 + x2 + 5x3 ≥ 20

4x1 + x2 + x3 ≥ 30 x1, x2, X3 ≥ 0

Page 31: The Simplex Method - MMDU, Mullana - North India's … content/BCA_504 Comp...Standard Maximization Problems in Standard Form A linear programming problem is said to be a standard

WORKED –OUT PROBLEM 2

Form the dual problem:

Minimize C = 16 x1 + 9x2 + 21x3

subject to x1 + x2 + 3x3 ≥ 12 2x1 + x2 +x3 ≥ 16

x1, x2, x3 ≥ 0

Page 32: The Simplex Method - MMDU, Mullana - North India's … content/BCA_504 Comp...Standard Maximization Problems in Standard Form A linear programming problem is said to be a standard

ORIGINAL PROBLEM (1)

Minimize C = 16x1 + 45x2

DUAL PROBLEM (2)

Maximize P = 50y1 + 27y2

subject to 2x1 + 5x2 ≥ 50 x1 + 3x2 ≥ 27x1, x2 ≥ 0

subject to 2y1 + y2 ≤ 16 5y1 + 3y2 ≤ 45 y1,y2 ≥ 0

Solution of Minimization Problems

Page 33: The Simplex Method - MMDU, Mullana - North India's … content/BCA_504 Comp...Standard Maximization Problems in Standard Form A linear programming problem is said to be a standard

MINIMIZATION PROBLEMS

- The Dual Form- Graphical Approach- Solution of Minimization Problems with

Simplex Method- A Transportation Problem- The Big M method- Minimization by The Big M Method