Simplex Method

The simplex method is a step-by-step way to solve a linear programming problem with matrices. You add a slack variable to each constraint, put the numbers in a table called a tableau, and pivot until the bottom row has no negative entries. Then you read off the maximum and the values that give it.

Before this lesson: Linear Programming, Augmented Matrices and Leontief Input-Output Model

The idea

In linear programming, the constraints form a system of inequalities, and the best value of the objective always happens at a corner of the feasible region. With two variables you can graph the region and test every corner. With three or more variables, or many constraints, graphing stops working.

The simplex method tests corners without a graph. It starts at the corner where every variable is 0. Each pivot moves to a neighboring corner with a larger value of the objective. When no move can raise the objective, you are at the maximum.

This lesson covers standard maximization problems: maximize the objective, every variable is nonnegative, and every constraint has the form (expression) ≤ (nonnegative number).

Simplex method steps

  1. Write each constraint as an equation by adding a slack variable: the unused amount of that resource. For example, x + 2y \le 8 becomes x + 2y + s_1 = 8 with s_1 \ge 0.
  2. Move every term of the objective to the left side: P = 4x + 6y becomes -4x - 6y + P = 0.
  3. Build the initial simplex tableau: one row per constraint, then the objective row at the bottom.
  4. Choose the pivot column: the column with the most negative entry in the bottom row.
  5. Choose the pivot row with the ratio test: divide each right-hand entry by the positive entry above it in the pivot column. The smallest ratio wins. Skip entries that are 0 or negative.
  6. Pivot: divide the pivot row by the pivot, then use row operations (see augmented matrices) to make every other entry in the pivot column 0.
  7. Repeat steps 4–6 until the bottom row has no negative entries. Then read the answer.

Reading a tableau. A basic variable has a column with one 1 and zeros everywhere else. Its value is the right-hand entry in the row of that 1. Every other variable (a nonbasic variable) equals 0. The bottom-right entry is the current value of P.

\text{ratio} = \dfrac{\text{right-hand entry}}{\text{positive entry in the pivot column}}

Simplex method examples

Examples 1 and 2 solve the same problem: maximize P = 4x + 6y subject to x + 2y \le 8, 3x + 2y \le 12, x \ge 0 and y \ge 0.

Example 1: Setting up the initial tableau

x + 2y + s_1 = 8

Add slack variable s_1 to the first constraint.

3x + 2y + s_2 = 12

Add slack variable s_2 to the second constraint.

-4x - 6y + P = 0

Subtract 4x and 6y from both sides of P = 4x + 6y.

x = 0,\ y = 0

Start at the origin, a corner of the region.

s_1 = 8,\ s_2 = 12,\ P = 0

Read the starting values: nothing is made yet, so every resource is unused.

Basicxys_1s_2RHS
s_112108
s_2320112
P−4−6000

Answer: the tableau above, where RHS means right-hand side. The P column never changes, so most books leave it out, as we do here. The starting solution is x = 0, y = 0, s_1 = 8, s_2 = 12 and P = 0.

Example 2: Solving with two pivots

Start from the tableau in Example 1. Call its rows R_1, R_2 and R_P.

-6 \lt -4

The most negative entry in the bottom row is −6, so the y column is the pivot column.

\tfrac{8}{2} = 4,\ \tfrac{12}{2} = 6

Ratio test: divide each right-hand entry by the y entry.

4 \lt 6

The smaller ratio is in row 1, so the pivot is the 2 in row 1.

R_1 = \tfrac{1}{2}(1,\ 2,\ 1,\ 0 \mid 8) = (\tfrac{1}{2},\ 1,\ \tfrac{1}{2},\ 0 \mid 4)

Divide row 1 by the pivot, 2 (see multiplying and dividing fractions).

R_2 = (3,\ 2,\ 0,\ 1 \mid 12) - 2(\tfrac{1}{2},\ 1,\ \tfrac{1}{2},\ 0 \mid 4) = (2,\ 0,\ -1,\ 1 \mid 4)

Subtract 2 times the new row 1 to make the y entry 0.

R_P = (-4,\ -6,\ 0,\ 0 \mid 0) + 6(\tfrac{1}{2},\ 1,\ \tfrac{1}{2},\ 0 \mid 4) = (-1,\ 0,\ 3,\ 0 \mid 24)

Add 6 times the new row 1 to make the y entry 0.

