Dual to Find Optimal Solution in Linear Program
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:
- Each variable in the primal LP becomes a constraint in the dual LP;
- Each constraint in the primal LP becomes a variable in the dual LP;
- The objective direction is inversed – maximum in the primal becomes minimum in the dual and vice versa.
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.
Constructing the dual LP [edit]
Given a primal LP, the following algorithm can be used to construct its dual LP.[1] : 85 The primal LP is defined by:
The dual LP is constructed as follows.
From this algorithm, it is easy to see that the dual of the dual is the primal.
Vector formulations [edit]
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 c T x subject to A x ≤ b, x ≥ 0 | Minimize b T y subject to A T y ≥ c, y ≥ 0 | This is called a "symmetric" dual problem |
Maximize c T x subject to A x ≤ b | Minimize b T y subject to A T y = c, y ≥ 0 | This is called an "asymmetric" dual problem |
Maximize c T x subject to A x = b, x ≥ 0 | Minimize b T y subject to A T y ≥ c |
The duality theorems [edit]
Below, suppose the primal LP is "maximize c T x subject to [constraints]" and the dual LP is "minimize b T y subject to [constraints]".
Weak duality [edit]
The weak duality theorem says that, for each feasible solution x of the primal and each feasible solution y of the dual: c T x ≤ b T y. 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. This implies:
max x c T x ≤ min y b T y
In 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 weak duality theorem is relatively simple to prove. Suppose the primal LP is "Maximize c T x subject to A x ≤ b, x ≥ 0". Suppose we create a linear combination of the constraints, with positive coefficients, such that the coefficients of x in the constraints are at least c T. 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 LP "Minimize b T y subject to A T y ≥ c, y ≥ 0".[1] : 81–83 See the tiny example below.
Strong duality [edit]
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.:
max x c T x = min y b T y
The 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.[1] : 87–89
Another proof uses the Farkas lemma.[1] : 94
Theoretical implications [edit]
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 c T x subject to A x ≤ 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 A x ≤ b, A T y ≥ c, c T x ≥ b T y, x ≥ 0, y ≥ 0
If the combined LP has a feasible solution (x,y), then by weak duality, c T x = b T y. 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 too.
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:[2] : 260–261
- Show a feasible solution to the primal LP with value t; this proves that the optimum is at least t.
- Show a feasible solution to the dual LP with value t; this proves that the optimum is at most t.
Examples [edit]
Tiny example [edit]
Consider the primal LP, with two variables and one constraint:
Applying the recipe above gives the following dual LP, with one variable and two constraints:
It is easy to see that the maximum of the primal LP is attained when x 1 is minimized to its lower bound (0) and x 2 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 y 1 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 . We can use the constraint multiplied by some coefficient, say . For any we get: . Now, if and , then , so . Hence, the objective of the dual LP is an upper bound on the objective of the primal LP.
Farmer example [edit]
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, units of fertilizer and units of pesticide must be used. Similarly, to grow one unit of barley, one unit of land, units of fertilizer and units of pesticide must be used.
The primal problem would be the farmer deciding how much wheat ( ) and barley ( ) to grow if their sell prices are and per unit.
Maximize: | (maximize the revenue from producing wheat and barley) | |
subject to: | (cannot use more land than available) | |
(cannot use more fertilizer than available) | ||
(cannot use more pesticide than available) | ||
(cannot produce negative quantities of wheat or barley). |
In matrix form this becomes:
- Maximize:
- subject to:
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), S 1 for wheat and S 2 for barley. This corresponds to the following LP:
Minimize: | (minimize the total cost of the means of production as the "objective function") | |
subject to: | (the farmer must receive no less than S 1 for his wheat) | |
(the farmer must receive no less than S 2 for his barley) | ||
(prices cannot be negative). |
In matrix form this becomes:
- Minimize:
- subject to:
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.
Infeasible program [edit]
A LP can also be unbounded or infeasible. Duality theory tells us that:
- If the primal is unbounded, then the dual is infeasible;
- If the dual is unbounded, then the primal is infeasible.
However, it is possible for both the dual and the primal to be infeasible. Here is an example:
Applications [edit]
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.[3]
The Minimax theorem for zero-sum games can be proved using the strong-duality theorem.[1] : sub.8.1
Alternative algorithm [edit]
Sometimes, one may find it more intuitive to obtain the dual program without looking at the program matrix. Consider the following linear program:
Minimize | |||
subject to | |||
We have m +n conditions and all variables are non-negative. We shall define m +n dual variables: y j and s i . We get:
Minimize | |||
subject to | |||
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, x 1 appears in n + 1 constraints. If we sum its constraints' coefficients we get a 1,1 y 1 +a 1,2 y 2 + ... +a 1,;;n;; y n +f 1 s 1. This sum must be at most c 1. As a result, we get:
Maximize | |||
subject to | |||
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.
Real-life interpretations [edit]
The duality theorem has an economic interpretation. If we interpret the primal LP as a classical "resource allocation" problem, its dual LP can be interpreted as a "resource valuation" problem. See also Shadow price.
The duality theorem has a physical interpretation too.[1] : 86–87
References [edit]
- ^ a b c d e f g Gärtner, Bernd; Matoušek, Jiří (2006). Understanding and Using Linear Programming. Berlin: Springer. ISBN3-540-30697-8. Pages 81–104.
- ^ Lovász, László; Plummer, M. D. (1986), Matching Theory, Annals of Discrete Mathematics, 29, North-Holland, ISBN0-444-87916-1, MR 0859549
- ^ A. A. Ahmadi (2016). "Lecture 6: linear programming and matching" (PDF). Princeton University.
Dual to Find Optimal Solution in Linear Program
Source: https://en.wikipedia.org/wiki/Dual_linear_program