Recovering a Dual Solution from a Primal Solution
Given an optimal primal solution to a linear program, use the complementary slackness conditions to set up and solve a linear system that recovers the optimal dual solution.
Tutorial
Recovering the Dual via Complementary Slackness
Given an optimal primal solution we can recover the optimal dual solution by solving a small linear system built from the complementary slackness conditions.
For a primal of the form
the dual is
Complementary slackness gives two rules:
- (Positive primal variable.) If then the -th dual constraint is tight:
- (Slack primal constraint.) If then
To recover write one equation for each positive and one equation for each slack primal constraint, and solve the linear system in
For example, consider the primal
with optimal Both primal constraints are tight, and both variables are positive. The dual constraints (one per primal variable) are
Rule 1 forces both to be tight:
Solving gives