Proofs: Jonker-Volgenant algorithm
These are the human proofs of Jonker-Volgenant algorithm, at full length.
The Jonker-Volgenant algorithm returns a minimum-cost assignment full
This proof shows: correctness, termination.
Let be an real matrix with (the cases are handled directly). The algorithm keeps column prices and a partial assignment: is the column of row or nil, and is the row of column or nil, with exactly when . For each row put . Then
holds for any prices. The invariant is
(CS) for each assigned row , .
Lemma 1 (the initialization keeps (CS)). (CS) holds after lines L2 to L4, and every change of prices and of the assignment in lines L5 to L10 keeps it. Lines L7 to L10 stop.
Proof. After line L3 for every column, , so for all , and . Line L4 assigns row to column only if , a reduced cost of 0, which is the least possible. So (CS) holds.
Lowering a price raises for every row and changes nothing else. For an assigned row with , its value at is unchanged and its other values do not go down, so stays a minimum.
At line L6, row was a minimum row of exactly one column in line L3, so was set there. Line L6 changes only the price of the column of the row it treats, and different rows treated there have different columns, so is unchanged when row is treated, and . Let , with the current prices. After , the value of row at is , which is the least of its values. So (CS) holds for , and for the other rows by the first paragraph.
At line L9, row is free, and . If , the new price makes the value of at equal to , which is the new minimum of row , and line L10 assigns to . If , no price changes, and is assigned to or , both of value . The row that loses its column becomes free, so (CS) no longer speaks of it. Other rows are covered by the first paragraph.
Each pass makes at most bids, and a row that is not allowed to bid goes to the list of free rows, so each pass stops.
After line L10, the free rows are exactly the rows with $x_i = $ nil: every row that loses its column at line L10 is put back on a list, and rows that were never assigned in L4 start on the list.
Lemma 2 (one augmentation). Suppose (CS) holds when line L12 starts for a free row . Then lines L13 to L17 stop with a free column , and after lines L18 and L19 (CS) holds, row is assigned, and every row assigned before is still assigned.
Proof. For an assigned row and any column , write for its reduced cost; by (CS), . In line L17, with , the quantity equals , so . The prices do not change during lines L12 to L17.
Invariants of the search. While lines L13 to L17 run:
(a) a column enters with for the current , and then never changes; the value never decreases; (b) every column has , and is a set of columns outside with whose values do not change while they are in ; (c) a value and the row are always set together, and either and , or for a column that was in at that moment and .
Line L14 sets to the least outside , so (b) holds after it, and the new is at least the old one by (b). Line L16 moves a column of , with , into . Line L17 changes only columns outside , and each new value is ; a value equal to puts the column into . This gives (a), (b) and (c).
Termination. Each pass of the loop that does not stop moves one column into . Only assigned columns enter : a free column in stops the loop at line L15, and a free column that reaches at line L17 stops it at once. Row is free, so at most columns are assigned, and at most columns enter . When is empty, some column is outside , so line L14 is defined. So the loop stops, with a free column and .
A key inequality. Put with the final values; by (a) and (b), for and for the other columns. We claim: for each , with row , and each column ,
When was moved into , the value of was . If was already in , then by (a). If was in , then and it does not change later. If line L17 then compared , afterwards , and values only go down. If line L17 stopped before comparing , this was the last pass, so the final equals and . In every case (2) holds, as . Also, for every ,
since line L12 sets to this value and it only decreases.
New prices. Line L18 sets for all (no change outside ). Then for any row that was assigned and any column ,
Let before line L19. If , then and , so . If , (2) gives . So every row keeps a minimum at its old column; we use this for the rows that line L19 does not move.
The path. By (c), following from gives , , and so on, to a column with ; each with is in , and it entered before received its , so the walk goes back in time and stops. The equalities of (c) hold with the final values, since values in do not change: and , where . Line L19 assigns to and each to , and no other row changes.
For a moved row : , which is the least value of row by (2) with . For row : , and for any , by (3). So (CS) holds after line L19, is assigned, and the other rows keep a column.
Theorem. LAPJV stops and returns a permutation of least total cost, with and satisfying (1) and equality on the pairs .
Proof. By Lemma 1, (CS) holds when line L11 starts. Line L11 treats each free row once, and by Lemma 2 each augmentation keeps (CS), assigns its row and unassigns no row. So at the end every row is assigned to a distinct column, and is a permutation. The returned equals by (CS), so (1) holds, with equality on the chosen pairs.
Let be any permutation. By (1),
because and are both bijections onto the columns. So has the least cost.