\input{template}
\input{macros}
\usepackage{tabls}
\usepackage[dvips]{color}

\begin{document}
\lecture{28}{Primal-dual algorithm for matching in bipartite graphs (contd.)}{Shakeb Sagheer}

\section{Recap of last lecture}
In the previous lecture we looked at the ILP for matching in unweighted bipartite graphs. Let the variable $X_{uv}$ be defined as follows

\begin{equation*} X_{uv} = \begin{cases} 0 & \text{if edge (u,v)  is not matched,} \\ 1 &\text{if edge  (u,v)  is matched} \end{cases} \end{equation*}

Then the primal and dual formulations of the ILP are 

\begin{center}
\begin{tabular}{r|l}
\underline{Primal} & \underline{Dual} \\
 & \\	
max $ \sum X_{uv} $   &    min $ \sum Y_u + \sum Z_v $\\
$\forall{u} $ $ \sum X_{uw} \leq 1 $ & $ Y_p +  Z_q \geq 1 $ , $ Y_p , Z_q \geq 0 $  \\
$\forall{v} $ $\sum X_{wv} \leq 1 $ & \\
$\forall{u,v} $ $ X_{uv} \geq 0 $ & \\
\end{tabular}
\end{center}
It was observed that the above dual formulation corresponds to finding the minimum vertex cover of the graph.

\section{ILP for Matching in Weighted Bipartite Graph}
In weighted matching problem, a number $w_{uv} \geq 0 $ is associated with each edge of the graph, called the \emph{weight} of that edge and we are suppposed to find a matching with the largest possible sum of weights. Thus our task is to maximize $ \sum w_{uv} X_{uv}.$. The  constraints remain as such.

The ILP, therefore, can be formulated as

\begin{center}
max $ \sum w_{uv} X_{uv} $ \linebreak 
\begin{equation} \forall{u} \sum X_{uw} \leq 1  \end{equation}
\begin{equation} \forall{v} \sum X_{wv} \leq 1 \end{equation}
$\forall{u,v} $ $ X_{uv} \geq 0 $ \\
\end{center}

The dual of above primal can be formulated as 

\begin{center}
min $ \sum Y_u + \sum Z_v $ \linebreak 
$ Y_u +  Z_v \geq w_{uv} $ , $ Y_u , Z_v \geq 0 $ for all edges (u,v)
\end{center}

It can be seen that in the above problem, we can do away by adopting the convention that the underlying graph is always complete, and letting the weights of the missing edges be equal to zero. Thus after adding appropriate zero weight edges, the inequations (1) and (2) can be replaced by following equations.

\begin{center}
$\forall{u} $ $ \sum X_{uw} = 1 $ \linebreak 
$\forall{v} $ $\sum X_{wv} = 1 $ \linebreak 
\end{center}

Since we have dropped the inequalities in the primal the inequalities $ Y_u , Z_v \geq 0 $ can be dropped in the dual.

Hence the primal and dual formulations of the ILP are

\begin{center}
\begin{tabular}{r|l}
\underline{Primal} & \underline{Dual} \\
 & \\	
max $ \sum w_{uv} X_{uv} $   &    min $ \sum Y_u + \sum Z_v $\\
$\forall{u} $ $ \sum X_{uw} = 1 $ & $ Y_u +  Z_v \geq w_{uv} $  \\
$\forall{v} $ $\sum X_{wv} = 1 $ & \\
$\forall{u,v} $ $ X_{uv} \geq 0 $ & \\
\end{tabular}
\end{center}

\section{Algorithm for finding Maximum Matching}
\begin{itemize}
\item \textbf{Initialization}
For each vertex initialize the variables $Y_{u}$ and $Z_{v}$ to the highest weight edge incident on it
\item \textbf{Iterative Step}
Consider all u,v's for which the equality
\begin{center}
$ Y_u +  Z_v = w_{uv} $
\end{center}
holds.
Let E' be the set of edges for which we have the above equality, then for these edges the following dual can be formulated,
\begin{center}
for each edge (u,v) in E' \\
min $ \sum Y'_u + \sum Z'_v $ \linebreak 
$ Y'_u +  Z'_v \geq 0 $ 
\end{center}
This is the unweighted version of the dual and is easier to solve. When we have an optimal solution the minimum value of $ \sum Y'_u + \sum Z'_v $ is 0 and this cannot be furthur improved upon. 

Our task is to find a matching of size n in E'. If we can find one then we are done.

In the next lecture we will discuss how to find such a matching.
\end{itemize}
\end{document}
