1. Preface
For the past few months, I have been troubled with the following questions:
- How to construct the dual problem of a linear programming? Is there a general method to do this?
- Why is the number of variables in dual problem equal to the number of constraints in primal problem?
- Why is the number of constraints in dual problem equal to the number of variables in primal problem?
- Why is the sign of the i-th variable of dual problem determined by the sign of the i-th constraint of primal problem?
- Why is the the sign of the j-th constraint of dual problem is determined by the sign of the j-th variable of primal problem?
If you also want to know the reasons behind them, go on reading and you will have a deeper understanding of the dual problem.
2. Lagrange Dual Problem
2.1 Dual Pair
The two problems
z=max{c(x)∣x∈X}
w=min{w(u)∣u∈U}
form a (weak)-dual pair if c(x)≤w(u) for all x∈X and all u∈U. When z=w, they form a strong-dual pair.
2.2 Primal Problem
Consider an optimization problem
s.t.p∗=minf0(x)fi(x)≤0,i=1,⋯,m
We denote by D the domain of the problem, with D⊆Rn. The above is referred as primal problem.
One purpose of Lagrange duality is to find a lower bound on minimization problem.
2.3 Dual Problem
To the problem we associate the Lagrangian L:Rn×Rm→R
L(x,λ)=f0(x)+i=1∑mλifi(x)
The variables λ∈Rm are called Lagrange multipliers.
It can be easily verified that
f0(x)≥L(x,λ),∀x∈D,λ≥0
So the primal problem can be precisely expressed as
p∗=x∈Dminλ≥0maxL(x,λ)
We then define the Lagrange dual function
g(λ)=x∈RnminL(x,λ)
Thus we can obtain
f0(x)≥L(x,λ)≥g(λ),∀x∈D,λ≥0
so the problem
s.t.d∗=maxg(λ)λ≥0
and the primal problem form a (weak)-dual pair. The above problem is called Lagrange Dual Problem.
2.4 Cases With Equality Constraints
Generally, consider cases with equality constraints:
s.t.p∗=minf0(x){fi(x)≤0,i=1,⋯,mhi(x)=0,i=1,⋯,p
Rewrite the problem as:
s.t.p∗=minf0(x)⎩⎨⎧fi(x)≤0,hi(x)≤0,−hi(x)≤0,i=1,⋯,mi=1,⋯,pi=1,⋯,p
Using a multiplier vi+,vi− for the constraint hi(x)≤0 and −hi(x)≤0, we write the associated Lagrangian as
L(x,λ,v+,v−)=f0(x)+i=1∑mλifi(x)+i=1∑pvi+hi(x)+i=1∑pvi−(−hi(x))=f0(x)+i=1∑mλifi(x)+i=1∑pvihi(x)
where v=v+−v− doesn't have any sign constraints.
Thus, inequality constraints in the original problem are associated with sign constraints on the corresponding multipliers.
3. Examples
Based on the above theory, let's construct the dual problem of Linear Programming.
3.1 Inequality Form
Consider the following form,
s.t.maxcTx{Ax≤bx≥0
change the form into
s.t.min−cTx{Ax−b≤0−x≤0
Construct the Lagrangian
L(x,λ,v)=−cTx+λT(Ax−b)+vT(−x)=(−cT+λTA−vT)x−λTb
−cTx≥L(x,λ,v),∀λ≥0,v≥0
If −cT+λTA−vT=0, then
g(λ,v)=xminL(x,λ,v)=−λTb
−cTx≥L(x,λ,v)≥g(λ,v),∀λ≥0,v≥0
So the dual problem is
s.t.max−λTb{−cT+λTA=vTλ≥0,v≥0
The final form can be obtained as follow:
s.t.minλTb{ATλ≥cλ≥0
3.2 A General Form
Consider the following problem
s.t.maxc1x1+c2x2+c3x3⎩⎨⎧a11x1+a12x2+a13x3≤b1a21x1+a22x2+a23x3≥b2a31x1+a32x2+a33x3=b3x1≥0,x2≤0,x3 free
rewrite the problem as:
s.t.min−(c1x1+c2x2+c3x3)⎩⎨⎧a11x1+a12x2+a13x3−b1−(a21x1+a22x2+a23x3−b2)a31x1+a32x2+a33x3−b3−(a31x1+a32x2+a33x3−b3)−x1≤0x2≤0≤0≤0≤0≤0
Construct the Lagrangian
L(x,λ,v)==−c1x1−c2x2−c3x3+λ1+(a11x1+a12x2+a13x3−b1)+λ2−(−(a21x1+a22x2+a23x3−b2))+λ3+(a31x1+a32x2+a33x3−b3)+λ3−(−(a31x1+a32x2+a33x3−b3))+v1−(−x1)+v2+x2(−c1+λ1+a11−λ2−a21+(λ3+−λ3−)a31−v1−)x1+(−c2+λ1+a12−λ2−a22+(λ3+−λ3−)a32+v2+)x2+(−c3+λ1+a13−λ2−a23+(λ3+−λ3−)a33)x3−(λ1+b1−λ2−b2+(λ3+−λ3−)b3)
−c1x1−c2x2−c3x3≥L(x,λ,v),∀λ1+,λ2−,λ3+,λ3−,v1−,v2+≥0
If
−c1+λ1+a11−λ2−a21+(λ3+−λ3−)a31−v1−=0−c2+λ1+a12−λ2−a22+(λ3+−λ3−)a32+v2+=0−c3+λ1+a13−λ2−a23+(λ3+−λ3−)a33=0
let λ1=λ1+,λ2=−λ2−,λ3=λ3+−λ3−, then λ1≥0,λ2≤0,λ3 free,
−c1+λ1a11+λ2a21+λ3a31=v1−≥0−c2+λ1a12+λ2a22+λ3a32=−v2+≤0−c3+λ1a13+λ2a23+λ3a33=0
then
g(λ,v)=xminL(x,λ,v)=−(λ1+b1−λ2−b2+(λ3+−λ3−)b3)=−(λ1b1+λ2b2+λ3b3)
the dual problem is
s.t.minλ1b1+λ2b2+λ3b3⎩⎨⎧λ1a11+λ2a21+λ3a31≥c1λ1a12+λ2a22+λ3a32≤c2λ1a13+λ2a23+λ3a33=c3λ1≥0,λ2≤0,λ3 free
Now, I think your trouble has disappeared. Thanks for your attention!
4. Reference
[1]. Laurence A. Wolsey, Integer programming; John Wiley & Sons, Inc: New York, America, 1998; pp. 28.
[2]. Lecture 7: Weak Duality(Lecturer: Laurent El Ghaoui): people.eecs.berkeley.edu/~elghaoui/T…