\input{template}
\input{macros}
\begin{document}
\lecture{29}{Primal-dual algorithm for matching in bipartite graphs (contd.)}{Gaurav Meena}

\begin{enumerate} 
\item Primal

\begin{eqnarray}
&& max \sum W_{w} X_{uv}  \nonumber \\ 
&& \sum X_{uv} = 1  \nonumber \\
&& X_{uv} \geq 0 
\end{eqnarray}

\item Dual

\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}

\end{enumerate}

\subsection*{Algorithm}

\begin{enumerate}

	\item Start with any feasible dual solution.
	
	\item Let E' be the set of edges for which the inequalities are held.
		
\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}
	
\begin{eqnarray}
\label{eq:bounded}
&& -1 \; \leq \; Y'_{u} \; \leq \; 1 \nonumber \\
&& -1 \; \leq \; Z'_{v} \; \leq \; 1 
\end{eqnarray}

Equation ~\ref{eq:bounded} is just to make sure that the LP is bounded.
	
\item If we find a primal feasible and dual feasible with the same cost then we are done. It is the optimal solution. 

The dual of equation ~\ref{eq:primal} :
\begin{eqnarray}
\label{eq:dual}
&& max \; 0 \nonumber \\
&& \forall \{u, v\}\;\in\;E', \; \; \sum X_{uv} = 1  \nonumber \\
&& X_{uv} \; \geq \; 0
\end{eqnarray}

Equation ~\ref{eq:dual} must be matching of the size n in E'.

\item If we find a matching of maximum size then we are done.

\item If we know that the Dual is not optimal, then it means that matching in E' is not of size n \;\(max\) and we need to improve the solution.

\item What if the matching is not of size n in E'? How to improve?

Suppose the matching is of size t then there is a vertex cover of size t. In this vertex cover, for all the vertices increase the value of the vertex by $\delta$. For vertices not in the vertex cover, decrease the value by $\delta$.

Since there are total 2n vertices and t $<$ n so the total cost will decrease.

We increase with best $\delta$ we can, such that one more edge tighten and another edge comes in E'.

\end{enumerate}

\end{document}