x = 0,\ y = 4,\ P = 24

Read the new corner: y is now basic. The bottom row still has −1, so keep going.

\tfrac{4}{1/2} = 8,\ \tfrac{4}{2} = 2

The x column is the pivot column now. Ratio test on its positive entries.

2 \lt 8

The smaller ratio is in row 2, so the pivot is the 2 in row 2.

R_2 = \tfrac{1}{2}(2,\ 0,\ -1,\ 1 \mid 4) = (1,\ 0,\ -\tfrac{1}{2},\ \tfrac{1}{2} \mid 2)

Divide row 2 by the pivot, 2.

R_1 = (\tfrac{1}{2},\ 1,\ \tfrac{1}{2},\ 0 \mid 4) - \tfrac{1}{2}(1,\ 0,\ -\tfrac{1}{2},\ \tfrac{1}{2} \mid 2) = (0,\ 1,\ \tfrac{3}{4},\ -\tfrac{1}{4} \mid 3)

Subtract one half of the new row 2 to make the x entry 0.

R_P = (-1,\ 0,\ 3,\ 0 \mid 24) + 1(1,\ 0,\ -\tfrac{1}{2},\ \tfrac{1}{2} \mid 2) = (0,\ 0,\ \tfrac{5}{2},\ \tfrac{1}{2} \mid 26)

Add the new row 2 to make the x entry 0.

Basicxys_1s_2RHS
y01\tfrac{3}{4}-\tfrac{1}{4}3
x10-\tfrac{1}{2}\tfrac{1}{2}2
P00\tfrac{5}{2}\tfrac{1}{2}26
x = 2,\ y = 3

The bottom row has no negative entries, so this tableau is final. Read the basic variables.

4(2) + 6(3) = 8 + 18 = 26

Check: the objective at (2, 3) matches the bottom-right entry.

Graph of the feasible region for maximizing P = 4x + 6y with x + 2y ≤ 8, 3x + 2y ≤ 12, x ≥ 0 and y ≥ 0. The shaded region has corners (0, 0), (4, 0), (2, 3) and (0, 4), where P equals 0, 16, 26 and 24. Dashed orange arrows show the simplex method’s path: pivot 1 moves from (0, 0) up to (0, 4), and pivot 2 moves to (2, 3), the maximum P = 26.
Each pivot moves to a neighboring corner with a larger P: from 0 to 24 to 26. The corner (4, 0) is never visited.

Answer: the maximum is P = 26 at x = 2, y = 3. Both slack variables are 0, so both resources are used up.

Example 3: Reading the answer from a final tableau

A problem asks you to maximize P = 8x + 6y subject to x + 2y \le 28, x \le 10 and y \le 16, with x and y nonnegative. After two pivots the tableau is:

Basicxys_1s_2s_3RHS
y01\tfrac{1}{2}-\tfrac{1}{2}09
x1001010
s_300-\tfrac{1}{2}\tfrac{1}{2}17
P00350134

Is the tableau final, and what is the solution?

0,\ 0,\ 3,\ 5,\ 0 \ge 0

No entry in the bottom row is negative, so the tableau is final.

y = 9

The y column has its 1 in row 1, whose right-hand entry is 9.

x = 10

The x column has its 1 in row 2.

s_3 = 7

The s_3 column has its 1 in row 3.

s_1 = 0,\ s_2 = 0

The s_1 and s_2 columns are not basic, so they equal 0.

P = 134

Read the bottom-right entry.

8(10) + 6(9) = 80 + 54 = 134

Check the objective.

Answer: the maximum is P = 134 at x = 10, y = 9. The slack s_3 = 7 means the third constraint has room left: y is 9, which is 7 below its limit of 16.

Example 4: Three variables

Maximize P = 3x + 5y + 3z subject to 2x + 2y + z \le 8 and x + 3y + 2z \le 14, with x, y and z nonnegative. A graph would need three dimensions, but the steps are the same.

Basicxyzs_1s_2RHS
s_1221108
s_21320114
P−3−5−3000
-5 \text{ is most negative}

The y column is the first pivot column.

\tfrac{8}{2} = 4,\ \tfrac{14}{3} \approx 4.67

Ratio test: row 1 has the smaller ratio, so the pivot is the 2 in row 1.

