I took two operations research classes back in college, 10 years ago. I have not used the knowledge since then, but I'd like to do a refresher on it. I'd like to minimize the cost of keeping an external warehouse stocked with enough inventory to meet forecasted demand.
I have a cost function $C(x)$ made up of three cost elements:
$P(x)$ is the cost to pick the product from an internal warehouse.
$S(X)$ is the cost to ship the product to the external warehouse.
$W(x)$ is the cost to house the product at the external warehouse.
The product can be picked and shipped in two forms - single unit or cases. Single unit will have a more expensive per unit cost to pick and ship but you can pick and ship any number of units. Cases have to be picked and shipped by the case quantity. Costs to house the product at the external warehouse is based on average cubic feet per day.
Here's what I've come up with so far:
minimize $C(x)$ where $x$ = units, $f$ = forecasted demand such that $x \ge f$
$$C(x) = P(x) + S(x) + W(x)$$
Where I'm struggling is:
- Understanding how to represent the fact that each day has separate demand, so we'll probably want multiple shipments throughout a week/month/year.
- How to build out $P(x)$ and $S(x)$ to indicate the costs depend on whether the units are a full case or not.
How can I represent these two constraints in my model?
Assuming the product is not something with a really short shelf live (so that what isn't used in any period is immediately discarded), you need to index your quantity variable by time, and you also need to introduce a variable (also indexed by time) for inventory. You then add flow constraints, of the form "previous inventory level + arriving shipments - sales/demand = new inventory level".
You also have to decide what happens if inventory is less than demand. One possibility is that you do not allow it (require all demand to be covered, regardless of cost), in which case you need constraints of the form "inventory at start of period >= demand for period" (or "starting inventory + arrivals >= demand" if shipments arrive before demand is incurred). Another possibility is that unmet demand is simply lost, possibly with a penalty (in which case you need a variable for lost demand in each period). A third possibility is backordering (unmet demand is satisfied in the following period), which you can handle either by letting you inventory variable go negative (if there is no penalty for backordering) or by introducing yet another time-indexed variable for backorders and including it in the flow constraints.