300. Duality

300.1. Linear Programming Duality

Every linear program (primal) has a unique and symmetric dual problem. For any primal LP, there is a unique dual, whose dual is the primal.

Solving the dual gives you information about the primal.

300.1.1. General Form

300.1.2. Standard Form


ObjmaxminObj
Constraint=00urs.Variable
Variable00urs.=Constraint
Example

Minimization

Maximization


300.1.3. Weak Duality

  1. Dual objective gives a lower bound for a minimization primal
𝑐𝑇𝑥𝑏𝑇𝑦
  1. Dual objective gives an upper bound for a maximization primal
𝑐𝑇𝑥𝑏𝑇𝑦

Sufficiency of optimality

If 𝑥̄ and 𝑦̄ are primal and dual feasible and 𝑐𝑇𝑥̄𝑦̄𝑇𝑏, then 𝑥̄ and 𝑦̄ are primal and dual optimal

Example

Given a primal feasible solution 𝑥̄, if we find a dual feasible solution so that their objective values are identical, 𝑥̄ is optimal (strong duality)

300.1.4. Dual Oprimal solution

If we have solved the primal LP, the dual optimal solution can be obtained

If 𝑥̄ is primal optimal with basis 𝐵, then 𝑦̄𝑇=𝑐𝐵𝑇𝐴𝐵1 is dual optimal

300.1.5. Strong Duality

If both primal and dual are feasible and at least one has an optimal solution:

𝑥̄ and 𝑦̄ are primal and dual optimal iff 𝑥̄ and 𝑦̄ are primal and dual feasible and

𝑐𝑇𝑥̄=𝑏𝑇𝑦̄
Example


Using the simplex method, we obtain the optimal tableau:

  • The associated optimal basis is 𝐵=(1,2,5)
  • The optimal solution is 𝑥̄=(3,2)
  • The associated objective value is 𝑧=3

For the standard form primal LP:

𝑐𝑇=[
]
𝐴=[
]

Given 𝑥𝐵=(𝑥1,𝑥2,𝑥5) and 𝑥𝑁=(𝑥2,𝑥4):

𝑐𝐵𝑇=[
]
𝐴𝐵=[
]
𝑦̄=𝑐𝐵𝑇𝐴𝐵1=[100][141401212012121]=[14140]

For 𝑦̄=(14,14,0):

  • It is dual feasible: 2(14)+2(14)>1 and 14+14+00
  • Its dual objective value 𝑤=4(14)+8(14)=3=𝑧

Therefore 𝑦̄ is dual optimal

Example

Minimization

Minimization

300.1.6. Feasibility-Infeasibility Certificates

PrimalDual
InfeasibleUnboundedFinitely Optimal
Infeasible
Unbounded
Finitely Optimal
Example

Infeasible Primal Infeasible Dual

Infeasible Primal Unbounded Dual

Unbounded Primal Infeasible Primal

300.1.7. Strong and Weak Duality

Problem TypeDualityWeak DualityStrong Duality
Min Primal
Max Dual
𝑐𝑇𝑥𝑏𝑇𝑦𝑐𝑇𝑥>𝑏𝑇𝑦if𝑥𝑥or𝑦𝑦𝑐𝑇𝑥=𝑏𝑇𝑦
Max Primal
Min Dual
𝑐𝑇𝑥𝑏𝑇𝑦𝑐𝑇𝑥<𝑏𝑇𝑦if𝑥𝑥or𝑦𝑦𝑐𝑇𝑥=𝑏𝑇𝑦

300.1.8. Complimentary Slackness

Slack variables of the dual LP

min𝑦𝑇𝑏𝑠.𝑡.𝑦𝑇𝐴𝑣𝑇=𝑐𝑇𝑣0

𝑥̄ and (𝑦̄,𝑣̄) are primal and dual optimal iff they are feasible and 𝑣̄𝑇𝑥̄=𝟎

Proof

We have

𝑐𝑇𝑥̄=(𝑦̄𝑇𝐴𝑣̄𝑇)𝑥̄=𝑦̄𝑇𝐴𝑥̄𝑣̄𝑇𝑥̄=𝑦̄𝑇𝑏𝑣̄𝑇𝑥̄

Therefore 𝑣̄𝑇𝑥̄=0 iff 𝑐𝑇𝑥̄=𝑦̄𝑇𝑏, i.e., 𝑥̄ and (𝑦̄,𝑣̄) are primal and dual optimal according to strong duality.

Example

If optimal solution:

𝑥1𝑣1=𝟎𝑥2𝑣2=𝟎

Similarly, for an optimal solution:

𝑠1𝑦1=𝟎𝑠2𝑦2=𝟎

Let (𝑥̄,𝑠̄) be primal optimal, we have (𝑥̄,𝑠̄)=(3,2,0,0,1). Let’s find the dual optimal solution (𝑦̄,𝑣̄) without solving the LP.

According to complimentary slackness 𝑥1̄,𝑥2̄,𝑠1̄>0 imply 𝑣1̄=𝑣2̄=𝑦3̄=0 since:

𝑥1̄𝑥1̄=0𝑥2̄𝑥2̄=0𝑠3̄𝑦3̄=0

The two dual functional equalities are reduced to:

2𝑦1̄+2𝑦2̄=1𝑦1̄+𝑦2̄=0

Solving the above equaltions results in 𝑦1̄=14 and 𝑦2̄=14.

(𝑦̄,𝑣̄) is then guaranteed to be dual optimal

(𝑧=3=𝑤)

If a primal solution is positive, the dual slack must be zero and vis versa.

𝑥𝑖(𝑐𝑖(𝐴𝑇𝑦)𝑖)=𝟎𝑖

If:

300.1.9. Shadow Prices

What if I have an additional unit of a particular resource?

For each resource there is a maximum price we are willing to pay for one additional unit

Definition: Shadow Price

For an LP that has an optimal colution, the shadow price of a constraint if the amount the objective value increases when the RHS of that constraint increases by 1, assuming the current optimal basis remains optimal

Sign or Shadow Price

Objective
Function
Constraint
=
max00Free
min00Free

Finding all shadow prices:

Example

The solution to the dual program is the shadow price of the primal

What are the shadow prices?

min6𝑥1+4𝑥2𝑠.𝑡.𝑥1+𝑥222𝑥1+𝑥21

Solve the dual LP

max2𝑦1+𝑦2𝑠.𝑡.𝑦1+3𝑦26𝑦1+𝑦24

The dual optimal solution is 𝑦=(4,0)

So shadow prices are 4 and 0 respectively

The shadow price is the absolute increase on the objective value given an increase of 1 on the RHS values

Instead of solving 𝑚 LPs (one for each constraint increase by 1), we can just solve the dual LP