\input{template}
\input{macros}
\usepackage{epsfig}
\usepackage{color, graphicx}

\begin{document}
\lecture{27}{Primal-dual algorithm for matching in bipartite graphs}{Parthasarathi Roy}

\section{The Primal-Dual method}
\begin{alignat*}{2}
\text{P : \quad max } & c^T x & \text{\quad \quad \quad D : \quad min } & y^T b \\
\text{s.t. }Ax & \leq b & \text{s.t. } A^Ty &= c \\
& & y &\geq 0
\end{alignat*}

Now consider the following unweighted LP for the above primal,

\begin{center}
max $c^Ty$ \linebreak 
$\text{s.t. }A'y \leq 0$
\end{center}

Let $X$ satisfy the primal and $Y$ satisfy the above LP.
Let $X' = X + \epsilon Y$. Then $X'$ satisfies the primal 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.

\section{Matching in Bipartite Graphs}
\subsection{The Primal}
\textbf{Variables}: One variable is used for each edge. An edge is either in or out in the bipartite matching.

$X_{uv}$ represents edge $\{u,v\}$.

\textbf{Cost}: $max \sum_{uv} X_{uv}$



\textbf{Constraints}: For every vertex, there is at most one edge incident on it.

\begin{align}
\forall u \in U, \sum_w X_{uw} \leq 1 \\
\forall v \in V, \sum_p X_{pv} \leq 1 \\
\forall u, v,  0 \leq X_{uv} \leq 1, \text{$X_{uv}$ is integral}
\end{align}



\subsection{The Dual}

For the dual, the number of variables is equal to the number of vertices in the bipartite graph.

\begin{figure}[h]
 \centering
 \includegraphics[height=7cm]{Lec27pFig1.eps}
 \caption{Variables in the dual represent the vertices}
 \label{Matching}
\end{figure}

\textbf{Cost}: 
$min \sum_u Y_u + \sum_v Z_v$. The first term in the sum stands for vertices of set $U$, while the second term stands for vertices in the set $V$.

\textbf{Constraints}: For edge $\{p,q\}$,
\begin{align}
Y_p + Z_q \geq 1\\
Y_p, Z_q \geq 0
\end{align}

This represents the fact that for each edge, one of the vertices must be picked. The dual of the maximum matching problem in bipartite graphs is the minimum vertex cover problem.

\begin{Def} \label{lec27:Def1}
 A \textbf{vertex cover} is a set of vertices $V$ in an undirected graph where every edge connects at least one vertex in the set $V$.
\end{Def}

\section{Minimum vertex cover from the maximum matching in bipartite graphs}

If $V$ is a vertex cover and $M$ is a maximum matching for a bipartite graph,
\begin{equation}
|V| \geq |M|
\end{equation}

This is because, any vertex cover has to include at least one end-point of an edge of a maximum matching.


\textit{In any bipartite graph, the number of edges in a maximum matching is equal to the number of vertices in a minimum vertex cover.}

\textbf{Finding a minimum vertex cover from a maximum matching:}


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$. Then $V'$ is a minimum vertex cover for $G$ (Refer Fig. 2).


\begin{figure}[h]
 \centering
 \includegraphics[height=7cm]{Lec27pFig2.eps}
 \caption{Minimum vertex cover from maximum matching}
 \label{Matching}
\end{figure}

\end{document}









