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

\begin{document}
\lecture{27}{Primal-dual algorithm for matching in bipartite graphs}{Mohit Gogia}

\section{Primal Dual Method}

\begin{center}
\begin{tabular}{r|l}
\underline{Primal} & \underline{Dual} \\
 & \\
max $c^Tx$   &    min $y^Tb$\\
$Ax \leq b$ & $A^Ty = c$ \\
 & $y \geq 0$ \\
\end{tabular}
\end{center}

Now consider the following unweighted LP for the above primal.

\begin{center}
max $c^Ty$ \linebreak 
$A'y \leq 0$
\end{center}

\begin{center}
Let $X' = X + \epsilon y$ \linebreak
where  X satisfies the primal and $\epsilon y$ satisfies the above unweighted LP
\end{center}

Then X' satisfies primal as well and the value of its objective function is greater than that for X. This gives us a method for solving the primal. We keep on increasing $X_{i}$'s in the primal by $y$ till the value of $c^Ty$ becomes 0. In the next section, we frame bipartite matching as an ILP.

\section{ILP for Bipartite Matching}
\begin{itemize}
\item \textbf{Primal formulation}
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 ILP can be formulated as
\begin{center}
max $ \sum X_{uv} $ \linebreak 
$\forall{u} $ $ \sum X_{uw} \leq 1 $ \linebreak 
$\forall{v} $ $\sum X_{pv} \leq 1 $ \linebreak 
$\forall{u,v} $ $ 0 \leq  X_{uw} \leq 1, X_{uv} $ is integral
\end{center}

Now, as before, we remove the conditions $ X_{uw} \leq 1 $ and $ X_{uv} $  is integral to get LP correspoding to the above ILP\footnote{Even after removing the integrality constraints, the solution after relaxation is same as that without relaxation}.

\item \textbf{Dual formulation}
The dual will have variables $ Y_u $ and $ Z_v $ corresponding to each vertex (Figure 1).
\newpage
\begin{figure}[!h]
\begin{center}
\includegraphics[scale=0.5]{Fig2.eps}
\caption{Variables in dual correspond to vertices of the two partitions}
\end{center}
\end{figure}

Hence the dual can be formulated as
\begin{center}
min $ \sum Y_u + \sum Z_v $ \linebreak 
$ Y_p +  Z_q \geq 1 $ , $ Y_p , Z_q \geq 1 $ for all edges (p,q)
\end{center}

It can be clearly seen that the dual corresponds to finding the minimum vertex cover of the graph.
\begin{Def}
A vertex cover of an undirected graph is a subset of vertices of the graph which contains at least one of the two endpoints of each edge.
\end{Def}
\end{itemize}

Next we see the how to find a  minimum vertex cover for a graph using a maximum  mathcing for that graph.

\section{Minimum Vertex Cover from Maximum Matching}

If V denotes a vertex cover and M a maximum matching for the same graph, because any vertex cover has to include at least one endpoint of each matched edge, so 
\begin{center}
$|V| \geq |M|$
\end{center}

Also it can be shown that \textit{size of minimum vertex cover for a graph is equal to the size of its maximum matching}.

Now, given a maximum matching how do we find a vertex cover?

\textit{Let G(V,E) be a graph and M be a maximum matching for the graph. Let V' be the set of those vertices in M which are at odd distance from unmatched vertices in G wrt M. Then V' is a minimum vertex cover for G}

An intuitive way to understand the above is shown in Fig 2.
\newpage
\begin{figure}[!h]
\begin{center}
\includegraphics[scale=0.5]{Fig1.eps}
\caption{Minimum Vertex Cover from Maximum Matching}
\end{center}
\end{figure}

In the next lecture, we will look at the case of mathching in bipartite graphs with weights associated with edges.
\end{document}
