You are on page 1of 6

# 7.

## 4 Linear Programming: The Simplex Method

For linear programming problems with more than two variables, the graphical method is usually
impossible, so the simplex method is used. Because the simplex method is used for problems
with many variables, it usually is no practical to use letters such as x, y, z, or w as variables,
1
, x
2
, x
3
, onJ x
4
are used. In the simplex method, all constraints must be
expressed in the form
o
1
x
1
+o
2
x
2
+o
3
x
3
+ b

The first step is to convert each constraint (a linear inequality) into a linear equation. This is done
by adding a nonnegative variable, called a slack variable to each constraint.

1. For the linear programming problem, use slack variables to convert each constraint into a
linear equation.
Hoximizc: z = 8x
1
+Sx
2
+x
3

Sub]cct to: Sx
1
-x
2
+4x
3
9S
7x
1
+6x
2
+8x
3
118
4x
1
+Sx
2
+1ux
3
22u
x
1
u, x
2
u, x
3
u
Solution: The Slack Variables are x
4
, x
5
, onJ x
6

Sx
1
-x
2
+4x
3
+ x
4
= 9S
7x
1
+6x
2
+8x
3
+x
5
= 118
4x
1
+Sx
2
+1ux
3
+ x
6
= 22u

A linear programming problem can be written in matrix form called the simplex tableau. The
last row of the simplex tableau corresponds to the objective function with all variables on the
left-hand side.

2. Introduce slack variables as necessary and then write the initial simplex tableau for the linear
programming problem.
Hoximizc: z = Sx
1
+Sx
2
+7x
3

Sub]cct to: 4x
1
+Sx
2
+2x
3
6u
Sx
1
+4x
2
+x
3
24
x
1
u, x
2
u, x
3
u

Solution: The Slack Variables are x
4
onJ x
5

4x
1
+Sx
2
+2x
3
+ x
4
= 6u
Sx
1
+4x
2
+ x
3
+x
5
= 24
The objective function z = Sx
1
+Sx
2
+7x
3
needs to be rewritten so that all the variables are on
the left-hand side: -Sx
1
-Sx
2
-7x
3
+z = u.
x
1
x
2
x
3
x
4
x
5
z
The initial simplex tableau is _
4 S 2
S 4 1
-S -S -7

1
u
u

u
1
u

u
u
1

6u
24
u
_

Except for the entries 1 and 0 on the right end-the numbers in the bottom row of a simplex
tableau are called indicators. The indicators in this tableau are -5 -3 -7 0 and 0. The column
containing the most negative indicator is called the pivot column. In this example, the third
column is the pivot column, since -7 is the most negative indicator. Now for each positive entry
in the pivot column, divide the number in the far right column of the same row by the positive
number in the pivot column. The row with the smallest quotient is called the pivot row. The
entry in the pivot row and pivot column is the pivot. The pivot is the number in the matrix
chosen to change to a 1 and all other entries in that column changed to zeros.
Quotients :
60
2
= Su onJ
24
1
= 24. The smallest quotient is 24, so the pivot is 4. Pivoting is
complete once all the indicators are nonnegative.

Examples: Use the simplex method to solve.
3. Hoximizc z = x
1
+Sx
2

Subject to: x
1
+x
2
1u
Sx
1
+2x
2
2u
x
1
+2x
2
S6
x
1
u, x
2
u

The Slack Variables are x
3
, x
4
, onJ x
5

x
1
+x
2
+x
3
= 1u
Sx
1
+2x
2
+ x
4
= 2u
x
1
+2x
2
+ x
5
= S6
The objective function z = x
1
+Sx
2
needs to be rewritten so that all the variables are on the left-
hand side: -x
1
-Sx
2
+z = u.

The initial simplex tableau is
x
1
x
2
x
3
x
4
x
5
z
l
l
l
l
l
1 1 1
S 2 u
1 2 u

u u u
1 u u
u 1 u

-1 -S u u u 1

1u
2u
S6
u
1
1
1
1
1

The second column is the pivot column, since -3 is the most negative indicator.
Quotients;
1u
1
, = 1u,
2u
2
, = 1u,
S6
2
, = 18. Since there are two equally small quotients,
we can choose either entry in column 2 to be the pivot. Lets choose the number 1 in column 2 to
be the pivot.
x
1
x
2
x
3
x
4
x
5
z x
1
x
2
x
3
x
4
x
5
z
l
l
l
l
l
1 1 1
S 2 u
1 2 u

u u u
1 u u
u 1 u

-1 -S u u u 1

