faculty.psau.edu.sa · Web viewIn a linear programming problem with two variables, the slack...

9
Simplex Method The Simplex Method is matrix-based method used for solving linear programming problems with any number of variables. It can be used to solve linear programming problems that already are, or can be converted to, standard maximum-type problems. An example of a standard maximum-type problem is: Maximize P = 4x + 4y Subject to x + 3y ≤ 30 2x + y ≤ 20 x ≥ 0, y ≥ 0 A linear programming problem is a standard maximum- type problem if the following conditions are met: (a) The objective function is linear and is to be maximized. (b) The variables are all nonnegative. (c) The structural constraints are all of the form ax + by + …≤ c, where c ≥ 0. E.g.: (a) Maximize P = 3x 1 + 4x 2 subject to the constraints: 1

Transcript of faculty.psau.edu.sa · Web viewIn a linear programming problem with two variables, the slack...

Simplex Method

The Simplex Method is matrix-based method used for solving linear

programming problems with any number of variables. It can be used

to solve linear programming problems that already are, or can be

converted to, standard maximum-type problems. An example of a

standard maximum-type problem is:

Maximize P = 4x + 4y

Subject to x + 3y ≤ 30

2x + y ≤ 20

x ≥ 0, y ≥ 0

A linear programming problem is a standard maximum- type

problem if the following conditions are met:

(a)The objective function is linear and is to be maximized.

(b)The variables are all nonnegative.

(c)The structural constraints are all of the form ax + by + …≤ c,

where c ≥ 0.

E.g.:

(a)Maximize P = 3x1 + 4x2 subject to the constraints:

5x1 + 2x2 ≤ 145

2x1 + 3x2 ≤ 222

x1 ≥ 0, x2 ≥ 0

is in standard form

(b)Maximize P = 3x1 + 4x2 subject to the constraints:

5x1 + 2x2 ≥ −125

2x1 + 3x2 ≤ 222

1

x1 ≥ 0, x2 ≥ 0

is NOT in standard for

(c)NOTE: 2x1 + 3x2 ≥ −125 can be put in correct form by

multiplying by (-1) and getting −2x1 − 3x2 ≤ 125

From all the above, the first step of the simplex algorithm it is

standard maximum- type problem.

The Second step towards using the simplex algorithm is to

convert the structural constraints into equalities by adding so

called slack variables. The following structural constraints,

x + 2y ≤ 8

x - y ≤ 4

Variables, s1 and s2 are added (to the left side) to the first and second

Constraint, respectively:

x + 2y + s1 = 8

x - y + s2 = 4:

The slack variables will always be nonnegative (zero or positive)

when solving linear programming problems. In a linear programming

problem with two variables, the slack variables are always

nonnegative in the corner points of the feasible region (the variables

that are nonzero are called basic variables. A basic solution for which

all variables are nonnegative are called a basic feasible solution)

The third step is to insert the slack equations into a matrix.

2

The fourth step: set the non-basic variables equal to zero:

Non-basic variables and we set them equal to zero

For the basic variables, s1 and s2, we obtain,

s1 = 8 - x - 2y

s2 = 4 - x + y

In addition, since we set the non-basic variables equal to zero, the

values of our variables before we begin pivoting are:

x = 0

y = 0

s1 = 8

s2 = 4

This solution is a basic feasible solution and is often written as

(x, x, s1, s2) = (0, 0, 8, 4)

The Smallest-Quotient Rule

1. Introduce slack variables and state the problem

2. Construct the simplex table

3. Determine if the left part of the bottom row contains negative

entries. If none are present, the solution to the table is a

maximum and the problem is solved.

4. If the left part of the bottom row contains negative entries,

construct a new simplex table

a) Choose the pivot column by checking the entries of the last

row of the current table, excluding the right-hand entry. The

3

pivot column is the one containing the most-negative of

these entries

b) Choose the pivot element by computing ratios associated

with the positive entries of the pivot column. The pivot

element is the one corresponding to the smallest

nonnegative ratio.

c) Construct the new simplex tableau by pivoting around the

selected element

5. Return to step 3. Steps 3 and 4 are repeated as many times as

necessary to find a maximum.

Example Simplex Method I

Step 1

- Let u, v and w be the slack variables. The corresponding linear

system is

4

Step 2

- Set up the initial simplex tableau.

Step 3

Determine if maximum has been reached

Determine if maximum has been reached

At least one negative entry. Maximum has not been reached

5

6 3 1 0 0 0 961 1 0 1 0 0 182 6 0 0 1 0 7280 70 0 0 0 1 0

Steps 4a, b

• Choose the pivot element

6

Summary

The simplex method entails pivoting around entries in the simplex

tableau until the bottom row contains no negative entries except

perhaps the entry in the last column. The solution can be read off the

final tableau by letting the variables heading columns with 0 entries

in every row but the ith row take on the value in the ith row of the

right-most column, and setting the other variables equal to 0

7