\input{template}
\input{macros}
\begin{document}
\lecture{30}{Primal-Dual Algorithm for Matching in Bipartite Graphs (Conclusion)}{Ankit Aggarwal}

\section{Primal-Dual Method}
\begin{center}
\begin{tabular}{r|l}
\underline{Primal} & \underline{Dual}\\
&\\
max $\sum w_{uv}x_{uv}$   &    min $\sum Y_{u} + \sum Z_{v}$\\
&\\
$\sum x_{uv}$ = 1         &    $\forall \{u,v\}$, $y_{u} + z_{v} \geq w_{uv}$\\
&\\
$x_{uv}$ = 0\\
&\\
\end{tabular}
\end{center}

\section{Procedure}
\begin{itemize}
\item If there doesn't exist any constraint such that the equality holds in it, we decrease all dual variables by some \textit{$\delta$}, such that atleast one of the constraints satisfy equality.
\item Let $E^{'}$ be the edges such that $y_{u}$ + $z_{v}$ = $w_{uv}$
\item Now solve, \\
\begin{align}
\text{min}\qquad\sum y'_{u} &+ \sum z'_{v}\\
\forall {u,v}, \exists E,\qquad y'_{u} &+ z'_{v} \geq 0
\end{align}
\item Find a maximum matching in this graph using the "original" algorithm.
\item Now, suppose there are 2n vertices, then there are 2 cases:
\begin{itemize}
\item If that matching has size n, the weight of the matching is\\
\begin{align}
\sum_{(u,v) \text{in the matching}} w_{uv} = \sum y_{u} + \sum z_{v} = \text{Dual Cost}
\end{align}
\item If the matching is of size t, which is less than  n, find a vertex cover S of size t.
\end{itemize}
\item Vertex Cover : \textbf{(Algorithm)}
\begin{itemize}
\item Decrease the vetex label in (V - S) by $\delta$
\item Increase the vertex label in S by same $\delta$
\item There is a net decrease in the cost.
\item Take those vertices which are at odd distances from unmatched vertices (see in Figure \ref{30fig1}.
\ffigureh{30fig1}{4in}{Showing the odd distant vertices w.r.t. unmatched vertex v1.}{30fig1}
\item After this, there can be some matched edges for which neither vertices are taken.
\end{itemize}
\item We also show that these decrease and increase in labels don't violate the constraints:
\begin{align}
y_{\text{new}} &= y_{\text{old}} + y'\\
z_{\text{new}} &= z_{\text{old}} + z'
\end{align}
\begin{itemize}
\item Because $y_{old}$ and $z_{old}$ are equal to corresponding $w_{uv}$, and y' and z' are positive, hence $y_{new}$ and $z_{new}$ are greater than equal to $w_{uv}$.
\end{itemize}
\end{itemize}

\section{Time Complexity}
Two Cases:
\begin{enumerate}
\item Either we increase the size of matching, or
\item we increase the size of the component.
\end{enumerate}

So, by the end, atmost $n^{2}$ steps will be taken. Hence, the algo is O($n^{2}$), i.e., polynomial.

\section{Few things to take over}
\begin{enumerate}
\item At every step, we need not find maximal matching (because we could use the augmenting path from previous step).
\item This can be used for unweighted case also. See, how this looks overall.
\end{enumerate}
\end{document}
