<p>I find the geometric interpretation useful. Say we have the primal as $\max c x$ subject to $Ax \le b$ and $x \ge 0$. We know that optimum solutions are vertices of the polytope defined by the constraints. Each such vertex is defined by the intersection of $n$ linearly independent hyperplanes defined by the constraints. When is a vertex solution $x^*$ optimal for the direction $c$? It is optimal iff the vector $c$ is in the cone of the rows of $A$ defining the vertex $x^*$ (that is the vector $c$ can be written as a non-negative combination of the rows defining $x^*$). Otherwise we can improve the solution. The dual variables corresponding to the rows defining $x^*$ are strictly positive and the rest are $0$. This shows dual complementary slackness. Once we have strong duality we also get primal complementary slackness. </p>

CC BY-SA 4.0
2019-10-11T02:53:04.447Z
This is very well illustrated and explained in more detail on page 93 of Schrijver "Theory of Linear and Integer Programming."
Elle Najt
CC BY-SA 3.0
2014-06-15T14:35:20.053Z
2014-06-15T14:35:20.053Z
Chandra Chekuri
<p>As you have noted, complementary slackness follows immediately from strong duality, i.e., equality of the primal and dual objective functions at an optimum.
Complementarity slackness can be thought of as a combinatorial optimality condition, where a zero duality gap (equality of the primal and dual objective functions) can be thought of as a numerical optimality condition.</p>

<p>In order to understand what complementary slackness means, the concept of dual variables as "shadow prices" is useful. The dual variable associated with a primal constraint is called the constraint's shadow price because it can be thought of as how much the objective function would increase if the constraint was relaxed (meaning e.g. the right hand side of a $\le$ constraint was increased). </p>

<p>Complementary slackness says that at an optimal solution, if a shadow price (dual variable) is positive, meaning that the objective function could be increased if the corresponding primal constraint was relaxed, then this primal constraint must be tight. If not, the primal objective function value could be improved (by changing the primal variables in order to make this non-binding primal constraint binding).</p>

CC BY-SA 3.0
2014-06-15T09:41:33.153Z
2016-03-30T14:22:58.073Z
2016-03-30T14:22:58.073Z
Rahul Savani
<p>What's an intuitive proof that shows that the conditions of complementary slackness are indeed true:</p>

<ol>
<li>If $x^*_j &gt; 0$ then the $j$-th constraint in the dual is binding.</li>
<li>If the $j$-th constraint in the dual is not binding, then $x^*_j = 0$</li>
</ol>

<p>And similarly for the dual variables $y^*_i$ and constraints in the Primal. Where $x^*$ and $y^*$ are the optimal solutions to the Primal and Dual respectively.</p>

<p>What's an intuitive proof as to why this is the case? Staring at the equations makes sense algebraically, but I wish to understand it at a more visceral level.</p>

<ds.algorithms><linear-programming><primal-dual>
Intuitively, why is the complementary slackness condition true?
PhD
# Intuitively, why is the complementary slackness condition true?

(Asked by: username_0 on 2014-06-15)

What's an intuitive proof that shows that the conditions of complementary slackness are indeed true:

1. If $x^\*\_j > 0$ then the $j$-th constraint in the dual is binding.
2. If the $j$-th constraint in the dual is not binding, then $x^\*\_j = 0$

And similarly for the dual variables $y^\*\_i$ and constraints in the Primal. Where $x^\*$ and $y^\*$ are the optimal solutions to the Primal and Dual respectively.

What's an intuitive proof as to why this is the case? Staring at the equations makes sense algebraically, but I wish to understand it at a more visceral level.

**Tags:** ds.algorithms, linear-programming, primal-dual

---

## 2 answers

### Answer by username_3 on 2014-06-15. Score: 17 | Accepted answer

As you have noted, complementary slackness follows immediately from strong duality, i.e., equality of the primal and dual objective functions at an optimum.
Complementarity slackness can be thought of as a combinatorial optimality condition, where a zero duality gap (equality of the primal and dual objective functions) can be thought of as a numerical optimality condition.

In order to understand what complementary slackness means, the concept of dual variables as "shadow prices" is useful. The dual variable associated with a primal constraint is called the constraint's shadow price because it can be thought of as how much the objective function would increase if the constraint was relaxed (meaning e.g. the right hand side of a $\le$ constraint was increased).

Complementary slackness says that at an optimal solution, if a shadow price (dual variable) is positive, meaning that the objective function could be increased if the corresponding primal constraint was relaxed, then this primal constraint must be tight. If not, the primal objective function value could be improved (by changing the primal variables in order to make this non-binding primal constraint binding).


---

### Answer by username_1 on 2014-06-15. Score: 10

I find the geometric interpretation useful. Say we have the primal as $\max c x$ subject to $Ax \le b$ and $x \ge 0$. We know that optimum solutions are vertices of the polytope defined by the constraints. Each such vertex is defined by the intersection of $n$ linearly independent hyperplanes defined by the constraints. When is a vertex solution $x^\*$ optimal for the direction $c$? It is optimal iff the vector $c$ is in the cone of the rows of $A$ defining the vertex $x^\*$ (that is the vector $c$ can be written as a non-negative combination of the rows defining $x^\*$). Otherwise we can improve the solution. The dual variables corresponding to the rows defining $x^\*$ are strictly positive and the rest are $0$. This shows dual complementary slackness. Once we have strong duality we also get primal complementary slackness.

> **Comments:**
> **username_2**: This is very well illustrated and explained in more detail on page 93 of Schrijver "Theory of Linear and Integer Programming."  

---

