# Combinatorics (Fall 2010)/Duality, Matroid

## Duality

Consider the following LP:

{\displaystyle {\begin{aligned}{\text{minimize}}&&7x_{1}+x_{2}+5x_{3}\\{\text{subject to}}&&x_{1}-x_{2}+3x_{3}&\geq 10\\&&5x_{1}-2x_{2}-x_{3}&\geq 6\\&&x_{1},x_{2},x_{3}&\geq 0\end{aligned}}}

Let ${\displaystyle OPT}$ be the value of the optimal solution. We want to estimate the upper and lower bound of ${\displaystyle OPT}$.

Since ${\displaystyle OPT}$ is the minimum over the feasible set, every feasible solution forms an upper bound for ${\displaystyle OPT}$. For example ${\displaystyle {\boldsymbol {x}}=(2,1,3)}$ is a feasible solution, thus ${\displaystyle OPT\leq 7\cdot 2+1+5\cdot 3=30}$.

For the lower bound, the optimal solution must satisfy the two constraints:

{\displaystyle {\begin{aligned}x_{1}-x_{2}+3x_{3}&\geq 10,\\5x_{1}-2x_{2}-x_{3}&\geq 6.\\\end{aligned}}}

Since the ${\displaystyle x_{i}}$'s are restricted to be nonnegative, term-by-term comparison of coefficients shows that

${\displaystyle 7x_{1}+x_{2}+5x_{3}\geq (x_{1}-x_{2}+3x_{3})+(5x_{1}-2x_{2}-x_{3})\geq 16.}$

The idea behind this lower bound process is that we are finding suitable nonnegative multipliers (in the above case the multipliers are all 1s) for the constraints so that when we take their sum, the coefficient of each ${\displaystyle x_{i}}$ in the sum is dominated by the coefficient in the objective function. It is important to ensure that the multipliers are nonnegative, so they do not reverse the direction of the constraint inequality.

To find the best lower bound, we need to choose the multipliers in such a way that the sum is as large as possible. Interestingly, the problem of finding the best lower bound can be formulated as another LP:

{\displaystyle {\begin{aligned}{\text{maximize}}&&10y_{1}+6y_{2}\\{\text{subject to}}&&y_{1}+5y_{2}&\leq 7\\&&-y_{1}+2y_{2}&\leq 1\\&&3y_{1}-y_{2}&\leq 5\\&&y_{1},y_{2}&\geq 0\end{aligned}}}

Here ${\displaystyle y_{1}}$ and ${\displaystyle y_{2}}$ were chosen to be nonnegative multipliers for the first and the second constraint, respectively. We call the first LP the primal program and the second LP the dual program. By definition, every feasible solution to the dual program gives a lower bound for the primal program.

### LP duality

Given an LP in canonical form, called the primal LP:

{\displaystyle {\begin{aligned}{\text{minimize}}&&{\boldsymbol {c}}^{T}{\boldsymbol {x}}\\{\text{subject to}}&&A{\boldsymbol {x}}&\geq {\boldsymbol {b}}\\&&{\boldsymbol {x}}&\geq {\boldsymbol {0}}\end{aligned}}}

the dual LP is defined as follows:

{\displaystyle {\begin{aligned}{\text{maximum}}&&{\boldsymbol {b}}^{T}{\boldsymbol {y}}\\{\text{subject to}}&&A^{T}{\boldsymbol {y}}&\leq {\boldsymbol {c}}\\&&{\boldsymbol {y}}&\geq {\boldsymbol {0}}\end{aligned}}}

We then give some examples.

Surviving problem (diet problem)

Let us consider the surviving problem. Suppose we have ${\displaystyle n}$ types of natural food, each containing up to ${\displaystyle m}$ types of vitamins. The ${\displaystyle j}$th food has ${\displaystyle a_{ij}}$ amount of vitamin ${\displaystyle i}$, and the price of the ${\displaystyle j}$th food is ${\displaystyle c_{j}}$. We need to consume ${\displaystyle b_{i}}$ amount of vitamin ${\displaystyle i}$ for each ${\displaystyle 1\leq i\leq m}$ to keep a good health. We want to minimize the total costs of food while keeping healthy. The problem can be formalized as the following LP:

