Min-Cost Flow & Assignment
In short: Max flow asks how much can move. Min-cost flow asks how cheaply a given amount can move, when every pipe also has a price per unit. The algorithm is the familiar one, with the search for an augmenting path replaced by a search for the cheapest one: push units along the cheapest route with capacity left, update the residual graph, repeat. Because every reverse edge refunds its forward cost (its weight is the negative of the original), the residual graph always has negative edges — so the search uses Bellman-Ford, not Dijkstra, even though every pipe you started with had a non-negative cost. The assignment problem — pairing rows to columns for the least total cost — turns out to be the exact same algorithm on a network where every pipe has capacity one.

From matching to pricing
Section 17's assign_drivers found the biggest matching, with no notion of
one driver-job pairing being better than another. Give every pipe in that
same network a cost — what it's worth to Meridian to have ana driving the
truck instead of the van — and "the best assignment" becomes a min-cost
flow question with every capacity equal to 1. The four-pipe graph above is
exactly that: r1-c1 costing 4 instead of r1-c2 costing 1 is the
difference between a good pairing and a bad one, and checking both totals
(4 vs. 3) is the entire Hungarian algorithm's idea in miniature. A real
Hungarian solver avoids trying every permutation; this lesson's exercise
uses permutations directly, since the matrices Meridian deals with here are
small enough that it doesn't matter.