Linear programming is a mathematical method that is used to optimize the allocation of resources. It can be applied to a wide range of problems, such as maximizing profits or minimizing costs. One of the key concepts in linear programming is the shadow price, which can be used to determine how a change in one of the constraints of a linear programming problem affects the optimal solution.
What is the shadow price
So, what exactly is the shadow price? In simple terms, the shadow price represents the amount by which the optimal objective function value would change in response to a change of one unit in one of the constraints. To understand this, let’s consider an example.
the shadow price is the amount the objective function improves when we get an extra unit of the resource represented by the constraint
Suppose you are running a factory that produces two products, A and B. The factory has a limited amount of resources, including labor, materials, and machine time. Your goal is to maximize profits, subject to these resource constraints. This problem can be formulated as a linear programming problem, with the objective of maximizing profit:
Maximize P = 5A + 4B
Subject to:
- 2A + 3B ≤ 12 (labor constraint)
- A + 2B ≤ 8 (materials constraint)
- A + B ≤ 5 (machine time constraint)
Here, P represents the total profit earned by producing A and B, and the three constraints represent the limited availability of labor, materials, and machine time. To solve this problem, we can use a linear programming solver, which will determine the optimal values of A and B that maximize profit, subject to these constraints. A and B are the decision variables representing now many units of A and B optimize the production mix.
Shadow Price Linear Programming: Solving with Excel Solver
I formulated the problem above in Excel with this layout (this is just one way to do it, there are other ways, probably better ones):
The second row contains the decision variables, and the values shown are for the optimal solution (A=5, B=0). The third row contains the objective function. Rows 4, 5 and 6 contain the three constraints.
And this is the formulation in the Excel Solver menu corresponding to the layout shown above:
Chosing to get a Sensitivity Analysis report and solving we get this in a separate sheet:
Which clearly shows in the last row that for cell $A$6 (the third constraint is in row 6) the shadow price is 5. We would get the objective function to go up by 5 if we get an extra unit of the third constraint.
The shadow price is the maximum that we should be willing to pay for an extra unit of recources in that constraint
Conclusion
As you can see, the shadow price provides valuable information about the sensitivity of the optimal solution to changes in the constraints of a linear programming problem. In general, the shadow price for a particular constraint will be non-negative, since increasing the availability of a resource will either improve the objective function value or have no effect. However, there may be cases where the shadow price is zero as you can see it is the case for the first two constraints. If the shadow price is zero it means we should not pay any price for more resources because those constraints are “non-boundary constraints” that are really not restricting the decisions made.