\input{template}
\input{macros}

\usepackage{color, graphicx}
\usepackage{amssymb, amsmath}
\usepackage{epsfig}


\begin{document}
\lecture{19}{Nonbipartite Matching}{Mayank Singhal}
%% -----------------------------------------------------------------------------
%%                          Beginning of Section 1.
%% -----------------------------------------------------------------------------

\section{Recap}
Our goal is to find a matching M of maximum size given a graph G = (V,E). We know that M is maximum iff there is
no augmenting path w.r.t. M in G. And in last lecture we saw how to find a matching of max size for a bipartite graph.Remember there may exist more than one such matching but our goal is to find any one of them. To find an augmenting path we used a modified BFS starting from unmatched vertices. And whenever we found one we saw we can increase the size of M by one. 

\section{Nonbipartite Matching}

The problem in case of non-bipartite graphs is the existence of blossoms.

\begin{Def}
A blossom is a cycle of length 2k+1 with k edges matched . The base of the blossom is the vertex with both incident edges unmatched.See figure 1.
\end{Def}


There are no blossoms in bipartite graphs because blossoms have odd no of edges and there does not exist a cycle with odd no of edges in a bipartite graph.In case of a nonbipartite graph whenever we come across a blossom we reduce it to a single vertex. And any edge that does not belong to blossom but is incident on one of its vertices is now incident on this new vertex formed by shrinking the blossom.Now to prove the validity of this operation we need to prove the following lemma. 

\begin{Lem}
 Let M be a matching. let B be a blossom such that the base is unmatched in a graph G. 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 exists an augumenting path in $G^{'}$ w.r.t $M^{'}$.
\end{Lem}

\begin{proof}
\newline
\emph{Part 1:} Given an augumenting path in G w.r.t M to show that there exist an augumenting path in $G^{'}$ w.r.t $M^{'}$.\newline

If the augmenting path in G and the blossom had no edge in common then the same augmenting path exists in $G^{'}$ w.r.t
 $M^{'}$. Now lets look at the case where the augmenting path in G and the blossom have common edges. Note that this path has one end-point outside the blossom. Consider the first time the path enters the blossom. This will be through an unmatched edge. This part yields an augmenting path in $G^{'}$.


\emph{Part 2:} Given an augmenting path in $G^{'}$ w.r.t $M^{'}$ to show that there exist an augmenting path in G w.r.t M.

Consider an augmenting path in $G^{'}$ w.r.t. $M^{'}$. If this path does not intersect the shrunk vertex (say $v_{b}$) then the same path is an augmenting path in G. Otherwise this path has to end at $v_{b}$. Extend this to an augmenting path in G by moving in the "appropriate" direction along the blossom till the base. 

\end{proof}

\begin{figure}
 \centering
 \includegraphics[width=.25\textwidth]{blossom}
 \caption{Blossom}
 \label{blossom}
\end{figure}

\end{document}
