Definition · The assignment problemGiven an n × n cost matrix C, the assignment problem is to choose a permutation σ of {1, …, n} minimising Σᵢ cᵢ,σ(i) — one job per worker, one worker per job.
Written as a linear programme it is the transportation problem with every supply and every demand equal to one, so the previous lessons apply unchanged; and since its matrix is a node-arc incidence matrix, its corners are whole and are exactly the permutations.
That last sentence is worth pausing on, because it is what makes the problem tractable. There are n! permutations — 24 on a four-by-four table, 120 on a five-by-five — and yet the linear relaxation does not need a single integrality constraint. The relaxation's corners are the permutations, by the determinant argument of “Total Unimodularity and Integer Corners”.
Theorem · Reductions do not change the answerSubtracting a constant from every entry of a row, or from every entry of a column, changes the cost of every complete assignment by that same constant. The set of optimal assignments is therefore unchanged, and the optimal value of the original problem is the optimal value of the reduced one plus the total subtracted.
The proof is the counting observation: a complete assignment meets each row once and each column once, so it picks up each constant exactly once. The lab verifies it by brute force on its five-by-five example rather than by restating it.
J1 J2 J3 J4 row min
A 10 19 8 15 8
B 10 18 7 17 7
C 13 16 9 14 9
D 12 19 8 18 8 total off the rows 32
after the rows then the column minima 2 7 0 5 (14)
2 11 0 7 0 4 0 2
3 11 0 10 => 1 4 0 5
4 7 0 5 2 0 0 0
4 11 0 10 2 4 0 5
taken off so far 32 + 14 = 46, and the answer will be 49
Counting the cover
The reduced matrix above has seven zeros. The question is whether they carry a complete assignment — four zeros, no two in the same row or column — and the answer is that they do not: the largest matching on the zero cells has three pairs, so by König's theorem three lines suffice to cover every zero, and three is fewer than four. The lab prints both numbers side by side at every cover step, because they are always equal and that equality is the whole justification for counting lines at all.
Example · The step where drawing lines by eye stops workingAfter one adjustment the matrix is 0 4 1 2 / 0 3 0 4 / 2 0 1 0 / 1 3 0 4, with six zeros. The minimum cover is 3 and it is attained exactly one way: the third row together with the first and third columns.
Apply the usual eye test — cover whichever row or column holds the most still-uncovered zeros, and repeat — and the answer depends on how ties are broken: towards rows it draws four lines, towards columns three. Four is n, so the reader who broke ties towards rows now goes looking for a complete assignment among six zeros that cannot supply one. The recipe is not a function of the matrix, and that is why this lab does not implement it.
When the cover is short of n, adjust: let θ be the smallest uncovered entry, subtract it from every uncovered entry and add it to every entry covered twice. Entries covered once are untouched. Nothing becomes negative, no existing zero is destroyed, and at least one new zero appears. This is again a row-and-column operation in disguise, so the previous theorem still applies and the answer still cannot move.
The bound, climbing
Example · Two numbers meetingRun the method on the four fitters. The constants taken off total 32, then 46, then 47, then 49; the adjustments are θ = 1 and then θ = 2, and the third cover has four lines. The final zeros carry the assignment A to the fourth job, B to the first, C to the second and D to the third, costing 15 + 10 + 16 + 8 = 49.
The constants recovered as a dual solution are u = (10, 10, 9, 11) and v = (0, 7, −3, 5), which add to 49 as well, and satisfy uᵢ + vⱼ ≤ cᵢⱼ in all sixteen cells. A feasible dual point and a feasible primal point with the same value: that is strong duality, on this instance, and it is the certificate the method hands you rather than a claim that it terminated.
The dual total never falls — 32, 46, 46, 47, 47, 49, 49 step by step, standing still at the cover steps and rising at the adjustments — and it is dual feasible at every one of them, not only at the end. So the method can be stopped early and what you have is still a genuine lower bound, which is more than most hand methods offer.
Example · Greed, pricedTake the cheapest cell, strike out its row and column, repeat. On the fitters it picks (B, J3) at 7, then (A, J1) at 10, (C, J4) at 14 and (D, J2) at 19, for 50 — one more than the optimum. On the four crews and four sites it opens at 35 and ends at 315 against an optimum of 275, forty too much. On the five drivers it lands on 38, which is exactly right.
That third case is the one to remember. Greed produced the optimum and produced no reason to believe it, and a right answer with no certificate is not a method. The Hungarian run on the same table ends with a dual total of 38 beside a primal cost of 38, and that pair is the difference.