Computer Science/Optimization

14. Duality

  • -
728x90
반응형

Introduction

  • A baker with two types of cakes: simple and fancy
  • Both types require some basic ingredients; the fancy type requires fancier ingredients and more labor but generates more profit.
  • Popular bakery: No upper limit on the quantity that can be sold
  • Baker’s problem: How many simple and fancy cakes to produce?
max24x1+14x2\max 24x_1 + 14x_2

subject to\text{subject to}

3x1+2x21204x1+x21002x1+x270x1,x203x_1 + 2x_2 \le 120 \\ 4x_1 + x_2 \le 100 \\ 2x_1 + x_2 \le 70 \\ x_1, x_2\ge 0

Optimum : x1=16,x2=36x_1^* = 16, x_2^* = 36

→ Total revenue : 888

Suppose I would like to take over the baker’s business. How much should I pay to get this deal? Consider unit price I pay for the baker’s asset as the variables

min120y1+100y2+70y3\min 120y_1 + 100 y_2 + 70y_3

subject to\text{subject to}

3y1+4y2+2y3242y1+y2+y314y1,y2,y303y_1 + 4y_2 + 2y_3 \ge 24\\2y_1 + y_2 + y_3 \ge 14 \\ y_1, y_2, y_3 \ge 0
Dual linear program
The dual of a given linear program (LP) is another LP that is derived from the original (the primal) LP in the following schematic way:
https://en.wikipedia.org/wiki/Dual_linear_program
Duality (optimization)
In mathematical optimization theory, duality or the duality principle is the principle that optimization problems may be viewed from either of two perspectives, the primal problem or the dual problem. If the primal is a minimization problem then the dual is a maximization problem (and vice versa). Any feasible solution to the primal (minimization) problem is at least as large as any feasible solution to the dual (maximization) problem. Therefore, the solution to the primal is an upper bound to the solution of the dual, and the solution of the dual is a lower bound to the solution of the primal.[1] This fact is called weak duality.
https://en.wikipedia.org/wiki/Duality_(optimization)

Dual LP

For any LP, there is a dual LP

  • min \leftrightarrow max
  • objective function \leftrightarrow Right-hand side
  • Transposed constraint matrix
  • variable sign depends on the type of inequality

The original LP is called the primal

  1. Primal
mincTx\min c^Tx

subject to\text{subject to}

Axbx0Ax \ge b \\ x \ge 0
  1. Dual
maxbTy\max b^Ty

subject to\text{subject to}

ATycy0A^Ty \le c \\ y \ge 0

Derivation

We already see that primal problem and dual problem related to the order of the optimization.

We can express the primal problem by using Lagrangian as follows

minx0maxλ0cTxλT(Axb)\min_{x\ge0}\max_{\lambda\ge 0} c^Tx - \lambda^T(Ax - b)

If we swap the order of optimization i.e.

maxλ0minx0cTxλT(Axb)\max_{\lambda\ge 0}\min_{x\ge0} c^Tx - \lambda^T(Ax - b)

we call it dual problem.

Note that

maxλ0minx0cTxλT(Axb)=maxλ0minx0icixiλi(Aixibi)=maxλ0minx0i(ciλiAi)xi+λibi\max_{\lambda\ge 0}\min_{x\ge0} c^Tx - \lambda^T(Ax - b)\\ = \max_{\lambda\ge 0}\min_{x\ge0} \sum_ic_ix_i - \lambda_i(A_ix_i - b_i) \\ =\max_{\lambda\ge0}\min_{x\ge0}\sum_i(c_i - \lambda_iA_i)x_i + \lambda_ib_i

where AiA_i is ii’th row of AA.

Since xi0,ix_i \ge 0,\forall i, it satisfy the condition as a constraint

💡
We can simply understand this concept as a constant in penalty function.

Therefore, above equation can be expressed

maxbTλ\max b^T\lambda

subject to\text{subject to}

ciλiAi,iλ0c_i \ge \lambda_iA_i, \forall i \\ \lambda \ge 0
💡
λ0\lambda \ge 0 is related to the dual feasibility or a constant in penalty function.

or we can expressed as follows

maxbTλ\max b^T\lambda

subject to\text{subject to}

ATλcλ0A^T\lambda \le c \\ \lambda\ge 0

Duality Table

Weak Duality

Assuming minimization in primal LP

  • Any feasible solution of the primal gives an upper bound for the dual
  • Any feasible solution of the dual gives a lower bound for the primal

Proof

Suppose take xx such that

Axb,x0Ax \ge b, x\ge 0