R_1 = \tfrac{1}{2}(2,\ 2,\ 1,\ 1,\ 0 \mid 8) = (1,\ 1,\ \tfrac{1}{2},\ \tfrac{1}{2},\ 0 \mid 4)

Divide row 1 by 2.

R_2 = (1,\ 3,\ 2,\ 0,\ 1 \mid 14) - 3(1,\ 1,\ \tfrac{1}{2},\ \tfrac{1}{2},\ 0 \mid 4) = (-2,\ 0,\ \tfrac{1}{2},\ -\tfrac{3}{2},\ 1 \mid 2)

Subtract 3 times the new row 1.

R_P = (-3,\ -5,\ -3,\ 0,\ 0 \mid 0) + 5(1,\ 1,\ \tfrac{1}{2},\ \tfrac{1}{2},\ 0 \mid 4) = (2,\ 0,\ -\tfrac{1}{2},\ \tfrac{5}{2},\ 0 \mid 20)

Add 5 times the new row 1.

-\tfrac{1}{2} \lt 0

The z column still has a negative entry, so it is the next pivot column.

\tfrac{4}{1/2} = 8,\ \tfrac{2}{1/2} = 4

Ratio test: row 2 has the smaller ratio, so the pivot is the \tfrac{1}{2} in row 2.

R_2 = 2(-2,\ 0,\ \tfrac{1}{2},\ -\tfrac{3}{2},\ 1 \mid 2) = (-4,\ 0,\ 1,\ -3,\ 2 \mid 4)

Divide row 2 by \tfrac{1}{2}, which is the same as multiplying by 2.

R_1 = (1,\ 1,\ \tfrac{1}{2},\ \tfrac{1}{2},\ 0 \mid 4) - \tfrac{1}{2}(-4,\ 0,\ 1,\ -3,\ 2 \mid 4) = (3,\ 1,\ 0,\ 2,\ -1 \mid 2)

Subtract one half of the new row 2.

R_P = (2,\ 0,\ -\tfrac{1}{2},\ \tfrac{5}{2},\ 0 \mid 20) + \tfrac{1}{2}(-4,\ 0,\ 1,\ -3,\ 2 \mid 4) = (0,\ 0,\ 0,\ 1,\ 1 \mid 22)

Add one half of the new row 2. No negatives remain.

y = 2,\ z = 4,\ x = 0

Read the basic variables: y from row 1, z from row 2. The x column is not basic.

3(0) + 5(2) + 3(4) = 0 + 10 + 12 = 22

Check the objective.

Answer: the maximum is P = 22 at x = 0, y = 2, z = 4. Making none of product x is part of the best plan.

Example 5: Planning production (word problem)

A furniture shop makes benches and shelves. A bench needs 2 hours of cutting and 1 hour of finishing. A shelf needs 1 hour of cutting and 1 hour of finishing. Each week the shop has 60 cutting hours and 44 finishing hours, and it can sell at most 32 shelves. The profit is $40 per bench and $80 per shelf. How many of each should it make to maximize profit?

x = \text{benches},\ y = \text{shelves}

Define the variables.

P = 40x + 80y

Write the profit function to maximize (see cost, revenue and profit functions).

2x + y \le 60,\ x + y \le 44,\ y \le 32

Write the cutting, finishing and sales limits.

2x + y + s_1 = 60

Add slack variables to each constraint. Here s_1 is unused cutting time.

x + y + s_2 = 44,\ y + s_3 = 32

The other two: unused finishing time and unsold shelf demand.

-40x - 80y + P = 0

Rewrite the objective for the bottom row.

Basicxys_1s_2s_3RHS
s_12110060
s_21101044
s_30100132
P−40−800000
\tfrac{60}{1} = 60,\ \tfrac{44}{1} = 44,\ \tfrac{32}{1} = 32

The y column (−80) is the pivot column. Row 3 has the smallest ratio, so its 1 is the pivot.

R_1 = (2,\ 1,\ 1,\ 0,\ 0 \mid 60) - (0,\ 1,\ 0,\ 0,\ 1 \mid 32) = (2,\ 0,\ 1,\ 0,\ -1 \mid 28)

The pivot is already 1. Subtract row 3 from row 1.

R_2 = (1,\ 1,\ 0,\ 1,\ 0 \mid 44) - (0,\ 1,\ 0,\ 0,\ 1 \mid 32) = (1,\ 0,\ 0,\ 1,\ -1 \mid 12)

