Maximize x1+2x2 given −3x1+2x2≤10 and x1+x2≤15 and x1,x2≥0.Minimize 10y1+15y2 given −3y1+y2≥1 and 2y1+y2≥2 and y1,y2≥0.
More generally, the dual looks like this:
Claim. If both linear programs are feasible, the following is true.
max{c⊤x∣Ax≤b and x≥0}=min{b⊤y∣A⊤y≥c and y≥0}
Proof: To show weak duality, just write c⊤x=x⊤c≤x⊤A⊤y=(Ax)⊤y≤b⊤y.
To show strong duality, ehhhh it's like vibe-ly obvious, but proving it requires Farkas' Lemma. ■
Some jargon dumping:
In the former, we have m primal constraints and n primal decision variables.
In the dual, we have m dual decision variables and n dual constraints.
The dual of the dual is the primal.
Remark. It is possible for both an LP and its dual to be infeasible. Try to construct one!
Example. More generally, we might want to find the dual of more complicated linear programs.
Maximize x1−x2+2x3 given −x1+3x2≤−3 and x1+3x3≥2 and x2+x3=7 and x1,x2≥0.
Take some time to convince yourself that the dual is the following.
Minimize −3y1+2y2+7y3 given −y1+y2≥1 and 3y1+y3≥−1 and 3y2+y3=2 and y1≥0,y2≤0.
Be very careful about the choices of {≥,≤,=}.
Remark. Given an optimal solution to the primal, we can find an optimal solution to the dual. We do this by identifying the constraints in the primal that are slacked, ignoring those, and setting everything else to be tight. This is DCW-Equality.
We can use LP to solve the MST problem. Give indicator variables xe for all edges with xe≥0.
Minimize e∈E∑w(e)xe given e crosses Π∑xe≥∣Π∣−1 for all partitions Π of V and xe≥0.
The optimal value is at most the weight of an MST. The hope is that the optimal solution uses xe∈{0,1}, in which case the optimal solution is an MST. Note that the dual of this problem looks like:
Maximize partitions Π∑(∣Π∣−1)yΠ given Π:e crosses Π∑yΠ≤w(e) for all e∈E and yΠ≥0.