# Optimizing Inventory Replenishment for Seasonal Demand with Discrete Delivery Times
## 3 Methodology
Equation (4) is to define the inventory holding costs from week \(i\) to week \(j\) depending on the center of area method. This is only based on the average demand. However, later on, the safety stock holding costs are also considered. The number of weeks in the year is 52. The average size of inventory is the total demand covered by one replenishment lot divided by 2. Equation (5) is to guarantee that every week is covered by only one replenishment. Equation (6) guarantees that the first term in Equation (5) to be more than 0. This is because Equation (6) enforces \(x_{ij}\) value to be 1 if the demand plus safety stock for a certain week is more than the available initial inventory. In other words, a new replenishment is needed. Equation (6) is needed only for the first few weeks, then it is redundant for the later weeks. The value z is related to service level. For a 95% service level, \(z=1.645\). Equation (7) is to set \(y_{w}\) to be zero if there is enough inventory to cover the demand during the first few weeks (from week 1 to week \(w\)). In this case, all the variables \(x_{ij}\) starting in any week from 1 to w can be zero. To enforce the variables \(x_{ij}\) to be zeros, Equation (8) is used. The model will set them to be zero because it is better to reduce the inventory holding costs, and that means that the model will try to delay the first replenishment to the last possible week without stock-out. On the other hand, if the left-hand side of Equation (7) is positive, \(y_{w}\) must be 1, meaning that a replenishment must be conducted. \(y_{w}\) and \(Y_{w}\) are indicator variables. An indicator variable is a binary variable (0 or 1) that indicates a certain state in a model. The use of M (large number) is a well-known practice in MIP. It is usually used to enforce two integer variables to have a relationship between them. For example, in Equation (8) if the summation of the \(x_{ij}\) is greater than one, then \(y_{w}\) must be one. The reader might refer to some practical uses of M in the chapter AIMMS [53], which shows uses such as fixed costs, either-or constraints, and conditional constraints. Equation (9) is to define \(Y_{w}\) which has the opposite value of \(y_{w}\). If \(y_{w}\) is 1, \(Y_{w}\) must be zero. It is needed for formulation purposes. Equation (10) is to define initial inventory holding costs, where the first term is for average cycle inventory and the second one is for the safety stock. On average, safety stock lasts until the end of this period. Therefore, it is not multiplied by 0.5 as the cycle inventory. Such an initial safety stock is not a decision variable as the normal safety stock because it is affected by \(P_{0}\), meaning that it is usually higher than needed. Therefore, the first \(Q_{ij}\) must be reduced. \(E_{w}\) has a value greater than zero if \(Y_{w}\) is greater than zero, meaning that the first replenishment comes after the week w. If \(E_{w}\) is zero, then all the \(E_{1}\), \(E_{2}\),... \(E_{w-1}\) must also be zero. We need, however, to include only the inventory holding costs \(E_{w}\) in the objective function since it contains the holding costs for the weeks from 1 to w. Therefore, Equation (11) is to find the maximum of the \(E_{1}\), \(E_{2}\),... \(E_{w-1}\), \(E_{w}\) (if they are >0), which is \(E_{w}\). In other words, C equals the maximum \(E_{w}\) greater than zero. \(E_{w+1}\) in this case must be zero. The existence of C in the minimization objective function prohibits it to be more than \(E_{w}\). Equation (12) is used to guarantee not to exceed the suppliers' maximum volume. The lot size (\(Q_{ij}\)) will be defined in Equations (16) and (17). Equation (13) is to find the total demand covered by the lot. Equation (14) is to define the standard deviation of the demand from week \(i\) to week \(j\). Equation (15) is to find the total costs, which are the same as the objective function but without the term containing the \(y_{w}\) variable. This constraint does not affect the results, but it shows the total costs.