Subtract row 3 from row 2.

R_P = (-40,\ -80,\ 0,\ 0,\ 0 \mid 0) + 80(0,\ 1,\ 0,\ 0,\ 1 \mid 32) = (-40,\ 0,\ 0,\ 0,\ 80 \mid 2560)

Add 80 times row 3. The x column still shows −40.

\tfrac{28}{2} = 14,\ \tfrac{12}{1} = 12

Ratio test in the x column. Skip row 3, whose x entry is 0.

12 \lt 14

Row 2 wins, so the pivot is the 1 in row 2.

R_1 = (2,\ 0,\ 1,\ 0,\ -1 \mid 28) - 2(1,\ 0,\ 0,\ 1,\ -1 \mid 12) = (0,\ 0,\ 1,\ -2,\ 1 \mid 4)

The pivot is 1. Subtract 2 times row 2 from row 1.

R_P = (-40,\ 0,\ 0,\ 0,\ 80 \mid 2560) + 40(1,\ 0,\ 0,\ 1,\ -1 \mid 12) = (0,\ 0,\ 0,\ 40,\ 40 \mid 3040)

Add 40 times row 2. Row 3 already has a 0 in the x column. No negatives remain.

x = 12,\ y = 32,\ s_1 = 4

Read the basic variables: x from row 2, y from row 3, s_1 from row 1.

40(12) + 80(32) = 480 + 2560 = 3040

Check the profit.

Answer: make 12 benches and 32 shelves for a maximum weekly profit of $3,040. Finishing time and shelf demand are used up, and 4 cutting hours are left over (s_1 = 4).

Common mistakes

MistakeExample of the errorFix
Choosing the pivot column by the largest positive numberPicking the s₁ column in Example 2 because 3 is the biggest bottom-row entryPick the most negative entry in the bottom row. Positive entries mean that variable cannot raise P.
Choosing the pivot row by the largest entryPicking row 2 in Example 4 because 3 is bigger than 2Use the ratio test: right-hand entry divided by the pivot-column entry. Row 1 has ratio 4, the smaller one.
Using 0 or negative entries in the ratio testDividing 32 by 0 in Example 5’s second pivotOnly positive entries in the pivot column get a ratio. Skip the rest.
Forgetting the minus signs in the objective rowWriting 4, 6 instead of −4, −6 in Example 1Move every term to the left: P = 4x + 6y becomes −4x − 6y + P = 0.
Reading a value from the wrong rowSaying x = 9 in Example 3 because x appears firstFind the 1 in the variable’s column, then read the right-hand entry in that row.
Stopping too earlyStopping in Example 2 at P = 24Keep pivoting until the bottom row has no negative entries.

Related ideas

Every two-person zero-sum game can be written as a linear program, which is how larger mixed strategy games are solved.

Unbounded problems

If the pivot column has no positive entries, the ratio test has nothing to compare. Then P can grow without limit, and the problem is unbounded: it has no maximum. In a real business problem this usually means a constraint was left out.

Ties and other cases

If two columns tie for most negative, either one works. If the ratio test ties, either row works, but the next tableau may have a basic variable equal to 0. If a nonbasic variable has a 0 in the final bottom row, the problem may have more than one best solution.

Connection to row reduction

Each pivot uses the same row operations as Gaussian elimination, so the simplex method is row reduction with a rule for choosing pivots. Problems with “≥” constraints or a minimum need more work. The next lesson, Simplex Method for Minimization, solves them with the dual problem.

Shadow prices

In the final bottom row, the entry under each slack variable is its shadow price: how much P would rise for one more unit of that resource. In Example 5, one more finishing hour would add $40 of profit, while one more cutting hour would add nothing, since 4 are already unused.

