Six linear programming problems solved step by step with the simplex method: a graphical warm-up, three full tableau solutions, a minimization, an unbounded problem and a problem with infinitely many optimal solutions. Every tableau is shown, so you can check each pivot.
Contents2 sections
The simplex method in five steps
For a problem “maximize subject to , ” with :
- Add a slack variable to each constraint to make it an equation: , .
- Write the tableau. The objective row holds (we write ). The slack variables form the first basis, which is the corner .
- Entering variable: the column with the most negative entry in the row. If no entry is negative, the current solution is optimal.
- Ratio test: for each row with a positive entry in that column, divide the right-hand side by that entry. The smallest ratio picks the leaving row. If no entry is positive, the problem is unbounded.
- Pivot: divide the pivot row by the pivot, then clear the rest of the column with row operations. Go back to step 3.
Each pivot moves from one corner of the feasible region to a neighboring corner with a value of at least as large.
Problem 1
Solve graphically: maximize subject to , , .
Hint
An optimum of a linear program is always reached at a corner of the feasible region. List the corners.
View Solution
The corners are where the boundary lines meet:
- :
- on :
- on :
- Intersection of and : subtracting gives , so :
The largest value is at .
Answer:
Problem 2
Use the simplex method: maximize subject to , , , .
Hint
Add . The first entering variable is (coefficient in the row).
View Solution
| Basis | RHS | |||||
|---|---|---|---|---|---|---|
| 1 | 0 | 1 | 0 | 0 | 4 | |
| 0 | 2 | 0 | 1 | 0 | 12 | |
| 3 | 2 | 0 | 0 | 1 | 18 | |
| −3 | −5 | 0 | 0 | 0 | 0 |
Pivot 1. Most negative in the row: , so enters. Ratios: , (the row has 0 and is skipped). Smallest is 6, so leaves. Pivot on the 2.
| Basis | RHS | |||||
|---|---|---|---|---|---|---|
| 1 | 0 | 1 | 0 | 0 | 4 | |
| 0 | 1 | 0 | 0 | 6 | ||
| 3 | 0 | 0 | −1 | 1 | 6 | |
| −3 | 0 | 0 | 0 | 30 |
Pivot 2. Now enters (). Ratios: , . So leaves; pivot on the 3.
| Basis | RHS | |||||
|---|---|---|---|---|---|---|
| 0 | 0 | 1 | 2 | |||
| 0 | 1 | 0 | 0 | 6 | ||
| 1 | 0 | 0 | 2 | |||
| 0 | 0 | 0 | 1 | 36 |
No negative entries remain in the row, so this is optimal. Read the basic variables from the RHS column: , , (the first constraint has 2 units of slack), .
Answer:
Problem 3
Maximize subject to
Hint
After the first pivot, a negative entry appears under even though the and entries are positive. Keep going.
View Solution
| Basis | RHS | ||||||
|---|---|---|---|---|---|---|---|
| 2 | 3 | 1 | 1 | 0 | 0 | 5 | |
| 4 | 1 | 2 | 0 | 1 | 0 | 11 | |
| 3 | 4 | 2 | 0 | 0 | 1 | 8 | |
| −5 | −4 | −3 | 0 | 0 | 0 | 0 |
Pivot 1. enters (). Ratios: , , . The smallest is 2.5, so leaves.
| Basis | RHS | ||||||
|---|---|---|---|---|---|---|---|
| 1 | 0 | 0 | |||||
| 0 | −5 | 0 | −2 | 1 | 0 | 1 | |
| 0 | 0 | 1 | |||||
| 0 | 0 | 0 |
Pivot 2. The only negative entry is under , so enters. Ratios (positive entries only): row , row . So leaves.
| Basis | RHS | ||||||
|---|---|---|---|---|---|---|---|
| 1 | 2 | 0 | 2 | 0 | −1 | 2 | |
| 0 | −5 | 0 | −2 | 1 | 0 | 1 | |
| 0 | −1 | 1 | −3 | 0 | 2 | 1 | |
| 0 | 3 | 0 | 1 | 0 | 1 | 13 |
All -row entries are now : optimal. , , (nonbasic), and . Check the constraints: , , .
Answer:
Problem 4
Minimize subject to , , .
Hint
Minimizing is the same as maximizing .
View Solution
Maximize instead. The row holds .
| Basis | RHS | ||||
|---|---|---|---|---|---|
| 1 | 1 | 1 | 0 | 4 | |
| −1 | 1 | 0 | 1 | 2 | |
| 1 | −3 | 0 | 0 | 0 |
Pivot 1. enters (). Ratios: , . So leaves.
| Basis | RHS | ||||
|---|---|---|---|---|---|
| 2 | 0 | 1 | −1 | 2 | |
| −1 | 1 | 0 | 1 | 2 | |
| −2 | 0 | 0 | 3 | 6 |
Pivot 2. enters (). Only the row has a positive entry: . So leaves.
| Basis | RHS | ||||
|---|---|---|---|---|---|
| 1 | 0 | 1 | |||
| 0 | 1 | 3 | |||
| 0 | 0 | 1 | 2 | 8 |
Optimal: , , . Since , the minimum of is . Check: .
Answer:
Problem 5
Maximize subject to , , . What does the simplex method report?
Hint
Do one pivot, then look closely at the column of the entering variable.
View Solution
First pivot: and both have ; take . Only the first row has a positive entry, so leaves.
| Basis | RHS | ||||
|---|---|---|---|---|---|
| 1 | −1 | 1 | 0 | 1 | |
| 0 | −1 | 2 | 1 | 4 | |
| 0 | −2 | 1 | 0 | 1 |
Now enters (), but every entry in the column is negative: no row limits how far can grow. The ratio test finds nothing, so the problem is unbounded.
Concretely, with the tableau gives , , all feasible, and .
Answer: unbounded, no maximum
Problem 6
Maximize subject to , , . Is the optimal solution unique?
Hint
In the final tableau, look at the -row entry of a nonbasic variable.
View Solution
enters (); the only positive entry is in the first row, ratio , so leaves.
| Basis | RHS | ||||
|---|---|---|---|---|---|
| 1 | 0 | 4 | |||
| 1 | 0 | 0 | 1 | 6 | |
| 0 | 0 | 2 | 0 | 16 |
The row has no negative entry, so at . But the nonbasic variable has a zero in the row: bringing it in does not change . Pivoting in (ratios and , so leaves) gives the corner , also with .
The reason is visible in the data: , parallel to the first constraint. Every point of the segment from to is optimal.
Answer: , infinitely many optimal points
Frequently asked questions
What if a constraint is “” or an equation?
Then the slack variables do not give a starting corner. Add artificial variables and use the Big M method or the two-phase method, which first finds a feasible corner and then optimizes.
What does a tie in the ratio test mean?
A tie means the next corner is degenerate (a basic variable becomes 0). Pick either row; in rare cases the method can cycle, which a rule such as Bland’s rule (always choose the lowest-index variable) prevents.
Is the simplex method the same as solving graphically?
It follows the same idea, moving from corner to corner, but works with any number of variables, where drawing is impossible.