lec08
Lecture 8. Duality of Linear Programming
8.1 LP duality
Consider the following LP:
Clearly
The dual of the dual is the primal.
The dual program can be rewritten as:
We note that the primal problem may have different forms. If the primal has a constraint
Now we use the form
If
Since
If
However, if the primal problem is infeasible, we cannot conclude that the dual problem is unbounded below. It is possible that both primal and dual problems are infeasible.
Consider the following problem:
We’ve already known that any feasible solution of the dual gives an upper to the primal. The question is that, is there any gap between the optimal value of the primal and the optimal value of the dual?
If the primal problem has a finite optimal solution
Now we can complete the following table.
| unbounded | infeasible | ||
|---|---|---|---|
| unbounded | × | √ | × |
| infeasible | √ | √ | × |
| × | × | √ |
The proof of the strong duality is an application of the Farkas’ lemma, which we have introduced in Lecture 4.
Let
; .
To apply this lemma, we consider the following corollary.
Suppose
- There exists
such that and . - There exists
such that , , and .

Let
Let
- There exists
such that ; - There exists
such that and .
Note that item 1 is equivalent to
We are now ready to prove the strong duality theorem.
Without loss of generality, we assume that the dual problem has an optimal solution
Let
- Case 1.
. Then we have and . Thus, and . Noting that is also a feasible solution to the dual problem. But . - Case 2.
. Dividing on both sides, it leads to which implies that and . So is a feasible solution to the dual problem, and better than .
The proof is concluded by the contradictions in both cases.
In the proof of the corollary of the Farkas’ lemma, we employ the matrix
Complementary slackness
As an application of the strong duality of linear program, the following theorem reveals some relations between the optimal solutions to the primal and the dual.
Suppose
The complementary slackness shows that if the
It is clear that
8.2 Applications of linear programming duality
We now consider some applications of the strong duality theorem.
The first example is the zero-sum games. We can show that the strong duality theorem can be used to prove minimax theorem, a central theorem in game theory that is even considered as the starting point of game theory. Consider the rock-scissors-paper game between two players, the row player and the column player. Each player can play one of the three moves: R(rock), S(scissors), or P(paper). Two players play simultaneously. The payoff matrix of this game is given in
| G | R | S | P |
|---|---|---|---|
| R | 0 | 1 | -1 |
| S | -1 | 0 | 1 |
| P | 1 | -1 | 0 |
For example, if the row player plays R and the column player plays S, the row player receives payoff 1, and the column player receives payoff −1 (the column player’s loss is 1). In this game, the sum of all the players payoffs always equals to 0. Games satisfy this property are called zero-sum games.
A strategy of a player is a probability distribution over {R,S,P}. If the strategy specifies that one of the three moves is played with probability 1, this strategy is called a pure strategy. Otherwise, it is a mixed strategy. Fix one player’s strategy, the best response for the other player is a strategy that maximizes this player’s payoff. For example, if the column player plays the strategy
In general, suppose each of the two players can play one of the
- Given a fixed strategy
of the row player, the column player’s best strategy is to minimize . So the goal of the row player is to choose to maximize , that is, . - Given a fixed strategy
of the column player, the row player’s best strategy is to maximize . So the goal of the column player is to choose to minimize , that is, .
We claim that their goals can be reformulated as the primal and dual linear programs. To this end, we now consider a simple example.
For instance, let
- If row choose strategy
, then the payoff of column is . The column player will choose a strategy so that the payoff is as large as possible. So the payoff of column is .
Hence the goal of row is: , which can be reformulated as - If column choose strategy
, then the payoff of row is . The row player will choose a strategy so that the payoff is as large as possible. So the payoff of row is .
Hence the goal of column is: , which can be reformulated as One can see that problem if the dual of . Hence the equality follows from the strong duality theorem. This is formally characterized by the following minimax theorem.
Given a zero-sum game with payoff matrix
Another example of duality is the maximum matching and minimum vertex cover problem in graph theory. Given an undirected graph
Clearly the set
Suppose the graph
We can write an integer programming formulation of the maximum matching problem. Any matching
Analogously, for each vertex
In a bipartite graph
- Case 1. There exists a cycle
. Note that is an even number since is bipartite. Let . Then add to for all odd , and subtract from for all even (we assume that ). The resulting satisfy all constraints and the size of the fractional matching remains the same. - Case 2. There is no cycles. Then choose any path
. Note that all edges incident to has except . So if belongs to but . Similarly, if belongs to but . Again, let . Then subtract from for all even , and add to for all odd (we assume that ). Now the resulting satisfy all constraints and the size of the fractional matching is nondecreasing.
Each operation decreases the number of fractional edges. So there is no fractional edges after finite many operations. Consequently, any fractional matching can be converted into an integral matching with equal or greater size, which implies that the size of the maximum fractional matching equals the size of the maximum matching.
We can also show that the size of the minimum fractional vertex cover equals the size of the minimum vertex cover in a bipartite graph
We construct a vertex cover
Next, we calculate the expected size of
Overall, we conclude that in any bipartite graph, the size of the maximum matching equals the size of the minimum vertex cover.