In the following inventory problem, there are $N$ units of inventory available at the beginning of the time horizon $T$. Each day $t\in T$, it is possible to sell one unit of the inventory at price $c_t$. The problem is find the optimal sequence of days where the units are sold, in order to maximize revenues.
It is obvious that the optimal sequence of days are the $N$ days with largest price $c_t$, however the point of the exercise is to use dynamic programming with the following (backwards) recursive equation: $$ f(t,n) = \max\left\{ f(t+1,n), f(t+1,n-1)+c_t \right\} $$ The equation states that on day $t$ with $n$ units of inventory, the optimal revenue is the maximum value between:
- $f(t+1,n)$, in which case the inventory is kept constant
- $f(t+1,n-1)+c_t$, in which case one unit is sold at price $c_t$, and inventory decreases by one unit
The recursive equation can be initialized with $f(|T|+1,n)=0$ (the items of the inventory cannot be sold after the last day of the time horizon), and the optimal strategy consists in selling one unit on day $t$ if $$c_t \ge f(t,n)-f(t,n-1)$$ i.e. if the marginal revenue of one unit of inventory is smaller than the price $c_t$.
If I decide to solve this problem with linear programming, is it possible to extract the value $f(t,n)-f(t,n-1)$ somehow? Indeed, I understand that this value is of interest because it can be used to find the optimal trajectory, but also because it represents the future revenues that can be expected from one unit of inventory at a given time, at a given level. In other words, it is a measure of the "value" of the inventory. If the problem becomes more complex with side constraints, or that dynamic programming is no longer an option for some reason, how can I still compute this indicator? Is it hidden somewhere in the equivalent linear program?