5.8 Analytic Results for the \((Q,r)\) Policy
5.8 Analytic Results for the \((Q,r)\) Policy
In this section, we extend the analysis of a single-item inventory system under a base-stock policy to a \((Q,r)\) inventory system.
There is a convenient way to relate the \((Q,r)\) system to a number of base-stock systems. To see this, imagine two animals, a squirrel that observes the \((Q,r)\) system at the end of each demand period, and a bear that only wakes up when the inventory position right at the start of the interval equals some fixed \(i,\) where \(i\) must lie in the set \(\set{r+1, \ldots, r+Q};\) if not, the bear hibernates. From the bear’s point of view, the inventory position moves as in a base-stock system with order-up-to level \(i:\) whenever the bear wakes, the position is \(i,\) and just before the bear falls asleep it is \(i-D.\) The inventory level, however, also depends on the outstanding orders; Th. 5.8.1 shows how to deal with these.
More generally, we can associate a different bear with each position in the set \(\set{r+1, \ldots, r+Q},\) so exactly one bear is awake at any time. To combine the statistics observed by the bears and the statistics observed by the squirrel, we need, for each \(i,\) the long-run fraction of periods in which the inventory position \(\IP\) equals \(i.\) For instance, if the squirrel knows1We assume that the limit over all sample paths \(\set{\IP_{k}}\) exists almost surely, so that we can invoke the strong law of large numbers.
\begin{equation*} p(i) = \lim_{T\to \infty} \frac{1}{T} \sum_{k=1}^{T}\1{\IP_k = i}, \end{equation*}for all \(i\in \set{r+1, \ldots, r+Q},\) then it can retrieve the ready rate \(\sum_{i=r+1}^{Q+r} p(i) \alpha(i)\) from the ready rate \(\alpha(i)\) observed by the bear with order-up-to level \(i.\)2We label the ready rate of the base-stock model by the order-up-to level.
Theorem 5.8.1.
Assume that the greatest common divisor of \(Q\) and the possible demand sizes is \(1\) (in particular, \(\P{D=1}>0\) suffices). Under the \((Q,r)\) policy, \(p(i) = \P{\IP = i} = 1/Q\) for \(i=r+1, \ldots, r+Q,\) in the long-run time limit. Consequently, \(\IL\) is distributed as \(\IP-X,\) where \(\IP\) and \(X\) are independent.
Proof
For simplicity take \(Q=3, r=0,\) so that the inventory position \(\IP\) cycles between the levels \(1, 2\) and \(3.\)3The proof is the same for general \(Q\) and \(r,\) but needs a bit more notation. We apply level-crossing arguments, as follows. Write \(f_{i} = \P{D\in \set{i, i+3, i+6, \ldots}}\) for the probability that the period demand equals a multiple of \(3\) plus \(i,\) \(i=0, 1, 2.\) Suppose that, at the start of period \(k,\) the position \(\IP_{k} = 3.\) Since we order in multiples of \(Q=3,\) the probability \(\P{\IP_{k+1} =3|\IP_{k}=3} = f_{0},\) i.e., equal to the probability that \(D_{k}\) is a multiple of \(3.\) Likewise, \(\P{\IP_{k+1} = 2|\IP_k=3} = f_{1},\) and \(\P{\IP_{k+1} = 1|\IP_k=3} = f_{2}.\) Next, since we again order in multiples of \(Q,\) \(\P{\IP_{k+1} = 1|\IP_k=2} = f_{1},\) and similarly for the other possibilities. Therefore, we can use level crossing to conclude that in the long run, \((f_{1}+f_2)p(3) = f_2p(2) + f_1 p(1).\) However, because of the \((Q,r)\) ordering rule, we can cyclically change \(p(1), p(2)\) and \(p(3)\) in this equality. By symmetry, the uniform distribution is a solution. The gcd condition makes the position process irreducible, so this is the unique long-run time distribution: \(p(i) = 1/3\) for all \(i.\)
For the second claim, telescope the recursion for the inventory level as in the proof of lem:2. The orders included in \(\IP_{k-\leadtime}\) have all arrived by the start of period \(k,\) and the later orders have not, so
\begin{equation*} \IL_{k} = \IP_{k-\leadtime} - D[k-\leadtime, k). \end{equation*}The position \(\IP_{k-\leadtime}\) depends only on the demands before period \(k-\leadtime,\) hence it is independent of \(D[k-\leadtime, k) \sim X.\) By the first claim, \(\IP_{k-\leadtime}\) is uniform on \(\set{r+1, \ldots, r+Q}\) in the long run, so \(\IL \sim \IP - X\) with \(\IP\) and \(X\) independent.
With the above theorem the ready rate for the \((Q,r)\) model can be computed with the formula
\begin{align*} \alpha = \frac1Q \sum_{i=r+1}^{r+Q} \alpha(i) = \frac{1}{Q} \sum_{i=r+1}^{r+Q} \P{X+D\leq i}, \tag{5.8.1} \end{align*}where \(\alpha(i)\) is the ready rate of the base-stock model with order-up-to level \(i.\)
For the average inventory level, we write \(\IL(i)\) for the inventory level of the base-stock model with order-up-to level \(i,\) and get
\begin{align*} \E{\IL} &= \frac1Q\sum_{i=r+1}^{r+Q} \E{\IL(i)} = \frac1Q\sum_{i=r+1}^{r+Q} (i - \E X) = \frac{Q+1}2 + r - \E X. \end{align*}The expected number of backorders \(\E{\IL^-}\) and expected on-hand inventory \(\E{\IL^+}\) can be found by equivalent summations:
\begin{align*} \E{\IL^{+}} &= \frac1Q\sum_{i=r+1}^{r+Q} \E{\IL^{+}(i)}, & \E{\IL^{-}} &= \frac1Q\sum_{i=r+1}^{r+Q} \E{\IL^{-}(i)}, \end{align*}using (5.7.3) and (5.7.4) of the base-stock model.
Finally, with \(h\) and \(b\) the holding and backorder cost per item per period, the total average cost becomes
\begin{equation*} C(Q,r) = K\frac{\E D}{Q} + h \E{\IL^{+}} + b \E{\IL^-}. \end{equation*}The first term needs some comments. Average demand is \(\E D\) items per period, and each batch supplies \(Q\) items. By rate stability, the average number of batches ordered per period is therefore \(\E D/Q.\) In case we have to pay the order cost for each batch of \(Q\) items, \(K \E{D}/Q\) is the average ordering cost. This is also the case if \(\P{D\leq Q} = 1\), because this implies that a demand can trigger at most one replenishment in a period. However, if \(\P{D>Q}>0,\) several batches of \(Q\) units may be ordered in the same period. When we just have to pay for the fraction of periods in which we order,4So, the cost of ordering \(m\geq 1\) batches of \(Q\) in the same period costs \(K\), independent of \(m\). the ordering-cost term becomes \(K\P{\IP'\leq r}.\) The reason is of course that when the end-of-period position \(\IP'\leq r\), a replenishment is triggered.
It remains to find optimal values for \(r\) and \(Q.\) Fast algorithms exist to compute optimal \(r\) and \(Q,\) but we omit this. A simple method5But not very efficient. is to perform a complete grid search over a reasonable set of pairs of \(r\) and \(Q.\) Another simple heuristic is to use the EOQ6See Exercise 7, and set \(d=\E D.\) formula to set \(Q = \sqrt{2\E{D}K/h}\) and then search for \(r\) such that the total average cost is minimal.7For that value of \(Q\)!
With similar methods we can search for an \(r\) such that the \(\alpha\) or \(\beta\) service level criteria are met.
By Th. 5.8.1, the inventory position is uniform on \(\{r+1,\ldots,r+Q\},\) and the inventory level is \(\IL=\IP-X.\) Given \(\IL,\) the ready rate and the fill rate follow from the same formulas as for the base-stock policy, and the cost has the extra ordering cost \(K\E D/Q.\) Therefore the class \(\cl{QR}\) in Alg. 5.8.1 extends \(\cl{BaseStock}\) of Alg. 5.7.1. It overrides \(\IL\) and \(C,\) and inherits \(\alpha\) and \(\beta;\) the methods take the policy parameters \((Q,r)\) instead of \(S.\)
\begin{algorithm}
\caption{The performance of a \((Q,r)\) policy.}
\begin{algorithmic}[1]
\State \textbf{Input:} demand rv \(D,\) lead time \(\leadtime,\) costs \(h,\, b,\, K.\)
\State \textbf{Output:} ready rate, fill rate, and average cost as functions of \((Q,r).\)
\State \textbf{class} \(\cl{QR}\rb{D,\, \leadtime,\, h,\, b,\, K}\) \textbf{extends} \(\cl{BaseStock}\)
\State \(\quad\) \textbf{methods:}
\State \(\quad\quad \IP\gets\lambdafun{(Q,\, r)}{\cl{RV}\rb{\pr{MakeMap}\rb{\qb{r+1,\, \ldots,\, r+Q},\, \qb{1,\, \ldots,\, 1}}}}\)
\State \(\quad\quad \IL\gets\lambdafun{(Q,\, r)}{\IP(Q,r)-X}\)
\State \(\quad\quad C\gets\lambdafun{(Q,\, r)}{K\cdot D.\var{mean}/Q+\IL(Q,r).\pr{E}\rb{\lambdafun{i}{h i^+ + b i^-}}}\)
\end{algorithmic}
\end{algorithm}
Python code
# Run the Python blocks of the base-stock policy first; they define BaseStock.
class QR(BaseStock):
def __init__(self, D, leadtime, h, b, K):
super().__init__(D, leadtime, h, b)
self.K = K
def IP(self, Q, r):
return RV(MakeMap(range(r + 1, r + Q + 1), [1] * Q))
def IL(self, Q, r):
return self.IP(Q, r) - self.X
def C(self, Q, r):
h, b = self.h, self.b
return self.K * self.D.mean / Q + self.IL(Q, r).E(
lambda i: h * max(i, 0) + b * max(-i, 0))
R code
# Run the R blocks of the base-stock policy first; they define BaseStock.
QR <- setRefClass("QR", contains = "BaseStock",
fields = list(K = "numeric"),
methods = list(
initialize = function(D, leadtime, h, b, K) {
callSuper(D, leadtime, h, b)
K <<- K
},
IP = function(Q, r) RV(MakeMap(as.list((r + 1):(r + Q)), as.list(rep(1, Q)))),
IL = function(Q, r) IP(Q, r) - X,
C = function(Q, r) {
K * mean(D) / Q + E(IL(Q, r), function(i) h * max(i, 0) + b * max(-i, 0))
}
)
)
For the Lighthouse Company case specified in Alg. 2.5.4, we compute the performance of a \((Q,r)\) policy with the above formulas and the algorithms of Section 1.5. To select the policy parameters, we apply the general grid-search algorithm of Alg. 2.5.2 to the exact cost \(C(Q,r).\)
\begin{algorithm}
\caption{Find a low-cost \((Q,r)\) policy for the Lighthouse Company.}
\begin{algorithmic}[1]
\State \textbf{Input:} policy cost function \(C(Q,\, r).\)
\State \textbf{Output:} best \((Q,\, r)\) on the specified grid and its cost.
\State \(G\gets\qb{(Q,\, r):Q\in\qb{1,\, \ldots,\, 30},\, \ r\in\qb{-5,\, \ldots,\, 15}}\)
\State \(\mathit{qr\_cost}\gets\lambdafun{(Q,\, r)}{C(Q,\, r)}\)
\State \((Q^\star,\, r^\star),\, C^\star\gets
\pr{GridSearch}\rb{\mathit{qr\_cost},\, G}\)
\Return \((Q^\star,\, r^\star),\, C^\star\)
\end{algorithmic}
\end{algorithm}
Python code
# Supply c(Q, r), for example qr.C with qr = QR(D, leadtime, h, b, K).
def LighthouseQRGridSearch(c):
grid = [(Q, r) for Q in range(1, 31) for r in range(-5, 16)]
# min keeps the first candidate on ties and evaluates each cost once.
policy, cost = min(((policy, c(*policy)) for policy in grid),
key=lambda entry: entry[1])
return policy, cost
R code
# Supply c(Q, r), for example qr$C with qr <- QR$new(D, leadtime, h, b, K).
LighthouseQRGridSearch <- function(c) {
best_policy <- NULL
best_cost <- Inf
for (Q in 1:30) {
for (r in -5:15) {
cost <- c(Q, r)
if (is.null(best_policy) || cost < best_cost) {
best_policy <- base::c(Q, r)
best_cost <- cost
}
}
}
list(policy = best_policy, cost = best_cost)
}
For every displayed value of \(Q,\) the table gives the value of \(r\) with the lowest cost in the grid, together with the resulting ready rate, fill rate, and average cost.
| \(Q\) | \(r\) | \(\alpha(Q,r)\) | \(\beta(Q,r)\) | \(C(Q,r)\) |
|---|---|---|---|---|
| 16 | 5 | 0.899 | 0.906 | 14.003 |
| 17 | 5 | 0.905 | 0.911 | 13.864 |
| 18 | 5 | 0.911 | 0.916 | 13.777 |
| 19 | 5 | 0.915 | 0.921 | 13.734 |
| 20 | 5 | 0.920 | 0.925 | 13.729 |
| 21 | 5 | 0.923 | 0.928 | 13.756 |
| 22 | 5 | 0.927 | 0.931 | 13.811 |
| 23 | 5 | 0.930 | 0.934 | 13.890 |
| 24 | 4 | 0.905 | 0.909 | 13.972 |
Over the entire grid, the lowest cost is attained at \((Q^\star,r^\star)=(20,5),\) with \(c^\star\approx13.73.\)
TF 1.
Claim: The (\(Q, r\)) inventory policy can be analyzed by comparing it with multiple base-stock systems.
Solution
Did you actually try? Write your solution down first for comparison.
Show the solution
True. The inventory position is uniform on \(\set{r+1,\ldots,r+Q},\) and while it is at \(i\) the system behaves as a base-stock system with order-up-to level \(i.\)
TF 2.
Claim: In a (\(Q, r\)) policy system, the inventory position \(\IP\) at the beginning of an interval must always be equal to the reorder level \(r.\)
Solution
Did you actually try? Write your solution down first for comparison.
Show the solution
False.
TF 3.
Suppose that the demand in every period is \(D\equiv2\) and the lead time is three periods. Claim: The lead-time demand is \(X=D_1+D_2+D_3=6.\)
Solution
Did you actually try? Write your solution down first for comparison.
Show the solution
True. Demand is two in each of the three lead-time periods.
TF 4.
The fill rate for the \((Q,r)\) inventory system is defined as
\begin{equation*} \beta = \E{\Min{D, \IL^{+}}}/\E D. \end{equation*}Claim: for the independent rvs \(D\) and \(\IL,\) the value \(\Min{D,\, \IL^+}.\var{mean}/D.\var{mean}\) is \(\beta.\)
Solution
Did you actually try? Write your solution down first for comparison.
Show the solution
True. The operator \(\min\) of Alg. 1.5.14 gives the rv \(\Min{D, \IL^+};\) its mean is the numerator of \(\beta.\)
TF 5.
Claim: The order frequency of the (\(Q, r\)) policy is equal to \(Q/\E D.\)
Solution
Did you actually try? Write your solution down first for comparison.
Show the solution
False.
TF 6.
Claim: The average cost under a \((Q,r)\) policy is
\begin{equation*} C(Q,r)=K\frac{Q}{\E D}+h\E{\IL^+}+b\E{\IL^-}. \end{equation*}Solution
Did you actually try? Write your solution down first for comparison.
Show the solution
False. The order frequency is \(\E D/Q,\) so the order-cost term should be \(K\E D/Q.\)
Exercise 7.
Perhaps the most important formula in practical inventory management is the Economic Order Quantity (EOQ) that determines the optimal order quantity in case demand is constant, i.e., \(D\equiv d,\) the lead time \(\leadtime=0\) and backlogging is not allowed. Assume \(Q\geq d,\) so each replenishment consists of one batch of \(Q\) items, and \(\gcd(d,Q)=1,\) so that Th. 5.8.1 applies. Treating \(Q\) as continuous, derive the EOQ relation \(Q^2=2dK/h,\) and explain when its solution satisfies \(Q\geq d.\)
Hint
With \(\leadtime=0,\) the inventory level at the start of a period equals its position and lies between \(r+1\) and \(r+Q.\) Demand during the period is \(d,\) so no backlogging requires \(r+1\geq d.\) Choose \(r=d-1\) to minimize holding cost, and use Exercise 6.
Solution
Did you actually try? Write your solution down first for comparison.
Show the solution
When \(\leadtime=0,\) we have \(X=0,\) so inventory at the start of a period equals its position. With \(r=d-1,\) this position is uniform on \(\set{d,d+1,\ldots,d+Q-1}.\) Therefore,
\begin{align*} \E{\IL^+} &= \frac1Q\sum_{i=d}^{d+Q-1}i = d+\frac{Q-1}{2},\\ c(Q,d-1) &= \frac{Kd}{Q}+h\left(d+\frac{Q-1}{2}\right). \end{align*}Treating \(Q\) as continuous, differentiating and setting the derivative to zero yields the result. The unconstrained optimum satisfies \(Q\geq d\) when \(2K\geq hd.\) Otherwise, the constrained continuous optimum is \(Q=d.\) For the discrete model, choose a feasible integer \(Q\geq d\) satisfying the gcd assumption by comparing costs.