## Lecture #9: The Hungarian Algorithm

Indeed, as several of you pointed out, we could have changed the definition of utility to make it $u_{ib}(p) := v_{ib} - p_i$, and not $u_{ib}(p) := \max(v_{ib} - p_i, 0)$. Now a buyer could have negative utility for their most preferred item as well, but that’s OK. The argument for termination was that the total dual decreases at each step (this remains unchanged), and it is bounded below by the primal value (which is also unchanged). The proof is even cleaner.
Other advantages: now each buyer always has degree at least one in $H(p)$, so we don’t need to adjust the prices (or raise prices on the most constricted set), we just raise prices on any constricted set. This change makes the preference graph $H(p)$ be invariant to adding a constant to every item’s price, so $H(p)$ when the prices are say $M$ for all items, is the same as the preference graph when all the items have price zero.
The non-negative utility makes more sense in the max-weight matching problem, where we don’t enforce getting a perfect matching. There the dual variables $u_b$ indeed have to be non-negative — which is where I first saw the algorithm, hence its presence in my presentation today.