29-2 Complementary slackness
Complementary slackness describes a relationship between the values of primal variables and dual constraints and between the values of dual variables and primal constraints. Let be a feasible solution to the primal linear program given in , and let be a feasible solution to the dual linear program given in . Complementary slackness states that the following conditions are necessary and sufficient for and to be optimal:
and
a. Verify that complementary slackness holds for the linear program in lines .
b. Prove that complementary slackness holds for any primal linear program and its corresponding dual.
c. Prove that a feasible solution to a primal linear program given in lines is optimal if and only if there exist values such that
- is a feasible solution to the dual linear program given in ,
- for all such that , and
- for all such that .
a. An optimal solution to the LP program given in - is . An optimal solution to the dual is . It is then straightforward to verify that the equations hold.
b. First suppose that complementary slackness holds. Then the optimal objective value of the primal problem is, if it exists,
which is precisely the optimal objective value of the dual problem. If any is , then those terms drop out of them sum, so we can safely replace by whatever we like in those terms. Since the objective values are equal, they must be optimal. An identical argument shows that if an optimal solution exists for the dual problem then any feasible solution for the primal problem which satisfies the second equality of complementary slackness must also be optimal.
Now suppose that and are optimal solutions, but that complementary slackness fails. In other words, there exists some such that but , or there exists some such that but . In the first case we have
This implies that the optimal objective value of the primal solution is strictly less than the optimal value of the dual solution, a contradiction. The argument for the second case is identical. Thus, and are optimal solutions if and only if complementary slackness holds.
c. This follows immediately from part (b). If is feasible and satisfies conditions 1, 2, and 3, then complementary slackness holds, so and are optimal. On the other hand, if is optimal, then the dual linear program must have an optimal solution as well, according to Theorem 29.10. Optimal solutions are feasible, and by part (b), and satisfy complementary slackness. Thus, conditions 1, 2, and 3 hold.