r/AskComputerScience • u/thetan_free • Dec 07 '24
Combinatorial Optimisation - fridge/freezers during a blackout
Wondering if anyone has thoughts on solving a specific optimisation problem many encounter in real-life: how to save food in your fridge/freezer during a blackout.
The idea is to move items between the fridge and the freezer in an optimal way as the temperature drops. It seems like some sort of dual-Knapsack Problem.
One strategy is to move low-value items from the freezer to the fridge, to preserve high-value items in the fridge. (So as your frozen peas thaw in the fridge, they keep your salmon cold for longer.) Later, once the freezer is above freezing and all is lost, it makes sense to move high-value items from the fridge into the freezer.
How could I set up a combinatorial optimisation problem to solve this?
I'm thinking at the start, there are two sets of items, each with a value and a volume (known to you), in the fridge and freezer, respectively.. The fridge and freezer have different total volumes and temperatures. Temperature drops in a predictable way for both. Frozen food is lost when it exceeds zero. Fridge food is lost when it exceeds, say, ten degrees C. Hence, the fridge and freezer are two time-varying knapsacks, right? Your decision space at each time T is to move an item from one to the other. So maybe it's like a dynamic program?
Two variants:
- You do know when the power will come back on. How does that change the model?
- If you want to move an item, you have to open both the doors, which costs (a known) extra temperature increase on each.
Thoughts?
View all comments
Show parent comment
1
u/johndcochran Dec 08 '24
You also have the issue that moving a "low value" item from the freezer to the fridge will reduce the time that the freezer will remain safe for high value items in it. Both by the penality of opening the freezer and by replacing the volume occupied by the peas (which is mostly ice) with air. There's a reason that it's recommended that you keep your freezer full in case of a power failure. Even to the extend of storing containers of ice, so that if there's a power failure, you have a larger thermal mass to carry you through the failure.