1u
2u
S6
u
1
1
1
1
1
r
2
- -2r
1
+r
2

l
l
l
l
l
1 1 1
S u -2
1 2 u

u u u
1 u u
u 1 u

-1 -S u u u 1

1u
u
S6
u
1
1
1
1
1
r
3
- -2r
1
+r
3

-2 -2 -2 u u u -2u -2 -2 -2 u u u -2u
+ S 2 u 1 u u 2u + 1 2 u u 1 u S6
S u -2 1 u u u -1 u -2 u 1 u 16
x
1
x
2
x
3
x
4
x
5
z x
1
x
2
x
3
x
4
x
5
z
l
l
l
l
l
1 1 1
S u -2
-1 u -2

u u u
1 u u
u 1 u

-1 -S u u u 1

1u
u
16
u
1
1
1
1
1
r
4
- Sr
1
+r
4

l
l
l
l
l
1 1 1
S u -2
-1 u -2

u u u
1 u u
u 1 u

2 u S u u 1

1u
u
16
Su
1
1
1
1
1

S S S u u u Su
+ -1 -S u u u 1 u
2 u S u u 1 S
Since there are no negatives in the last row, we are done pivoting. The corresponding
equation is
2x
1
+Sx
3
+z = Su or z = Su -2x
1
-Sx
3
. The basic variables are x
2
, x
4
, x
5
, onJ z the
nonbasic variables are x
1
onJ x
3
. The solution is found by setting the nonbasic variables equal
to zero. So x
1
= u onJ x
3
= u, then fom the last Tableau we have the following equations:
x
1
+x
2
+x
3
= 1u
Sx
1
-x
3
+x
4
= u
-x
1
-2x
3
+ x
5
= 16
Substituing x
1
= u onJ x
3
= u gives us x
2
= 1u, x
4
= u, onJ x
5
= 16 and the
maximum value for the variable z is z = Su.

SimplexMethod:
2. Setuptheinitialtableau
3. Locatethemostnegativeindicator.Thisindicatordeterminesthepivotcolumn
4. Usethepositiveentriesinthepivotcolumntoformthenecessaryquotientsfor
determiningthepivot.Iftherearenopositiveentries,nomaximumsolutionexists.If
twoquotientsareequallythesmallest,leteitherdeterminethepivot.
5. Dividethepivotrowbythepivottochangethepivotto1.Thenuserowoperations
tochangeallotherentriesinthepivotcolumnto0.
6. Iftheindicatorsareallpositiveor0,youhavefoundthefinaltableau
7. Seteachnonbasicvariableequalto0andsolvethesystemforthebasicvariables.
Themaximumvalueisthenumberinthelowerrighthandcornerofthetableau.
4. Maximize z = Sx
1
+2x
2
+x
3

Subject to _
2x
1
+2x
2
+x
3
1u
x
1
+2x
2
+Sx
3
1S
x
1
u, x
2
u, x
3
u

Introduce slack variables and rewriting the objective function as -Sx
1
-2x
2
- x
3
+z = u
gives us the initial tableau
x
1
x
2
x
3
x
4
x
5
z
_
2 2 1
1 2 S
-S -2 -1

1 u u
u 1 u
u u 1

1u
1S
u
_ The pivot column is column 1. Quotients
1u
2
, = S onJ
1S
1
, = 1S.
The smallest quotient is 5, so the 2 in row 1 column1 is the pivot. Divide row 1 by 2 to get
x
1
x
2
x
3
x
4
x
5
z x
1
x
2
x
3
x
4
x
5
z
_
1 1
1
2
,
1 2 S
-S -2 -1

1
2
, u u
u 1 u
u u 1

S
1S
u
_ r
1
- -r
1
+r
2
_
1 1
1
2
,
u 1
S
2
,
-S -2 -1

1
2
, u u
-
1
2
, 1 u
u u 1

S
1u
u
_

-1 -1 -
1
2
, -
1
2
, u u -S
+ 1 2 S u 1 u 1S
u 1
S
2
, -
1
2
, 1 u 1u
x
1
x
2
x
3
x
4
x
5
z
r
3
- Sr
1
+r
3

l
l
l
l
1 1
1
2
,
u 1
S
2
,
u 1
1
2
,

1
2
, u u
-
1
2
, 1 u
S
2
, u 1

S
1u
1S
1
1
1
1

S S
S
2
,
S
2
, u u 1S
-S -2 -1 u u 1 u
u 1
1
2
,
S
2
, u 1 1S

