Three warehouses [tex]A_1, A_2, A_3[/tex] have [tex]20[/tex], [tex]10[/tex] and [tex]15[/tex] tons of goods, respectively, and four consumers [tex]B_1, B_2, B_3, B_4[/tex] need [tex]15[/tex], [tex]20[/tex], [tex]15[/tex] and [tex]10[/tex] tons, respectively. The transportation costs (in dollars per ton) are given by the matrix [tex]C=\begin{bmatrix}2&1&4&6\\4&6&3&2\\6&4&5&3\end{bmatrix}[/tex], where row [tex]i[/tex] corresponds to warehouse [tex]A_i[/tex] and column [tex]j[/tex] to consumer [tex]B_j[/tex]. All the available goods must be shipped, and no consumer may receive more than it needs. Find the minimum total transportation cost (in dollars).
Solution:
The supply is [tex]20+10+15=45[/tex] tons and the demand is [tex]15+20+15+10=60[/tex] tons, so the problem is unbalanced. We add a fictitious warehouse [tex]A_4[/tex] with [tex]15[/tex] tons and zero costs; what it “delivers” is the unmet demand. Let [tex]x_{ij}[/tex] be the amount (in tons) shipped from [tex]A_i[/tex] to [tex]B_j[/tex].
The minimal-element method (first the zero-cost cells of [tex]A_4[/tex], then the cheapest real cells) gives the initial plan and its cost:
[tex]x_{41}=15,\ x_{12}=20,\ x_{24}=10,\ x_{33}=15,\qquad z=20\times 1+10\times 2+15\times 5=115[/tex]
Along the cycle [tex](A_2B_3)^{+},\ (A_2B_4)^{-},\ (A_3B_4)^{+},\ (A_3B_3)^{-}[/tex] the cost changes by [tex]3-2+3-5=-1[/tex] per ton, and we can move [tex]\theta=\min(10, 15)=10[/tex] tons along it. The new plan ([tex]B_1[/tex] stays unsupplied) and its cost:
[tex]x_{12}=20,\ x_{23}=10,\ x_{33}=5,\ x_{34}=10,\qquad z=20\times 1+10\times 3+5\times 5+10\times 3=105[/tex]
Optimality check by potentials: take [tex]u_1=2,\ u_2=3,\ u_3=5,\ u_4=0[/tex] and [tex]v_1=0,\ v_2=-1,\ v_3=0,\ v_4=-2[/tex]. Then [tex]u_i+v_j=c_{ij}[/tex] in every used cell, and all estimates [tex]c_{ij}-u_i-v_j[/tex] (by rows, the last row for [tex]A_4[/tex]) are non-negative:
[tex]\begin{bmatrix}0&0&2&6\\1&4&0&1\\1&0&0&0\\0&1&0&2\end{bmatrix}[/tex]
Hence, for every admissible plan (all of the supply shipped, [tex]B_j[/tex] receiving [tex]r_j[/tex] tons, not more than it needs), since [tex]c_{ij}\ge u_i+v_j[/tex] for [tex]i=1,2,3[/tex], we have
[tex]\sum_{i,j} c_{ij}x_{ij}\ge\sum_{i,j}(u_i+v_j)x_{ij}=2\times 20+3\times 10+5\times 15-r_2-2r_4\ge 145-20-2\times 10=105[/tex]
because [tex]r_2\le 20[/tex] and [tex]r_4\le 10[/tex]. So no plan is cheaper, and the minimum total cost is [tex]105[/tex] dollars.