Practice problems

  1. Write the initial simplex tableau for: maximize P = 7x + 5y subject to 3x + y \le 21, x + 2y \le 16, x \ge 0, y \ge 0.
  2. For the tableau in Problem 1, find the pivot column, the pivot row and the pivot.
  3. Carry out the pivot from Problem 2. Is the new tableau final?
  4. A final tableau for maximizing P = 8x + 7y has rows (0,\ 1,\ 1,\ -\tfrac{1}{2},\ 0 \mid 11), (1,\ 0,\ 0,\ \tfrac{1}{2},\ 0 \mid 25), (0,\ 0,\ -2,\ \tfrac{1}{2},\ 1 \mid 11) and bottom row (0,\ 0,\ 7,\ \tfrac{1}{2},\ 0 \mid 277), with columns x, y, s_1, s_2, s_3. Read the solution.
  5. A tableau with columns x, y, s_1, s_2, s_3 has rows (\tfrac{1}{2},\ 1,\ \tfrac{1}{2},\ 0,\ 0 \mid 13), (1,\ 0,\ 0,\ 1,\ 0 \mid 36), (1,\ 0,\ -1,\ 0,\ 1 \mid 2) and bottom row (-3,\ 0,\ 4,\ 0,\ 0 \mid 104). Is it final? If not, find the next pivot.
  6. Use the simplex method to maximize P = 5x + 4y subject to 2x + y \le 10, x + y \le 7, x \ge 0, y \ge 0.
  7. Use the simplex method to maximize P = 7x + y subject to 2x + 2y \le 28, x \le 10, y \le 30, x \ge 0, y \ge 0.
  8. Use the simplex method to maximize P = 3x + 8y + 5z subject to x + 2y + 2z \le 38, 3x + 2y + z \le 28, with x, y and z nonnegative.
  9. A candle maker makes small and large candle batches. A small batch takes 1 hour of pouring and 2 hours of curing; a large batch takes 2 hours of pouring and 1 hour of curing. There are 56 pouring hours and 30 curing hours, and at most 24 large batches can be sold. Profit is $20 per small batch and $40 per large batch. Find the best plan.
  10. Maximize P = x + 2y subject to x - y \le 3, x - 2y \le 4, x \ge 0, y \ge 0. What happens?
Show answers

1.

3x + y + s_1 = 21

Add slack variable s_1 to the first constraint.

x + 2y + s_2 = 16

Add slack variable s_2 to the second constraint.

-7x - 5y + P = 0

Rewrite the objective.

(3,\ 1,\ 1,\ 0 \mid 21),\ (1,\ 2,\ 0,\ 1 \mid 16)

Constraint rows, with columns x, y, s_1, s_2.

(-7,\ -5,\ 0,\ 0 \mid 0)

Bottom row.

Answer: rows (3, 1, 1, 0 | 21) and (1, 2, 0, 1 | 16), bottom row (−7, −5, 0, 0 | 0)

2.

-7 \lt -5

The most negative bottom entry is in the x column.

\tfrac{21}{3} = 7,\ \tfrac{16}{1} = 16

Ratio test on the x column.

7 \lt 16

Row 1 has the smaller ratio.

Answer: x column, row 1, pivot 3

3.

R_1 = \tfrac{1}{3}(3,\ 1,\ 1,\ 0 \mid 21) = (1,\ \tfrac{1}{3},\ \tfrac{1}{3},\ 0 \mid 7)

Divide row 1 by the pivot, 3.

R_2 = (1,\ 2,\ 0,\ 1 \mid 16) - (1,\ \tfrac{1}{3},\ \tfrac{1}{3},\ 0 \mid 7) = (0,\ \tfrac{5}{3},\ -\tfrac{1}{3},\ 1 \mid 9)

Subtract the new row 1 from row 2.

R_P = (-7,\ -5,\ 0,\ 0 \mid 0) + 7(1,\ \tfrac{1}{3},\ \tfrac{1}{3},\ 0 \mid 7) = (0,\ -\tfrac{8}{3},\ \tfrac{7}{3},\ 0 \mid 49)

Add 7 times the new row 1.

-\tfrac{8}{3} \lt 0

The bottom row still has a negative entry.

Answer: rows (1, 1/3, 1/3, 0 | 7) and (0, 5/3, −1/3, 1 | 9), bottom row (0, −8/3, 7/3, 0 | 49); not final, so the y column is pivoted next

4.

0,\ 0,\ 7,\ \tfrac{1}{2},\ 0 \ge 0

No negative bottom entries, so the tableau is final.

y = 11

The y column has its 1 in row 1.

x = 25

The x column has its 1 in row 2.

s_3 = 11

The s_3 column has its 1 in row 3; s_1 and s_2 are 0.

8(25) + 7(11) = 200 + 77 = 277

Check the objective against the bottom-right entry.

Answer: maximum P = 277 at x = 25, y = 11

5.

-3 \lt 0