The nonbasic variables are x
2
, x
3
, , onJ x
4
set these equal to 0. The corresponding system is
_
x
1
+x
2
+
1
2
, x
3
+
1
2
, x
4
= S
x
2
+
S
2
, x
3
-
1
2
, x
4
+x
5
= 1u

This gives x
1
= S, x
5
= 1u and the maximum value of z is 15.

5. Maximize: z = 4x
1
-Sx
2
+2x
3

Subject to: _
2x
1
-x
2
+8x
3
4u
4x
1
-Sx
2
+6x
3
6u
2x
1
-2x
2
+6x
3
24

_
2 -1 8 1 u u u 4u
4 -S 6 u 1 u u 6u
2 -2 6 u u 1 u 24
-4 S -2 u u u 1 u
_ the pivot column is column 1.
Quotients
4u
2
, = 2u,
6u
4
, = 1S, onJ
24
2
, = 12. The smallest quotient is 12, the pivot is
the 2 in column 1 row 3. Divide row 3 by 2, the pivot.
_
2 -1 8 1 u u u 4u
4 -S 6 u 1 u u 6u
1 -1 S u u
1
2
, u 12
-4 S -2 u u u 1 u
_ r
1
- -2r
3
+r
1
_
u 1 2 1 u -1 u 16
4 -S 6 u 1 u u 6u
1 -1 S u u
1
2
, u 12
-4 S -2 u u u 1 u
_
-2 2 -6 u u -1 u -24
2 -1 8 1 u u u 4u
u 1 2 1 u -1 u 16

_
u 1 2 1 u -1 u 16
4 -S 6 u 1 u u 6u
1 -1 S u u
1
2
, u 12
-4 S -2 u u u 1 u
_ r
2
- -4r
3
+r
2
_
u 1 2 1 u -1 u 16
u -1 -6 u 1 -2 u 12
1 -1 S u u
1
2
, u 12
-4 S -2 u u u 1 u
_
-4 4 -12 u u -2 u -48
4 -S 6 u 1 u u 6u
u - 1 -6 u 1 -2 u 12

_
u 1 2 1 u -1 u 16
u -1 -6 u 1 -2 u 12
1 -1 S u u
1
2
, u 12
-4 S -2 u u u 1 u
_ r
4
- 4r
3
+r
4
_
u 1 2 1 u -1 u 16
u -1 -6 u 1 -2 u 12
1 -1 S u u
1
2
, u 12
u -1 8 u u 2 1 48
_
4 - 4 12 u u 2 u 48
-4 S -2 u u u 1 u
u - 1 8 u u 2 1 48
The new pilot column is column 2 and the first row is the only possible pivot row.

_
u 1 2 1 u -1 u 16
u -1 -6 u 1 -2 u 12
1 -1 S u u
1
2
, u 12
u -1 8 u u 2 1 48
_ r
2
- r
1
+r
2
_
u 1 2 1 u -1 u 16
u u -4 1 1 -S u 28
1 -1 S u u
1
2
, u 12
u -1 8 u u 2 1 48
_
u 1 2 1 u -1 u 16
u -1 -6 u 1 -2 u 12
u u -4 1 1 -S u 28
_
u 1 2 1 u -1 u 16
u u -4 1 1 -S u 28
1 -1 S u u
1
2
, u 12
u -1 8 u u 2 1 48
_ r
3
- r
1
+r
3
_
u 1 2 1 u -1 u 16
u u -4 1 1 -S u 28
1 u S 1 u -
1
2
, u 28
u -1 8 u u 2 1 48
_
u 1 2 1 u -1 u 16
1 -1 S u u
1
2
, u 12
1 u S 1 u -
1
2
, u 28
_
u 1 2 1 u -1 u 16
u u -4 1 1 -S u 28
1 u S 1 u -
1
2
, u 28
u -1 8 u u 2 1 48
_ r
4
- r
1
+r
4
_
u 1 2 1 u -1 u 16
u u -4 1 1 -S u 28
1 u S 1 u -
1
2
, u 28
u u 1u 1 u 1 1 64
_
u 1 2 1 u -1 u 16
u -1 8 u u 2 1 48
u u 1u 1 u 1 1 64
Setting the nonbasic valuables equal to zero and solving the corresponding system yields
_
x
2
+2x
3
+x
4
- x
6
= 16
-4x
3
+x
4
+x
5
-Sx
6
= 28
x
1
+Sx
3
+x
4
-
1
2
, x
6
= 28

x
3
= u, x
4
= u, x
6
= u
Gives x
2
= 16, x
5
= 28, onJ x
1
= 28. The maximum value of z is 64