Every linear program can be converted into Canonical form

max⁡cTxs.t. Ax≤bx≥0 \begin{array}{lr} \max & c^T x \\ \text{s.t. } & Ax \le b \\ &x \ge 0 \end{array}

for some c,x∈Rnc, x \in \mathbb{R}^n, A∈Rm×nA \in \mathbb{R}^{m \times n} and b∈Rmb \in \mathbb{R}^m.

Dual Program and Weak Duality

Next, we try to construct an upper bound for the optimal solution of this optimization problem, based on its linear constraints.

If y∈Rmy \in \mathbb{R}^m and y≥0y \ge 0, then yT(Ax)y^T (Ax) is called a conic combination of the constraints. It holds that

yT(Ax)≤yTb. y^T (Ax) \le y^T b.

If yy further satisfies the constraint

cT≤yTA, c^T \le y^T A,

combining with the fact that x≥0x \ge 0, we get

cTx≤(yTA)x=yT(Ax)≤yTb. c^T x \le (y^T A) x = y^T (Ax) \le y^T b.

Hence yTby^T b is an upper bound of the optimal value of the original program. We want the bound to be as tight as possible. This motivates another linear program:

min⁡yTbs.t. yTA≥cTy≥0 \begin{array}{lr} \min & y^T b \\ \text{s.t. } & y^T A \ge c^T \\ & y \ge 0 \end{array}

We call the original program the primal and the derived program its dual. The philosophy behind the dual construction is to combine the primal constraints to obtain a bound of its optimal value.

Corollary. If the primal is unbounded, then the dual is infeasible. If the dual is unbounded, then the primal is infeasible.

In general, the primal may not be given in Canonical form and can be formulated as

max⁡cTx+cˉTxˉ+c^Tx^s.t. Ax+Aˉxˉ+A^x^≤bBx+Bˉxˉ+B^x^=bˉCx+Cˉxˉ+C^x^≥b^x≥0x^≤0 \begin{array}{lr} \max & c^T x + \bar c^T \bar x + \hat c^T \hat x \\ \text{s.t. } & Ax + \bar A \bar x + \hat A \hat x \le b \\ & Bx + \bar B \bar x + \hat B \hat x = \bar b \\ & Cx + \bar C \bar x + \hat C \hat x \ge \hat b \\ & x \ge 0 \\ & \hat x \le 0 \end{array}

Note that the xˉ\bar x's are unconstrained variables. Driven by the same philosophy, we hope to derive an upper bound by using the constraints:

cTx+cˉTxˉ+c^Tx^≤yT(Ax+Aˉxˉ+A^x^)+yˉT(Bx+Bˉxˉ+B^x^)+y^T(Cx+Cˉxˉ+C^x^)≤yTb+yˉTbˉ+y^Tb^ \begin{aligned} c^T x + \bar c^T \bar x + \hat c^T \hat x & \le y^T (Ax + \bar A \bar x + \hat A \hat x) \\ & + \bar y^T (Bx + \bar B \bar x + \hat B \hat x) \\ & + \hat y^T (Cx + \bar C \bar x + \hat C \hat x) \\ &\le y^T b + \bar y^T \bar b + \hat y^T \hat b \end{aligned}
  1. To guarantee the second inequality, we require that

    • yT≥0y^T \ge 0 (since the constraint Ax+Aˉxˉ+A^x^≤bAx + \bar A \bar x + \hat A \hat x \le b holds),

    • yˉT\bar y^T be unconstrained (since the constraint Bx+Bˉxˉ+B^x^=bˉBx + \bar B \bar x + \hat B \hat x = \bar b holds), and

    • y^T≤0\hat y^T \le 0 (since the constraint Cx+Cˉxˉ+C^x^≥b^Cx + \bar C \bar x + \hat C \hat x \ge \hat b holds).

    We see that the types of constraints in the primal determine the signs of variables in the dual.

  2. The reverse is also true: the constraints in the dual are determined the signs of variables in the primal. The first inequality implies that (by proper rearranging):

    cTx+cˉTxˉ+c^Tx^≤(yTA+yˉTB+y^TC)x+(yTAˉ+yˉTBˉ+y^TCˉ)xˉ+(yTA^+yˉTB^+y^TC^)x^ \begin{aligned} c^T x + \bar c^T \bar x + \hat c^T \hat x & \le (y^T A + \bar y^T B + \hat y^T C)x \\ & + (y^T \bar A + \bar y^T \bar B + \hat y^T \bar C) \bar x \\ & + (y^T \hat A + \bar y^T \hat B + \hat y^T \hat C) \hat x \end{aligned}

    As x≥0x \ge 0, xˉ\bar x unconstrained and x^≤0\hat x \le 0, a sufficient condition for the inequality to become true is

    cT≤(yTA+yˉTB+y^TC)cˉT=(yTAˉ+yˉTBˉ+y^TCˉ)c^T≥(yTA^+yˉTB^+y^TC^) \begin{aligned} c^T & \le (y^T A + \bar y^T B + \hat y^T C) \\ \bar c^T & = (y^T \bar A + \bar y^T \bar B + \hat y^T \bar C) \\ \hat c^T & \ge (y^T \hat A + \bar y^T \hat B + \hat y^T \hat C) \\ \end{aligned}

    That gives the first set of constraints the dual variables yy, yˉ\bar y and y^\hat y need to satisfies, respectively. We have just seen that the sign of the primal variable determines the type of constraint in the dual.

    Of particular interest is the inequality constraint, which we will discuss in details in the next section.

