# Optimization of Inventory Management to Prevent Drug Shortages in the Hospital Supply Chain
## 3 System Model
### A Dynamic Refilling Drug Optimization Model  
Based on the aforementioned objective and constraints, the Dynamic dRug Refilling Optimization (DR2O) model is presented as follows:  
\[\min_{\mathbf{x}} \sum_{t=1}^{T}\sum_{i\in\mathcal{I}}\alpha_{i}p_{i}(t)x_{i}(t)+R_{ i}(v_{i}(t),r_{i}(t))+\psi(v_{i}(t))\] s.t \[\underline{\zeta}_{i}(t)\leq v_{i}(t)=v_{i}(t-1)-\lambda_{i}(t)-e _{i}(t)+x_{i}(t)\leq C_{i}(t),\forall i\in\mathcal{I},t=1,2,\ldots,T,\] \[\sum_{t=1}^{T}\sum_{i\in\mathcal{I}}x_{i}(t)p_{i}(t)\leq\mathbb{B},\] \[x_{i}(t)p_{i}(t)\leq B_{i}(t),\forall i\in\mathcal{I},\] \[\underline{\rho}_{i}(t)\leq x_{i}(t)\leq\bar{\rho}_{i}(t),\forall i \in\mathcal{I},t=1,2,\ldots,T.\]  
In general, this problem can be seen as a variant of the classic ski-rental problem [11]. Specifically, a drug \(i\) is similar to the person in the classic ski-rental problem who is going to ski, but does not know how long the snow will last. He/she therefore has to make a decision every day as to whether to buy (so he/she will not need to pay for the next days) or to rent skis to minimize the overall cost. In our problem, we have to decide whether to buy a drug or not at time \(t\), and we do not know the user demand in advance, which could result in a shortage in the next period. A hospital might spend a good portion of its budget buying and storing a high volume of medicines that may not be used until their expiration. However, a hospital could fall into a shortage crisis if it manages a low supply of drugs. To address this problem, we advocate a learning method to deal with the following issues: (i) the uncertainty of demand that affects the decisions at every timeslot and (ii) the automation mechanism that can automatically make a decision to adapt to the environmental situation.  
**Theorem 1**.: _DR2O is NP-hard._  
Proof.: Consider a knapsack problem with \(N\) items where each item has a non-negative weight \(w_{i}\) and a value \(p_{i}\). There is a bound \(W\) to select a subset \(S\) of items where \(\sum_{i\in S}w_{i}\leq W\). The objective is to select a subset of maximum total value \(\sum_{i\in S}p_{i}\), subject to the boundary constraint. Using a binary variable \(x_{n}\) to indicate item \(n\) is selected in the subset \(S\), the problem formulation of the knapsack problem is as follows:  
\[\max f(\mathbf{x})=\sum_{n\in N}p_{n}x_{n}\] (8) s.t. \[\sum_{n\in N}x_{n}w_{n}\leq W, \tag{9}\] \[x_{n}\in\{0,1\}. \tag{10}\]  
Let us simplify the system by considering an offline model of DR2O, as using DR2O with an online form is always more complicated due to uncertain demands. This means that we can know exactly the amount of drugs used in timeslot \(t\). Hence, as shown in Figure 2, to refill drugs in period \(T\), we need to find a subset of the blocks presented for the amount of drugs in each timeslot \(t\) in which the total is bounded by the budget \(\mathbb{B}\). If we consider the revenue of each drug determined from the surplus between the value \(\theta_{i}\) and the refilling cost, the objective of DR2O can be formed similarly to the knapsack problem by maximizing the total revenue of all the drugs.  
\[\max\sum_{t=1}^{T}\sum_{i\in\mathcal{I}}\theta_{i}(v_{i}(t-1)+\lambda_{i}(t))-[ \alpha_{i}p_{i}(t)x_{i}(t)+R_{i}(v_{i}(t),r_{i}(t))+\psi(v_{i}(t))]. \tag{11}\]  
Since the first term of (11) is constant because \(\lambda_{i}(t)\) is given, this objective function can be maximized by minimizing the second term as we formulated in DR2O. Thus, the offline DR2O constructs an instance of the knapsack problem, which is proven to be NP-hard [40].