Part 11 - Linear Programming: Duality and Sensitivity Analysis

Introduction

In this part we will cover duality for Linear Programs (LPs) and the corresponding weak & strong duality theorems. Further, we will also discuss sensitivity analysis and complementarity of (dual) LPs, which will give us an alternative view of the simplex method.a

Primal-Dual LP Problems

Definition 1 (Primal LP Problem)

Consider the primal LP problem on standard form,

(P)z={min cTxsubject to Ax=b x0\begin{align*} (P) \quad & \newline z^{\star} & = \begin{cases} \min \ & \mathbf{c}^T \mathbf{x} \newline \text{subject to} \ & A \mathbf{x} = \mathbf{b} \newline \ & \mathbf{x} \geq \mathbf{0} \end{cases} \end{align*}

where zz^{\star} is the optimal objective value.

Definition 2 (Dual LP Problem)

The dual LP problem corresponding to the primal LP problem (P)(P) is,

(D)q={max bTysubject to ATyc\begin{align*} (D) \quad & \newline q^{\star} & = \begin{cases} \max \ & \mathbf{b}^T \mathbf{y} \newline \text{subject to} \ & A^T \mathbf{y} \leq \mathbf{c} \end{cases} \end{align*}

where qq^{\star} is the optimal objective value.

Explanation (Derivation of the Dual Problem)

We know that the Lagrangian for the primal LP problem is,

L(x,y)=cTxyT(bAx)=bTy+xT(ATyc)\begin{align*} \mathcal{L}(\mathbf{x}, \mathbf{y}) & = \mathbf{c}^T \mathbf{x} - \mathbf{y}^T (\mathbf{b} - A \mathbf{x}) \newline & = \mathbf{b}^T \mathbf{y} + \mathbf{x}^T (A^T \mathbf{y} - \mathbf{c}) \end{align*}

thus, the dual function q(y)q(\mathbf{y}) is,

q(y)=inf bTy+xT(ATyc)subject to x0={bTy,ATyc0,otherwise\begin{align*} \begin{align*} q(\mathbf{y}) = & \inf \ \mathbf{b}^T \mathbf{y} + \mathbf{x}^T (A^T \mathbf{y} - \mathbf{c}) \newline & \text{subject to} \ \mathbf{x} \geq \mathbf{0} \newline \end{align*} \newline = \begin{cases} \mathbf{b}^T \mathbf{y}, & A^T \mathbf{y} - \mathbf{c} \leq \mathbf{0} \newline -\infty, & \text{otherwise} \end{cases} \end{align*}

Therefore, the dual problem is,

max q(y)subject to ATyc\begin{align*} \max \ & q(\mathbf{y}) \newline \text{subject to} \ & A^T \mathbf{y} \leq \mathbf{c} \end{align*}

which is exactly the dual LP problem defined above.

Remark 1

We note that the primal has nn variables and mm constraints, while the dual has mm variables and nn constraints.

Further, the dual of the dual is the primal, i.e., (D)(D) is the dual of (P)(P) and (P)(P) is the dual of (D)(D).

Proof

The Lagrangian for the dual LP problem is,

L(y,x)=bTy+xT(cATy)=cTx+yT(bAx)\begin{align*} \mathcal{L}(\mathbf{y}, \mathbf{x}) & = \mathbf{b}^T \mathbf{y} + \mathbf{x}^T (\mathbf{c} - A^T \mathbf{y}) \newline & = \mathbf{c}^T \mathbf{x} + \mathbf{y}^T (\mathbf{b} - A \mathbf{x}) \end{align*}

thus, the dual function p(x)p(\mathbf{x}) is,

p(x)=sup cTx+yT(bAx)subject to y free={cTx,Ax=b+,otherwise\begin{align*} \begin{align*} p(\mathbf{x}) = & \sup \ \mathbf{c}^T \mathbf{x} + \mathbf{y}^T (\mathbf{b} - A \mathbf{x}) \newline & \text{subject to} \ \mathbf{y} \text{ free} \newline \end{align*} \newline = \begin{cases} \mathbf{c}^T \mathbf{x}, & A \mathbf{x} = \mathbf{b} \newline +\infty, & \text{otherwise} \end{cases} \end{align*}

Therefore, the dual problem is,

min p(x)subject to Ax=b x0\begin{align*} \min \ & p(\mathbf{x}) \newline \text{subject to} \ & A \mathbf{x} = \mathbf{b} \newline \ & \mathbf{x} \geq \mathbf{0} \end{align*}

which is exactly the primal LP problem defined above, thus the dual of the dual is the primal.

Lastly, we can derive duals of LPs on non-standard form as well.

Intuition (Dual Problems on Non-Standard Form)

From what we have seen, we can see some symmetries between the primal and dual LP problems. Using these symmetries, we can derive duals of LPs on non-standard form.

Table 1: Symmetries between primal and dual linear programs.
Primal (P) Dual (D)
min\min/inf\inf max\max/sup\sup
Variables Constraints
0\geq 0 \leq
0\leq 0 \geq
free ==
Constraints Variables
== free
\geq 0\geq 0
\leq 0\leq 0

Weak and Strong Duality

Theorem 1 (Weak Duality Theorem)

If x\mathbf{x} is a feasible solution to the primal LP problem (P)(P) and y\mathbf{y} is a feasible solution to the dual LP problem (D)(D), then,

cTxbTy\mathbf{c}^T \mathbf{x} \geq \mathbf{b}^T \mathbf{y}
Proof

Since x\mathbf{x} is feasible for (P)(P), we have that Ax=bA \mathbf{x} = \mathbf{b} and x0\mathbf{x} \geq \mathbf{0}.

Since y\mathbf{y} is feasible for (D)(D), we have that ATycA^T \mathbf{y} \leq \mathbf{c}. Therefore,

cTx(ATyc)Tx=yT(Ax)=b=bTy\begin{align*} \mathbf{c}^T \mathbf{x} & \geq (\underbrace{A^T \mathbf{y}}_{\leq \mathbf{c}})^T \mathbf{x} \newline & = \mathbf{y}^T \underbrace{(A \mathbf{x})}_{= \mathbf{b}} \newline & = \mathbf{b}^T \mathbf{y} _\blacksquare \end{align*}

From this theorem, we have some corollaries.

Corollary 1
  1. If z=z^{\star} = -\infty (the primal is unbounded), then the dual is infeasible.
  2. If q=+q^{\star} = +\infty (the dual is unbounded), then the primal is infeasible.
Proof
  1. Suppose that the primal is unbounded, i.e., z=z^{\star} = -\infty. If the dual is feasible, then there exists a feasible y\mathbf{y} such that bTy\mathbf{b}^T \mathbf{y} is finite. However, by the weak duality theorem, we have that cTxbTy\mathbf{c}^T \mathbf{x} \geq \mathbf{b}^T \mathbf{y} for all feasible x\mathbf{x}. This contradicts the assumption that the primal is unbounded, thus the dual must be infeasible.
  2. The proof is similar to the first part, by swapping the roles of the primal and dual.
  1. If x\mathbf{x} is feasible to (P)(P) and y\mathbf{y} is feasible to (D)(D) such that cTx=bTy\mathbf{c}^T \mathbf{x} = \mathbf{b}^T \mathbf{y}, then x\mathbf{x} and y\mathbf{y} are optimal to (P)(P) and (D)(D), respectively.
Theorem 2 (Strong Duality Theorem)

If both (P)(P) and (D)(D) are both feasible, then there exists optimal x\mathbf{x}^{\star} to (P)(P) and optimal y\mathbf{y}^{\star} to (D)(D) such that,

cTx=bTy\mathbf{c}^T \mathbf{x}^{\star} = \mathbf{b}^T \mathbf{y}^{\star}
Proof

Let (P)(P) be feasible, thus z>z^{\star} > -\infty, therefore, there exists an optimal BFS.

Let x\mathbf{x}^{\star} be an optimal BFS to (P)(P), for this BFS, we know that c~NT0\tilde{\mathbf{c}}_N^T \geq \mathbf{0}, let y=cBTB1\mathbf{y}^{\star} = \mathbf{c}_B^T B^{-1}.a

c~NT=cNTcBTB1N=cNTyTN0NTycN\begin{align*} \tilde{\mathbf{c}}_N^T & = \mathbf{c}_N^T - \mathbf{c}_B^T B^{-1} N \newline & = \mathbf{c}_N^T - \mathbf{y}^{\star T} N \newline & \geq \mathbf{0} \newline \Rightarrow & N^T \mathbf{y}^{\star} \leq \mathbf{c}_N \newline \end{align*}

Furthermore,

cBTyTB=cBTcBTB1BIBTy=cBcB\begin{align*} \mathbf{c}_B^T - \mathbf{y}^{\star T} B & = \mathbf{c}_B^T - \mathbf{c}_B^T \underbrace{B^{-1} B}_{\mathbf{I}} \newline \mathbf{B}^T \mathbf{y}^{\star} & = \mathbf{c}_B \leq \mathbf{c}_B \newline \end{align*}

This means that,

ATy=[BTNT]y=[BTyNTy][cBcN]=c\begin{align*} A^T \mathbf{y}^{\star} & = \begin{bmatrix} B^T \newline N^T \end{bmatrix} \mathbf{y}^{\star} = \begin{bmatrix} B^T \mathbf{y} \newline N^T \mathbf{y} \end{bmatrix} \leq \begin{bmatrix} \mathbf{c}_B \newline \mathbf{c}_N \end{bmatrix} = \mathbf{c} \newline \end{align*}

and thus y\mathbf{y}^{\star} is feasible for (D)(D).

Further,

bTy=yTb=cBTB1bxB=cBTxB+cNTxN=cTx\begin{align*} \mathbf{b}^T \mathbf{y}^{\star} & = \mathbf{y}^{\star T} \mathbf{b} \newline & = \underbrace{\mathbf{c}_B^T B^{-1} b}_{\mathbf{x}_B} \newline & = \mathbf{c}_B^T \mathbf{x}_B^{\star} + \mathbf{c}_N^T \mathbf{x}_N^{\star} \newline & = \mathbf{c}^T \mathbf{x}^\star \newline \end{align*}

Thus, by corollary of weak duality, x\mathbf{x}^{\star} and y\mathbf{y}^{\star} are optimal to (P)(P) and (D)(D), respectively. _\blacksquare

Remark 2

If x\mathbf{x}^{\star} is an optimal BFS to (P)(P) such that c~NT0\tilde{\mathbf{c}}_N^T \geq \mathbf{0}, then y=(B1)TcB\mathbf{y}^{\star} = (B^{-1})^T \mathbf{c}_B is optimal to (D)(D).

Table 2: Possible primal and dual linear-program outcomes.
Finite Optimal Solution Unbounded Infeasible
Finite Optimal Solution Possible\color{green}{\text{Possible}} Impossible\color{red}{\text{Impossible}} Impossible\color{red}{\text{Impossible}}
Unbounded Impossible\color{red}{\text{Impossible}} Impossible\color{red}{\text{Impossible}} Possible\color{green}{\text{Possible}}
Infeasible Impossible\color{red}{\text{Impossible}} Possible\color{green}{\text{Possible}} Possible\color{green}{\text{Possible}}

Sensitivity Analysis

When solving LP problems, it is often the case that the parameters (i.e., AA, b\mathbf{b}, and c\mathbf{c}) are not known exactly. Thus, it is important to understand how changes in these parameters affect the optimal solution and objective value. This is the goal of sensitivity analysis.

Definition 3 (Sensitivity Analysis in c\mathbf{c})

Let x\mathbf{x}^{\star} (nondegenerate and unique) be an optimal BFS to the primal LP problem (P)(P). Further, consider some arbitrary perturbation,

min (c+Δc)Txsubject to Ax=b x0\begin{align*} \min \ & (\mathbf{c} + \Delta \mathbf{c})^T \mathbf{x} \newline \text{subject to} \ & A \mathbf{x} = \mathbf{b} \newline \ & \mathbf{x} \geq \mathbf{0} \end{align*}

x\mathbf{x}^{\star} remains optimal if and only if,

c~NT=(cN+ΔcN)T(cB+ΔcB)TB1N0\tilde{\mathbf{c}}_N^T = (\mathbf{c}_N + \Delta \mathbf{c}_N)^T - (\mathbf{c}_B + \Delta \mathbf{c}_B)^T B^{-1} N \geq \mathbf{0}
Note

We would ideally like to define a function that maps,

w(c)=min cTxsubject to Ax=bx0w(\mathbf{c}) = \begin{align*} & \min \ \mathbf{c}^T \mathbf{x} \newline & \text{subject to} \ A \mathbf{x} = \mathbf{b} \newline & \mathbf{x} \geq \mathbf{0} \end{align*}

If Δc\Delta \mathbf{c} is small enough, then we are interested in cw(c)\nabla_{\mathbf{c}} w(\mathbf{c}),

w(c)=cTxcw(c)=x\begin{align*} w(\mathbf{c}) & = \mathbf{c}^T \mathbf{x}^{\star} \newline \nabla_{\mathbf{c}} w(\mathbf{c}) & = \mathbf{x}^{\star} \end{align*}

However, this is only valid if x\mathbf{x}^{\star} remains optimal for all small perturbations in c\mathbf{c}.

Definition 4 (Sensitivity Analysis in b\mathbf{b})

Let x\mathbf{x}^{\star} (nondegenerate and unique) be an optimal BFS to the primal LP problem (P)(P). Further, consider some arbitrary perturbation,

min cTxsubject to Ax=b+Δb x0\begin{align*} \min \ & \mathbf{c}^T \mathbf{x} \newline \text{subject to} \ & A \mathbf{x} = \mathbf{b} + \Delta \mathbf{b} \newline \ & \mathbf{x} \geq \mathbf{0} \end{align*}

x\mathbf{x}^{\star} remains optimal if and only if,

[xBxN]=[B1(b+Δb)0]0\begin{bmatrix} \mathbf{x}_B \newline \mathbf{x}_N \end{bmatrix} = \begin{bmatrix} B^{-1} (\mathbf{b} + \Delta \mathbf{b}) \newline \mathbf{0} \end{bmatrix} \geq \mathbf{0}
Note

We would ideally like to define a function that maps,

v(b)=min cTxsubject to Ax=bx0v(\mathbf{b}) = \begin{align*} & \min \ \mathbf{c}^T \mathbf{x} \newline & \text{subject to} \ A \mathbf{x} = \mathbf{b} \newline & \mathbf{x} \geq \mathbf{0} \end{align*}

If Δb\Delta \mathbf{b} is small enough, then we are interested in bv(b)\nabla_{\mathbf{b}} v(\mathbf{b}),

Theorem 3 (Shadow Prize Theorem)

If for a given bb the optimal BFS of (P)(P) is nondegenerate and unique, then bv(b)=y\nabla_{\mathbf{b}} v(\mathbf{b}) = \mathbf{y}^{\star}, where y\mathbf{y}^{\star} is the optimal solution to the dual problem (D)(D).

Complementarity

Theorem 4 (Complementary Slackness Theorem)

Let x\mathbf{x} be feasible to the primal LP problem (P)(P) and y\mathbf{y} be feasible to the dual LP problem (D)(D).

{x is optimal to (P)y is optimal to (D)    xj(cj(Aj)Ty)=0, j=1,,n\begin{cases} \mathbf{x} \text{ is optimal to } (P) \newline \mathbf{y} \text{ is optimal to } (D) \end{cases} \newline \iff \newline x_j \left(c_j - (A_j)^T \mathbf{y}\right) = 0, \ \forall j = 1, \ldots, n \newline

where AjA_j is the jj-th column of AA.

Corollary 2 (Characterization of Optimal Solutions)

x\mathbf{x} is optimal to (P)(P) and y\mathbf{y} is optimal to (D)(D) if and only if,

{Ax=b, x0ATycxj(cj(Aj)Ty)=0, j=1,,n\begin{cases} A \mathbf{x} = \mathbf{b}, \ \mathbf{x} \geq \mathbf{0} \newline A^T \mathbf{y} \leq \mathbf{c} \newline x_j \left(c_j - (A_j)^T \mathbf{y}\right) = 0, \ \forall j = 1, \ldots, n \end{cases}
Algorithm (Alternative View of the Simplex Method)
  1. Partition A=[BN]A = \begin{bmatrix} B & N \end{bmatrix} with xB=B1b\mathbf{x}_B = B^{-1} \mathbf{b} and xN=0\mathbf{x}_N = \mathbf{0} (BFS), so primally feasible.
  2. For [BTNT]y[cBcN]\begin{bmatrix} B^T \newline N^T \end{bmatrix} \mathbf{y} \leq \begin{bmatrix} \mathbf{c}_B \newline \mathbf{c}_N \end{bmatrix}, let y=(B1)TcB\mathbf{y} = (B^{-1})^T \mathbf{c}_B, this implies complementarity.
  3. Left to check for optimality is dual feasibility, this means,
NTycNNT(B1)TcBcNc~NT=cNTcBTB1N0\begin{align*} N^T \mathbf{y} & \leq \mathbf{c}_N \newline N^T (B^{-1})^T \mathbf{c}_B & \leq \mathbf{c}_N \newline \tilde{\mathbf{c}}_N^T & = \mathbf{c}_N^T - \mathbf{c}_B^T B^{-1} N \geq \mathbf{0} \end{align*}
  1. If c~NT0\tilde{\mathbf{c}}_N^T \geq \mathbf{0}, then x\mathbf{x} and y\mathbf{y} are optimal for (P)(P) and (D)(D), respectively.
  2. If c~NT≱0\tilde{\mathbf{c}}_N^T \not\geq \mathbf{0}, then perform a pivot step to get a new BFS and repeat from step 2.