Skip to main content
Examonaut

Topic 5 · Lesson 4 of 5

Two-stage simplex and big-M

Constraints with ≥\geq

A constraint such as x≥2x \geq 2 needs a surplus variable: x−s=2x - s = 2 with s≥0s \geq 0. At the origin this would make s=−2s = -2, which is not allowed, so there is no starting solution. The fix is an artificial variable a≥0a \geq 0: x−s+a=2x - s + a = 2. At the origin, a=2a = 2. An artificial variable has no meaning in the problem, so the method must drive it to 0. There are two ways.

Worked example

Problem

Maximise P=2x+yP = 2x + y subject to x+y≤6x + y \leq 6, x≥2x \geq 2, x,y≥0x, y \geq 0. The equations are x+y+r=6x + y + r = 6 and x−s+a=2x - s + a = 2.

The two-stage simplex method

Stage 1: minimise the sum of the artificial variables, by maximising I=−aI = -a (the negative of their sum). Write II in terms of the non-basic variables: a=2−x+sa = 2 - x + s, so I=x−s−2I = x - s - 2, giving the row I−x+s=−2I - x + s = -2. Add this as an extra objective row below PP, and carry out the simplex algorithm using the II row to choose pivots:

b.v.xysraValuer110106a10−1012P−2−10000I−10100−2\begin{array}{c|ccccc|c} \text{b.v.} & x & y & s & r & a & \text{Value} \\ \hline r & 1 & 1 & 0 & 1 & 0 & 6 \\ a & 1 & 0 & -1 & 0 & 1 & 2 \\ P & -2 & -1 & 0 & 0 & 0 & 0 \\ I & -1 & 0 & 1 & 0 & 0 & -2 \end{array}

The xx column has −1-1 in the II row; ratios 6 and 2, so the pivot is in row aa. After the iteration:

b.v.xysraValuer0111−14x10−1012P0−1−2024I000010\begin{array}{c|ccccc|c} \text{b.v.} & x & y & s & r & a & \text{Value} \\ \hline r & 0 & 1 & 1 & 1 & -1 & 4 \\ x & 1 & 0 & -1 & 0 & 1 & 2 \\ P & 0 & -1 & -2 & 0 & 2 & 4 \\ I & 0 & 0 & 0 & 0 & 1 & 0 \end{array}

I=0I = 0, so the artificial variable is 0 and the first stage is complete. The current solution, x=2x = 2, y=0y = 0, is a vertex of the real feasible region.

Stage 2: delete the aa column and the II row, and continue with the PP row as normal:

b.v.xysrValuer01114x10−102P0−1−204\begin{array}{c|cccc|c} \text{b.v.} & x & y & s & r & \text{Value} \\ \hline r & 0 & 1 & 1 & 1 & 4 \\ x & 1 & 0 & -1 & 0 & 2 \\ P & 0 & -1 & -2 & 0 & 4 \end{array}

The most negative entry is −2-2, in the ss column; the only positive entry in that column is in row rr, so ss enters and rr leaves:

b.v.xysrValues01114x11016P010212\begin{array}{c|cccc|c} \text{b.v.} & x & y & s & r & \text{Value} \\ \hline s & 0 & 1 & 1 & 1 & 4 \\ x & 1 & 1 & 0 & 1 & 6 \\ P & 0 & 1 & 0 & 2 & 12 \end{array}

Optimal: x=6x = 6, y=0y = 0, P=12P = 12.

If stage 1 ends with I<0I < 0, the artificial variable cannot be removed and the problem has no feasible solution.

The big-M method

Instead of two stages, give the artificial variable a huge penalty: maximise P=2x+y−MaP = 2x + y - Ma, where MM is a very large positive number. Substitute a=2−x+sa = 2 - x + s:

P=2x+y−M(2−x+s)⇒P−(2+M)x−y+Ms=−2MP = 2x + y - M(2 - x + s) \quad\Rightarrow\quad P - (2 + M)x - y + Ms = -2M

Entries in the objective row are now of the form p+qMp + qM. To compare them, compare the coefficients of MM first; only if those are equal compare the numbers. So −(2+M)-(2 + M) is more negative than −1-1.

b.v.xysraValuer110106a10−1012P−2−M−1M00−2M\begin{array}{c|ccccc|c} \text{b.v.} & x & y & s & r & a & \text{Value} \\ \hline r & 1 & 1 & 0 & 1 & 0 & 6 \\ a & 1 & 0 & -1 & 0 & 1 & 2 \\ P & -2 - M & -1 & M & 0 & 0 & -2M \end{array}

The pivot is in the xx column, row aa (ratios 6 and 2):

b.v.xysraValuer0111−14x10−1012P0−1−202+M4\begin{array}{c|ccccc|c} \text{b.v.} & x & y & s & r & a & \text{Value} \\ \hline r & 0 & 1 & 1 & 1 & -1 & 4 \\ x & 1 & 0 & -1 & 0 & 1 & 2 \\ P & 0 & -1 & -2 & 0 & 2 + M & 4 \end{array}

Then ss enters (entry −2-2) and rr leaves:

b.v.xysraValues0111−14x110106P0102M12\begin{array}{c|ccccc|c} \text{b.v.} & x & y & s & r & a & \text{Value} \\ \hline s & 0 & 1 & 1 & 1 & -1 & 4 \\ x & 1 & 1 & 0 & 1 & 0 & 6 \\ P & 0 & 1 & 0 & 2 & M & 12 \end{array}

There are no negative entries (MM is positive and large), aa is non-basic so a=0a = 0, and the solution is again x=6x = 6, y=0y = 0, P=12P = 12.

Practise this topic

Both are part of Premium.