LPSolve Shadow Prices
Hello, and welcome to this LPSolve Knowledge Base video. In this episode, we’ll discuss shadow prices in LPSolve and how to interpret the information they provide after a ration is formulated.
Let’s start by looking at a simple formulation example. Here, we’re balancing a milk replacer ration using whole milk and milk replacer ingredients. In this formulation, we’ve set two minimum specifications: dry matter at 15 percent and crude protein at 24 percent. When we run the formulation, the solver finds a feasible solution that meets both of these minimum requirements, and the total cost of the ration is $487.33 per ton.
We’ll begin by examining the shadow price for the minimum crude protein constraint. Protein is binding at 24 percent, meaning the ration is formulated exactly at the minimum level allowed. The shadow price tells us how much the ration cost will change if we increase that minimum protein requirement. In this case, the shadow price is $1,447.83 per unit. Because protein is expressed as a decimal fraction in the formulation, this corresponds to a cost increase of about $14.48 per one percentage-point increase in crude protein.
The solver also provides an allowable range for this shadow price. In this example, the shadow price is valid between protein levels of 23.30 percent and 24.57 percent. As long as we adjust the protein minimum within this range, the same shadow price applies. If we move outside that range, the formulation will restructure and a new shadow price will be calculated.
To see this in practice, let’s increase the minimum protein from 24.0 percent to 24.5 percent. This change keeps us within the allowable range. When we rerun the formulation, the ration cost increases from $487.33 to $494.57, a difference of $7.24 per ton. That result matches the shadow price exactly: multiplying the shadow price of $1,447.83 by the 0.005 increase in protein gives a predicted cost increase of $7.24 per ton.
We can interpret dry matter shadow prices the same way. In this example, dry matter also has a binding minimum, with a shadow price of $1,058 per unit. This value is valid between dry matter levels of 14.91 percent and 17 percent. If we increase the dry matter minimum from 15 to 16 percent and rerun the formulation, the ration cost increases by $10.58 per ton. Again, this matches the shadow price once we account for the units used in the formulation.
Shadow prices are useful because they tell us which nutrients are driving ration cost and how expensive those nutrients are at the margin. Shadow prices only appear when a constraint is binding. If a nutrient is not binding, changing its minimum or maximum has no effect on ration cost, and no shadow price is reported. By comparing shadow prices across nutrients, we can quickly identify which constraints are most costly and where small changes in requirements may have the largest economic impact.
That’s it for this video on shadow prices. Thanks for watching, and be sure to check out the other LPSolve Knowledge Base videos to learn how to get the most out of the program.