The bottom row has a negative entry, so the tableau is not final; the x column is the pivot column.

\tfrac{13}{1/2} = 26,\ \tfrac{36}{1} = 36,\ \tfrac{2}{1} = 2

Ratio test on the x column.

2 \lt 26 \lt 36

Row 3 has the smallest ratio.

Answer: not final; pivot on the 1 in row 3 of the x column

6.

(2,\ 1,\ 1,\ 0 \mid 10),\ (1,\ 1,\ 0,\ 1 \mid 7),\ (-5,\ -4,\ 0,\ 0 \mid 0)

Set up the tableau.

\tfrac{10}{2} = 5,\ \tfrac{7}{1} = 7

The x column (−5) is the pivot column; row 1 wins, pivot 2.

R_1 = (1,\ \tfrac{1}{2},\ \tfrac{1}{2},\ 0 \mid 5)

Divide row 1 by 2.

R_2 = (0,\ \tfrac{1}{2},\ -\tfrac{1}{2},\ 1 \mid 2)

Subtract the new row 1 from row 2.

R_P = (0,\ -\tfrac{3}{2},\ \tfrac{5}{2},\ 0 \mid 25)

Add 5 times the new row 1 to the bottom row.

\tfrac{5}{1/2} = 10,\ \tfrac{2}{1/2} = 4

The y column is next; row 2 wins, pivot \tfrac{1}{2}.

R_2 = (0,\ 1,\ -1,\ 2 \mid 4)

Multiply row 2 by 2.

R_1 = (1,\ 0,\ 1,\ -1 \mid 3)

Subtract one half of the new row 2 from row 1.

R_P = (0,\ 0,\ 1,\ 3 \mid 31)

Add three halves of the new row 2. No negatives remain.

5(3) + 4(4) = 15 + 16 = 31

Check the objective at x = 3, y = 4.

Answer: maximum P = 31 at x = 3, y = 4

7.

(2,\ 2,\ 1,\ 0,\ 0 \mid 28),\ (1,\ 0,\ 0,\ 1,\ 0 \mid 10),\ (0,\ 1,\ 0,\ 0,\ 1 \mid 30)

Set up the constraint rows.

(-7,\ -1,\ 0,\ 0,\ 0 \mid 0)

Set up the bottom row.

\tfrac{28}{2} = 14,\ \tfrac{10}{1} = 10

The x column is the pivot column; skip row 3 (entry 0). Row 2 wins, pivot 1.

R_1 = (0,\ 2,\ 1,\ -2,\ 0 \mid 8)

Subtract 2 times row 2 from row 1.

R_P = (0,\ -1,\ 0,\ 7,\ 0 \mid 70)

Add 7 times row 2 to the bottom row.

\tfrac{8}{2} = 4,\ \tfrac{30}{1} = 30

The y column is next; row 1 wins, pivot 2.

R_1 = (0,\ 1,\ \tfrac{1}{2},\ -1,\ 0 \mid 4)

Divide row 1 by 2.

R_3 = (0,\ 0,\ -\tfrac{1}{2},\ 1,\ 1 \mid 26)

Subtract the new row 1 from row 3.

R_P = (0,\ 0,\ \tfrac{1}{2},\ 6,\ 0 \mid 74)

Add the new row 1 to the bottom row. No negatives remain.

7(10) + 4 = 70 + 4 = 74

Check the objective at x = 10, y = 4.

Answer: maximum P = 74 at x = 10, y = 4 (with 26 left in the third constraint)

8.

(1,\ 2,\ 2,\ 1,\ 0 \mid 38),\ (3,\ 2,\ 1,\ 0,\ 1 \mid 28),\ (-3,\ -8,\ -5,\ 0,\ 0 \mid 0)

Set up the tableau with columns x, y, z, s_1, s_2.

\tfrac{38}{2} = 19,\ \tfrac{28}{2} = 14

The y column (−8) is the pivot column; row 2 wins, pivot 2.

R_2 = (\tfrac{3}{2},\ 1,\ \tfrac{1}{2},\ 0,\ \tfrac{1}{2} \mid 14)

Divide row 2 by 2.

R_1 = (-2,\ 0,\ 1,\ 1,\ -1 \mid 10)

Subtract 2 times the new row 2 from row 1.

R_P = (9,\ 0,\ -1,\ 0,\ 4 \mid 112)

