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

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

%% -----------------------------------------------------------------------------
%%                          Section 1: Recap
%% -----------------------------------------------------------------------------

\section{Recap}
In the previous lecture, we discussed the ILP formulation for \emph{unweighted}\footnote{Unweighted: The weight of each edge in the graph is 1} bipartite matching. It was observed that the dual for this particular case corresponds to the \emph{minimum vertex cover} for the graph.\newline\newline
In this lecture we will talk about the more general case of matching in a weighted bipartite graph.

%% -----------------------------------------------------------------------------
%%                          Section 2: ILP Formulation
%% -----------------------------------------------------------------------------

\section{ILP formulation of Matching in a Weighted Bipartite Graph}
The input is a graph with each edge having a positive weight $W_{uv}$.

\begin{Def}
A maximum weighted bipartite matching is defined as a perfect matching where the sum of the values of the edges in the matching have a maximal value.
\end{Def}

As we will later see, the size of such a matching would be \emph{n}\footnote{where n is the number of vertices in the graph}. Note that, if the graph is not complete bipartite, missing edges are inserted with value zero. \newline\newline
The variable $X_{uv}$ is defined as,
\begin{equation*} X_{uv} = \begin{cases} 0 & \text{if edge (u,v) belongs to the matching,} \\ 1 &\text{if edge  (u,v) does not belong to the matching} \end{cases} \end{equation*}

Again, as we have added zero-weighted edges to \emph{complete} the graph, we assert that the summations $\forall{u} \sum X_{uw}$ and $\forall{v} \sum X_{pv}$ be \emph{exactly} equal to 1.\newline\newline
Therefore, the ILP (\emph{primal}) for this problem is:

\begin{center}
max $ \sum W_{uv} X_{uv} $ \linebreak 
\begin{equation*} \forall{u} \sum X_{uw} = 1  \end{equation*}
\begin{equation*} \forall{v} \sum X_{pv} = 1 \end{equation*}
$\forall{u,v} $ $ X_{uv} \geq 0 , X_{uv} $ is integral
\end{center}

The resultant dual is:

\begin{center}
min $ \sum Y_u + \sum Z_v $ \linebreak 
$ Y_u +  Z_v \geq W_{uv} $
\end{center}

%% -----------------------------------------------------------------------------
%%                          Section 3: Algorithm
%% -----------------------------------------------------------------------------

\section{Algorithm to find Maximum Weighted Bipartite Matching}
\begin{itemize}
\item \textbf{Step 1 - Initialization:}
For all vertices \emph{v}, initialize $Y_{v}$ and $Z_{v}$ to the highest weight edge incident on it.
\item \textbf{Step 2 - Iteration: }
Now, locate all edges \emph{(u,v)} for which the equality
\begin{center}
$ Y_{u} +  Z_{v} = W_{uv} $
\end{center}
holds.\newline
Let \emph{E} represent the set of such edges. Then the following dual can be formulated for edges in \emph{E},
\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 version of the dual is unweighted, and hence easier to solve. In the optimum solution, we have $ \sum Y'_u + \sum Z'_v = 0$. \\

In the next lecture we complete this algorithm.
\end{itemize}
\end{document}
