<p>In your case you have a <em>fixed monthly cost</em> <strong>(FMC)</strong> and a <em>variable monthly cost</em> <strong>(VMC)</strong> for each choice of package. <strong>FMC</strong> is in {x, x+10000, x+20000}, while <strong>VMC</strong> is the sum of the <em>variable weekly costs</em> <strong>VWC</strong> for the 4 weeks. <strong>VWC</strong> is determined by the partition of the interval of the set of days D = (M,T,W,T,F,S,S) into k disjoint sub-intervals, with k in {1,3,5}.</p>

<p>Therefore you have to choose min{<strong>FMC1</strong>+<strong>VMC1*</strong>, <strong>FMC3</strong>+<strong>VMC3*</strong>, <strong>FMC5</strong>+<strong>VMC5*</strong>}, where <strong>VMCk*</strong> denotes the minimum variable monthly cost for partitioning D into k intervals (Note that for the case of k=1 the answer is trivial since there exists a single partition for each week). Since the variable weekly cost is  <strong>VWC</strong>= 0.7*(<em>r1+r2+r3+r4+r5+r6+r7</em>), <em>ri</em> being the remaining amount of day <em>i</em>, it all boils down to minimizing the remaining quantity of each week.  In calculating the <strong>VMCk*</strong> you can use DP-algorithm described in <a href="https://arxiv.org/pdf/math/0309285.pdf" rel="nofollow noreferrer">this</a> paper, with the objective of minimizing the remaining amount of each week.</p>

<p>So in high level:</p>

<ol>
<li>Obtain the minimum variable weekly cost -> minimum remaining amount of each week using DP, for each package of deposits {1,3,5}. And then the variable monthly cost as the sum of the 4 weeks.</li>
<li>Choose the minimum total cost from considering the fixed cost of each package and the variable one obtained at 1.</li>
</ol>
optimal algorithm to solve CLSP(Capacitated Lot Sizing) with the transportation constraints and storage levels
<p>A bank has an ATM machine. For a particular week, the usage of cash in millions as below.</p>

<ul>
<li>5- Monday</li>
<li>4- Tuesday</li>
<li>1- Wednesday</li>
<li>15- Thursday</li>
<li>6- Friday</li>
<li>2- Saturday</li>
<li>4- Sunday</li>
</ul>

<p>The bank hires a depositing company to deposit money in 5, 3, or 1 rounds per week.</p>

<p>The depositing company provides following packages to the bank when charging for depositing money, </p>

<ul>
<li><p>Cost for depositing in 4 rounds per month- 21135</p></li>
<li><p>Cost for depositing in 12 rounds per month- 32000</p></li>
<li><p>Cost for depositing in 20 rounds per month- 41975</p></li>
</ul>

<p>Ordering remains as Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday. This order shouldn’t be violated when categorizing values.</p>

<p><strong>Example</strong></p>

<ul>
<li>5 rounds</li>
</ul>

<p>[(5+4),1, 15, 6, (2+4)]</p>

<p>[(5+4), 1, (15+6)=20+1, 2, 4]</p>

<p>can have many other combinations which don't break order.</p>

<ul>
<li>3 rounds</li>
</ul>

<p>[(5+4+1), 15, (6+2+4)]</p>

<p>[(5+4), (1+15), (6+2+4)]</p>

<p>can have many other combinations which don't break order.</p>

<ul>
<li>1 round</li>
</ul>

<p>[(5+4+1+15+6+2+4)]</p>

<p>Also the bank has to bear a holding cost of 0.019% of the remaining amount at the end of the day. </p>

<p><strong>Example</strong></p>

<p>Consider 1st week usage of cash as follows.( in millions)</p>

<p>Mon-    13</p>

<p>Tue-    5</p>

<p>Wed-    4</p>

<p>Thu-    4</p>

<p>Fri-    2</p>

<p>Sat-    11</p>

<p>Sun-    1</p>

<p><strong><em>5 - rounds</em></strong> </p>

<p>1st week Cash depositing order - 13, (5+4), 4, (2+11), 1</p>

<p>Assuming depositing is done in 5 rounds for all 4 weeks of the month,
(5*4 = 20)</p>

<p>Total depositing cost = 41975</p>

<p>1-  13 deposited, 
    13 withdrawn,
        0 remaining,
            0 holding cost</p>

<p>2-  (5+4) deposited,
    5 withdrawn,
        4 remaining,
            4*0.00019  holding cost</p>

<p>3-  0 deposited,
    4 withdrawn,
        0 remaining,
            0 holding cost</p>

<p>4-  4 deposited, 
    4 withdrawn,
        0 remaining,
            0 holding cost</p>

<p>5-  (2+11) deposited,
    2 withdrawn,
        11 remaining,
            11*0.00019 holding cost</p>

<p>6-  0 deposited,
    11 withdrawn,
        0 remaining,
            0 holding cost</p>

<p>7-  1 deposited,
    1 withdrawn, 
        0 remaining,
            0 holding cost</p>

<p>Total holding cost for 1st week = 4*0.00019 + 11*0.00019  = 0.00285 millions= 2850</p>

<p>Likewise I need to find the total holding cost for the month considering each particular week. </p>

<p><strong><em>3- rounds</em></strong></p>

<p>Cash depositing order for 1st week - 13, (5+4+4), (2+11+1)=(1+1+12)</p>

<p>Edit- Assuming 12 rounds per month package is choosen, therefore 3 rounds per week( 3*4 =12)</p>

<p>Total depositing cost = 32000</p>

<p>1 - 13 deposited,
    13 withdrawn,
        0 remaining, 0 holding cost</p>

<p>2-  (5+4+4) deposited, 5 withdrawn, (4+4) remaining, (4+4)*0.00019 holding cost</p>

<p>3-  0 deposited, 4 withdrawn, 4 remaining, 4*0.00019 holding cost</p>

<p>4- 0 deposited, 4 withdrawn, 0 remaining, 0 holding cost</p>

<p>5- (2+11+1) deposited, 2 withdrawn, (11+1) remaining, (11+1)*0.00019 holding cost</p>

<p>6- 0 deposited, 11 withdrawn, 1 remaining, 1*0.00019 holding cost</p>

<p>7- 0 deposited, 1 withdrawn, 0 remaining, 0 holding cost</p>

<p>Total holding cost for 1st week = (4+4)*0.00019 + 4*0.00019 + (11+1)*0.00019 + 1*0.00019 = 0.00475 millions = 4750</p>

<p>Likewise I need to find the total holding cost for the month considering each week.</p>

<p>Edit - suppose the 41975 package is picked. Then it means cash deposited in 20 rounds per month. That means 5 rounds per week. If the 32000 package is picked, then 12 rounds per month. That means 3 rounds per week. If the 21135 package is picked, then it means for 4 rounds per month, that means 1 round per week. There are no mixed combinations of 5,3,1 for the four weeks of a particular month. Only all four weeks are done in 1, 3 or 5 rounds. We have to select the best package considering holding cost and package cost. </p>

<p>A good combination of 5 rounds which doesn't violate order, can be better than all the 3 rounds solutions and the 1 round solution. Same applies for 3 rounds solution aswell. Or else 1 round solution can be better than all 5 rounds and 3 rounds solutions.</p>

<p>When depositing rounds increase, holding cost reduces but depositing cost increases. When rounds decrease, depositing cost reduces but holding cost increases. So I need to find the order of depositing money for each week of the month and the monthly depositing package which can make a good tradeoff between total holding cost and total depositing cost, consuming the least time. </p>

<p>Any insight to the approach will be really helpful.</p>