Worked example: a firm produces three construction materials — concrete, mortar and grout — each consuming a limited resource of labour, blending time and storage. We compute the optimal production strategy using the Simplex method.
Resource table Resource Concrete Mortar Grout Availability Labour 1 hr 2 hr 2 hr 20 hr Blending time 2 hr 1 hr 2 hr 20 hr Storage 2 m³ 2 m³ 1 m³ 20 m³ Sales price $20 $30 $40 — Manufacturing cost $10 $18 $28 —
Optimisation problem max x 1 , x 2 , x 3 10 x 1 + 12 x 2 + 12 x 3 s.t. x 1 + 2 x 2 + 2 x 3 ≤ 20 2 x 1 + x 2 + 2 x 3 ≤ 20 2 x 1 + 2 x 2 + x 3 ≤ 20 x 1 , x 2 , x 3 ≥ 0 \begin{aligned} & \max_{x_1,x_2,x_3} \; 10x_1+12x_2+12x_3 \\ & \text{s.t. } x_1+2x_2+2x_3\le 20 \\ & \quad\;\; 2x_1+x_2+2x_3\le 20 \\ & \quad\;\; 2x_1+2x_2+x_3\le 20 \\ & \quad\;\; x_1,x_2,x_3\ge 0 \end{aligned} x 1 , x 2 , x 3 max 10 x 1 + 12 x 2 + 12 x 3 s.t. x 1 + 2 x 2 + 2 x 3 ≤ 20 2 x 1 + x 2 + 2 x 3 ≤ 20 2 x 1 + 2 x 2 + x 3 ≤ 20 x 1 , x 2 , x 3 ≥ 0 After putting the problem in standard form we have:
min x 1 , … , x 6 − 10 x 1 − 12 x 2 − 12 x 3 s.t. x 1 + 2 x 2 + 2 x 3 + x 4 = 20 2 x 1 + x 2 + 2 x 3 + x 5 = 20 2 x 1 + 2 x 2 + x 3 + x 6 = 20 x 1 , x 2 , x 3 , x 4 , x 5 , x 6 ≥ 0 \begin{aligned} & \min_{x_1,\dots,x_6} \; -10x_1-12x_2-12x_3 \\ & \text{s.t. } x_1+2x_2+2x_3+x_4=20 \\ & \quad\;\; 2x_1+x_2+2x_3+x_5=20 \\ & \quad\;\; 2x_1+2x_2+x_3+x_6=20 \\ & \quad\;\; x_1,x_2,x_3,x_4,x_5,x_6\ge 0 \end{aligned} x 1 , … , x 6 min − 10 x 1 − 12 x 2 − 12 x 3 s.t. x 1 + 2 x 2 + 2 x 3 + x 4 = 20 2 x 1 + x 2 + 2 x 3 + x 5 = 20 2 x 1 + 2 x 2 + x 3 + x 6 = 20 x 1 , x 2 , x 3 , x 4 , x 5 , x 6 ≥ 0 Simplex method (outline) Identify an initial feasible basis { x B 1 , … , x B m } \{x_{B1},\dots,x_{Bm}\} { x B 1 , … , x B m } . Compute reduced costs c ˉ k = c k − c B B − 1 A k \bar c_k=c_k-c_B B^{-1}A_k c ˉ k = c k − c B B − 1 A k for each non-basic variable. If all reduced costs are non-negative, the current basis is optimal — STOP. Otherwise, pick a non-basic x k x_k x k with negative reduced cost to enter the basis. Set x k = min i Δ x i x_k=\min_i \Delta x_i x k = min i Δ x i . Return to step 2. Simplex tableau — outline by inspection By inspection, a feasible basis is { x 4 , x 5 , x 6 } \{x_4,x_5,x_6\} { x 4 , x 5 , x 6 } , which corresponds to the extreme point ( 0 , 0 , 0 , 20 , 20 , 20 ) (0,0,0,20,20,20) ( 0 , 0 , 0 , 20 , 20 , 20 ) . We have
B = [ 1 0 0 0 1 0 0 0 1 ] B=\begin{bmatrix}1&0&0\\0&1&0\\0&0&1\end{bmatrix} B = 1 0 0 0 1 0 0 0 1 Therefore B − 1 = B B^{-1}=B B − 1 = B and the reduced cost vector is
c ˉ = c − c B B − 1 A = [ − 10 − 12 − 12 0 0 0 ] − [ 0 0 0 ] [ 1 0 0 0 1 0 0 0 1 ] [ 1 2 2 1 0 0 2 1 2 0 1 0 2 2 1 0 0 1 ] = [ − 10 − 12 − 12 0 0 0 ] \bar c = c - c_B B^{-1}A = \begin{bmatrix}-10&-12&-12&0&0&0\end{bmatrix} - \begin{bmatrix}0&0&0\end{bmatrix}\begin{bmatrix}1&0&0\\0&1&0\\0&0&1\end{bmatrix}\begin{bmatrix}1&2&2&1&0&0\\2&1&2&0&1&0\\2&2&1&0&0&1\end{bmatrix} = \begin{bmatrix}-10&-12&-12&0&0&0\end{bmatrix} c ˉ = c − c B B − 1 A = [ − 10 − 12 − 12 0 0 0 ] − [ 0 0 0 ] 1 0 0 0 1 0 0 0 1 1 2 2 2 1 2 2 2 1 1 0 0 0 1 0 0 0 1 = [ − 10 − 12 − 12 0 0 0 ] The reduced cost of x 1 x_1 x 1 is negative, so we choose it to enter the basis. We calculate the change in the existing basic variables:
Δ x B = B − 1 A 1 = A 1 = [ 1 2 2 ] \Delta x^B = B^{-1}A^1 = A^1 = \begin{bmatrix}1\\2\\2\end{bmatrix} Δ x B = B − 1 A 1 = A 1 = 1 2 2 Checking the ratio test, we see that x 4 / Δ x 4 = 20 x_4/\Delta x_4=20 x 4 /Δ x 4 = 20 , x 5 / Δ x 5 = 10 x_5/\Delta x_5=10 x 5 /Δ x 5 = 10 and x 6 / Δ x 6 = 10 x_6/\Delta x_6=10 x 6 /Δ x 6 = 10 , so one of x 5 x_5 x 5 and x 6 x_6 x 6 must leave the basis; let's assume that x 5 x_5 x 5 leaves, so the new basis is { x 4 , x 1 , x 6 } \{x_4,x_1,x_6\} { x 4 , x 1 , x 6 } . Now
B = [ 1 1 0 0 2 0 0 2 1 ] B − 1 = [ 1 − 0.5 0 0 0.5 0 0 − 1 1 ] B=\begin{bmatrix}1&1&0\\0&2&0\\0&2&1\end{bmatrix}\qquad B^{-1}=\begin{bmatrix}1&-0.5&0\\0&0.5&0\\0&-1&1\end{bmatrix} B = 1 0 0 1 2 2 0 0 1 B − 1 = 1 0 0 − 0.5 0.5 − 1 0 0 1 The current solution is B − 1 b = [ 10 0 0 10 0 0 ] B^{-1}b=[10\;0\;0\;10\;0\;0] B − 1 b = [ 10 0 0 10 0 0 ] and
c ˉ = [ − 10 − 12 − 12 0 0 0 ] − [ 0 − 10 0 ] [ 1 − 0.5 0 0 0.5 0 0 − 1 1 ] [ 1 2 2 1 0 0 2 1 2 0 1 0 2 2 1 0 0 1 ] = [ 0 − 7 − 2 0 5 0 ] \bar c = \begin{bmatrix}-10&-12&-12&0&0&0\end{bmatrix} - \begin{bmatrix}0&-10&0\end{bmatrix}\begin{bmatrix}1&-0.5&0\\0&0.5&0\\0&-1&1\end{bmatrix}\begin{bmatrix}1&2&2&1&0&0\\2&1&2&0&1&0\\2&2&1&0&0&1\end{bmatrix} = \begin{bmatrix}0&-7&-2&0&5&0\end{bmatrix} c ˉ = [ − 10 − 12 − 12 0 0 0 ] − [ 0 − 10 0 ] 1 0 0 − 0.5 0.5 − 1 0 0 1 1 2 2 2 1 2 2 2 1 1 0 0 0 1 0 0 0 1 = [ 0 − 7 − 2 0 5 0 ] The reduced cost of x 3 x_3 x 3 is negative, so we choose it to enter the basis. We calculate
Δ x B = B − 1 A 3 = [ 1 − 0.5 0 0 0.5 0 0 − 1 1 ] [ 2 1 1 ] = [ 1 1 − 1 ] \Delta x^B = B^{-1}A^3 = \begin{bmatrix}1&-0.5&0\\0&0.5&0\\0&-1&1\end{bmatrix}\begin{bmatrix}2\\1\\1\end{bmatrix} = \begin{bmatrix}1\\1\\-1\end{bmatrix} Δ x B = B − 1 A 3 = 1 0 0 − 0.5 0.5 − 1 0 0 1 2 1 1 = 1 1 − 1 Checking the ratio test, we see that x 4 / Δ x 4 = 10 x_4/\Delta x_4=10 x 4 /Δ x 4 = 10 and x 1 / Δ x 1 = 10 x_1/\Delta x_1=10 x 1 /Δ x 1 = 10 , so one of x 4 x_4 x 4 and x 1 x_1 x 1 must leave the basis; let's assume that x 4 x_4 x 4 leaves, so the new basis is { x 3 , x 1 , x 6 } \{x_3,x_1,x_6\} { x 3 , x 1 , x 6 } . Now
B = [ 2 1 0 2 2 0 1 2 1 ] B − 1 = [ 1 − 0.5 0 − 1 1 0 1 − 1.5 1 ] B=\begin{bmatrix}2&1&0\\2&2&0\\1&2&1\end{bmatrix}\quad B^{-1}=\begin{bmatrix}1&-0.5&0\\-1&1&0\\1&-1.5&1\end{bmatrix} B = 2 2 1 1 2 2 0 0 1 B − 1 = 1 − 1 1 − 0.5 1 − 1.5 0 0 1 so the current solution is B − 1 b = [ 0 0 10 0 0 10 ] B^{-1}b=[0\;0\;10\;0\;0\;10] B − 1 b = [ 0 0 10 0 0 10 ] and
c ˉ = [ − 10 − 12 − 12 0 0 0 ] − [ − 12 − 10 0 ] [ 1 − 0.5 0 − 1 1 0 1 − 1.5 1 ] [ 1 2 2 1 0 0 2 1 2 0 1 0 2 2 1 0 0 1 ] = [ 0 − 4 0 2 4 0 ] \bar c = \begin{bmatrix}-10&-12&-12&0&0&0\end{bmatrix} - \begin{bmatrix}-12&-10&0\end{bmatrix}\begin{bmatrix}1&-0.5&0\\-1&1&0\\1&-1.5&1\end{bmatrix}\begin{bmatrix}1&2&2&1&0&0\\2&1&2&0&1&0\\2&2&1&0&0&1\end{bmatrix} = \begin{bmatrix}0&-4&0&2&4&0\end{bmatrix} c ˉ = [ − 10 − 12 − 12 0 0 0 ] − [ − 12 − 10 0 ] 1 − 1 1 − 0.5 1 − 1.5 0 0 1 1 2 2 2 1 2 2 2 1 1 0 0 0 1 0 0 0 1 = [ 0 − 4 0 2 4 0 ] The reduced cost of x 2 x_2 x 2 is negative, so we choose it to enter the basis. We calculate
Δ x B = B − 1 A 2 = [ 1 − 0.5 0 − 1 1 0 1 − 1.5 1 ] [ 2 1 2 ] = [ 1.5 − 1 2.5 ] \Delta x^B = B^{-1}A^2 = \begin{bmatrix}1&-0.5&0\\-1&1&0\\1&-1.5&1\end{bmatrix}\begin{bmatrix}2\\1\\2\end{bmatrix} = \begin{bmatrix}1.5\\-1\\2.5\end{bmatrix} Δ x B = B − 1 A 2 = 1 − 1 1 − 0.5 1 − 1.5 0 0 1 2 1 2 = 1.5 − 1 2.5 Checking the ratio test, we see that x 3 / Δ x 3 = 6.67 x_3/\Delta x_3=6.67 x 3 /Δ x 3 = 6.67 and x 6 / Δ x 6 = 4 x_6/\Delta x_6=4 x 6 /Δ x 6 = 4 , so x 6 x_6 x 6 must leave the basis, and the new basis is { x 3 , x 1 , x 2 } \{x_3,x_1,x_2\} { x 3 , x 1 , x 2 } . Now
B = [ 2 1 2 2 2 1 1 2 2 ] B − 1 = [ 0.4 0.4 − 0.6 − 0.6 0.4 0.4 0.4 − 0.6 0.4 ] B=\begin{bmatrix}2&1&2\\2&2&1\\1&2&2\end{bmatrix}\quad B^{-1}=\begin{bmatrix}0.4&0.4&-0.6\\-0.6&0.4&0.4\\0.4&-0.6&0.4\end{bmatrix} B = 2 2 1 1 2 2 2 1 2 B − 1 = 0.4 − 0.6 0.4 0.4 0.4 − 0.6 − 0.6 0.4 0.4 so the current solution is B − 1 b = [ 4 4 4 0 0 0 ] B^{-1}b=[4\;4\;4\;0\;0\;0] B − 1 b = [ 4 4 4 0 0 0 ] and
c ˉ = [ − 10 − 12 − 12 0 0 0 ] − [ − 12 − 10 − 12 ] [ 0.4 0.4 − 0.6 − 0.6 0.4 0.4 0.4 − 0.6 0.4 ] [ 1 2 2 1 0 0 2 1 2 0 1 0 2 2 1 0 0 1 ] = [ 0 0 0 3.6 1.6 1.6 ] \bar c = \begin{bmatrix}-10&-12&-12&0&0&0\end{bmatrix} - \begin{bmatrix}-12&-10&-12\end{bmatrix}\begin{bmatrix}0.4&0.4&-0.6\\-0.6&0.4&0.4\\0.4&-0.6&0.4\end{bmatrix}\begin{bmatrix}1&2&2&1&0&0\\2&1&2&0&1&0\\2&2&1&0&0&1\end{bmatrix} = \begin{bmatrix}0&0&0&3.6&1.6&1.6\end{bmatrix} c ˉ = [ − 10 − 12 − 12 0 0 0 ] − [ − 12 − 10 − 12 ] 0.4 − 0.6 0.4 0.4 0.4 − 0.6 − 0.6 0.4 0.4 1 2 2 2 1 2 2 2 1 1 0 0 0 1 0 0 0 1 = [ 0 0 0 3.6 1.6 1.6 ] All reduced costs are nonnegative, so the current basis is optimal.
Optimal solution After iterating the Simplex tableau, the optimal solution is:
x ∗ = [ 4 4 4 0 0 0 ] , c ⋅ x ∗ = − 136 x^*=[4\;\;4\;\;4\;\;0\;\;0\;\;0],\qquad c\cdot x^*=-136 x ∗ = [ 4 4 4 0 0 0 ] , c ⋅ x ∗ = − 136 i.e. produce 4 tons each of concrete, mortar and grout for maximum profit.