A company needs to ship goods from a warehouse to a city through a network of roads, each with a capacity (how much it can carry) and a cost (price per unit). You must move a fixed amount â the demand â and you want to do it as cheaply as possible.
The naive instinct is to dump everything onto the cheapest road. But the cheapest road has limited capacity; once it's full, the overflow must take pricier routes. Balancing cost against capacity across the whole network is the real puzzle.
That's minimum-cost flow, and it's a quiet hero. Unlike most problems on this site, it's easy â solvable in polynomial time. Better still, it's a unifier: maximum flow, shortest paths, and the assignment problem are all special cases of it. One efficient algorithm, a whole family of problems solved.
Comments
Loading comments...