# Combinatorics (Fall 2010)/Duality, Matroid

## Duality

Consider the following LP:

\displaystyle{ \begin{align} \text{minimize} && 7x_1+x_2+5x_3\\ \text{subject to} && x_1-x_2+3x_3 &\ge 10\\ && 5x_1-2x_2-x_3 &\ge 6\\ && x_1,x_2,x_3 &\ge 0 \end{align} }

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\le 7\cdot 2+1+5\cdot 3=30 }$.

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

\displaystyle{ \begin{align} x_1-x_2+3x_3 &\ge 10,\\ 5x_1-2x_2-x_3 &\ge 6.\\ \end{align} }

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\ge(x_1-x_2+3x_3)+(5x_1-2x_2-x_3)\ge 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{align} \text{maximize} && 10y_1+6y_2\\ \text{subject to} && y_1+5y_2 &\le 7\\ && -y_1+2y_2 &\le 1\\ &&3y_1-y_2 &\le 5\\ && y_1,y_2&\ge 0 \end{align} }

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{align} \text{minimize} && \boldsymbol{c}^T\boldsymbol{x}\\ \text{subject to} && A\boldsymbol{x} &\ge\boldsymbol{b}\\ && \boldsymbol{x} &\ge \boldsymbol{0} \end{align} }

the dual LP is defined as follows:

\displaystyle{ \begin{align} \text{maximum} && \boldsymbol{b}^T\boldsymbol{y}\\ \text{subject to} && A^T\boldsymbol{y} &\le\boldsymbol{c}\\ && \boldsymbol{y} &\ge \boldsymbol{0} \end{align} }

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\le i\le 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{align} \text{minimize} \quad& c_1x_1+c_2x_2+\cdots+c_nx_n\\ \begin{align} \text{subject to} \\ \\ \end{align} \quad & \begin{align} a_{i1}x_{1}+a_{i2}x_{2}+\cdots+a_{in}x_{n} &\le b_{i} &\quad& \forall 1\le i\le m\\ x_{j}&\ge 0 &\quad& \forall 1\le j\le n \end{align} \end{align} }

The dual LP is

\displaystyle{ \begin{align} \text{maximize} \quad& b_1y_1+b_2y_2+\cdots+b_ny_m\\ \begin{align} \text{subject to} \\ \\ \end{align} \quad & \begin{align} a_{1j}y_{1}+a_{2j}y_{2}+\cdots+a_{mj}y_{m} &\le c_{j} &\quad& \forall 1\le j\le n\\ y_{i}&\ge 0 &\quad& \forall 1\le i\le m \end{align} \end{align} }

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}^my_ja_{ij}\le c_j }$ for any $\displaystyle{ 1\le j\le 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{align} \text{maximize} \quad& \sum_{v:(s,v)\in E}f_{sv}\\ \begin{align} \text{subject to} \\ \\ \\ \\ \end{align} \quad & \begin{align} f_{uv}&\le 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}&\ge 0 &\quad& \forall (u,v)\in E \end{align} \end{align} }

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{align} \text{maximize} \quad& f_{ts}\\ \begin{align} \text{subject to} \\ \\ \\ \\ \end{align} \quad & \begin{align} f_{uv}&\le c_{uv} &\quad& \forall (u,v)\in E\\ \sum_{u:(u,v)\in E'}f_{uv}-\sum_{w:(v,w)\in E'}f_{vw} &\le0 &\quad& \forall v\in V\\ f_{uv}&\ge 0 &\quad& \forall (u,v)\in E' \end{align} \end{align} }

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{align} \text{minimize} \quad& \sum_{(u,v)\in E}c_{uv}d_{uv}\\ \begin{align} \text{subject to} \\ \\ \\ \\ \end{align} \quad & \begin{align} d_{uv}-p_u+p_v &\ge 0 &\quad& \forall (u,v)\in E\\ p_s-p_t &\ge1 \\ d_{uv} &\ge 0 &\quad& \forall (u,v)\in E\\ p_v&\ge 0 &\quad& \forall v\in V \end{align} \end{align} }

It is more helpful to consider its integer version:

