Contents  |  ‹ Previous  |  Next ›  |  Download EPUB  |  PDF

Chapter 9
Simplex Method in Tableau Form

Learning Outcomes

Try it out visually!

Simplex Pivoter in Tableau Form: the same pivoting mechanics as this chapter, with every row operation shown.

Free Tableau Pivoter: a Gauss–Jordan sandbox; pivot on any entry and see what happens.

The dictionary method of Chapter 7 and the matrix calculations of Chapter 8 both carry out the same arithmetic; they differ only in how much of it we write down. The simplex tableau is the most compact bookkeeping of all: a single table of numbers that stores the slack form of the linear program and updates it in place at each pivot. Everything the simplex method needs (which variable to bring in, which to send out, and whether we are finished) can be read straight off the table.

We use the same linear program solved by dictionaries earlier,

max z = 2x + 3y  s.t.  x + y 9, 2x + y 16, x + 2y 14, x,y 0,

so that you can compare the two presentations line for line.

9.1 Building the tableau

First put the program in standard form by adding a nonnegative slack variable to each constraint:

x + y + s1 = 9, 2x + y + s2 = 16, x + 2y + s3 = 14, x,y,s1,s2,s3 0.

We also record the objective as an equation. Moving the cost terms to the left,

z 2x 3y = 0,

so that the objective sits in the table on the same footing as the constraints. This equation is the objective row (or z-row); we place it on top.

Each row of the tableau lists the coefficients of one equation, and the final column holds its right-hand side. The leftmost column names the basic variable of that row: the variable that appears with coefficient 1 in that row and 0 in every other row. Reading the starting tableau,

Basis

x

y

s1

s2

s3

RHS

z

2

3

0

0

0

0

s1

1

1

1

0

0

9

s2

2

1

0

1

0

16

s3

1

2

0

0

1

14

the basis is {s1,s2,s3}. Setting the nonbasic variables x = y = 0 gives the basic feasible solution s1 = 9,s2 = 16,s3 = 14 read directly from the RHS column, with objective value z = 0 (the RHS of the z-row). The entries of the z-row, 2 and 3, record the reduced costs of x and y with the sign flipped: increasing x or y from zero would change z at the rates + 2 and + 3, the negatives of the stored entries.

 Sign convention.  In the dictionary form we wrote z = 2x + 3y and increased the variable with the largest positive coefficient. The tableau instead stores the row z 2x 3y = 0, so the very same coefficients appear negated. The two rules therefore read as mirror images and give identical decisions: in tableau form we bring in the variable with the most negative z-row entry, and we stop when every z-row entry is nonnegative.

9.2 One pivot, three colors

A pivot has three moves, and we color them consistently throughout the book: green chooses the entering variable, orange runs the ratio test to find the leaving variable, and blue marks the pivot element where the two meet.

15!//
Basis

x

18!// y

s1

s2

s3

RHS

ratio
z

2

3

0

0

0

0

s1

1

1

1

0

0

9

91 = 9
s2

2

1

0

1

0

16

161 = 16
s3

1

30!// 2

0

0

1

14

142 = 7 

 Entering: y ( z-row entry 3, the most negative).  Leaving: s3 (smallest ratio 7).  Pivot on the blue element.

The pivot itself is just Gaussian elimination on the pivot column, driving it to a unit column with the 1 in the pivot row.

 Entering.  The z-row entries are 2 (for x) and 3 (for y). The most negative is 3, so y enters: increasing y improves z fastest.

 Ratio test.  Divide each constraint’s RHS by its positive entry in the y column:

9 1 = 9,16 1 = 16,14 2 = 7(smallest).

The smallest ratio, 7, occurs in the s3 row, so s3 leaves. The pivot element is the entry where the entering column meets the leaving row, namely 2.

 Pivot.  Scale the pivot row so the pivot element becomes 1, then clear the y column everywhere else:

