3 ms·
I'm not very experienced at hosting, but this is pretty close to what I'd do. If chip supply isn't a constraint, I'll aim for halving the quantity each step up
by hot_gril 2y ago
I'm not very experienced at hosting, but this is pretty close to what I'd do. If chip supply isn't a constraint, I'll aim for halving the quantity each step up then redistribute from there, so 12x25c 7x$1 2x$5 in your example. If chips are limited, I go based on the ratios of available chips.
At first glance, seems like you could do this with linear programming instead of mixed-integer if you're ok shaving off the fractions at the end and handing them out naively. Nobody will mind getting 1-2 more chips than theoretically necessary.
- hansvm 2y ago> At first glance, seems like you could do this with linear programming instead of mixed-integer if you're ok shaving off the fractions at the end and handing them out naively. Nobody will mind getting 1-2 more chips than theoretically necessary. You're almost certainly totally right for this problem, but in general that's one of the pitfalls in beginner mixed-integer programming implementations. Rounding a reasonable real-number solution has almost no guarantees in terms of approximate optimality or error bounds compared to the optimal integer solution.
- hot_gril 2y agoYeah, in general it's not this easy. In this case, seems like the worst case is getting x.999 of each chip.