{\displaystyle {\begin{aligned}{\text{minimize}}\quad &c_{1}x_{1}+c_{2}x_{2}+\cdots +c_{n}x_{n}\\{\begin{aligned}{\text{subject to}}\\\\\end{aligned}}\quad &{\begin{aligned}a_{i1}x_{1}+a_{i2}x_{2}+\cdots +a_{in}x_{n}&\leq b_{i}&\quad &\forall 1\leq i\leq m\\x_{j}&\geq 0&\quad &\forall 1\leq j\leq n\end{aligned}}\end{aligned}}}

The dual LP is

{\displaystyle {\begin{aligned}{\text{maximize}}\quad &b_{1}y_{1}+b_{2}y_{2}+\cdots +b_{n}y_{m}\\{\begin{aligned}{\text{subject to}}\\\\\end{aligned}}\quad &{\begin{aligned}a_{1j}y_{1}+a_{2j}y_{2}+\cdots +a_{mj}y_{m}&\leq c_{j}&\quad &\forall 1\leq j\leq n\\y_{i}&\geq 0&\quad &\forall 1\leq i\leq m\end{aligned}}\end{aligned}}}

The problem can be interpreted as follows: A food company produces ${\displaystyle m}$ types of vitamin pills. The company wants to design a pricing system such that

• The vitamin ${\displaystyle i}$ has a nonnegative price ${\displaystyle y_{i}}$.
• The price system should be competitive to any natural food. A costumer cannot replace the vitamins by any natural food and get a cheaper price, that is, ${\displaystyle \sum _{i=1}^{m}y_{j}a_{ij}\leq c_{j}}$ for any ${\displaystyle 1\leq j\leq n}$.
• The company wants to find the maximal profit, assuming that the customer only buy exactly the necessary amount of vitamins (${\displaystyle b_{i}}$ for vitamin ${\displaystyle i}$).
Maximum flow problem

In the last lecture, we defined the maximum flow problem, whose LP is

{\displaystyle {\begin{aligned}{\text{maximize}}\quad &\sum _{v:(s,v)\in E}f_{sv}\\{\begin{aligned}{\text{subject to}}\\\\\\\\\end{aligned}}\quad &{\begin{aligned}f_{uv}&\leq c_{uv}&\quad &\forall (u,v)\in E\\\sum _{u:(u,v)\in E}f_{uv}-\sum _{w:(v,w)\in E}f_{vw}&=0&\quad &\forall v\in V\setminus \{s,t\}\\f_{uv}&\geq 0&\quad &\forall (u,v)\in E\end{aligned}}\end{aligned}}}

where directed graph ${\displaystyle G(V,E)}$ is the flow network, ${\displaystyle s\in V}$ is the source, ${\displaystyle t\in V}$ is the sink, and ${\displaystyle c_{uv}}$ is the capacity of directed edge ${\displaystyle (u,v)\in E}$.