new y-row 1 2(s3-row) = [1 2,1,0,0,1 27], z-row z-row + 3(new y-row), s1-row s1-row 1(new y-row), s2-row s2-row 1(new y-row).

The result is the second tableau, with basis {s1,s2,y}:

Basis

x

y

s1

s2

s3

RHS

ratio
z

1 2

0

0

0

3 2

21

s1

1 2

0

1

0

1 2

2

2(12) = 4 
s2

3 2

0

0

1

1 2

9

9(32) = 6
y

1 2

1

0

0

1 2

7

7(12) = 14

 Entering: x (only negative z-row entry, 1 2).  Leaving: s1 (smallest ratio 4).  Pivot on 1 2.

Notice the objective value has already climbed from 0 to 21. One more pivot on the blue element (scale the s1-row by 2, then clear the x column) produces the third tableau, with basis {x,s2,y}:

12!//
Basis

x

y

s1

s2

s3

RHS

z

0

0

1

0

1

23

x

1

0

2

0

1

4

s2

0

0

3

1

1

3

y

0

1

1

0

1

5

9.3 Optimality and reading the solution

Every entry of the z-row is now nonnegative, so no variable can enter and improve the objective: the tableau is optimal. We read the solution straight from the RHS column, taking each basic variable equal to its right-hand side and each nonbasic variable equal to zero:

x = 4,y = 5,z = 23 with s2 = 3,s1 = s3 = 0.

The result matches the dictionary solution exactly, as it must. The nonzero slack s2 = 3 says the second constraint 2x + y 16 is slack (indeed 2(4) + 5 = 13 < 16), while s1 = s3 = 0 says the first and third constraints are tight at the optimum.

Algorithm: Simplex Method (Tableau Form)

Choose the entering variable Scan the objective row. Pick a nonbasic variable with a negative entry; a common choice is the most negative. If no entry is negative, stop: the current tableau is optimal.

Ratio test for the leaving variable For each row with a positive entry in the entering column, form the ratio RHS entering-column entry. The row with the smallest ratio leaves. (If no entry is positive, the problem is unbounded.)

Pivot Scale the pivot row so the pivot element becomes 1, then add multiples of it to every other row, including the objective row, so the rest of the entering column becomes 0.

Repeat until optimal Repeat until every objective-row entry is nonnegative. Then read the optimal solution and objective value from the RHS column.

The tableau, the dictionary, and the matrix form are three windows onto one algorithm: the tableau is fastest to compute by hand, the dictionary makes the underlying equations explicit, and the matrix form (Chapter 8) shows why each update is a change of basis.

9.4 Artificial Variables and the Big-M Method

Every tableau so far began from the slack basis, where the slack variables supplied a ready-made identity block and a feasible starting point. A “ ” constraint spoils that: its surplus variable enters with a coefficient of 1, so it cannot serve as a basic variable, and the origin is infeasible. The tableau form handles this exactly as the dictionary form does (Chapter 7), by adding an artificial variable to each such constraint and penalizing it by a large constant M in the objective (the Big-M method). The one new wrinkle is bookkeeping: because each artificial variable starts in the basis, we must first clear its column from the objective row before the simplex rules apply.

9.4.1 A problem with no slack-basis start

Return to the linear program

max 2x + 3y  s.t.  2x + y 5,2x + y 16,x + 2y 14,x,y 0.

The first constraint needs a surplus variable e1 and an artificial variable a1; the other two take ordinary slacks:

2x + y e1 + a1 = 5, 2x + y + s2 = 16, x + 2y + s3 = 14, max z = 2x+3yMa1.

Step 1 — Price the artificial variable out of the objective row.  Writing the objective as z 2x 3y + Ma1 = 0 would leave a nonzero entry under the basic variable a1. Subtracting M times the a1-row restores a proper tableau, at the cost of introducing M into the other entries:

