Verifying Optimality via Complementary Slackness
Use complementary slackness as a practical optimality test. Given a candidate primal solution (and optionally a candidate dual), check primal feasibility, construct or check the matching dual via CS, and conclude whether the candidate is optimal or not.
Tutorial
Optimality as a Checklist
The complementary slackness theorem turns optimality into a checklist. Given a candidate primal solution and a candidate dual solution , we can certify both are optimal without ever solving either LP.
For the primal--dual pair
the pair is simultaneously optimal if and only if all three of the following hold:
- Primal feasibility: and .
- Dual feasibility: and .
- Complementary slackness:
- For each primal constraint : .
- For each primal variable : .
In words: whenever a primal constraint is slack, the matching dual variable must be ; whenever a dual constraint is slack, the matching primal variable must be .
To verify a candidate pair, we just run the checklist.