The rules of obtaining dual are summarized as follows:

Primalmax⁡min⁡DualConstraints≤bi≥bi=bi≥0≤0Both sidesVariablesVariables≥0≤0Both sides≥cj≤ci=cjConstraints \begin{array}{llll} \hline \text{Primal} & \max & \min & \text{Dual} & \\ \hline \text{Constraints} & \begin{array}{l} \le b_i \\ \ge b_i \\ = b_i \end{array} & \begin{array}{l} \ge 0 \\ \le 0 \\ \text{Both sides} \end{array} & \text{Variables} & \\ \hline \text{Variables} & \begin{array}{l} \ge 0 \\ \le 0 \\ \text{Both sides} \end{array} & \begin{array}{l} \ge c_j \\ \le c_i \\ = c_j \end{array} & \text{Constraints} & \\ \hline \end{array}

Complementary Slackness

The strong duality states that, if both primal and dual are feasible, then the objective function values of their optimal solutions are equal. It follows that the inequalities in weak duality are saturated

cTx=(yTA)x=yT(Ax)=yTb. c^T x = (y^T A) x = y^T (Ax) = y^T b.

Therefore,

(yTA−cT)x=0, yT(b−Ax)=0. (y^T A - c^T) x = 0,\, \\ y^T (b - Ax) = 0.

If the primal is in canonical form, then the fact that yTA≥cy^T A \ge c, x≥0x \ge 0, y≥0y \ge 0, and b−Ax≥0b - Ax \ge 0 implies that

(yTA−cT)i=0∨xi=0, ∀ i∈[n],yj=0∨(b−Ax)j=0, ∀ j∈[m], \begin{matrix} (y^T A - c^T)_i = 0 &\vee & x_i = 0,\, &\forall \ i \in [n], \\ y_j = 0 &\vee & (b - Ax)_j = 0,\, &\forall \ j \in [m], \end{matrix}

where (yTA−cT)i(y^T A - c^T)_i is its ii-th coordinate of the vector yTA−cT∈R1×ny^T A - c^T \in \mathbb{R}^{1 \times n}, and (b−Ax)j(b - Ax)_j is the jj-th coordinate of the vector b−Ax∈Rm×1b - Ax \in \mathbb{R}^{m \times 1}.

This is known as complementary slackness.

Question to ponder: what is the geometric interpretation of complementary slackness?

Strong Duality

Theorem. Exactly one of the following four cases holds:

  1. Neither the primal nor the dual is feasible.
  2. If both the primal and dual are feasible, then their optimal values are equal.
  3. If the primal is feasible and unbounded, and dual is infeasible.
  4. If the dual is feasible and unbounded, and primal is infeasible.