Basis x y e1 s2 s3 a1 RHS ratio
z 2 2M 3 M M 0 0 0 5M
a1 2 1 1 0 0 1 5 52 = 2.5 
s2 2 1 0 1 0 0 16 162 = 8
s3 1 2 0 0 1 0 14 141 = 14

 Entering: x (its z-row entry 2 2M is the most negative for large M).  Leaving: a1 (smallest ratio 2.5).  Pivot on 2.

The very first pivot drives the artificial variable out of the basis. After pivoting on the blue element we obtain

Basis x y e1 s2 s3 a1 RHS
z 0 2 1 0 0 1 + M 5
x 1 1 2 1 2 0 0 1 2 5 2
s2 0 0 1 1 0 1 11
s3 0 3 2 1 2 0 1 1 2 23 2

The artificial variable a1 is now nonbasic, and its objective-row entry 1 + M is positive, so it will never re-enter: we may delete the a1 column and forget it ever existed. What remains is an ordinary feasible tableau, which we drive to optimality with the plain simplex rules of the previous sections. A few pivots later every objective-row entry is nonnegative:

Basis x y e1 s2 s3 RHS
z 0 0 0 1 3 4 3 24
x 1 0 0 2 3 1 3 6
e1 0 0 1 1 0 11
y 0 1 0 1 3 2 3 4

Reading the optimal tableau gives x = 6, y = 4, and z = 24, with surplus e1 = 11 on the first constraint and both later constraints tight ( s2 = s3 = 0).

9.4.2 Detecting infeasibility in tableau form

The Big-M method also announces when a problem has no feasible solution: an artificial variable that refuses to leave the basis. Consider

max 2x + 3y  s.t.  2x + y 22,2x + y 16,x + 2y 14,x,y 0,

whose first two constraints demand that 2x + y be simultaneously at least 22 and at most 16. Setting it up exactly as before and pricing out the artificial variable gives the starting tableau

Basis x y e1 s2 s3 a1 RHS
z 2 2M 3 M M 0 0 0 22M
a1 2 1 1 0 0 1 22
s2 2 1 0 1 0 0 16
s3 1 2 0 0 1 0 14

Running the simplex method to optimality of the penalized problem (two pivots suffice) leads to

Basis x y e1 s2 s3 a1 RHS
z 0 0 M 1 3 + M 4 3 0 24 6M
a1 0 0 1 1 0 1 6
x 1 0 0 2 3 1 3 0 6
y 0 1 0 1 3 2 3 0 4

Every objective-row entry is nonnegative, so this tableau is optimal for the Big-M problem, yet the artificial variable a1 is still basic, at the positive value a1 = 6. Because a genuine solution of the original problem would let us set every artificial variable to zero, a positive artificial variable in the optimal Big-M tableau is the signal that the original linear program is infeasible. The tell-tale 6M in the objective value 24 6M says the same thing: no finite objective can escape the penalty.

Artificial variable leaves the basis

Artificial variable stays basic ( > 0)

A feasible basis for the original problem was found; delete the artificial columns and continue.

The original problem is infeasible; no feasible basis exists.

Table 9.1: Interpreting the final Big- M tableau: the artificial variable leaves the basis versus stays basic.

9.5 Exercises

Warm-ups

Exercise 9.1: Reading a mid-solve tableau

  The tableau below is the second tableau of this chapter’s running example, reached after one pivot:

Basis

x

y

s1

s2

s3

RHS

z

1 2

0

0

0

3 2

21

s1

1 2

0

1

0

1 2

2

s2

3 2

0

0

1

1 2

9

y

1 2

1

0

0

1 2

7

1.
Which variables are basic and which are nonbasic?
2.
Read off the basic feasible solution and the objective value.
3.
What are the reduced costs of the nonbasic variables?
4.
Is this tableau optimal? If not, which variable enters next?

9.1, first worked tableau; §9.2]

Exercise 9.2: Reading a tableau

  The following tableau arose while solving a maximization problem, with the objective row on top:

Basis

x1

x2

s1

s2

RHS

z

0

0

3

1