We add a new edge from ${\displaystyle t}$ to ${\displaystyle s}$ to ${\displaystyle E}$, and let the capacity be ${\displaystyle c_{ts}=\infty }$. Let ${\displaystyle E'}$ be the new edge set. The LP for the max-flow problem can be rewritten as:

{\displaystyle {\begin{aligned}{\text{maximize}}\quad &f_{ts}\\{\begin{aligned}{\text{subject to}}\\\\\\\\\end{aligned}}\quad &{\begin{aligned}f_{uv}&\leq c_{uv}&\quad &\forall (u,v)\in E\\\sum _{u:(u,v)\in E'}f_{uv}-\sum _{w:(v,w)\in E'}f_{vw}&\leq 0&\quad &\forall v\in V\\f_{uv}&\geq 0&\quad &\forall (u,v)\in E'\end{aligned}}\end{aligned}}}

The second set of inequalities seem weaker than the original conservation constraint of flows, however, if this inequality holds at every node, then in fact it must be satisfied with equality at every node, thereby implying the flow conservation.

To obtain the dual program we introduce variables ${\displaystyle d_{uv}}$ and ${\displaystyle p_{v}}$ corresponding to the two types of inequalities in the primal. The dual LP is:

{\displaystyle {\begin{aligned}{\text{minimize}}\quad &\sum _{(u,v)\in E}c_{uv}d_{uv}\\{\begin{aligned}{\text{subject to}}\\\\\\\\\end{aligned}}\quad &{\begin{aligned}d_{uv}-p_{u}+p_{v}&\geq 0&\quad &\forall (u,v)\in E\\p_{s}-p_{t}&\geq 1\\d_{uv}&\geq 0&\quad &\forall (u,v)\in E\\p_{v}&\geq 0&\quad &\forall v\in V\end{aligned}}\end{aligned}}}

It is more helpful to consider its integer version:

{\displaystyle {\begin{aligned}{\text{minimize}}\quad &\sum _{(u,v)\in E}c_{uv}d_{uv}\\{\begin{aligned}{\text{subject to}}\\\\\\\\\end{aligned}}\quad &{\begin{aligned}d_{uv}-p_{u}+p_{v}&\geq 0&\quad &\forall (u,v)\in E\\p_{s}-p_{t}&\geq 1\\d_{uv}&\in \{0,1\}&\quad &\forall (u,v)\in E\\p_{v}&\in \{0,1\}&\quad &\forall v\in V\end{aligned}}\end{aligned}}}

In the last lecture, we know that the LP for max-flow is totally unimordular, so is this dual LP, therefore the optimal solutions to the integer program are the optimal solutions to the LP.

The variables ${\displaystyle p_{v}}$ defines a bipartition of vertex set ${\displaystyle V}$. Let ${\displaystyle S=\{v\in V\mid p_{v}=1\}}$. The complement ${\displaystyle {\bar {S}}=\{v\in V\mid p_{v}=1\}}$.

For 0/1-valued variables, the only way to satisfy ${\displaystyle p_{s}-p_{t}\geq 1}$ is to have ${\displaystyle p_{s}=1}$ and ${\displaystyle p_{t}=0}$. Therefore, ${\displaystyle (S,{\bar {S}})}$ is an ${\displaystyle s}$-${\displaystyle t}$ cut.

In an optimal solution, ${\displaystyle d_{uv}=1}$ if and only if ${\displaystyle u\in S,v\in {\bar {S}}}$ and ${\displaystyle (u,v)\in E}$. Therefore, the objective function of an optimal solution ${\displaystyle \sum _{u\in S,v\not \in S \atop (u,v)\in E}c_{uv}}$ is the capacity of the minimum ${\displaystyle s}$-${\displaystyle t}$ cut ${\displaystyle (S,{\bar {S}})}$.

### Duality theorems

Let the primal LP be:

{\displaystyle {\begin{aligned}{\text{minimize}}&&{\boldsymbol {c}}^{T}{\boldsymbol {x}}\\{\text{subject to}}&&A{\boldsymbol {x}}&\geq {\boldsymbol {b}}\\&&{\boldsymbol {x}}&\geq {\boldsymbol {0}}\end{aligned}}}

Its dual LP is:

{\displaystyle {\begin{aligned}{\text{maximum}}&&{\boldsymbol {b}}^{T}{\boldsymbol {y}}\\{\text{subject to}}&&A^{T}{\boldsymbol {y}}&\leq {\boldsymbol {c}}\\&&{\boldsymbol {y}}&\geq {\boldsymbol {0}}\end{aligned}}}
 Theorem The dual of a dual is the primal.
Proof.
 The dual program can be written as the following minimization in canonical form: {\displaystyle {\begin{aligned}\min &&-{\boldsymbol {b}}^{T}{\boldsymbol {y}}\\{\text{s.t.}}&&-A^{T}{\boldsymbol {y}}&\geq -{\boldsymbol {c}}\\&&{\boldsymbol {y}}&\geq {\boldsymbol {0}}\end{aligned}}} Its dual is: {\displaystyle {\begin{aligned}\max &&-{\boldsymbol {c}}^{T}{\boldsymbol {x}}\\{\text{s.t.}}&&-A{\boldsymbol {x}}&\leq -{\boldsymbol {b}}\\&&{\boldsymbol {x}}&\geq {\boldsymbol {0}}\end{aligned}}} which is equivalent to the primal: {\displaystyle {\begin{aligned}\min &&{\boldsymbol {c}}^{T}{\boldsymbol {x}}\\{\text{s.t.}}&&A{\boldsymbol {x}}&\geq {\boldsymbol {b}}\\&&{\boldsymbol {x}}&\geq {\boldsymbol {0}}\end{aligned}}}
${\displaystyle \square }$

We have shown that feasible solutions of a dual program can be used to lower bound the optimum of the primal program. This is formalized by the following important theorem.

 Theorem (Weak duality theorem) If there exists an optimal solution to the primal LP: {\displaystyle {\begin{aligned}\min &&{\boldsymbol {c}}^{T}{\boldsymbol {x}}\\{\text{s.t.}}&&A{\boldsymbol {x}}&\geq {\boldsymbol {b}}\\&&{\boldsymbol {x}}&\geq {\boldsymbol {0}}\end{aligned}}} then, {\displaystyle {\begin{aligned}{\begin{aligned}\min &&{\boldsymbol {c}}^{T}{\boldsymbol {x}}\\{\text{s.t.}}&&A{\boldsymbol {x}}&\geq {\boldsymbol {b}}\\&&{\boldsymbol {x}}&\geq {\boldsymbol {0}}\end{aligned}}&{\begin{aligned}\geq \\\\\\\end{aligned}}&\quad {\begin{aligned}\max &&{\boldsymbol {b}}^{T}{\boldsymbol {y}}\\{\text{s.t.}}&&A^{T}{\boldsymbol {y}}&\leq {\boldsymbol {c}}\\&&{\boldsymbol {y}}&\geq {\boldsymbol {0}}\end{aligned}}\end{aligned}}}
Proof.
 Let ${\displaystyle {\boldsymbol {x}}}$ be an arbitrary feasible solution to the primal LP, and ${\displaystyle {\boldsymbol {y}}}$ be an arbitrary feasible solution to the dual LP. We estimate ${\displaystyle {\boldsymbol {y}}^{T}A{\boldsymbol {x}}}$ in two ways. Recall that ${\displaystyle A{\boldsymbol {x}}\geq {\boldsymbol {b}}}$ and ${\displaystyle A^{T}{\boldsymbol {y}}\leq {\boldsymbol {c}}}$, thus ${\displaystyle {\boldsymbol {y}}^{T}{\boldsymbol {b}}\leq {\boldsymbol {y}}^{T}A{\boldsymbol {x}}\leq {\boldsymbol {c}}^{T}{\boldsymbol {x}}}$. Since this holds for any feasible solutions, it must also hold for the optimal solutions.
${\displaystyle \square }$

A harmonically beautiful result is that the optimums of the primal LP and its dual are equal. This is called the strong duality theorem of linear programming.

 Theorem (Strong duality theorem) If there exists an optimal solution to the primal LP: {\displaystyle {\begin{aligned}\min &&{\boldsymbol {c}}^{T}{\boldsymbol {x}}\\{\text{s.t.}}&&A{\boldsymbol {x}}&\geq {\boldsymbol {b}}\\&&{\boldsymbol {x}}&\geq {\boldsymbol {0}}\end{aligned}}} then, {\displaystyle {\begin{aligned}{\begin{aligned}\min &&{\boldsymbol {c}}^{T}{\boldsymbol {x}}\\{\text{s.t.}}&&A{\boldsymbol {x}}&\geq {\boldsymbol {b}}\\&&{\boldsymbol {x}}&\geq {\boldsymbol {0}}\end{aligned}}&{\begin{aligned}=\\\\\\\end{aligned}}&\quad {\begin{aligned}\max &&{\boldsymbol {b}}^{T}{\boldsymbol {y}}\\{\text{s.t.}}&&A^{T}{\boldsymbol {y}}&\leq {\boldsymbol {c}}\\&&{\boldsymbol {y}}&\geq {\boldsymbol {0}}\end{aligned}}\end{aligned}}}

## Matroid

The matroid is a structure shared by a class of optimization problems for which greedy algorithms work.

### Kruskal's greedy algorithm for MST

For the minimum-weight spanning tree (MST) problem. We are given a connected undirected graph ${\displaystyle G(V,E)}$ with positive edge weights ${\displaystyle w:E\rightarrow \mathbb {R} ^{+}}$, and want to find a spanning tree ${\displaystyle T}$ of the minimum accumulated weight ${\displaystyle \sum _{e\in T}w_{e}}$.

We consider the equivalent maximum problem to find a spanning tree with maximum weight. To see this makes the problem no harder, we can replace the weight ${\displaystyle w_{e}}$ for every edge ${\displaystyle e\in E}$ by ${\displaystyle W-w_{e}}$, where ${\displaystyle W}$ is a sufficient large constant which is greater than all weights. The minimum-weight spanning tree for the modified weight is the maximum-weight spanning tree for the original weight.

The following greedy algorithm solves the maximum-weight spanning tree problem.

 Kruskal's Algorithm ${\displaystyle S=\emptyset }$; while ${\displaystyle \exists e\in E}$ that ${\displaystyle S\cup \{e\}}$ is forest pick such ${\displaystyle e}$ with maximum ${\displaystyle w_{e}}$; ${\displaystyle S=S\cup \{e\}}$;

It is not hard to verify the correctness of this greedy algorithm. But we are more interested in the general framework underlying this algorithm.

### Matroids

Let ${\displaystyle X}$ be a finite set and ${\displaystyle {\mathcal {F}}\subseteq 2^{X}}$ be a family of subsets of ${\displaystyle X}$. A member set ${\displaystyle S\in {\mathcal {F}}}$ is called maximal if ${\displaystyle S\cup \{x\}\not \in {\mathcal {F}}}$ for any ${\displaystyle x\in X\setminus S}$.

For ${\displaystyle Y\subseteq X}$, denote ${\displaystyle {\mathcal {F}}_{Y}=\{S\in {\mathcal {F}}\mid S\subseteq Y\}}$. Obviously,${\displaystyle {\mathcal {F}}_{Y}={\mathcal {F}}\cap 2^{Y}\,}$.

 Definition A set system ${\displaystyle {\mathcal {F}}\subseteq 2^{X}}$ is a matroid if it satisfies: (hereditary) if ${\displaystyle T\subseteq S\in {\mathcal {F}}}$ then ${\displaystyle T\in {\mathcal {F}}}$; (matroid property) for every ${\displaystyle Y\subseteq X}$, all maximal ${\displaystyle S\in {\mathcal {F}}_{Y}}$ have the same ${\displaystyle |S|}$.

Suppose ${\displaystyle {\mathcal {F}}}$ is a matroid. Some matroid terminologies:

• Each member set ${\displaystyle S\in {\mathcal {F}}}$ is called an independent set.
• A maximal independent subset of a set ${\displaystyle Y\subset X}$, i.e., a maximal ${\displaystyle S\in {\mathcal {F}}_{Y}}$, is called a basis of ${\displaystyle Y}$.
• The size of the maximal ${\displaystyle S\in {\mathcal {F}}_{Y}}$ is called the rank of ${\displaystyle Y}$, denoted ${\displaystyle r(Y)}$.

#### Graph matroids

Let ${\displaystyle G(V,E)}$ be a graph. Define a set system with ground set ${\displaystyle E}$ as

${\displaystyle {\mathcal {F}}=\{S\subseteq E\mid {\text{there is no cycle in }}S\}.}$

That is, ${\displaystyle {\mathcal {F}}}$ is the set of all forests in ${\displaystyle G}$.

We claim that ${\displaystyle {\mathcal {F}}}$ is a matroid.

First, ${\displaystyle {\mathcal {F}}}$ is hereditary since any subgraph of a forest must also be a forest.

We then verify the matroid property of ${\displaystyle {\mathcal {F}}}$. Let ${\displaystyle Y\subseteq E}$ be an arbitrary subgraph of ${\displaystyle G}$. Suppose ${\displaystyle Y}$ has ${\displaystyle k}$ connected components. For any maximal forest ${\displaystyle S}$ in ${\displaystyle Y}$ (i.e., ${\displaystyle S}$ is a spanning forest in ${\displaystyle Y}$), it holds that ${\displaystyle |S|=n-k}$. In other words, for any ${\displaystyle Y\subseteq E}$, all maximal member of ${\displaystyle {\mathcal {F}}_{Y}}$ have the same cardinality.

Therefore, ${\displaystyle {\mathcal {F}}}$ is a matroid. Each independent set (of matroid) is a forest in ${\displaystyle G}$. For any subgraph ${\displaystyle Y\subseteq G}$, the rank of ${\displaystyle Y}$ is the size of a spanning forest of ${\displaystyle Y}$.

#### Linear matroids

Let ${\displaystyle A}$ be an ${\displaystyle m\times n}$ matrix. Define a set system ${\displaystyle {\mathcal {F}}\subseteq 2^{[n]}}$ as

${\displaystyle {\mathcal {F}}=\{S\subseteq [n]\mid S{\text{ is a set of linearly independent columns in }}A\}.}$

${\displaystyle {\mathcal {F}}}$ is hereditary since every any subset of a set of linearly independent vectors is still linearly independent.

For any subset ${\displaystyle Y\subseteq [n]}$ of columns of ${\displaystyle A}$. Let ${\displaystyle B}$ be the submatrix composed by these columns. Then ${\displaystyle {\mathcal {F}}_{Y}}$ contains all sets of linearly independent columns of ${\displaystyle B}$. Clearly, all maximal such sets have the same size, which is the column-rank of ${\displaystyle B}$.

Therefore, ${\displaystyle {\mathcal {F}}}$ is a matroid. Each independent set (of matroid) is a linearly independent set of columns of matrix ${\displaystyle A}$. For any set ${\displaystyle Y\subseteq [n]}$ of columns of matrix ${\displaystyle A}$, the rank of ${\displaystyle Y}$ is the column-rank of the submatrix defined by the columns in ${\displaystyle Y}$.

### Weighted matroid maximization

Consider the following weighted matroid maximization problem. Let ${\displaystyle {\mathcal {F}}\subseteq 2^{X}}$ be a matroid. We define positive weights ${\displaystyle w:X\rightarrow \mathbb {R} ^{+}}$ of elements in ${\displaystyle X}$. Our goal is to find an independent set ${\displaystyle S\in {\mathcal {F}}}$ with the maximum accumulated weight ${\displaystyle \sum _{x\in S}w(x)}$.

We then introduce the Greedy Algorithm which finds the maximum-weight independent set.

 Greedy Algorithm ${\displaystyle S=\emptyset }$; while ${\displaystyle \exists x\not \in S}$ with ${\displaystyle S\cup \{x\}\in {\mathcal {F}}}$ choose such ${\displaystyle x}$ with maximum ${\displaystyle w(x)}$; ${\displaystyle S=S\cup \{x\}}$;

The correctness of the greedy algorithm is due to the next theorem.

 Theorem (Rado 1957; Edmonds 1970) The greedy algorithm finds an independent set ${\displaystyle S\in {\mathcal {F}}}$ with the maximum weight.
Proof.
 Suppose the theorem is false. Let ${\displaystyle S}$ be the independent set returned by the greedy algorithm and let ${\displaystyle T}$ be a maximum-weight independent set. Suppose ${\displaystyle S=\{x_{1},x_{2},\ldots ,x_{m}\}}$, where the ${\displaystyle x_{i}}$s are chosen by the algorithm in that order. Then it is easy to see that ${\displaystyle w(x_{1})\geq w(x_{2})\geq \cdots \geq w(x_{m})}$. Suppose ${\displaystyle T=\{y_{1},y_{2},\ldots ,y_{\ell }\}}$, where ${\displaystyle w(y_{1})\geq w(y_{2})\geq \cdots \geq w(y_{\ell })}$. Choose the least index ${\displaystyle k}$ such that ${\displaystyle w(x_{k})>w(y_{k})}$. If none exists, then we must have ${\displaystyle \ell >m}$; in this case we can let ${\displaystyle k=m+1}$. In either case we know that the greedy algorithm did not add any of ${\displaystyle y_{1},\ldots ,y_{k}}$ in step ${\displaystyle k}$. Since what it did choose has smaller weight, it must be that ${\displaystyle y_{i}}$, for ${\displaystyle 1\leq i\leq k}$, has the property either that ${\displaystyle y_{i}\in \{x_{1},\ldots ,x_{k-1}\}}$ or that ${\displaystyle \{x_{1},\ldots ,x_{k-1},y_{i}\}\not \in {\mathcal {F}}}$. In other words, ${\displaystyle \{x_{1},\ldots ,x_{k-1}\}}$ is a basis of ${\displaystyle Y=\{x_{1},\ldots ,x_{k-1},y_{1},\ldots ,y_{k}\}}$. But this contradicts the matroid property, since ${\displaystyle \{y_{1},\ldots ,y_{k}\}}$, being a subset of ${\displaystyle T}$, is also an independent subset of ${\displaystyle Y}$ and is larger.
${\displaystyle \square }$