\input{template}
\input{macros}
\begin{document}
\lecture{21}{Review of graph algorithms (contd.)}{Chaitanya Gokhale}


\section{Recap of previous lecture}
Previous lecture(s) dealt with the BFS based algorithm for matching in
general graphs. The following lemma was stated and proved earlier :
\begin{Lem}\label{lem1}
Let M be a matching. let B be a blossom such that the base is unmatched. Let
$G^`$ be the graph obtained by shrinking B. Let $M^`$ be the edges of M outside
B. There is an augumenting path in G w.r.t M iff there is an augumenting path in
$G^`$ w.r.t $M^`$.
\end{Lem}
In this lecture, we prove a complimentary lemma which completes the proof of correctness of the algorithm to find a maximum matching in a general graph.

\section{Complimentary Lemma and its proof}
In order to find an augmenting path in a general graph G w.r.t. matching M, we proceed in the same way as in case of bipartite graphs :

\begin{enumerate}
 \item Start from an unmatched vertex and do a BFS search.
However, in this case we might encouter a blossom.
\item If we reach a blossom B during BFS search, then switch the matched and unmatched edges of the path till the base of the bottom, as a result of which the base becomes unmatched (as shown in fig \ref{lec21:fig1}). Let us call the new matching as $M^`$.
\item Now, shrink the blossom B to a single vertex forming graph $G^`$ and matching $M^``$. Look for an augmenting path in the new graph.\\
\textit{We have an augmenting path in $G^`$ w.r.t. $M^``$
iff there exists an augmenting path in G w.r.t. matching M.}
\end{enumerate}
\begin{figure}
 \centering
 \includegraphics[bb=0 0 345 255]{figures/lec21fig1.eps}
 % lec21fig1.eps: 1048592x1048592 pixel, 300dpi, 8878.08x8878.08 cm, bb=0 0 345 255
 \caption{Switching matched and unmatched edges}
 \label{lec21:fig1}
\end{figure}
There exists an augmenting path in G w.r.t. matching  $M^`$ iff there exists an augmenting path in $G^`$ w.r.t. matching $M^``$ (by Lemma \ref{lem1} above).
Hence, in order to prove the correctness of algorithm, we need to prove the first part of the algorithm regarding switching, which can be stated as :
\begin{Lem}
Given a graph G and matching M and a path Q starting from an unmatched
node v, to the base u of a blossom B (base u being matched). Let $M^`$ be the matching
obtained on switching the matched and unmatched edges along path Q. Then an augmenting
path exists in G w.r.t matching M iff there exists one in G w.r.t. matching $M^`$.
\end{Lem}


\begin{proof}

Suppose that there exists an augmenting path P in the Graph G, after switching i.e.
w.r.t. matching $M^`$. We have two cases to consider :
\begin{enumerate}
\item[(a)] The augmenting path P has no edge common with path Q :\\
Then the same path exists in G w.r.t. matching M, as well.
\item[(b)] The augmenting path P has some edges common with the path Q (see
figure \ref{lec21:fig2}):\\
\begin{figure}
 \centering
 \includegraphics[width=14cm,height=3.1cm]{figures/lec21fig2.eps}
 % lec21fig2.eps: 1048592x1048592 pixel, 300dpi, 8878.08x8878.08 cm, bb=0 0 521 110
 \caption{P \& Q having Common edges}
 \label{lec21:fig2}
\end{figure}

Then, we mark out the common edges to both the paths.
We wish to construct an augmenting path in G w.r.t. M.
For that, ignore the common edges in P and Q. We have four end points of the two paths
P and Q that orginally existed. Since P is an augmenting path both its end-points
are free(unmatched), while one of the end-points of Q is free. Thus, 3 of the
4 end-points are unmatched. On removing the common edges, the 2 pairs of
end-points will still be connected by two different paths (refer figure \ref{lec21:fig3}. Since 3 of the 4 end-points are unmatched, there must be one of the two new paths having 
unmatched end-points. This path is alternating and has unmatched end-points.
$\implies$ This is the augmenting path we are looking for.
\end{enumerate}

From (a) \& (b) above, if G contains an augmenting path w.r.t. $M^`$ then there
is an augmenting path w.r.t. M as well. The above argument (cases (a)  \& (b)) holds for the converse as well and hence, the converse can be proved in the exact same manner.

Hence, the lemma stated above is proved.
\begin{figure}
 \centering
 \includegraphics[width=14cm, height=3.1cm]{figures/lec21fig3.eps}
 % lec21fig3.eps: 24x24 pixel, 300dpi, 0.20x0.20 cm, bb=0 0 521 123
 \caption{New paths connectign end-points after ignoring common edges}
 \label{lec21:fig3}
\end{figure}


\end{proof}


\end{document}