and take yy such that

ATyc,y0A^Ty \le c, y\ge 0

This is equivalent to

yTAcT,y0y^TA \le c^T, y\ge 0

Now, we compare the value of each objective funcitons.

cTxyTAxyTb=bTyc^Tx \ge y^TAx \ge y^Tb = b^Ty

Since xx and yy are arbitrary, this holds.

Suppose the primal has unbounded optimum, can we say something about the dual?

→ Dual have no feasible area

💡
즉 한쪽이 unbounded이면 다른쪽의 solution이 unfeasible하다.

Example of using Weak Duality

min120y1+100y2+70y3\min 120y_1 + 100 y_2 + 70y_3

subject to\text{subject to}

3y1+4y2+2y3242y1+y2+y314y1,y2,y303y_1 + 4y_2 + 2y_3 \ge 24\\2y_1 + y_2 + y_3 \ge 14 \\ y_1, y_2, y_3 \ge 0

Consider a solution in yy such that

y1=y3=0,y2=14y_1 = y_3 = 0, y_2 = 14

The value of its objective function is 1400. That means the maximum in the primal is at most 1400.

Strong Duality

If one of the two problems has an optimal solution, so does the other one and that the bounds given by the weak duality theorem are tight, i.e.

minxcTx=maxybTy\min_x c^Tx = \max_y b^Ty

Complementary Slackness and LP Optimality

Theorem (Complementary Slackness)

Consider a pair of primal and dual programs with the primal problem in standard form. If xx^* is optimal for the primal and yy^* is optimal for the dual, then

[x]T(cATy)=0[x^*]^T(c - A^Ty^*) = 0

If xx is feasible for the primal, yy is feasible for the dual, and xT(cATy)=0x^T(c - A^Ty) = 0, then xx and yy are optimal for their respective problems.

Proof

Note that

cTxyTAxc^Tx \ge y^TAx

for all x,ySx, y\in S, since x0x\ge0 and cTyTAc^T \ge y^TA

Similarly,

yTAxyTby^TAx \ge y^Tb

for all x,ySx, y \in S, since y0y\ge 0 and AxbAx \ge b

Let xx^* and yy^* are optimal for primal and dual respectively. Then

cTx[y]TAx[y]Tbc^Tx^* \ge [y^*]^TAx^* \ge [y^*]^Tb

By strong duality,

cTx=[y]TAx=[y]Tbc^Tx^* = [y^*]^TAx^* = [y^*]^Tb

Therefore,

[x]T(cATy)=0[x^*]^T(c - A^Ty^*) = 0

Since xT(cATy)=0x^T(c-A^Ty) = 0, it satisfy the KKT condition for dual problem. Therefore, yy is a optimal for dual problem. Moreover, by strong duality, we can sure that xx and yy are optimal for their respective problems.

💡
Notice that this condition is related to the complementary slackness condition in KKT condition. We will prove this relation exactly at the next section.

Optimality and the Lagrangian Function

We can view this problem as

mincTx\min c^Tx

subject to\text{subject to}

Axb(λ)Ix0(π)Ax \ge b \quad (\lambda) \\ Ix \ge 0 \quad (\pi)

Define

L(x,λ,π)=cTxλT(Axb)πT(Ix)\mathcal L(x, \lambda, \pi) = c^Tx - \lambda^T(Ax-b) - \pi^T(Ix)

Check KKT conditions

  1. Stationary condition
    xL(x,λ,π)=cATλπ=0\nabla_x \mathcal L(x, \lambda, \pi) = c - A^T\lambda - \pi = 0
  1. Dual feasibility
    λ0π0\lambda \ge0 \\ \pi \ge 0
  1. Primal feasibility
    AxbIx0Ax\ge b \\ Ix\ge 0
  1. Complementary slackness
    λT(Axb)=0πT(Ix)=0\lambda^T(Ax - b) = 0 \\ \pi^T(Ix) = 0

By stationary condition,

π=cATλ\pi = c - A^T\lambda

Since πx=0\pi x = 0,

πx=0=cxATλx(cATλ)x=0\pi x = 0 = cx - A^T\lambda x \\ \Rightarrow (c-A^T\lambda)x = 0

It is related to the complementary slackness

💡
Basically related to the optimal condition

Moreover, since π0\pi \ge 0,

cATλ0ATλcc- A^T\lambda \ge 0 \\ \Rightarrow A^T\lambda \le c

It is related to constraints in dual problem

반응형
Contents

포스팅 주소를 복사했습니다

이 글이 도움이 되었다면 공감 부탁드립니다.