Complementary Slackness Conditions

Use the complementary slackness conditions to relate primal and dual optimal solutions of a linear program: identify forced-zero dual variables, compute one optimum from the other, and certify optimality of a primal-dual pair.

Step 1 of 157%

Tutorial

Introduction to Complementary Slackness

Consider the standard primal–dual LP pair.

Primal: max  cTx\max\; c^T x subject to Axb, x0.A x \le b,\ x \ge 0.

Dual: min  bTy\min\; b^T y subject to ATyc, y0.A^T y \ge c,\ y \ge 0.

By the strong duality theorem, any optimal pair (x,y)(x^*, y^*) satisfies cTx=bTy.c^T x^* = b^T y^*. Combined with primal–dual feasibility, this identity forces a precise pairing between constraint slacks and variable values — the complementary slackness (CS) conditions.

For each primal constraint i=1,,m:i = 1, \ldots, m{:}

yi(biaiTx)=0.y_i^* \cdot (b_i - a_i^T x^*) = 0.

For each primal variable j=1,,n:j = 1, \ldots, n{:}

xj(ajTycj)=0.x_j^* \cdot (a_j^T y^* - c_j) = 0.

Equivalently:

  • yi>0    aiTx=biy_i^* > 0 \;\Longrightarrow\; a_i^T x^* = b_i (positive dual variable ⇒ primal constraint is tight).
  • aiTx<bi    yi=0a_i^T x^* < b_i \;\Longrightarrow\; y_i^* = 0 (slack primal constraint ⇒ zero shadow price).
  • xj>0    ajTy=cjx_j^* > 0 \;\Longrightarrow\; a_j^T y^* = c_j (positive primal variable ⇒ corresponding dual constraint is tight).
  • ajTy>cj    xj=0a_j^T y^* > c_j \;\Longrightarrow\; x_j^* = 0 (slack dual constraint ⇒ corresponding primal variable is zero).

These conditions are both necessary and sufficient for a primal–dual feasible pair to be optimal.

navigate · Enter open · Esc close · ⌘K/Ctrl K toggle