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:
The weak duality theorem states that the objective value of the dual LP at any feasible solution is always a bound on the objective of the primal LP at any feasible solution (upper or lower bound, depending on whether it is a maximization or minimization problem). In fact, this bounding property holds for the optimal values of the dual and primal LPs.
The strong duality theorem states that, moreover, if the primal has an optimal solution then the dual has an optimal solution too, and the two optima are equal.[1]
These theorems belong to a larger class of duality theorems in optimization. The strong duality theorem is one of the cases in which the duality gap (the gap between the optimum of the primal and the optimum of the dual) is 0.
Suppose we have the linear program:
Maximize cTx subject to Ax ≤ b, x ≥ 0.We would like to construct an upper bound on the solution. So we create a linear combination of the constraints, with positive coefficients, such that the coefficients of x in the constraints are at least cT. This linear combination gives us an upper bound on the objective. The variables y of the dual LP are the coefficients of this linear combination. The dual LP tries to find such coefficients that minimize the resulting upper bound. This gives the following LP:
Minimize bTy subject to ATy ≥ c, y ≥ 0This LP is called the dual of the original LP.
The duality theorem has an economic interpretation.[2] If we interpret the primal LP as a classical "resource allocation" problem, its dual LP can be interpreted as a "resource valuation" problem.
Consider a factory that is planning its production of goods. Let
x
xi
i
c\geq0
i
ci
x\geq0
b
A\geq0
i
Aji
j
Then, the constrained revenue maximization is the primal LP:
Maximize cTx subject to Ax ≤ b, x ≥ 0.Now consider another factory that has no raw material, and wishes to purchase the entire stock of raw material from the previous factory. It offers a price vector of
y
i
yi
ATy\geqc
y\geq0
Minimize bTy subject to ATy ≥ c, y ≥ 0The duality theorem states that the duality gap between the two LP problems is at least zero. Economically, it means that if the first factory is given an offer to buy its entire stock of raw material, at a per-item price of y, such that ATy ≥ c, y ≥ 0, then it should take the offer. It will make at least as much revenue as it could producing finished goods.
The strong duality theorem further states that the duality gap is zero. With strong duality, the dual solution
y*
A
b
c
y*
A
b
c
To see why, consider if the raw material prices
y\geq0
Ty) | |
(A | |
i |
<ci
i
i
ATy\geqc,y\geq0
bTy
y*
The duality theorem has a physical interpretation too.
In general, given a primal LP, the following algorithm can be used to construct its dual LP. The primal LP is defined by:
x1,\ldots,xn
xi
xi\geq0
xi\leq0
xi\inR
maximize~~~c1x1+ … +cnxn
ajx1+ … +ajxn\lesseqqgtrbj
bj
\geq
\leq
=
The dual LP is constructed as follows.
y1,\ldots,ym
\geqbj
yj\leq0
\leqbj
yj\geq0
=bj
yj\inR
minimize~~~b1y1+ … +bmym
a1y1+ … +amym\lesseqqgtrci
ci
xi\leq0
\leqci
xi\geq0
\geqci
xi\inR
=ci
From this algorithm, it is easy to see that the dual of the dual is the primal.
If all constraints have the same sign, it is possible to present the above recipe in a shorter way using matrices and vectors. The following table shows the relation between various kinds of primals and duals.
Primal | Dual | Note | |
---|---|---|---|
Maximize cTx subject to Ax ≤ b, x ≥ 0 | Minimize bTy subject to ATy ≥ c, y ≥ 0 | This is called a "symmetric" dual problem | |
Maximize cTx subject to Ax ≤ b | Minimize bTy subject to ATy = c, y ≥ 0 | This is called an "asymmetric" dual problem | |
Maximize cTx subject to Ax = b, x ≥ 0 | Minimize bTy subject to ATy ≥ c |
Below, suppose the primal LP is "maximize cTx subject to [constraints]" and the dual LP is "minimize bTy subject to [constraints]".
The weak duality theorem says that, for each feasible solution x of the primal and each feasible solution y of the dual: cTx ≤ bTy. In other words, the objective value in each feasible solution of the dual is an upper-bound on the objective value of the primal, and objective value in each feasible solution of the primal is a lower-bound on the objective value of the dual. Here is a proof for the primal LP "Maximize cTx subject to Ax ≤ b, x ≥ 0":
Weak duality implies:
maxx cTx ≤ miny bTyIn particular, if the primal is unbounded (from above) then the dual has no feasible solution, and if the dual is unbounded (from below) then the primal has no feasible solution.
The strong duality theorem says that 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.:
maxx cTx = miny bTyThe strong duality theorem is harder to prove; the proofs usually use the weak duality theorem as a sub-routine.
One proof uses the simplex algorithm and relies on the proof that, with the suitable pivot rule, it provides a correct solution. The proof establishes that, once the simplex algorithm finishes with a solution to the primal LP, it is possible to read from the final tableau, a solution to the dual LP. So, by running the simplex algorithm, we obtain solutions to both the primal and the dual simultaneously.
Another proof uses the Farkas lemma.
1. The weak duality theorem implies that finding a single feasible solution is as hard as finding an optimal feasible solution. Suppose we have an oracle that, given an LP, finds an arbitrary feasible solution (if one exists). Given the LP "Maximize cTx subject to Ax ≤ b, x ≥ 0", we can construct another LP by combining this LP with its dual. The combined LP has both x and y as variables:
Maximize 1
subject to Ax ≤ b, ATy ≥ c, cTx ≥ bTy, x ≥ 0, y ≥ 0If the combined LP has a feasible solution (x,y), then by weak duality, cTx = bTy. So x must be a maximal solution of the primal LP and y must be a minimal solution of the dual LP. If the combined LP has no feasible solution, then the primal LP has no feasible solution either.
2. The strong duality theorem provides a "good characterization" of the optimal value of an LP in that it allows us to easily prove that some value t is the optimum of some LP. The proof proceeds in two steps:
Consider the primal LP, with two variables and one constraint:
\begin{align} maximize&3x1+4x2\\ subjectto&5x1+6x2=7 \\ &x1\geq0,x2\geq0 \end{align}
Applying the recipe above gives the following dual LP, with one variable and two constraints:
\begin{align} minimize&7y1 \\ subjectto&5y1\geq3 \\ &6y1\geq4 \\ &y1\inR \end{align}
It is easy to see that the maximum of the primal LP is attained when x1 is minimized to its lower bound (0) and x2 is maximized to its upper bound under the constraint (7/6). The maximum is 4 ⋅ 7/6 = 14/3.
Similarly, the minimum of the dual LP is attained when y1 is minimized to its lower bound under the constraints: the first constraint gives a lower bound of 3/5 while the second constraint gives a stricter lower bound of 4/6, so the actual lower bound is 4/6 and the minimum is 7 ⋅ 4/6 = 14/3.
In accordance with the strong duality theorem, the maximum of the primal equals the minimum of the dual.
We use this example to illustrate the proof of the weak duality theorem. Suppose that, in the primal LP, we want to get an upper bound on the objective
3x1+4x2
y1
y1
y1 ⋅ (5x1+6x2)=7y1
y1 ⋅ 5x1\geq3x1
y1 ⋅ 6x2\geq4x2
y1 ⋅ (5x1+6x2)\geq3x1+4x2
7y1\geq3x1+4x2
Consider a farmer who may grow wheat and barley with the set provision of some L land, F fertilizer and P pesticide.To grow one unit of wheat, one unit of land,
F1
P1
F2
P2
The primal problem would be the farmer deciding how much wheat (
x1
x2
S1
S2
Maximize: S1 ⋅ x1+S2 ⋅ x2 | (maximize the revenue from producing wheat and barley) | ||
subject to: | x1+x2\leqL | (cannot use more land than available) | |
F1 ⋅ x1+F2 ⋅ x2\leqF | (cannot use more fertilizer than available) | ||
P1 ⋅ x1+P2 ⋅ x2\leqP | (cannot use more pesticide than available) | ||
x1,x2\geq0 | (cannot produce negative quantities of wheat or barley). |
In matrix form this becomes:
Maximize:
\begin{bmatrix}S1&S2\end{bmatrix}\begin{bmatrix}x1\ x2\end{bmatrix}
subject to:
\begin{bmatrix}1&1\ F1&F2\ P1&P2\end{bmatrix}\begin{bmatrix}x1\ x2\end{bmatrix}\leq\begin{bmatrix}L\ F\ P\end{bmatrix},\begin{bmatrix}x1\ x2\end{bmatrix}\ge0.
For the dual problem assume that y unit prices for each of these means of production (inputs) are set by a planning board. The planning board's job is to minimize the total cost of procuring the set amounts of inputs while providing the farmer with a floor on the unit price of each of his crops (outputs), S1 for wheat and S2 for barley. This corresponds to the following LP:
Minimize: L ⋅ yL+F ⋅ yF+P ⋅ yP | (minimize the total cost of the means of production as the "objective function") | ||
subject to: | yL+F1 ⋅ yF+P1 ⋅ yP\geqS1 | (the farmer must receive no less than S1 for his wheat) | |
yL+F2 ⋅ yF+P2 ⋅ yP\geqS2 | (the farmer must receive no less than S2 for his barley) | ||
yL,yF,yP\geq0 | (prices cannot be negative). |
In matrix form this becomes:
Minimize:
\begin{bmatrix}L&F&P\end{bmatrix}\begin{bmatrix}yL\ yF\ yP\end{bmatrix}
subject to:
\begin{bmatrix}1&F1&P1\ 1&F2&P2\end{bmatrix}\begin{bmatrix}yL\ yF\ yP\end{bmatrix}\ge\begin{bmatrix}S1\ S2\end{bmatrix},\begin{bmatrix}yL\ yF\ yP\end{bmatrix}\ge0.
The primal problem deals with physical quantities. With all inputs available in limited quantities, and assuming the unit prices of all outputs is known, what quantities of outputs to produce so as to maximize total revenue? The dual problem deals with economic values. With floor guarantees on all output unit prices, and assuming the available quantity of all inputs is known, what input unit pricing scheme to set so as to minimize total expenditure?
To each variable in the primal space corresponds an inequality to satisfy in the dual space, both indexed by output type. To each inequality to satisfy in the primal space corresponds a variable in the dual space, both indexed by input type.
The coefficients that bound the inequalities in the primal space are used to compute the objective in the dual space, input quantities in this example. The coefficients used to compute the objective in the primal space bound the inequalities in the dual space, output unit prices in this example.
Both the primal and the dual problems make use of the same matrix. In the primal space, this matrix expresses the consumption of physical quantities of inputs necessary to produce set quantities of outputs. In the dual space, it expresses the creation of the economic values associated with the outputs from set input unit prices.
Since each inequality can be replaced by an equality and a slack variable, this means each primal variable corresponds to a dual slack variable, and each dual variable corresponds to a primal slack variable. This relation allows us to speak about complementary slackness.
A LP can also be unbounded or infeasible. Duality theory tells us that:
However, it is possible for both the dual and the primal to be infeasible. Here is an example:
Maximize: 2x1-x2 | ||
Subject to: | x1-x2\le1 | |
-x1+x2\le-2 | ||
x1,x2\geq0. |
There is a close connection between linear programming problems, eigenequations, and von Neumann's general equilibrium model. The solution to a linear programming problem can be regarded as a generalized eigenvector.
The eigenequations of a square matrix are as follows:
\begin{matrix} pTA =\rhopT\\ Az =\rho{z}\\ \end{matrix}
where
pT
z
A
\rho
The above eigenequations for the square matrix can be extended to von Neumann's general equilibrium model:[3] [4]
\begin{matrix} pTA \geq\rhopTB\\ Az \leq\rhoB{z}\\ \end{matrix}
where the economic meanings of
p
z
The von Neumann's equilibrium model can be further extended to the following structural equilibrium model with
A
B
\begin{matrix}pTA(p,u,z) \geq\rhopTB(p,u,z)\\ A(p,u,z)z \leq\rhoB(p,u,z){z}\\ \end{matrix}
where the economic meaning of
u
\begin{matrix}pTA(u) \geqpTB\\ A(u)z \leqB{z} \end{matrix}
This form of the structural equilibrium model and linear programming problems can often be converted to each other, that is, the solutions to these two types of problems are often consistent.
If we define
A(u)=\begin{bmatrix} 0&u\\ A&0\\ \end{bmatrix}
B=\begin{bmatrix} cT&0\\ 0&b\\ \end{bmatrix}
p=\begin{bmatrix} 1\\ y\\ \end{bmatrix}
z=\begin{bmatrix} x\\ 1\\ \end{bmatrix}
\begin{bmatrix} yTA&u\\ \end{bmatrix} \geq \begin{bmatrix} cT&yTb\\ \end{bmatrix}
\begin{bmatrix} u\\ Ax\\ \end{bmatrix} \leq \begin{bmatrix} cTx\\ b\\ \end{bmatrix}
Let us illustrate the structural equilibrium model with the previously discussed tiny example. In this example, we have
A=\begin{bmatrix} 5&6 \end{bmatrix}
A(u)=\begin{bmatrix} 0&0&u\\ 5&6&0\\ \end{bmatrix}
B=\begin{bmatrix} 3&4&0\\ 0&0&7\\ \end{bmatrix}
To solve the structural equilibrium model, we obtain[6]
p*=(1,2/3)T, z*=(0,7/6,1)T, u*=14/3
These are consistent with the solutions to the linear programming problems.
We substitute the above calculation results into the structural equilibrium model, obtaining
\begin{matrix} pTA(u)=(10/3,4,14/3) \geq(3,4,14/3)=pTB\\ A(u)z=(14/3,7)T \leq(14/3,7)T=B{z} \end{matrix}
The max-flow min-cut theorem is a special case of the strong duality theorem: flow-maximization is the primal LP, and cut-minimization is the dual LP. See Max-flow min-cut theorem#Linear program formulation.
Other graph-related theorems can be proved using the strong duality theorem, in particular, Konig's theorem.[7]
The Minimax theorem for zero-sum games can be proved using the strong-duality theorem.
Sometimes, one may find it more intuitive to obtain the dual program without looking at the program matrix. Consider the following linear program:
Minimize |
cixi+
djtj | |||||||||||||
subject to |
aijxi+ejtj\gegj, | 1\lej\len | ||||||||||||
fixi+
bijtj\gehi, | 1\lei\lem | |||||||||||||
xi\ge0,tj\ge0, | 1\lei\lem,1\lej\len |
We have m + n conditions and all variables are non-negative. We shall define m + n dual variables: yj and si. We get:
Minimize |
cixi+
djtj | |||||||||||||
subject to |
aijxi ⋅ yj+ejtj ⋅ yj\gegj ⋅ yj, | 1\lej\len | ||||||||||||
fixi ⋅ si+
bijtj ⋅ si\gehi ⋅ si, | 1\lei\lem | |||||||||||||
xi\ge0,tj\ge0, | 1\lei\lem,1\lej\len | |||||||||||||
yj\ge0,si\ge0, | 1\lej\len,1\lei\lem |
Since this is a minimization problem, we would like to obtain a dual program that is a lower bound of the primal. In other words, we would like the sum of all right hand side of the constraints to be the maximal under the condition that for each primal variable the sum of its coefficients do not exceed its coefficient in the linear function. For example, x1 appears in n + 1 constraints. If we sum its constraints' coefficients we get a1,1y1 + a1,2y2 + ... + a1,;;n;;yn + f1s1. This sum must be at most c1. As a result, we get:
Maximize |
gjyj+
hisi | |||||||||||||
subject to |
aijyj+fisi\leci, | 1\lei\lem | ||||||||||||
ejyj+
bijsi\ledj, | 1\lej\len | |||||||||||||
yj\ge0,si\ge0, | 1\lej\len,1\lei\lem |
Note that we assume in our calculations steps that the program is in standard form. However, any linear program may be transformed to standard form and it is therefore not a limiting factor.