Add 8 times the new row 2 to the bottom row.

\tfrac{10}{1} = 10,\ \tfrac{14}{1/2} = 28

The z column is next; row 1 wins, pivot 1.

R_2 = (\tfrac{5}{2},\ 1,\ 0,\ -\tfrac{1}{2},\ 1 \mid 9)

Subtract one half of row 1 from row 2.

R_P = (7,\ 0,\ 0,\ 1,\ 3 \mid 122)

Add row 1 to the bottom row. No negatives remain.

3(0) + 8(9) + 5(10) = 0 + 72 + 50 = 122

Check the objective at x = 0, y = 9, z = 10.

Answer: maximum P = 122 at x = 0, y = 9, z = 10

9.

P = 20x + 40y

Let x = small batches and y = large batches.

(1,\ 2,\ 1,\ 0,\ 0 \mid 56),\ (2,\ 1,\ 0,\ 1,\ 0 \mid 30),\ (0,\ 1,\ 0,\ 0,\ 1 \mid 24)

Constraint rows for pouring, curing and sales.

(-20,\ -40,\ 0,\ 0,\ 0 \mid 0)

Bottom row.

\tfrac{56}{2} = 28,\ \tfrac{30}{1} = 30,\ \tfrac{24}{1} = 24

The y column is the pivot column; row 3 wins, pivot 1.

R_1 = (1,\ 0,\ 1,\ 0,\ -2 \mid 8)

Subtract 2 times row 3 from row 1.

R_2 = (2,\ 0,\ 0,\ 1,\ -1 \mid 6)

Subtract row 3 from row 2.

R_P = (-20,\ 0,\ 0,\ 0,\ 40 \mid 960)

Add 40 times row 3 to the bottom row.

\tfrac{8}{1} = 8,\ \tfrac{6}{2} = 3

The x column is next; skip row 3 (entry 0). Row 2 wins, pivot 2.

R_2 = (1,\ 0,\ 0,\ \tfrac{1}{2},\ -\tfrac{1}{2} \mid 3)

Divide row 2 by 2.

R_1 = (0,\ 0,\ 1,\ -\tfrac{1}{2},\ -\tfrac{3}{2} \mid 5)

Subtract the new row 2 from row 1.

R_P = (0,\ 0,\ 0,\ 10,\ 30 \mid 1020)

Add 20 times the new row 2 to the bottom row. No negatives remain.

20(3) + 40(24) = 60 + 960 = 1020

Check the profit at x = 3, y = 24.

Answer: 3 small and 24 large batches for a maximum profit of $1,020 (5 pouring hours left over)

10.

(1,\ -1,\ 1,\ 0 \mid 3),\ (1,\ -2,\ 0,\ 1 \mid 4),\ (-1,\ -2,\ 0,\ 0 \mid 0)

Set up the tableau.

-2 \lt -1

The y column is the pivot column.

-1,\ -2

Its entries above the bottom row are both negative, so no ratio can be formed.

Answer: the problem is unbounded; P has no maximum (for example, x = 0 and any large y is allowed)

Simplex method FAQ

What is the simplex method used for?

It solves linear programming problems, such as finding the production plan with the most profit or the least cost. It works with any number of variables, so it handles problems too big to graph.

What is a slack variable?

A slack variable turns a ≤ constraint into an equation. It stands for the unused part of the resource, so it is never negative.

How do you choose the pivot in the simplex method?

The pivot column has the most negative entry in the bottom row. In that column, divide each right-hand entry by its positive entry; the row with the smallest ratio is the pivot row.

How do you know when the simplex method is finished?

Stop when the bottom row has no negative entries. If a pivot column has no positive entries, stop too: the problem is unbounded.

Summary

  • Add a slack variable to each ≤ constraint and write the objective as −(coefficients) + P = 0.
  • Pivot column: most negative bottom-row entry. Pivot row: smallest ratio of right-hand entry to positive pivot-column entry.
  • Divide the pivot row by the pivot, then clear the rest of the pivot column with row operations.
  • Stop when the bottom row has no negatives; read basic variables from their rows and P from the bottom-right entry.
  • Each pivot moves to a better corner of the feasible region; no positive ratio means the problem is unbounded.

Previous lesson: Leontief Input-Output Model

Next lesson: Simplex Method for Minimization

Back to the Finite Math and Business Calculus Index