29.4 Duality
We have proven that, under certain assumptions, SIMPLEX will terminate. We have not yet shown that it actually finds the optimal solution to a linear program, however. In order to do so, we introduce a powerful concept called linear-programming duality.Duality is a very important property. In an optimization problem, the identification of a dual problem is almost always coupled with the discovery of a polynomial-time algorithm. Duality is also powerful in its ability to provide a proof that a solution is indeed optimal.
For example, suppose that, given an instance of a maximum-flow problem, we find a flow f of value |f|. How do we know whether f is a maximum flow? By the max-flow min-cut theorem (Theorem 26.7), if we can find a cut whose value is also |f|, then we have verified that f is indeed a maximum flow. This is an example of duality: given a maximization problem, we define a related minimization problem such that the two problems have the same optimal objective values.Given a linear program in which the objective is to maximize, we shall describe how to formulate a dual linear program in which the objective is to minimize and whose optimal value is identical to that of the original linear program. When referring to dual linear programs, we call the original linear program the primal.Given a primal linear program in standard form, as in (29.16)-(29.18), we define the dual linear program asminimize
(29.86) | ![]() |
subject to
(29.87) | ![]() |
(29.88) | ![]() |
To form the dual, we change the maximization to a minimization, exchange the roles of the right-hand sides and the objective-function coefficients, and replace the less-than-or-equal-to by a greater-than-or-equal-to. Each of the m constraints in the primal has an associated variable yi in the dual, and each of the n constraints in the dual has an associated variable xj in the primal. For example, consider the linear program given in (29.56)-(29.60). The dual of this linear program isminimize
(29.89) | ![]() |
subject to
(29.90) | ![]() |
(29.91) | ![]() |
(29.92) | ![]() |
(29.93) | ![]() |
We will show, in Theorem 29.10, that the optimal value of the dual linear program is always equal to the optimal value of the primal linear program. Further-more, the simplex algorithm actually implicitly solves both the primal and the dual linear programs simultaneously, thereby providing a proof of optimality.We begin by demonstrating weak duality, which states that any feasible solution to the primal linear program has a value no greater than that of any feasible solution to the dual linear program.
Lemma 29.8: (Weak linear-programming duality
Let



Proof We have

Corollary 29.9
Let



then




Before proving that there always is a dual solution whose value is equal to that of an optimal primal solution, we describe how to find such a solution. When we ran the simplex algorithm on the linear program in (29.56)-(29.60), the final iteration yielded the slack form (29.75)-(29.78) with B = {1, 2, 4} and N = {3, 5, 6}. As we shall show below, the basic solution associated with the final slack form is an optimal solution to the linear program; an optimal solution to linear program (29.56)-(29.60) is therefore


Then an optimal dual solution is to set
(29.94) | ![]() |
Thus, an optimal solution to the dual linear program defined in (29.89)-(29.93) is



Suppose that SIMPLEX returns values




(29.95) | ![]() |
Proof By Corollary 29.9, if we can find feasible solutions






(29.96) | ![]() |
Since SIMPLEX terminated with a solution, by the condition in line 2 we know that
(29.97) | ![]() |
If we define
(29.98) | ![]() |
we can rewrite equation (29.96) as
(29.99) | ![]() |
For the basic solution



(29.100) | ![]() |
(29.101) | ![]() |
We shall now show that





Therefore, for any set of values x, we have

so that
(29.102) | ![]() |
Applying Lemma 29.3 to equation (29.102), we obtain
(29.103) | ![]() |
(29.104) | ![]() |
By equation (29.103), we have that





which satisfies the constraints (29.87) of the dual. Finally, since



We have shown that, given a feasible linear program, if INITIALIZE-SIMPLEX returns a feasible solution, and if SIMPLEX terminates without returning "unbounded," then the solution returned is indeed an optimal solution. We have also shown how to construct an optimal solution to the dual linear program.Exercises 29.4-1
Formulate the dual of the linear program given in Exercise 29.3-4.
Exercises 29.4-2
Suppose that we have a linear program that is not in standard form. We could produce the dual by first converting it to standard form, and then taking the dual. It would be more convenient, however, to be able to produce the dual directly. Explain how, given an arbitrary linear program, we can directly take the dual of that linear program.
Exercises 29.4-3
Write down the dual of the maximum-flow linear program, as given in lines (29.47)-(29.50). Explain how to interpret this formulation as a minimum-cut problem.
Exercises 29.4-4
Write down the dual of the minimum-cost-flow linear program, as given in lines (29.51)-(29.55). Explain how to interpret this problem in terms of graphs and flows.
Exercises 29.4-5
Show that the dual of the dual of a linear program is the primal linear program.
Exercises 29.4-6
Which result from Chapter 26 can be interpreted as weak duality for the maximum-flow problem?