\input{template}

\input{macros}

\begin{document}

\lecture{29}{Primal-dual algorithm for matching in bipartite graphs
  (contd.)}{Abhimanyu Rawal}


\subsection*{Problem}

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. 

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*}

Our task is to maximize $ \sum w_{uv} X_{uv}.$

The Primal for matching in weighted bipartite graph is :

\begin{eqnarray}
&& max \sum W_{uv} X_{uv}  \nonumber \\ 
&& \sum X_{uv} = 1  \nonumber \\
&& X_{uv} \geq 0 
\end{eqnarray}



The Dual for the above is :


\begin{eqnarray}
&& min \sum_{u} Y_{u} + \sum_{v} Z_{v}  \nonumber \\
&& \forall  \; edge \; \{u, v\} \;\;\;\;  Y_{u} + Z_{v} \geq W_{uv} 
\end{eqnarray}


\subsection*{Algorithm}

\begin{enumerate}

        \item We start with any feasible dual solution, which may not
        necessarily be the optimal solition.

        \item Let E' be the set of those edges for which the inequalities are
        tight. For these edges the dual is rewritten as :

                
\begin{eqnarray}
\label{eq:primal}
&& min \sum Y'_{u} + \sum Z'_{v}  \nonumber \\
&& \forall  \; edge \; \{u, v\} \; \in  \; E', \;\;\;  Y'_{u} + Z'_{v} \geq 0 
\end{eqnarray}

Clearly this problem is unbound, hence to make it bounded, the following
equations need to added to the system :

\begin{eqnarray}
\label{eq:bounded}
&& -1 \; \leq \; Y'_{u} \; \leq \; 1 \nonumber \\
&& -1 \; \leq \; Z'_{v} \; \leq \; 1 
\end{eqnarray}


\item The optimal solution to the above system is the point at which the costs
  of the primal feasible and dual feasible coincide.

Treating the above equation as primal, B = 0. Hence, the dual of the above dual thus is:

\begin{eqnarray}
\label{eq:dual}
&& max \; (0) \nonumber \\
&& \forall \; edge \; \{u, v\}\;\in\;E', \; \; \sum X_{uv} = 1  \nonumber \\
&& X_{uv} \; \geq \; 0
\end{eqnarray}

This equation will give a matching of size n in E' by the following algorithm repeated recursively :

\begin{itemize}
\item If the current matching is of size n, then the dual is optimal and we have found the matching of maximum size.

\item Else, if the Dual is not optimal, then the matching in E' is less than  size n.

\item Let the size of the Dual be t. Then, in the vertex cover comprising of
  the t vertices, we increase the value of all the vertices by $\delta$. And
  for   all the remaining vertices (not in the vertex cover), we decrease the size
  by $\delta$. Since there are 2n vertices and t$<$n, the total cost will decrease.


\end{itemize}

\end{enumerate}

\end{document}


