Balanced distribution of resources

28 Views Asked by At

Let's say we have 9 storage units with the following current quantities:

152, 153, 154, 159, 157, 147, 140, 265, 205.

The 9 storage units will be supplied daily, for 30 days, with the following daily maximum quantities:

day 1: 12, day 2: 13.5, day 3: 15, etc (each day an increase in 1.5 units) until the 30th day.

The daily quantity can only be supplied towards one unit each day (so you can't split the 12 from 1st day to multiple units, it must go to 1 storage unit only).

Can a formula be devised to calculate which days which units must be supplied in order that at the end the resource distribution, after 30 days, resources/units are as balanced as possible (all units to have a similar or very close quantity) ? The one with 265 can be ignored if it is too high to be reached by the others.