Suppose you must decide, for each of a dozen warehouses, whether to open it or not â a clean yes/no choice â so that every customer is served at the lowest total cost. This is an integer problem, and in general it is NP-hard: there is no known fast algorithm that always finds the cheapest set.
But there is a famous trick. Relax the requirement that every decision be 0 or 1, and instead allow fractions: "open 0.4 of this warehouse." Now the problem becomes a linear program (LP), which we can solve quickly and optimally. The catch: you can't open four-tenths of a building. The LP's answer is a beautiful number that you cannot actually use.
Randomized rounding is how we cash it in. Treat each fraction as a probability and flip a biased coin: a variable set to 0.4 becomes "open" with 40% chance. It sounds reckless â yet the expected cost lands exactly on the LP's, and with a little care the result is provably close to the true optimum. Chance, used deliberately, turns an impossible answer into a usable one.
Comments
Loading comments...