Special Case

We first consider the special case such that not every linear program can be converted to this case. We consider the general form in the next section.

The special case is given by

min⁡yTb,s.t. yTA=cT. \begin{array}{lr} \min & y^T b, \\ \text{s.t. } & y^T A = c^T. \end{array}

The dual form is given by

max⁡cTx,s.t. Ax=b. \begin{array}{lr} \max & c^T x, \\ \text{s.t. } & Ax = b. \end{array}

The primal is feasible if cc is a linear combination of rows of AA, i.e., in the row space of AA. The dual is feasible if bb is a linear combination of columns of AA, i.e., in column space of AA, denoted as C(A)C(A).

It is possible that neither the primal nor the dual is feasible.

Example.

A=[1, 00, 0], b=[11], c=[11]. A = \begin{bmatrix} 1,\, &0\\ 0,\, &0\\ \end{bmatrix},\, b= \begin{bmatrix} 1 \\ 1 \\ \end{bmatrix},\, c= \begin{bmatrix} 1 \\ 1 \\ \end{bmatrix}.

Then neither Ax=bA x = b nor yTA=cTy^T A = c^T is feasible.

If both primal and dual are feasible, then for all feasible solutions xx and yy, it holds that

cTx=(yTA)x=yT(Ax)=yTb. c^T x = (y^T A) x = y^T (Ax) = y^T b.

Next, we show that

Theorem.

  1. If the primal is feasible and dual is infeasible, then the primal is unbounded.
  2. If the dual is feasible and primal is infeasible, then the dual is unbounded.

Proof. By symmetry, we prove just the former.

If Ax=bAx = b is not feasible, then bb lies outside the column space of AA, denoted as C(A)C(A) (the subspace in Rm\mathbb{R}^m spanned by the column vectors of AA). Let N(AT)N(A^T) be the subspace orthogonal to C(A)C(A). We can decompose bb into two part:

b=b1+b2, b = b_1 + b_2,

where b1∈C(A)b_1 \in C(A) is in the columns space of AA and b2∈N(AT)b_2 \in N(A^T) is orthogonal to the columns space of AA. By assumption we have b2≠0⃗b_2 \neq \vec 0.

Suppose yy is a feasible solution to yTA=cTy^T A = c^T. Then for all k∈Rk \in \mathbb{R}, y+k⋅b2y + k \cdot b_2 is still a feasible solution, since

(y+k⋅b2)TA=yTA+k⋅b2TA=yTA=cT. (y + k \cdot b_2)^T A = y^T A + k \cdot b_2^T A = y^T A = c^T.

The new solution has objective

(y+k⋅b2)Tb=yTb+k⋅∥b2∥22. (y + k \cdot b_2)^T b = y^T b + k \cdot \Vert b_2 \Vert_2^2.

When k→−∞k \rightarrow - \infty, we have yTb+k⋅∥b2∥22→−∞y^T b + k \cdot \Vert b_2 \Vert_2^2 \rightarrow - \infty, which implies that the primal is unbounded.

General Case

We discuss the more general form:

min⁡yTb,s.t. yTA≥cT. \begin{array}{lr} \min & y^T b, \\ \text{s.t. } & y^T A \ge c^T. \end{array}

Every linear program can be converted into this general form.

Its dual is given by

max⁡cTx,s.t. Ax=b,x≥0. \begin{array}{lr} \max & c^T x, \\ \text{s.t. } & Ax = b, \\ & x \ge 0. \end{array}

By weak duality,

cTx≤yTAx=yTb c^T x \le y^T A x = y^T b

To prove strong duality, we need only to prove that

If both primal and dual are feasible, then there exists feasible x,yx, y, such that cTx=yTAxc^T x = y^T A x.

Define the feasible set of the primal as

F≐{y∈Rm:yTA≥cT}. F \doteq \{ y \in \mathbb{R}^m : y^T A \ge c^T \}.

