What Duality is about in LP and derivation

To understand what duality is about, recall our introductory LP with the two types of chocolate:

maxx1+6x2x1200x2300x1+x2400x1,x20\max x_1 + 6x_2 \\ \begin{split} x_1 &\le 200 \\ x_2 &\le 300 \\ x_1 + x_2 &\le 400 \\ x_1, x_2 &\ge 0 \end{split}

The simplex algorithm declares the optimum solution as (x1,x2)=(100,300)(x_1, x_2) = (100,300), with objective value 19001900

Suppose we multiply the tree equalities by 0,5,10,5,1, we have

x1+6x21900x_1 + 6x_2 \le 1900

The multiplirs (0,5,1)(0,5,1) magically constitute a certificate of optimality!

But how do we systematically find it?

With the incentive above, we formulate our multipliers and call them yiy_i

MultiplierInequality
y1y_1x1200x_1 \le 200
y2y_2x2300x_2 \le 300
y3y_3x1+x2400x_1 + x_2 \le 400

To start with, those yiy_i must be nonnegative or otherwise they would flip the inequality directions.

(y1+y3)x1+(y2+y3)x2200y1+300y2+400y3(y_1 + y_3)x_1 + (y_2+y_3)x_2 \le 200y_1+300y_2+400y_3

We want the left hand side to look like our objective function x1+6x2x_1 + 6x_2 so the right-hand side is an upper-bound on the optimum solution ⇒ so

x1+6x2200y1+300y2+400y3 if {i,yi0y1+y31y2+y36x_1 + 6x_2 \le 200y_1 + 300 y_2 + 400y_3 \text{ if } \begin{cases} \forall i, y_i \ge 0 \\ y_1 + y_3 \ge 1 \\ y_2 + y_3 \ge 6 \end{cases}

Although we can let yiy_i to be arbitrarily large, we want this bound to be a tight bound so should minimize 200y1+300y2+400y3200y_1 + 300y_2 + 400y_3

Therefore now we have a new LP:

min200y1+300y2+400y3y1+y31y2+y36y1,y2,y30\min 200y_1 + 300y_2 + 400y_3 \\ \begin{split} y_1 + y_3 &\ge 1 \\ y_2 + y_3 &\ge 6 \\ y_1, y_2, y_3 &\ge 0 \end{split}

any feasible value of this dual LP is an upper bound on the original primal LP. So if we somehow find a pair of primal and dual feasible values that are equal, then they must be optimal.