40

x1

1

0

2

1

6

x2

0

1

1

1

4

Identify the basic and nonbasic variables, state the corresponding basic feasible solution and its objective value, and explain how you can tell from the objective row that this tableau is optimal.

9.1; §9.3]

Exercise 9.3: Entering variable, ratio test, and pivot element

  Consider the tableau

Basis

x1

x2

s1

s2

s3

RHS

z

4

3

0

0

0

0

s1

2

3

1

0

0

6

s2

4

1

0

1

0

8

s3

3

4

0

0

1

12

Determine the entering variable, carry out the ratio test showing every ratio, name the leaving variable, and circle the pivot element.

9.2]

Core problems

Exercise 9.4: Perform one pivot

  Starting from the tableau in Exercise 9.3, perform the pivot you identified and write the resulting tableau. Verify that the entering column has become a unit column and that the objective value in the z-row has increased.

9.2]

Exercise 9.5: Solve a linear program in tableau form

  Use the simplex method in tableau form to solve

max z = x + 2y  s.t.  x + y 4, x + 3y 6, x,y 0.

Show every tableau, coloring or labelling the entering column, leaving row, and pivot element at each step. State the optimal solution and objective value. (You should reach the optimum in two pivots.)

9.2; §9.3]

Exercise 9.6: A full two-pivot solve

  Solve the following linear program in tableau form, using the most-negative-entry rule to choose the entering variable:

max z = 3x + 2y  s.t.  2x + y 10, x + 3y 15, x,y 0.

Show the starting tableau and each tableau after a pivot, and state the optimal solution, the optimal objective value, and the values of the slack variables at the optimum.

9.2; §9.3]

Exercise 9.7: Setting up a Big-M tableau

  Consider the linear program

max 4x + 3y  s.t.  x + y 4,x + 2y 10,x,y 0.

Introduce a surplus variable e1 and an artificial variable a1 for the first constraint and a slack s2 for the second, and write the objective as max 4x + 3y Ma1. Build the initial tableau with the objective row on top, and then price out the artificial variable a1 so that its objective-row entry becomes zero. Which variable enters first, and does the artificial variable leave on the first pivot?

9.4]

Concepts and connections

Exercise 9.8: The z-row sign convention

  The dictionary form of Chapter 7 selects an entering variable with a positive objective coefficient, while the tableau selects one with a negative z-row entry.

1.
Explain where the sign flip comes from, using the fact that the tableau stores the objective as the equation z cx = 0.
2.
A dictionary reads z = 12 + 3x1 2x2. Write the corresponding z-row of a tableau, including its RHS entry.
3.
Explain why the RHS entry of the z-row equals the current objective value even though every other coefficient is negated.

9.1, sign-convention panel]

Exercise 9.9: From tableau to dictionary

  Write the dictionary that corresponds to the tableau in Exercise 9.2, expressing z and each basic variable in terms of the nonbasic variables s1 and s2. Confirm that setting the nonbasic variables to zero reproduces the same basic feasible solution.

9.1; Chapter 7]

Exercise 9.10: Recognizing an unbounded problem

  While solving a maximization problem you obtain

Basis

x1

x2

s1

s2

RHS

z

2

0

0

1

10

x2

1

1

0

1

3

s1

3

0

1

2

5

Which variable should enter? Attempt the ratio test and explain why it fails. What does this tell you about the linear program?

9.3, ratio test step of the algorithm card]

Exercise 9.11: Reading off infeasibility

  Suppose the Big-M method applied to some maximization problem terminates (every objective-row entry nonnegative) with the tableau

Basis x y e1 s2 a1 RHS
z 0 0 M 2 0 8 3M
a1 0 0 1 1 1 3
x 1 0 0 1 0 5
y 0 1 1 0 0 2

Is the tableau optimal for the penalized problem? What is the value of the artificial variable a1, and what does it tell you about the original linear program? Explain the role of the 3M term in the objective value.

9.4]