Let y⋆y^\star be the optimal solution for the primal. We see that y⋆y^\star can not be an interior point of the feasible set FF. Otherwise, for small enough k>0k > 0, y⋆−k⋅by^\star - k \cdot b belongs to FF. But (y⋆−k⋅b)Tb<y⋆b(y^\star - k \cdot b)^T b < y^\star b, contradicting y⋆y^\star being optimal.

Therefore, y⋆y^\star must be on the boundary of the FF, and there must exit one or more constraints saturated by y⋆y^\star. Define the set of indexes of the constraints that are saturated by y⋆y^\star

S≐{i∈[m]:(y⋆)TAi=ci}⊆[m], S \doteq \{ i \in [m] : (y^\star)^T A_i = c_i \} \subseteq [m],

where AiA_i is the ii-th column of matrix AA and cic_i is the ii-th coordinator of vector cc. Let ASA_S be set of columns indexed by SS.

Lemma. bb is in the conic hull of columns of ASA_S, i.e., ∃xS∈R∣S∣\exists x_S \in R^{|S|}, such that

  1. ASxS=bA_S x_S = b.
  2. xS≥0x_S \ge 0.

Such xSx_S can be converted into a feasible solution xx to the dual (by padding zeros in dimensions other than SS). It holds that

cTx=(y⋆)TAx=(y⋆)T(ASxS)=(y⋆)Tb. c^T x = (y^\star)^T A x = (y^\star)^T (A_S x_S ) = (y^\star)^T b.

Question to ponder: prove the existence of optimal solution of the primal, assuming feasibility of the dual.

Proof. We prove that if bb is not in the conic hull of ASA_S, we can more y⋆y^\star along some direction that decreases objective while maintaining feasibility.

By Farkas' Lemma, if bb is not in the conic hull of ASA_S, ∃v∈Rm\exists v \in \mathbb{R}^m, such that

  1. vTAS≥0v^T A_S \ge 0.
  2. vTb<0v^T b < 0.

Then we can move the vector y⋆y^\star along the direction of vv, by adding k⋅vk \cdot v to y⋆y^\star for some k≥0k \ge 0. This decreases the objective

(y⋆+k⋅v)Tb=(y⋆)Tb+k⋅vTb<(y⋆)Tb. (y^\star + k \cdot v)^T b = (y^\star)^T b + k \cdot v^T b < (y^\star)^T b.

How large can kk be, so the constraints (y⋆+k⋅v)TA≥cT(y^\star + k \cdot v)^T A \ge c^T are maintained.

  1. If i∈Sˉi \in \bar S, then (y⋆)TAi>ci(y^\star)^T A_i > c_i. Define

    ti≐{∞, if  vTAi≥0,((y⋆)TAi−ci)/∣vTAi∣, if  vTAi<0, t_i \doteq \begin{cases} \infty,\, &\text{if }\, v^T A_i \ge 0, \\ \Big( (y^\star)^T A_i - c_i \Big) / \big| v^T A_i \big|,\, &\text{if }\, v^T A_i < 0, \\ \end{cases}

    Then ti>0t_i > 0 and it is guaranteed that

    (y⋆)TAi+ti⋅v≥ci. (y^\star)^T A_i + t_i \cdot v \ge c_i.

    Denote k≐min⁡i∈Sˉti>0k \doteq \min_{i \in \bar S} t_i > 0.

  2. If i∈Si \in S, as vTAi≥0v^T A_i \ge 0, for the value of kk defined above, it holds that

    (y⋆+kv)TAi=ci+kvTAi≥ci, (y^\star + k v)^T A_i = c_i + k v^T A_i \ge c_i,

It concludes that (y⋆+kv)(y^\star + k v) is feasible. But (y⋆+kv)Tb<(y⋆)Tb(y^\star + k v)^T b < (y^\star)^T b. A contradiction.

Question to ponder: connect the above discussion to Lagrange multiplier and K.K.T condition.

Reference.

  1. David P. Williamson, ORIE 6300 Mathematical Programming I, Lecture 8
  2. Boyd, S. and Vandenberghe, L., 2004. Convex optimization. Cambridge university press.