*In which we introduce the theory of duality in linear programming.*

**1. The Dual of Linear Program **

Suppose that we have the following linear program in maximization standard form:

and that an LP-solver has found for us the solution , , , of cost . How can we convince ourselves, or another user, that the solution is indeed optimal, without having to trace the steps of the computation of the algorithm?

Observe that if we have two valid inequalities

then we can deduce that the inequality

(derived by “summing the left hand sides and the right hand sides” of our original inequalities) is also true. In fact, we can also scale the inequalities by a positive multiplicative factor before adding them up, so for every non-negative values we also have

Going back to our linear program (1), we see that if we scale the first inequality by , add the second inequality, and then add the third inequality scaled by , we get that, for every that is feasible for (1),

And so, for every feasible , its cost is

meaning that a solution of cost is indeed optimal.

In general, how do we find a good choice of scaling factors for the inequalities, and what kind of upper bounds can we prove to the optimum?

Suppose that we have a maximization linear program in standard form.

For every choice of non-negative scaling factors , we can derive the inequality

which is true for every feasible solution to the linear program (2). We can rewrite the inequality as

So we get that a certain linear function of the is always at most a certain value, for every feasible . The trick is now to choose the so that the linear function of the for which we get an upper bound is, in turn, an upper bound to the cost function of . We can achieve this if we choose the such that

Now we see that for every non-negative that satisfies (3), and for every that is feasible for (2),

Clearly, we want to find the non-negative values such that the above upper bound is as strong as possible, that is we want to

So we find out that if we want to find the scaling factors that give us the best possible upper bound to the optimum of a linear program in standard maximization form, we end up with a new linear program, in standard minimization form.

Definition 1Ifis a linear program in maximization standard form, then its

dualis the minimization linear program

So if we have a linear program in maximization linear form, which we are going to call the *primal* linear program, its dual is formed by having one variable for each constraint of the primal (not counting the non-negativity constraints of the primal variables), and having one constraint for each variable of the primal (plus the non-negative constraints of the dual variables); we change maximization to minimization, we switch the roles of the coefficients of the objective function and of the right-hand sides of the inequalities, and we take the transpose of the matrix of coefficients of the left-hand side of the inequalities.

The optimum of the dual is now an upper bound to the optimum of the primal.

How do we do the same thing but starting from a minimization linear program?

We can rewrite

in an equivalent way as

If we compute the dual of the above program we get

that is,

So we can form the dual of a linear program in minimization normal form in the same way in which we formed the dual in the maximization case:

- switch the type of optimization,
- introduce as many dual variables as the number of primal constraints (not counting the non-negativity constraints),
- define as many dual constraints (not counting the non-negativity constraints) as the number of primal variables.
- take the transpose of the matrix of coefficients of the left-hand side of the inequality,
- switch the roles of the vector of coefficients in the objective function and the vector of right-hand sides in the inequalities.

Note that:

Fact 2The dual of the dual of a linear program is the linear program itself.

We have already proved the following:

Fact 3If the primal (in maximization standard form) and the dual (in minimization standard form) are both feasible, then

Which we can generalize a little

Theorem 4 (Weak Duality Theorem)If is a linear program in maximization standard form, is a linear program in minimization standard form, and and are duals of each other then:

- If is unbounded, then is infeasible;
- If is unbounded, then is infeasible;
- If and are both feasible and bounded, then

*Proof:* We have proved the third statement already. Now observe that the third statement is also saying that if and are both feasible, then they have to both be bounded, because every feasible solution to gives a finite upper bound to the optimum of (which then cannot be ) and every feasible solution to gives a finite lower bound to the optimum of (which then cannot be ).

What is surprising is that, for bounded and feasible linear programs, there is always a dual solution that certifies the exact value of the optimum.

Theorem 5 (Strong Duality)If either or is feasible and bounded, then so is the other, and

To summarize, the following cases can arise:

- If one of or is feasible and bounded, then so is the other;
- If one of or is unbounded, then the other is infeasible;
- If one of or is infeasible, then the other cannot be feasible and bounded, that is, the other is going to be either infeasible or unbounded. Either case can happen.

We will return to the Strong Duality Theorem, and discuss its proof, later in the course.

## 9 comments

Comments feed for this article

April 25, 2011 at 5:59 pm

Bala SubramanianSeriously… You’ve summarized the concept painstakingly and a big thanks for it because I am referring to these notes for my exam… But just a thought… Instead of doing a lot of manual calculation, can’t we feed this problem to a computer and let it churn out the result?! Why should we strain our brain with these manual calculations when computer can immediately give us the result with steps…

July 5, 2011 at 5:29 pm

abhishekThanks! your notes are very helpful!!

November 1, 2011 at 3:31 am

Job Andrew oumaPlease expond a little more ou duality especially using examples to find the duals of given primals.

September 13, 2012 at 6:42 am

Plínio PortelaExcellent!! Pretty much clarifying and rigorous!! I’m looking for the promised strong theorem’s proof, though. I wonder if you could refer to a good exposition of the (weak and strong) theorems of complementarity in LP.

Thandks a lot.

October 30, 2012 at 8:22 pm

steve kibiiyour notes are good for beginners thanks alot keep it up

November 7, 2013 at 11:43 am

Nikhil Bhoyarawesome tutorials ,,, thanks thanks and thanks :) :)

November 17, 2013 at 5:36 am

George KakarelidisThe nice thing is that instead of Introducing duality just by definition, he guides the thought of the student gradually towards the duality.

@subramanian: there is a saying that with computer ‘garbage in garbage out’ . Now you have to know the process in order to be able to control the validity of some tones of printouts as is the norm for a medium size LP real life problem.

Regards

George Kakarelidis

Lecturer LP & Statistics

T.E.I. of West Greece

February 28, 2014 at 7:32 am

Rodrigo ManyariGreat article! Just one little thing, I think there’s a type-o in the equation right after:

“For every choice of non-negative scaling factors {y_1,\ldots,y_m}, we can derive the inequality”

The last y multiplying (a_m …) should be y_m instead of y_n, correct me if I’m wrong I might be missing something!

May 22, 2014 at 5:30 am

Ausbel gasperThanks for u are presentation in some way but add more notes to encouragement his/her lecture