\displaystyle{ \begin{align} \text{minimize} \quad& \sum_{(u,v)\in E}c_{uv}d_{uv}\\ \begin{align} \text{subject to} \\ \\ \\ \\ \end{align} \quad & \begin{align} d_{uv}-p_u+p_v &\ge 0 &\quad& \forall (u,v)\in E\\ p_s-p_t &\ge1 \\ d_{uv} &\in\{0,1\} &\quad& \forall (u,v)\in E\\ p_v&\in\{0,1\} &\quad& \forall v\in V \end{align} \end{align} }

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\ge1 }$ 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{align} \text{minimize} && \boldsymbol{c}^T\boldsymbol{x}\\ \text{subject to} && A\boldsymbol{x} &\ge\boldsymbol{b}\\ && \boldsymbol{x} &\ge \boldsymbol{0} \end{align} }

Its dual LP is:

\displaystyle{ \begin{align} \text{maximum} && \boldsymbol{b}^T\boldsymbol{y}\\ \text{subject to} && A^T\boldsymbol{y} &\le\boldsymbol{c}\\ && \boldsymbol{y} &\ge \boldsymbol{0} \end{align} }
 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{align} \min && -\boldsymbol{b}^T\boldsymbol{y}\\ \text{s.t.} && -A^T\boldsymbol{y} &\ge-\boldsymbol{c}\\ && \boldsymbol{y} &\ge \boldsymbol{0} \end{align} } Its dual is: \displaystyle{ \begin{align} \max && -\boldsymbol{c}^T\boldsymbol{x}\\ \text{s.t.} && -A\boldsymbol{x} &\le-\boldsymbol{b}\\ && \boldsymbol{x} &\ge \boldsymbol{0} \end{align} } which is equivalent to the primal: \displaystyle{ \begin{align} \min && \boldsymbol{c}^T\boldsymbol{x}\\ \text{s.t.} && A\boldsymbol{x} &\ge\boldsymbol{b}\\ && \boldsymbol{x} &\ge \boldsymbol{0} \end{align} }
$\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{align} \min && \boldsymbol{c}^T\boldsymbol{x}\\ \text{s.t.} && A\boldsymbol{x} &\ge\boldsymbol{b}\\ && \boldsymbol{x} &\ge \boldsymbol{0} \end{align} } then, \displaystyle{ \begin{align} \begin{align} \min && \boldsymbol{c}^T\boldsymbol{x}\\ \text{s.t.} && A\boldsymbol{x} &\ge\boldsymbol{b}\\ && \boldsymbol{x} &\ge \boldsymbol{0} \end{align} &\begin{align} \ge\\ \\ \\ \end{align}&\quad \begin{align} \max && \boldsymbol{b}^T\boldsymbol{y}\\ \text{s.t.} && A^T\boldsymbol{y} &\le\boldsymbol{c}\\ && \boldsymbol{y} &\ge \boldsymbol{0} \end{align} \end{align} }
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}^TA\boldsymbol{x} }$ in two ways. Recall that $\displaystyle{ A\boldsymbol{x} \ge\boldsymbol{b} }$ and $\displaystyle{ A^T\boldsymbol{y} \le\boldsymbol{c} }$, thus $\displaystyle{ \boldsymbol{y}^T\boldsymbol{b}\le\boldsymbol{y}^TA\boldsymbol{x}\le\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{align} \min && \boldsymbol{c}^T\boldsymbol{x}\\ \text{s.t.} && A\boldsymbol{x} &\ge\boldsymbol{b}\\ && \boldsymbol{x} &\ge \boldsymbol{0} \end{align} } then, \displaystyle{ \begin{align} \begin{align} \min && \boldsymbol{c}^T\boldsymbol{x}\\ \text{s.t.} && A\boldsymbol{x} &\ge\boldsymbol{b}\\ && \boldsymbol{x} &\ge \boldsymbol{0} \end{align} &\begin{align} =\\ \\ \\ \end{align}&\quad \begin{align} \max && \boldsymbol{b}^T\boldsymbol{y}\\ \text{s.t.} && A^T\boldsymbol{y} &\le\boldsymbol{c}\\ && \boldsymbol{y} &\ge \boldsymbol{0} \end{align} \end{align} }

## 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}\subseteq2^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)\ge w(x_2)\ge\cdots\ge w(x_m) }$. Suppose $\displaystyle{ T=\{y_1,y_2,\ldots,y_\ell\} }$, where $\displaystyle{ w(y_1)\ge w(y_2)\ge\cdots\ge w(y_\ell) }$. Choose the least index $\displaystyle{ k }$ such that $\displaystyle{ w(x_k)\gt w(y_k) }$. If none exists, then we must have $\displaystyle{ \ell\gt 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\le i\le 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 }$