Below is the output from running the Bubbles Brewery Example model.
{ "dual": { "constraint_dual": { "corn": 1, "hops": 2, "malt": 0 }, "variable_dual": { "dark_beer": 0, "light_beer": 0 } }, "objective": { "profit": 800 }, "primal": { "constraint_value": { "corn": 480, "hops": 160, "malt": 980 }, "variable_value": { "dark_beer": 28, "light_beer": 12 } } }
Objective function value
objective
In this example, the optimal objective function value is 800.
Primal decision variables
primal > variable_value
Primal decision variables are the variables in an optimization problem that represent the decisions to be made. These variables are typically the primary focus of the problem and are directly associated with the objective function and constraints.
In this example, the decision variables are 28 barrels of dark beer and 12 barrels of light beer.
Constraint values
primal > constraint_value
Constraint values indicate the evaluated left-hand side of each constraint, based on the optimal values of the decision variables. The left-hand side consists of the decision variables and their respective coefficients, while the right-hand side is a constant term with no variables.
In other words, constraint values represent how much of each resource is used in the optimal solution. In this example, 480 units of corn, 160 units of hops, and 980 units of malt are used. Comparing these to the original right-hand side limits—480 for corn, 160 for hops, and 1,190 for malt—you can see that all of the corn and hops are fully utilized. These constraints are binding, meaning they directly influence the optimal solution. Meanwhile, 210 units of malt are unused, making this a non-binding constraint.
Dual decision variables
For an example of how the dual problem is created and how these values are found, refer to the Bubbles Brewery Dual Formulation example.
dual > constraint_dual
Dual decision variables, also known as shadow prices or Lagrange multipliers, are variables associated with the constraints of an optimization problem. Each dual decision variable corresponds to a specific constraint in the primal problem. The value of a dual decision variable represents the rate of change in the optimal value of the objective function with respect to a small change in the right-hand side of the corresponding constraint.
In other words, the dual decision variables provide insight into how much the objective function would improve if the resources or limits defined by the constraints were relaxed or tightened by one. They are particularly useful for sensitivity analysis, helping to understand the economic or opportunity cost of constraints in the optimization model.
In a maximization problem, a positive dual variable indicates that increasing the right-hand side of the corresponding constraint would improve the objective function value, while in a minimization problem, it indicates that increasing the right-hand side would worsen the objective function value.
Note that these values only apply to linear programming problems. If any decision variables are integer constrained, the values will all say zero as they cannot be determined. Also note that these values do not hold true forever. Meaning if you change the constraint too much, the objective function value may change by a different amount.
In the Bubbles Brewery example, if we modify the corn constraint to have one more unit of corn available, the objective function would increase by 1 unit. If we modify the hops constraint to have one more unit of hops available, the objective function value would increase by 2 units. If we modify the amount of malt available, the objective function value would not change. Note that the inverse of these statements is also true. If we modify the problem so there is one less unit of hops available, the objective function value will decrease by 2 units.
Dual slack
dual > variable_dual
Slack variables in the dual problem of a mathematical optimization model represent the unused or excess resources. Each primal constraint corresponds to a dual variable, and slack variables measure how much room exists between resource availability and utilization. Zero slack indicates the dual constraint is binding, meaning it holds as an equality, while positive slack means the constraint is not fully used.
Comments
0 comments
Please sign in to leave a comment.