Challenge problems

Exercise 9.12: Certifying unboundedness from a tableau

  Applying the simplex method to

max z = x1 + x2  s.t.  x1 x2 1, x1 + x2 2, x1,x2 0

produces, after one pivot, the tableau

Basis

x1

x2

s1

s2

RHS

z

0

2

1

0

1

x1

1

1

1

0

1

s2

0

0

1

1

3

1.
Detect the unboundedness: identify the entering variable and show that the ratio test finds no limiting row.
2.
Certify it: letting the entering variable equal t 0, write the resulting family of solutions x(t) in all four variables, and verify by direct substitution that x(t) satisfies both original constraints and the nonnegativity conditions for every t 0.
3.
Show that z(t) as t , and sketch the feasible region to explain geometrically which direction the certificate ray points in.

9.3; Example 7.18]

Selected Solutions

Solution

(Exercise 9.2) The basic variables are the row labels x1 and x2; the nonbasic variables are s1 and s2. Setting the nonbasic variables to zero and reading the RHS column gives the basic feasible solution

x1 = 6,x2 = 4,s1 = s2 = 0,z = 40.

The objective-row entries of the nonbasic variables are 3 and 1, both nonnegative. In this convention a positive entry means that increasing the corresponding nonbasic variable would decrease z, so no pivot can improve the objective and the tableau is optimal.

Solution

(Exercise 9.3) The most negative objective-row entry is 4, so x1 enters. The ratio test divides each RHS by the positive entries of the x1 column:

6 2 = 3,8 4 = 2,12 3 = 4.

The minimum ratio 2 occurs in the s2 row, so s2 leaves and the pivot element is the 4 in the s2 row of the x1 column.

Solution

(Exercise 9.5) Adding slacks s1,s2, the initial tableau has objective row (1,2,0,00).

First pivot: y enters ( 2 is most negative). Ratios: 41 = 4 and 63 = 2, so s2 leaves; the pivot element is the 3 in the s2 row. Dividing the pivot row by 3 and clearing the y column gives

Basis

x

y

s1

s2

RHS

z

1 3

0

0

2 3

4

s1

2 3

0

1

1 3

2

y

1 3

1

0

1 3

2

Second pivot: x enters ( 1 3). Ratios: 22 3 = 3 and 21 3 = 6, so s1 leaves; the pivot element is the 2 3 in the s1 row. The resulting tableau is

Basis

x

y

s1

s2

RHS

z

0

0

1 2

1 2

5

x

1

0

3 2

1 2

3

y

0

1

1 2

1 2

1

Every objective-row entry is nonnegative, so the tableau is optimal: (x,y) = (3,1) with z = 5.

Solution

(Exercise 9.6) Adding slacks s1,s2, the starting tableau is

Basis

x

y

s1

s2

RHS

z

3

2

0

0

0

s1

2

1

1

0

10

s2

1

3

0

1

15

First pivot: x enters ( 3 is most negative). Ratios: 102 = 5 and 151 = 15, so s1 leaves; the pivot element is the 2 in the s1 row. Scaling the pivot row by 1 2 and clearing the x column gives

Basis

x

y

s1

s2

RHS

z

0

1 2

3 2

0

15

x

1

1 2

1 2

0

5

s2

0

5 2

1 2

1

10

Second pivot: y enters ( 1 2). Ratios: 51 2 = 10 and 105 2 = 4, so s2 leaves; the pivot element is the 5 2 in the s2 row. The resulting tableau is

Basis

x

y

s1

s2

RHS

z

0

0

7 5

1 5

17

x

1

0

3 5

1 5

3

y

0

1

1 5

2 5

4

Every z-row entry is nonnegative, so the tableau is optimal: (x,y) = (3,4) with z = 17 and s1 = s2 = 0 (both constraints are tight at the optimum).

© 2026 Robert Hildebrand and contributors · Licensed CC BY-SA 4.0 · Sources and attribution · Book home